Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
fix: only passing memory parameter when not null
Browse files Browse the repository at this point in the history
  • Loading branch information
I354751 committed Aug 9, 2018
1 parent 3cb5b73 commit 589ec33
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/apis/Request/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ public function converseText($text, $options = [], $memory = NULL, $log_level =
}

$headers = ['Content-Type' => 'application/json', 'Authorization' => "Token " . $token];
$body = json_encode([
$body = [
"text" => $text,
"language" => $language,
"conversation_token" => $conversation_token,
"memory" => $memory,
"log_level" => $log_level,
]);
];
if ($memory) {
$body['memory'] = $memory;
}
$body = json_encode($body);

$client = new \GuzzleHttp\Client();

Expand Down

0 comments on commit 589ec33

Please sign in to comment.