Skip to content

Commit a51105b

Browse files
authored
fix: Pass through strict flag for functions tools when using completion (#305)
1 parent 4818d5e commit a51105b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/brave-swans-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openai/agents-openai': patch
3+
---
4+
5+
Pass through strict flag for function tools when using completion

packages/agents-openai/src/openaiChatCompletionsConverter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export function toolToOpenAI(tool: SerializedTool): ChatCompletionTool {
277277
name: tool.name,
278278
description: tool.description || '',
279279
parameters: tool.parameters,
280+
strict: tool.strict,
280281
},
281282
};
282283
}

packages/agents-openai/test/openaiChatCompletionsConverter.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ describe('tool helpers', () => {
253253
required: [],
254254
additionalProperties: false,
255255
},
256+
strict: true,
256257
},
257258
});
258259
});

0 commit comments

Comments
 (0)