Message (Documentation Index
Fetch the complete documentation index at: https://docs.agentscope.io/llms.txt
Use this file to discover all available pages before exploring further.
Msg) is the basic data structure in AgentScope, responsible for exchanging information among agents, users, and tools.
Its basic fields include:
| Field | Description |
|---|---|
id | Unique identifier for the message |
name | The name of the message sender |
role | The role of the message sender (“user”, “assistant”, “system”) |
content | The content of the message, which can be text, image, video, audio, tool calls, tool results, etc. |
timestamp | The time when the message was created |
metadata | Additional information about the message, such as tool calls, reasoning traces, etc. |
The
content field can be a plain string for simple text messages, or a list of content blocks for multimodal and tool call messages. Each content block is a dictionary with a type field indicating the content type.| Type | Example |
|---|---|
text | {"type": "text", "text": "Hello AgentScope!"} |
thinking | {"type": "thinking", "thinking": "Hmm, let me think..."} |
image | {"type": "image", "source": {"type": "url", "url": "https://xxx/image.jpg"}} |
video | {"type": "video", "source": {"type": "url", "url": "https://xxx/video.mp4"}} |
audio | {"type": "audio", "source": {"type": "url", "url": "https://xxx/audio.mp3"}} |
tool_use | {"type": "tool_use", "id": "xxxx", "name": "search", "input": {"query": "..."}} |
tool_result | {"type": "tool_result", "id": "xxxx", "name": "search", "output": "..."} |