Skip to content

Commit

Permalink
explicit naming
Browse files Browse the repository at this point in the history
  • Loading branch information
eavanvalkenburg committed Jun 27, 2024
1 parent 7b5303f commit 5d84282
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/samples/concepts/auto_function_calling/nexus_raven.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ async def get_chat_message_contents(
prompt=chat_history.messages[-1].content,
settings=settings,
)
fcc, frc = await self._execute_function_calls(result[0], **kwargs)
if fcc:
function_call, function_result = await self._execute_function_calls(result[0], **kwargs)
if function_call:
return [
ChatMessageContent(role="assistant", items=[fcc], metadata={"ai_model_id": self.ai_model_id}),
ChatMessageContent(role="tool", items=[frc], name="nexus", metadata={"ai_model_id": self.ai_model_id}),
ChatMessageContent(role="assistant", items=[function_call], metadata={"ai_model_id": self.ai_model_id}),
ChatMessageContent(
role="tool", items=[function_result], name="nexus", metadata={"ai_model_id": self.ai_model_id}
),
]
return [ChatMessageContent(role="assistant", items=result, metadata={"ai_model_id": self.ai_model_id})]

Expand Down

0 comments on commit 5d84282

Please sign in to comment.