Skip to content

Commit b2a687c

Browse files
AielloChandkundel-openai
authored andcommitted
fix: Remove tools param when empty (#53)
1 parent 00e305b commit b2a687c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/better-shoes-march.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+
Ignore empty tool list when callling LLM

packages/agents-openai/src/openaiChatCompletionsModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class OpenAIChatCompletionsModel implements Model {
260260
const requestData = {
261261
model: this.#model,
262262
messages,
263-
tools,
263+
tools: tools.length ? tools : undefined,
264264
temperature: request.modelSettings.temperature,
265265
top_p: request.modelSettings.topP,
266266
frequency_penalty: request.modelSettings.frequencyPenalty,

0 commit comments

Comments
 (0)