Skip to content

Commit

Permalink
Merge pull request #130 from galadriel-ai/fix-groq
Browse files Browse the repository at this point in the history
Fix groq message handling on oracle side
  • Loading branch information
kristjanpeterson1 authored Sep 5, 2024
2 parents e48c40d + 26736d4 commit fc6270b
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 fc6270b

Please sign in to comment.