mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 12:00:15 +00:00
add option to skip provider tool call validation
This commit is contained in:
parent
2e3ff4a15a
commit
0196308266
12 changed files with 38 additions and 4 deletions
|
|
@ -45,6 +45,7 @@ export const streamOpenAIResponses: StreamFunction<"openai-responses"> = (
|
|||
options?: OpenAIResponsesOptions,
|
||||
): AssistantMessageEventStream => {
|
||||
const stream = new AssistantMessageEventStream();
|
||||
const shouldValidateToolCalls = options?.validateToolCallsAtProvider !== false;
|
||||
|
||||
// Start async processing
|
||||
(async () => {
|
||||
|
|
@ -240,7 +241,7 @@ export const streamOpenAIResponses: StreamFunction<"openai-responses"> = (
|
|||
};
|
||||
|
||||
// Validate tool arguments if tool definition is available
|
||||
if (context.tools) {
|
||||
if (shouldValidateToolCalls && context.tools) {
|
||||
const tool = context.tools.find((t) => t.name === toolCall.name);
|
||||
if (tool) {
|
||||
toolCall.arguments = validateToolArguments(tool, toolCall);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue