Skip to content

Commit

Permalink
Fix groq message handling on oracle side
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanpeterson1 committed Sep 5, 2024
1 parent e48c40d commit 26736d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oracles/src/domain/llm/groq_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ async def execute(chat: Chat) -> Optional[GroqChatCompletion]:
timeout=TIMEOUT,
)
for message in chat.messages:
if len(message.get("content")) and message.get("content")[0].get("text"):
message["content"] = message.get("content")[0].get("text")
if len(message.get("content")) and message.get("content"):
content = message.get("content")
if type(content) is not str:
message["content"] = message.get("content")[0].get("text")
chat_completion: ChatCompletion = await client.chat.completions.create(
messages=chat.messages,
model=chat.config.model,
Expand Down

0 comments on commit 26736d4

Please sign in to comment.