AssistantMessage¶
-
class
oci.generative_ai_inference.models.AssistantMessage(**kwargs)¶ Bases:
oci.generative_ai_inference.models.message.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
ROLE_ASSISTANTstr(object=’’) -> str ROLE_DEVELOPERstr(object=’’) -> str ROLE_SYSTEMstr(object=’’) -> str ROLE_TOOLstr(object=’’) -> str ROLE_USERstr(object=’’) -> str annotationsGets the annotations of this AssistantMessage. contentGets the content of this Message. nameGets the name of this AssistantMessage. refusalGets the refusal of this AssistantMessage. role[Required] Gets the role of this Message. tool_callsGets 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'¶
-
ROLE_DEVELOPER= 'DEVELOPER'¶
-
ROLE_SYSTEM= 'SYSTEM'¶
-
ROLE_TOOL= 'TOOL'¶
-
ROLE_USER= '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.
-
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: list[oci.generative_ai_inference.models.Annotation]
-
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.
-
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
-
refusal¶ Gets the refusal of this AssistantMessage. The refusal message by the assistant.
Returns: The refusal of this AssistantMessage. Return type: str
-
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
-
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: list[oci.generative_ai_inference.models.ToolCall]
-