File tree Expand file tree Collapse file tree
Kattbot.Common/Models/KattGpt
Kattbot/NotificationHandlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public record ChatCompletionCreateRequest
5050 /// https://platform.openai.com/docs/api-reference/chat/create#chat-create-parallel_tool_calls
5151 /// </summary>
5252 [ JsonPropertyName ( "parallel_tool_calls" ) ]
53- public bool ParallelToolCalls { get ; set ; } = false ;
53+ public bool ParallelToolCalls { get ; set ; }
5454
5555 /// <summary>
5656 /// Gets or sets what sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ private static ChatCompletionCreateRequest BuildRequest(
170170 Temperature = DefaultTemperature ,
171171 MaxTokens = MaxTokensToGenerate ,
172172 Tools = chatCompletionTools ,
173+ ParallelToolCalls = false ,
173174 } ;
174175
175176 return request ;
@@ -258,8 +259,7 @@ private async Task<List<ChatCompletionMessage>> HandleToolCallResponse(
258259
259260 if ( chatGptToolCallResponse . ToolCalls . Count > 1 )
260261 {
261- _discordErrorLogger . LogError ( $ "Too many tool calls: { chatGptToolCallResponse . ToolCalls . Count . ToString ( ) } ") ;
262- chatGptToolCallResponse . ToolCalls . RemoveRange ( index : 1 , chatGptToolCallResponse . ToolCalls . Count - 1 ) ;
262+ throw new Exception ( $ "Too many tool calls: { chatGptToolCallResponse . ToolCalls . Count . ToString ( ) } ") ;
263263 }
264264
265265 // Parse the function call arguments
You can’t perform that action at this time.
0 commit comments