From 7d56cdf045dbde39e4683b70bd0fbce01d67014b Mon Sep 17 00:00:00 2001 From: Marcus Schiesser <mail@marcusschiesser.de> Date: Wed, 10 Apr 2024 14:43:38 +0800 Subject: [PATCH] fix: Allow OpenAIAgent to be called without tools (#703) --- .changeset/neat-cherries-do.md | 5 +++++ packages/core/src/agent/openai/worker.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/neat-cherries-do.md diff --git a/.changeset/neat-cherries-do.md b/.changeset/neat-cherries-do.md new file mode 100644 index 000000000..f375aef33 --- /dev/null +++ b/.changeset/neat-cherries-do.md @@ -0,0 +1,5 @@ +--- +"llamaindex": patch +--- + +Allow OpenAIAgent to be called without tools diff --git a/packages/core/src/agent/openai/worker.ts b/packages/core/src/agent/openai/worker.ts index 9c82ca9d4..404757e5b 100644 --- a/packages/core/src/agent/openai/worker.ts +++ b/packages/core/src/agent/openai/worker.ts @@ -149,7 +149,7 @@ export class OpenAIAgentWorker ): LLMChatParamsBase<OpenAIAdditionalChatOptions> { const llmChatParams = { messages: this.getAllMessages(task), - tools: [] as BaseTool[], + tools: undefined as BaseTool[] | undefined, additionalChatOptions: {} as OpenAIAdditionalChatOptions, } satisfies LLMChatParamsBase<OpenAIAdditionalChatOptions>; -- GitLab