Hello, I am using the AgentsJS Framework and am wo...
# agents
b
Hello, I am using the AgentsJS Framework and am wondering why chat context filtering options include audio and function calls, but when using OpenAI Realtime Model, there is never a function call or audio entry in the chat context. Why? Especially the function calls are important in a multi-agent scenario so that the model knows what happened. Another question: When handoff to another agent happens, is the OpenAI Realtime session still the same and has the complete history or is the session new for every agent or is the history overwritten? I previously implemented a multi-agent app using OpenAI Realtime directly and the conversation history there includes function calls. Also, when I currently add an item manually to the chat context with
this.session.chatCtx.addMessage(...)
, a followup call to
this.session.chatCtx.toJSON()
does not include that item, also not later. This is very intransparent. Can someone help me please?
e
In case it helps:
this.session.chatCtx
returns a new copy every time you read/get that property (don't ask me why), so making any changes to it won't affect the agent/session at all. This is how I ended up manually adding a message (not sure if works for multi-agent use case though):
Copy code
// Same as session.chatCtx, but just being explicit
  const chatCtx = session.currentAgent.chatCtx.copy();
  chatCtx.addMessage(...);
  // This is what makes the message be part of future LLM completions
  await session.currentAgent.updateChatCtx(chatCtx);