Skip to content

Commit 1f8e675

Browse files
committed
[ Remove ] reverted back the impl for stream timeout appliance
1 parent 4539d6b commit 1f8e675

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/src/core/networking/client.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ abstract class OpenAINetworkingClient {
161161

162162
clientForUse
163163
.send(request)
164-
.timeout(OpenAIConfig.requestsTimeOut)
164+
// .timeout(OpenAIConfig.requestsTimeOut)
165165
.then((streamedResponse) {
166166
streamedResponse.stream.listen(
167167
(value) {
@@ -366,7 +366,15 @@ abstract class OpenAINetworkingClient {
366366

367367
OpenAILogger.logStartRequest(to);
368368

369-
clientForUse.send(request).timeout(OpenAIConfig.requestsTimeOut).then(
369+
clientForUse
370+
.send(request)
371+
// .timeout(
372+
// OpenAIConfig.requestsTimeOut,
373+
// onTimeout: () {
374+
// throw TimeoutException("Request timed out");
375+
// },
376+
// )
377+
.then(
370378
(respond) {
371379
OpenAILogger.startReadStreamResponse();
372380

lib/src/instance/chat/chat.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ interface class OpenAIChat implements OpenAIChatBase {
185185
"messages": messages.map((message) => message.toMap()).toList(),
186186
if (tools != null)
187187
"tools": tools.map((tool) => tool.toMap()).toList(growable: false),
188-
if (toolChoice != null) "tool_choice": toolChoice.value,
188+
if (toolChoice != null) "tool_choice": toolChoice,
189189
if (temperature != null) "temperature": temperature,
190190
if (topP != null) "top_p": topP,
191191
if (n != null) "n": n,

0 commit comments

Comments
 (0)