Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update quick start doc #1209

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Collect 和 Transform 两种流式范式,目前只在编排场景有用到。
上面的 Concat message stream 是 Eino 框架自动提供的能力,即使不是 message,是任意的 T,只要满足特定的条件,Eino 框架都会自动去做这个 StreamReader[T] 到 T 的转化,这个条件是:**在编排中,当一个组件的上游输出是 StreamReader[T],但是组件只提供了 T 作为输入的业务接口时,框架会自动将 StreamReader[T] concat 成 T,再输入给这个组件。**

> 💡
> 框架自动将 StreamReader[T] concat 成 T 的过程,可能需要用户提供一个 Concat function。详见 [Eino: 编排的设计理念](/zh/docs/eino/core_modules/chain_and_graph_orchestration/orchestration_design_principles#share-FaVnd9E2foy4fAxtbTqcsgq3n5f) 中关于“合并帧”的章节。
> 框架自动将 StreamReader[T] concat 成 T 的过程,可能需要用户提供一个 Concat function。详见 [Eino: 编排的设计理念](/zh/docs/eino/core_modules/chain_and_graph_orchestration/orchestration_design_principles) 中关于“合并帧”的章节。

另一方面,考虑一个相反的例子。还是 React Agent,这次是一个更完整的编排示意图:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Description: ""
date: "2025-01-15"
date: "2025-01-16"
lastmod: ""
tags: []
title: 'Eino: React Agent 使用手册'
Expand All @@ -9,7 +9,7 @@ weight: 0

# 简介

Eino React Agent 是实现了 [React 逻辑](https://react-lm.github.io/)的智能体框架,用户可以用来快速灵活地构建并调用 React Agent.
Eino React Agent 是实现了 [React 逻辑](https://react-lm.github.io/) 的智能体框架,用户可以用来快速灵活地构建并调用 React Agent.

> 💡
> 代码实现详见:[实现代码目录](https://github.com/cloudwego/eino/tree/main/flow/agent/react)
Expand Down
2 changes: 1 addition & 1 deletion content/zh/docs/eino/overview/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Description: ""
date: "2025-01-15"
date: "2025-01-16"
lastmod: ""
tags: []
title: 'Eino: 概述'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Description: ""
date: "2025-01-07"
date: "2025-01-16"
lastmod: ""
tags: []
title: 复杂业务逻辑的利器-编排
Expand Down
14 changes: 4 additions & 10 deletions content/zh/docs/eino/quick_start/simple_llm_application.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Description: ""
date: "2025-01-07"
date: "2025-01-16"
lastmod: ""
tags: []
title: 实现一个最简 LLM 应用
Expand Down Expand Up @@ -65,11 +65,8 @@ func main() {
// 系统消息模板
schema.SystemMessage("你是一个{role}。你需要用{style}的语气回答问题。你的目标是帮助程序员保持积极乐观的心态,提供技术建议的同时也要关注他们的心理健康。"),

// 插入可选的示例对话
schema.MessagesPlaceholder("examples", true),

// 插入必需的对话历史
schema.MessagesPlaceholder("chat_history", false),
// 插入需要的对话历史(新对话的话这里不填)
schema.MessagesPlaceholder("chat_history", true),

// 用户消息模板
schema.UserMessage("问题: {question}"),
Expand All @@ -80,13 +77,10 @@ func main() {
"role": "程序员鼓励师",
"style": "积极、温暖且专业",
"question": "我的代码一直报错,感觉好沮丧,该怎么办?",
// 对话历史(必需的
// 对话历史(这个例子里模拟两轮对话历史
"chat_history": []*schema.Message{
schema.UserMessage("你好"),
schema.AssistantMessage("嘿!我是你的程序员鼓励师!记住,每个优秀的程序员都是从 Debug 中成长起来的。有什么我可以帮你的吗?", nil),
},
// 示例对话(可选的)
"examples": []*schema.Message{
schema.UserMessage("我觉得自己写的代码太烂了"),
schema.AssistantMessage("每个程序员都经历过这个阶段!重要的是你在不断学习和进步。让我们一起看看代码,我相信通过重构和优化,它会变得更好。记住,Rome wasn't built in a day,代码质量是通过持续改进来提升的。", nil),
},
Expand Down
Loading