Skip to content

Conversation

@mrh997
Copy link
Contributor

@mrh997 mrh997 commented Nov 24, 2025

🚀 Eino 全新消息结构体定义发布 [Beta]

随着内置工具、MCP 工具、缓存等能力在 OpenAI Responses API、Claude API 等先进厂商的 API 中得到原生支持,模型正在从 “一次性问答引擎” 升级为 “面向用户目标的自主行动体”。我们很高兴地宣布 Eino 框架推出全新的消息结构体定义 AgenticMessage ,围绕 AgenticMessage 引入了三个核心组件:AgenticModelAgenticChatTemplateAgenticToolsNode,为构建更智能、更自主的 AI 应用提供强大支持。

Eino v0.9.0-alpha.2 版本已发布,立即更新 eino-example@release/agentic_model 体验 Eino 的 Agentic 能力,构建下一代智能应用! 🚀

git clone https://github.com/cloudwego/eino-examples.git
git checkout release/agentic_model
cd ./eino-examples/flow/agent/react/agentic
go run main.go

✨ 核心更新内容

1️⃣ AgenticMessage

  • AgenticMessage:通过 ContentBlock 多态结构承载复杂的复合内容(如"推理过程 + 工具调用 + 文本生成"),针对 OpenAI、Claude、Gemini 等不同模型提供商的专属扩展字段。
  • ContentBlock:支持以下 19 种内容类型,包括推理(Reasoning)、多模态输入输出、工具调用与结果等:

用户输入

  • UserInputText - 文本输入
  • UserInputImage - 图像输入
  • UserInputAudio - 音频输入
  • UserInputVideo - 视频输入
  • UserInputFile - 文件输入

模型生成

  • Reasoning - 推理过程
  • AssistantGenText - 生成文本
  • AssistantGenImage - 生成图像
  • AssistantGenAudio - 生成音频
  • AssistantGenVideo - 生成视频

工具调用

  • FunctionToolCall/Result - 用户自定义工具
  • ServerToolCall/Result - 服务端内置工具
  • MCPToolCall/Result - MCP 协议工具
  • MCPListToolsResult - MCP 工具列表
  • MCPToolApprovalRequest/Response - MCP 工具审批

2️⃣ AgenticModel

AgenticModel 是以 “目标驱动的自主执行” 为核心的模型能力抽象,是 ChatModel 的增强抽象。

📦 接口定义

type AgenticModel interface {
    Generate(ctx context.Context, input []*schema.AgenticMessage, opts ...Option) (*schema.AgenticMessage, error)
    Stream(ctx context.Context, input []*schema.AgenticMessage, opts ...Option) (*schema.StreamReader[*schema.AgenticMessage], error)
    WithTools(tools []*schema.ToolInfo) (AgenticModel, error)
}

🔥 模型厂商支持情况

厂商 版本
OpenAI github.com/cloudwego/eino-ext/components/model/agenticopenai@v0.9.0-alpha.1
ARK github.com/cloudwego/eino-ext/components/model/agenticark@v0.9.0-alpha.1
Gemini 开发中
Claude 开发中

3️⃣ AgenticChatTemplate

专为 AgenticMessage 设计的提示模板组件,用于构建结构化的上下文准备。

📦 接口定义

type AgenticChatTemplate interface {
    Format(ctx context.Context, vs map[string]any, opts ...Option) ([]*schema.AgenticMessage, error)
}

4️⃣ AgenticToolsNode

专为 AgenticModel 设计的工具执行组件,支持自动解析并执行模型生成的工具调用。


⚠️ Beta 说明

当前版本为 Beta 版本,API 可能会有调整。我们欢迎社区反馈和贡献!

反馈渠道

@mrh997 mrh997 force-pushed the release/agentic_model branch 3 times, most recently from 66bd0d0 to 630a8a3 Compare November 24, 2025 15:11
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 64.24028% with 506 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.99%. Comparing base (38efb3c) to head (10742a2).

Files with missing lines Patch % Lines
schema/agentic_message.go 65.24% 220 Missing and 122 partials ⚠️
utils/callbacks/template.go 65.21% 30 Missing and 2 partials ⚠️
compose/component_to_graph_node.go 0.00% 26 Missing ⚠️
compose/agentic_tools_node.go 73.52% 17 Missing and 1 partial ⚠️
schema/openai/extension.go 70.49% 9 Missing and 9 partials ⚠️
compose/chain.go 0.00% 12 Missing ⚠️
compose/chain_branch.go 0.00% 9 Missing ⚠️
compose/chain_parallel.go 0.00% 9 Missing ⚠️
compose/graph.go 0.00% 9 Missing ⚠️
compose/workflow.go 0.00% 9 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
- Coverage   81.62%   79.99%   -1.63%     
==========================================
  Files         127      135       +8     
  Lines       12250    13639    +1389     
==========================================
+ Hits         9999    10911     +912     
- Misses       1510     1849     +339     
- Partials      741      879     +138     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrh997 mrh997 force-pushed the release/agentic_model branch from f672218 to a7fdb1b Compare December 22, 2025 12:43
@mrh997 mrh997 force-pushed the release/agentic_model branch 3 times, most recently from afc347e to 59a320a Compare January 6, 2026 14:56
@mrh997 mrh997 changed the title feat(agentic): define AgenticModel component feat(components): define AgenticModel component Jan 6, 2026
@mrh997 mrh997 force-pushed the release/agentic_model branch 2 times, most recently from 9918722 to bd7776b Compare January 6, 2026 15:51
@mrh997 mrh997 force-pushed the release/agentic_model branch 3 times, most recently from 980e38f to 2f1d10e Compare January 22, 2026 02:55
@mrh997 mrh997 changed the title feat(components): define AgenticModel component feat(components): define AgenticMessage Jan 22, 2026
@mrh997 mrh997 changed the title feat(components): define AgenticMessage feat: define AgenticMessage Jan 22, 2026
@mrh997 mrh997 force-pushed the release/agentic_model branch from 2f1d10e to 10742a2 Compare January 22, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants