Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Latest commit

 

History

History

message

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Message Example

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.

Prerequisites

  • Go 1.26.3.
  • AI_DASHSCOPE_API_KEY for the DashScope ChatModel.

Run

cd example/message
go run .

Expected Output

Output includes:

conversation_messages=3