Skip to content

Commit

Permalink
[ Remove ] reverted back the impl for stream timeout appliance
Browse files Browse the repository at this point in the history
  • Loading branch information
anasfik committed Nov 22, 2023
1 parent 4539d6b commit 1f8e675
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/src/core/networking/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ abstract class OpenAINetworkingClient {

clientForUse
.send(request)
.timeout(OpenAIConfig.requestsTimeOut)
// .timeout(OpenAIConfig.requestsTimeOut)
.then((streamedResponse) {
streamedResponse.stream.listen(
(value) {
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion lib/src/instance/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1f8e675

Please sign in to comment.