Project home: README.md.
Chinese documentation: README-zh.md.
This example demonstrates the message package:
- Build a conversation history with system, user, and assistant messages.
- Read role order and text content from the history.
- Show that system messages are finished immediately while assistant messages can represent model output.
- Send the same history to a DashScope ChatModel.
- Go 1.26.3.
AI_DASHSCOPE_API_KEYfor the DashScope ChatModel.
cd example/message
go run .Output includes:
conversation_messages=3