Eai.Chat (eai v0.1.3)

Copy Markdown

Summary

Functions

单次发送消息,直接返回 AI 回复。

Functions

send(message, agent_id \\ "default")

单次发送消息,直接返回 AI 回复。

示例

iex> Eai.Chat.send("现在几点钟?")
{:ok, "当前时间是 2025-01-15T10:30:00Z"}

iex> Eai.Chat.send("列出活动会话", "my_agent")
{:ok, "当前有 2 个活动会话..."}

返回值是 {:ok, response}{:error, reason}, 与 Direct.run/2 保持一致,方便模式匹配。

start()