[ Remove ] reverted back the impl for stream timeout appliance

This commit is contained in:
Anas Fikhi
2023-11-22 04:20:15 +01:00
parent 4539d6bc60
commit 1f8e675fc1
2 changed files with 11 additions and 3 deletions

View File

@ -161,7 +161,7 @@ abstract class OpenAINetworkingClient {
clientForUse
.send(request)
.timeout(OpenAIConfig.requestsTimeOut)
// .timeout(OpenAIConfig.requestsTimeOut)
.then((streamedResponse) {
streamedResponse.stream.listen(
(value) {
@ -366,7 +366,15 @@ abstract class OpenAINetworkingClient {
OpenAILogger.logStartRequest(to);
clientForUse.send(request).timeout(OpenAIConfig.requestsTimeOut).then(
clientForUse
.send(request)
// .timeout(
// OpenAIConfig.requestsTimeOut,
// onTimeout: () {
// throw TimeoutException("Request timed out");
// },
// )
.then(
(respond) {
OpenAILogger.startReadStreamResponse();

View File

@ -185,7 +185,7 @@ interface class OpenAIChat implements OpenAIChatBase {
"messages": messages.map((message) => message.toMap()).toList(),
if (tools != null)
"tools": tools.map((tool) => tool.toMap()).toList(growable: false),
if (toolChoice != null) "tool_choice": toolChoice.value,
if (toolChoice != null) "tool_choice": toolChoice,
if (temperature != null) "temperature": temperature,
if (topP != null) "top_p": topP,
if (n != null) "n": n,