diff --git a/src/apis/Request/Request.php b/src/apis/Request/Request.php index f335eab..2aa7c50 100644 --- a/src/apis/Request/Request.php +++ b/src/apis/Request/Request.php @@ -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();