From 64683a55f3c0d5aa5b98b1b060fbf7fef5e8472f Mon Sep 17 00:00:00 2001
From: Emanuel Ferreira <contatoferreirads@gmail.com>
Date: Fri, 1 Mar 2024 21:45:02 -0300
Subject: [PATCH] fix: prefix messages always true (#596)

---
 .changeset/eighty-ducks-beam.md        | 5 +++++
 packages/core/src/agent/openai/base.ts | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100644 .changeset/eighty-ducks-beam.md

diff --git a/.changeset/eighty-ducks-beam.md b/.changeset/eighty-ducks-beam.md
new file mode 100644
index 000000000..dd960be1e
--- /dev/null
+++ b/.changeset/eighty-ducks-beam.md
@@ -0,0 +1,5 @@
+---
+"llamaindex": patch
+---
+
+fix: prefix messages always true
diff --git a/packages/core/src/agent/openai/base.ts b/packages/core/src/agent/openai/base.ts
index ff29ed31e..3374c2a04 100644
--- a/packages/core/src/agent/openai/base.ts
+++ b/packages/core/src/agent/openai/base.ts
@@ -37,8 +37,6 @@ export class OpenAIAgent extends AgentRunner {
     toolRetriever,
     systemPrompt,
   }: OpenAIAgentParams) {
-    prefixMessages = prefixMessages || [];
-
     llm = llm ?? new OpenAI({ model: "gpt-3.5-turbo-0613" });
 
     if (systemPrompt) {
-- 
GitLab