Fix GET agents API to return agent specific chat model

There had been a regression that made all agents display the default
chat model instead of the actual chat model associated with the agent.

This change resolves that issue by prioritizing agent specific chat
model from DB (over user or server chat model).
This commit is contained in:
Debanjum
2025-06-10 15:29:46 -07:00
parent 0cd709caf4
commit 5110a06085

View File

@@ -62,7 +62,7 @@ async def all_agents(
for agent in agents:
files = agent.fileobject_set.all()
file_names = [file.file_name for file in files]
agent_chat_model = await AgentAdapters.aget_agent_chat_model(default_agent, user)
agent_chat_model = await AgentAdapters.aget_agent_chat_model(agent, user)
agent_packet = {
"slug": agent.slug,
"name": agent.name,