You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same FunctionCall must be used in AssistantMessage and FunctionResultMessage for them to have the same tool_call_id. The current syntax for doing this could be cleaned up to avoid creating the awkward FunctionCall instance(s) above the chatprompt-function.
defplus(a: int, b: int) ->int:
returna+bplus_1_2=FunctionCall(plus, 1, 2)
@chatprompt(UserMessage("Use the plus function to add 1 and 2."),AssistantMessage(plus_1_2),FunctionResultMessage(3, plus_1_2),UserMessage("Now add 4 to the result."),functions=[plus],)defdo_math() ->FunctionCall[int]: ...
ideally could more like (moving the creation of the FunctionCall inside)
defplus(a: int, b: int) ->int:
returna+b@chatprompt(UserMessage("Use the plus function to add 1 and 2."),*assistant_function_call_and_result(3, plus, 1, 2),UserMessage("Now add 4 to the result."),functions=[plus],)defdo_math() ->FunctionCall[int]: ...
Also need to consider ParallelFunctionCall, and possibly future tools too.
The text was updated successfully, but these errors were encountered:
The same
FunctionCall
must be used inAssistantMessage
andFunctionResultMessage
for them to have the sametool_call_id
. The current syntax for doing this could be cleaned up to avoid creating the awkwardFunctionCall
instance(s) above the chatprompt-function.Example from the docs https://magentic.dev/chat-prompting/#functionresultmessage
ideally could more like (moving the creation of the
FunctionCall
inside)Also need to consider
ParallelFunctionCall
, and possibly future tools too.The text was updated successfully, but these errors were encountered: