Skip to content

Commit

Permalink
fix: only access memory_context if memory arg is True
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-alherrera committed Dec 6, 2024
1 parent 6888016 commit 9937b97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent_gateway/gateway/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ async def acall(
inputs["context"] = formatted_contexts

max_memory = 3 # TODO consider exposing this to users

if len(self.memory_context) <= max_memory:
self.memory_context.append({"Question:": input, "Answer": answer})
if self.memory:
if len(self.memory_context) <= max_memory:
self.memory_context.append({"Question:": input, "Answer": answer})

return answer

0 comments on commit 9937b97

Please sign in to comment.