Share via


message Module

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Classes

FunctionMessage

Represents the result of a function call execution.

Contains the output from executing a function that was requested by the AI model, along with the function call ID for correlation.

ModelMessage

Represents a response from an AI model.

Can contain either text content, function calls to be executed, or both. When function_calls is present, the content may be None.

SystemMessage

Represents system instructions or context for the AI model.

Used to guide model behavior, provide context, or set up the conversation parameters without being part of the user dialogue.

UserMessage

Represents a message from a user in the conversation.

Contains the user's input text and is typically used as the starting point for AI model interactions.

Data

Message

Union type representing any message in a conversation.

Can be a user input, model response, system instruction, or function result. Used throughout the AI framework for type-safe message handling.

alias of Union[UserMessage, ModelMessage, SystemMessage, FunctionMessage]

Message