Closed Jpickard1 closed 2 days ago
@Jpickard1 I have used flask's SimpleCache mechanism for maintaining states previously. We can use the same mechanism to track the agent LLM. This is better than implementing our own dictionary as cache, because we can switch it out for something better later if we want.
Sounds good. Can you make that work? I don't understand the SimpleCache mechanism @imnuvi
Describe the bug The user is not able to correctly change the LLM. The LLM is changed, but this change never impacts the way that the
Agent
's LLM is set. In particular, the/api/llm/set
endpoint was broken when theAgent
factory was introduced. Prior to this, theAgent
brad
was treated as a global, so/api/llm/set
was used to change the LLM associated with theAgent
. Now each time theAgentFactory
is used, a newAgent
is created with the defaultLLM
, despite the appearance of it having changed.Proposed Solution The
Agent
LLM must be set whenever/api/invoke/
is accessed. Perhaps, we could have a global dictionary with keys of the session id and values of the LLM / LLM name. Then, each time we hit/invoke/
we could get the correct LLM prior to usingbrad.invoke()
@imnuvi What do you think?