Skip to main content

FunctionCallingMessage

Class for message objects used specifically for function-related messages. Parameters:
  • func_name (Optional[str]): The name of the function used. (default: :obj:None)
  • args (Optional[Dict]): The dictionary of arguments passed to the function. (default: :obj:None)
  • result (Optional[Any]): The result of function execution. (default: :obj:None)
  • tool_call_id (Optional[str]): The ID of the tool call, if available. (default: :obj:None)
  • mask_output (Optional[bool]): Whether to return a sanitized placeholder instead of the raw tool output. (default: :obj:False)
  • extra_content (Optional[Dict[str, Any]]): Additional content associated with the tool call. (default: :obj:None)

to_openai_message

Converts the message to an :obj:OpenAIMessage object. Parameters:
  • role_at_backend (OpenAIBackendRole): The role of the message in OpenAI chat system.
Returns: OpenAIMessage: The converted :obj:OpenAIMessage object.

to_sharegpt

Convert FunctionCallingMessage to ShareGPT message.

to_openai_assistant_message

Returns: OpenAIAssistantMessage: The converted :obj:OpenAIAssistantMessage object.

to_openai_tool_message

Returns: OpenAIToolMessageParam: The converted :obj:OpenAIToolMessageParam object with its role being “tool”.

to_dict

Returns: dict: The converted dictionary.