ToolMessage

class oci.generative_ai_inference.models.ToolMessage(**kwargs)

Bases: oci.generative_ai_inference.models.message.Message

Represents a single instance of tool message.

Attributes

ROLE_ASSISTANT str(object=’’) -> str
ROLE_SYSTEM str(object=’’) -> str
ROLE_TOOL str(object=’’) -> str
ROLE_USER str(object=’’) -> str
content Gets the content of this Message.
role [Required] Gets the role of this Message.
tool_call_id Gets the tool_call_id of this ToolMessage.

Methods

__init__(**kwargs) Initializes a new ToolMessage object with values from keyword arguments.
get_subtype(object_dictionary) Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
ROLE_ASSISTANT = 'ASSISTANT'
ROLE_SYSTEM = 'SYSTEM'
ROLE_TOOL = 'TOOL'
ROLE_USER = 'USER'
__init__(**kwargs)

Initializes a new ToolMessage object with values from keyword arguments. The default value of the role attribute of this class is TOOL and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • role (str) – The value to assign to the role property of this ToolMessage. Allowed values for this property are: “SYSTEM”, “USER”, “ASSISTANT”, “TOOL”
  • content (list[oci.generative_ai_inference.models.ChatContent]) – The value to assign to the content property of this ToolMessage.
  • tool_call_id (str) – The value to assign to the tool_call_id property of this ToolMessage.
content

Gets the content of this Message. Contents of the chat message.

Returns:The content of this Message.
Return type:list[oci.generative_ai_inference.models.ChatContent]
static get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

role

[Required] Gets the role of this Message. Indicates who is writing the current chat message.

Allowed values for this property are: “SYSTEM”, “USER”, “ASSISTANT”, “TOOL”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The role of this Message.
Return type:str
tool_call_id

Gets the tool_call_id of this ToolMessage. Tool call that this message is responding to.

Returns:The tool_call_id of this ToolMessage.
Return type:str