Project home: README.md.
Chinese documentation: README-zh.md.
This example shows a minimal end-to-end Agent flow:
- Create a DashScope ChatModel from
AI_DASHSCOPE_API_KEY. - The model response asks the Agent to call
TaskCreate. - The Agent executes the task tool and appends the tool result to context.
- The second model response produces the final assistant reply.
- The example consumes
Agent.ReplyStreamso you can see the Agent event stream.
- Go 1.26.3.
AI_DASHSCOPE_API_KEYfor the DashScope ChatModel.
cd example/agent/basic
go run .Output includes:
agent_stream=...
tasks=1
events=tool_call:TaskCreate,tool_result:success