How we want to work now with LLM making a blunder:...
# proj-sdk
c
How we want to work now with LLM making a blunder: • let's say it returns a tool call, which has parameter 0 when we require >=1 • during processing, we create an AgentErrorEvent • and return early, so there is no Action • => next step, the condenser will drop the unmatched AgentErrorEvent • => the LLM never finds out and loops I'm not sure if I'm missing something? How do we want this to work, have a different type of Action/Event maybe, or should this become a MessageEvent?
c
• => next step, the condenser will drop the unmatched AgentErrorEvent
🤔 this sounds like a bug to me?
c
Well, it has a tool_call_id, so it would give a 400
🤔 Do you think we should fix what we send to the LLM for an AgentErrorEvent so that we don't send that tool id, ... but it still needs its own tool call, I feel
Taking a small step back: • the LLM did a boo-boo • and we can't validate the tool call => no ActionEvent to execute • how can we send this back?
c
Let's just send back an AgentErrorEvent as a tool result?
i thought that's what we are doing now..
c
It's a tool result, so it has a tool_call_id, and the LLM API returns 400 because it's a result that doesn't have a tool call
that's why the condenser excludes it...
Idk, I see 3 options: 1. send
AgentErrorEvent
but as a user message, not a tool result (tell the LLM a story about its blunder) 2. do not early return, try to create ActionEvent, but schema validation failed, so idk how 3. have a different non-executable Event, that we can use here My PR proposes 3
c
It's a tool result, so it has a tool_call_id, and the LLM API returns 400 because it's a result that doesn't have a tool call
wait.. so the condenser will remove the first action?
ugh i see!
interesting.. maybe
AgentErrorEvent
should actually contains an action too
or your solution in 623, i'll take a look!