AssistantMessage¶
- class oci.generative_ai_inference.models.AssistantMessage(**kwargs)¶
Bases:
MessageRepresents a single instance of assistant message.
Note: When responding to a tool call, set content to null (not “”). This ensures the model correctly processes tool call messages in multi-step interactions.
Attributes:
A constant which can be used with the role property of a Message.
A constant which can be used with the role property of a Message.
A constant which can be used with the role property of a Message.
A constant which can be used with the role property of a Message.
A constant which can be used with the role property of a Message.
Gets the annotations of this AssistantMessage.
Gets the content of this Message.
Gets the name of this AssistantMessage.
Gets the reasoning_content of this AssistantMessage.
Gets the refusal of this AssistantMessage.
[Required] Gets the role of this Message.
Gets the tool_calls of this AssistantMessage.
Methods:
__init__(**kwargs)Initializes a new AssistantMessage 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'¶
A constant which can be used with the role property of a Message. This constant has a value of “ASSISTANT”
- ROLE_DEVELOPER = 'DEVELOPER'¶
A constant which can be used with the role property of a Message. This constant has a value of “DEVELOPER”
- ROLE_SYSTEM = 'SYSTEM'¶
A constant which can be used with the role property of a Message. This constant has a value of “SYSTEM”
- ROLE_TOOL = 'TOOL'¶
A constant which can be used with the role property of a Message. This constant has a value of “TOOL”
- ROLE_USER = 'USER'¶
A constant which can be used with the role property of a Message. This constant has a value of “USER”
- __init__(**kwargs)¶
Initializes a new AssistantMessage object with values from keyword arguments. The default value of the
roleattribute of this class isASSISTANTand 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 AssistantMessage. Allowed values for this property are: “SYSTEM”, “ASSISTANT”, “USER”, “TOOL”, “DEVELOPER”
content (list[oci.generative_ai_inference.models.ChatContent]) – The value to assign to the content property of this AssistantMessage.
name (str) – The value to assign to the name property of this AssistantMessage.
refusal (str) – The value to assign to the refusal property of this AssistantMessage.
tool_calls (list[oci.generative_ai_inference.models.ToolCall]) – The value to assign to the tool_calls property of this AssistantMessage.
annotations (list[oci.generative_ai_inference.models.Annotation]) – The value to assign to the annotations property of this AssistantMessage.
reasoning_content (str) – The value to assign to the reasoning_content property of this AssistantMessage.
- property annotations¶
Gets the annotations of this AssistantMessage. List of annotations generated by the model, including inline citations from web search results.
- Returns
The annotations of this AssistantMessage.
- Return type
- property content¶
Gets the content of this Message. Contents of the chat message.
- Returns
The content of this Message.
- Return type
- 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.
- property name¶
Gets the name of this AssistantMessage. An optional name for the participant. Provides the model information to differentiate between participants of the same role.
- Returns
The name of this AssistantMessage.
- Return type
str
- property reasoning_content¶
Gets the reasoning_content of this AssistantMessage. Internal reasoning trace generated during response computation.
- Returns
The reasoning_content of this AssistantMessage.
- Return type
str
- property refusal¶
Gets the refusal of this AssistantMessage. The refusal message by the assistant.
- Returns
The refusal of this AssistantMessage.
- Return type
str
- property role¶
[Required] Gets the role of this Message. Indicates who is writing the current chat message.
Allowed values for this property are: “SYSTEM”, “ASSISTANT”, “USER”, “TOOL”, “DEVELOPER”, ‘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
- property tool_calls¶
Gets the tool_calls of this AssistantMessage. The tool calls generated by the model, such as function calls.
- Returns
The tool_calls of this AssistantMessage.
- Return type