I'm using the typescript agents-js framework and w...
# agents
q
I'm using the typescript agents-js framework and we are migrating to the V1. Is it correct that tool calls do not get submitted as chat items on the chat context of the session? If so, is there another place where I can find them or should I add them myself to the chat context?
l
I thought function tools should be part of the conversation, I modified https://github.com/livekit/agents-js/blob/main/examples/src/basic_agent.ts to listen for conversation items similar to https://docs.livekit.io/agents/build/events/#conversation_item_added-example and I see the agent responding to my questions about the weather. How are you accessing the chat items?
q
AiSdkLLM node.cpp
I have a setup where I have built my own node so that I can call LLM's through the Vercel AI sdk and I transform the outcoming chunks. The are part of the subsequent llm prompts so they are in the messages of the livekit pipeline, but they do not get put on the session chatCtx. Snippet above ⬆️
I'm also investigating this component further compared to other plugins to see wether I missed something
l
I find Devin helpful for these kind of questions as it has access to our entire public source code, https://deepwiki.com/search/what-code-in-typescript-is-res_c71ea301-e0f8-45ff-87d8-13d941348031?mode=fast, but I'm not familiar with the detail I'm afraid.
q
I have been looking into this extensively and there have been changes to these message persistance layer across the session and several agents. I came to the conclusion that the agent chatCtx holds all the tool calls and these do not get copied onto the session chatCtx. This means that they would not be available at the end of a call if there are multiple agents in a single call. What is the thought behind this? Do I need to copy these messages myself on agent exit?
l
I see what you are saying, and I assume that was a deliberate design choice (meaning you'd have to copy the messages yourself on agent exit) but I can't say why. Let me ping the agents team, to see if they can add some colour behind the design
q
Yes, an additional side note that other messages are copied automatically to both contexts. So might just be oversight for toolcalls, but then the agent context vs session context doesn't make that much sense either. Would love insights on this!
The session chatCtx synchronisation is aligned in https://github.com/livekit/agents-js/pull/863 which was released in version 1.0.23 so this is resolved