Skip to content

Commit

Permalink
hotfix: Apply a temp hotfix for sessions.chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Julep Developers committed Sep 16, 2024
1 parent c0402d4 commit c24e262
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions agents-api/agents_api/routers/sessions/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ async def chat(
# messages = messages[-settings["max_tokens"] :]
raise NotImplementedError("Truncation is not yet implemented")

# FIXME: Hotfix for datetime not serializable. Needs investigation
messages = [
msg.model_dump() if hasattr(msg, "model_dump") else msg
for msg in messages
]

messages = [
dict(role=m["role"], content=m["content"], user=m.get("user"))
for m in messages
]

# Get the response from the model
model_response = await litellm.acompletion(
messages=messages,
Expand Down

0 comments on commit c24e262

Please sign in to comment.