AG2 home page
Search or ask...
⌘K
ag2ai/ag2
ag2ai/ag2
Search...
Navigation
tools
autogen.tools.ChatContext
Documentation
User Guide
API References
Use Cases
User Stories
Contribute
FAQs
Ecosystem
Blog
API Reference
autogen
Overview
Agent
AgentNameConflictError
AssistantAgent
Cache
ChatResult
ContextExpression
ConversableAgent
GroupChat
GroupChatManager
InvalidCarryOverTypeError
LLMConfig
ModelClient
NoEligibleSpeakerError
OpenAIWrapper
SenderRequiredError
UndefinedNextAgentError
UpdateSystemMessage
UserProxyAgent
a_initiate_swarm_chat
a_run_swarm
config_list_from_dotenv
config_list_from_json
config_list_from_models
config_list_gpt4_gpt35
config_list_openai_aoai
filter_config
gather_usage_summary
get_config_list
initiate_chats
register_function
run_swarm
agentchat
agents
browser_utils
cache
code_utils
coding
doc_utils
events
exception_utils
fast_depends
formatting_utils
graph_utils
import_utils
interop
io
json_utils
llm_config
logger
math_utils
mcp
messages
oai
retrieve_utils
runtime_logging
token_count_utils
tools
Overview
BaseContext
ChatContext
Depends
Tool
Toolkit
get_function_schema
load_basemodels_if_needed
serialize_to_str
tool
contrib
dependency_injection
experimental
types
On this page
ChatContext
Instance Attributes
chat_messages
last_message
tools
autogen.tools.ChatContext
ChatContext
Copy
ChatContext(agent: ConversableAgent)
ChatContext class that extends BaseContext.
This class is used to represent a chat context that holds a list of messages.
It inherits from
BaseContext
and adds the
messages
attribute.
Initializes the ChatContext with an agent.
Parameters:
Name
Description
agent
Type:
ConversableAgent
Instance Attributes
chat_messages
The messages in the chat.
Returns:
A dictionary of agents and their messages.
last_message
The last message in the chat.
Returns:
The last message in the chat.
BaseContext
Depends
Assistant
Responses are generated using AI and may contain mistakes.