Skip to content

Commit f817ffa

Browse files
feat(eino): sync english docs
1 parent f394665 commit f817ffa

File tree

111 files changed

+10010
-14153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+10010
-14153
lines changed

assets/js/mermaid.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@
5454

5555
function isMermaidLike(text) {
5656
var t = text.trim();
57-
return /^%%\{init:/.test(t) || /^---\s*/.test(t) || /^(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|gantt|pie)\b/.test(t);
57+
if (/^%%\{init:/.test(t) || /^---\s*/.test(t)) return true;
58+
var firstLine = t.split('\n')[0].trim();
59+
if (/^(flowchart|sequenceDiagram|classDiagram|stateDiagram|gantt|pie)\b/.test(firstLine)) return true;
60+
// Only treat as mermaid when 'graph' starts with a valid direction token
61+
if (/^graph\s+(TD|TB|LR|RL)\b/.test(firstLine)) return true;
62+
return false;
5863
}
5964

6065
var toReplace = [];
6166
$('pre > code.language-mermaid').each(function() { toReplace.push($(this)); });
62-
$('pre > code').each(function() {
63-
var $c = $(this);
64-
if ($c.hasClass('language-mermaid')) return;
65-
if (isMermaidLike($c.text())) toReplace.push($c);
66-
});
6767

6868
toReplace.forEach(function($code) {
6969
needMermaid = true;

content/en/docs/eino/FAQ.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
Description: ""
3+
date: "2025-12-01"
4+
lastmod: ""
5+
tags: []
6+
title: FAQ
7+
weight: 6
8+
---
9+
10+
# Q: cannot use openapi3.TypeObject (untyped string constant "object") as *openapi3.Types value in struct literal; cannot use types (variable of type string) as *openapi3.Types value in struct literal
11+
12+
Ensure the `github.com/getkin/kin-openapi` dependency version does not exceed `v0.118.0`.
13+
14+
# Q: During agent streaming, it never reaches ToolsNode, or streaming is lost and appears non-streaming.
15+
16+
- First, update Eino to the latest version.
17+
18+
Different models output tool calls differently in streaming mode. Some models (e.g., OpenAI) emit tool calls directly; others (e.g., Claude) might emit text first and then the tool call. You therefore need different logic to determine whether a tool call is present in a streamed message.
19+
20+
The ReAct Agent `Config` has a `StreamToolCallChecker`. If omitted, the agent uses a default checker that determines a tool call by inspecting whether any non-empty early chunk contains tool calls:
21+
22+
```go
23+
func firstChunkStreamToolCallChecker(_ context.Context, sr *schema.StreamReader[*schema.Message]) (bool, error) {
24+
defer sr.Close()
25+
26+
for {
27+
msg, err := sr.Recv()
28+
if err == io.EOF {
29+
return false, nil
30+
}
31+
if err != nil {
32+
return false, err
33+
}
34+
35+
if len(msg.ToolCalls) > 0 {
36+
return true, nil
37+
}
38+
39+
if len(msg.Content) == 0 { // skip empty chunks at the front
40+
continue
41+
}
42+
43+
return false, nil
44+
}
45+
}
46+
```
47+
48+
This default works when the Tool Call message contains only a tool call.
49+
50+
It does not fit cases where a non-empty content chunk appears before the tool call. In such cases, provide a custom checker like this:
51+
52+
```go
53+
toolCallChecker := func(ctx context.Context, sr *schema.StreamReader[*schema.Message]) (bool, error) {
54+
defer sr.Close()
55+
for {
56+
msg, err := sr.Recv()
57+
if err != nil {
58+
if errors.Is(err, io.EOF) {
59+
// finish
60+
break
61+
}
62+
return false, err
63+
}
64+
if len(msg.ToolCalls) > 0 {
65+
return true, nil
66+
}
67+
}
68+
return false, nil
69+
}
70+
```
71+
72+
Note: this custom `StreamToolCallChecker` checks all chunks for tool calls. When the model is outputting a normal answer, this may reduce “early streaming detection”, because it waits until all chunks are inspected. To preserve streaming responsiveness, try guiding the model with prompts:
73+
74+
> 💡
75+
> Add prompt constraints such as: “If a tool is required, output only the tool call; do not output text.”
76+
>
77+
> Models vary in how much they adhere to such prompts. Tune and validate for your chosen model.
78+
79+
# Q: [github.com/bytedance/sonic/loader](http://github.com/bytedance/sonic/loader): invalid reference to runtime.lastmoduledatap
80+
81+
Older versions of `sonic` are incompatible with `go1.24`. Upgrade to `v1.13.2` or higher.
82+
83+
# Q: Tool input deserialization failed: `failed to invoke tool call {tool_call_id}: unmarshal input fail`
84+
85+
Models typically do not produce invalid JSON. Investigate the specific reason for deserialization failure; in most cases this is due to output truncation when the model’s response exceeds limits.
86+
87+
# Q: How can I implement batch processing nodes in Eino (like Coze’s batch nodes)?
88+
89+
Eino currently does not support batch processing. Two options:
90+
91+
1. Dynamically build the graph per request — the overhead is low. Note that `Chain Parallel` requires the number of parallel nodes to be greater than one.
92+
2. Implement a custom batch node and handle batching inside the node.
93+
94+
# Q: Panic occurs in Fornax SDK or panic stack mentions Fornax SDK
95+
96+
Upgrade both the Fornax SDK and Eino to the latest versions and retry.
97+
98+
# Q: Does Eino support structured model outputs?
99+
100+
Yes, in two steps:
101+
102+
1. Ensure the model outputs structured data. Options:
103+
- Some models support configuration for structured output (e.g., OpenAI response format).
104+
- Use tool calls to obtain structured results.
105+
- Prompt the model explicitly to output structured data.
106+
2. After obtaining a structured message, use `schema.NewMessageJSONParser` to parse the message into your target struct.
107+
108+
# Q: In image recognition scenarios, error: `One or more parameters specified in the request are not valid`
109+
110+
Check whether the model supports image input (for Doubao models, only variants with `vision` support it).
111+
112+
# Q: How to access Reasoning Content / “thinking” output from a chat model?
113+
114+
If a model implementation supports Reasoning Content (deep thinking), it is stored in the `Extra` field of the output `Message`. The provider package usually offers helpers like `GetReasoningContent`/`GetThinking` to extract it.
115+
116+
# Q: Errors include `context deadline exceeded`, `timeout`, or `context canceled`
117+
118+
This indicates a timeout or that the `ctx` was canceled by a service/framework or manually. Adjust timeouts or investigate your code. If model/component latency seems abnormally high, contact the provider directly. Eino only passes through.
119+
120+
# Q: How to access parent graph `State` within a subgraph?
121+
122+
If both parent and subgraph have `state`, the subgraph’s state overrides the parent’s. Define a custom context key. Before invoking the subgraph, call `compose.ProcessState()` to retrieve the parent state and pass it via your custom context key.
123+
124+
# Q: How does `eino-ext` adapt multimodal input/output for supported models?
125+
126+
For multimodal support, see [https://www.cloudwego.io/en/docs/eino/ecosystem_integration/chat_model](https://www.cloudwego.io/en/docs/eino/ecosystem_integration/chat_model) and the corresponding examples for each model.
127+
128+
# Q: Using `UserInputMultiContent` for multimodal input, but the model side seems to miss the data or cannot read `multicontent`
129+
130+
Recent versions of Eino introduce `UserInputMultiContent` and `AssistantGenMultiContent` for multimodal user input and model output respectively. All `eino-ext` chat model implementations have been adapted. If the model does not receive the multimodal payload, upgrade the provider package to the latest version and try again.
131+
132+
# Q: After upgrading to `0.6.x`, there are breaking changes
133+
134+
Per the migration plan [Migration from OpenAPI 3.0 Schema Object to JSONSchema in Eino · Discussion #397](https://github.com/cloudwego/eino/discussions/397), Eino `v0.6.1` removed the dependency on `getkin/kin-openapi` and all OpenAPI 3.0-related code.
135+
136+
If `eino-ext` modules error with `undefined: schema.NewParamsOneOfByOpenAPIV3`, upgrade those modules to the latest versions.
137+
138+
If schema migration is complex, use the helper tooling in the [JSONSchema conversion guide](https://bytedance.larkoffice.com/wiki/ZMaawoQC4iIjNykzahwc6YOknXf).
139+
140+
# Q: `context canceled` / `context deadline exceeded`
141+
142+
The `ctx` passed to Eino was canceled or timed out; this is unrelated to the framework itself.
143+

content/en/docs/eino/_index.md

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,15 @@
11
---
2-
Description: Eino is an AI application development framework based on Go
3-
date: "2025-02-21"
2+
Description: Eino is a Golang-based AI application development framework
3+
date: "2025-11-20"
44
lastmod: ""
55
linktitle: Eino
66
menu:
77
main:
88
parent: Documentation
99
weight: 6
1010
tags: []
11-
title: 'Eino: User Manual'
11+
title: Eino User Manual
1212
weight: 6
1313
---
1414

15-
> Eino pronunciation: US / 'aino /, approximate sound: i know, with the hope that the application can achieve the vision of "i know"
1615

17-
## What is Eino
18-
19-
> 💡
20-
> Eino:An AI Application Development Framework Built with Go
21-
22-
Eino aims to provide an AI application development framework built with Go. Eino refers to many excellent AI application development frameworks in the open-source community, such as LangChain, LangGraph, LlamaIndex, etc., and provides an AI application development framework that is more in line with the programming habits of Go.
23-
24-
Eino provides rich capabilities such as **atomic components**, **integrated components**, **component orchestration**, and **aspect extension** that assist in AI application development, which can help developers more simply and conveniently develop AI applications with a clear architecture, easy maintenance, and high availability.
25-
26-
Take ReactAgent as an example:
27-
28-
- It provides common components such as ChatModel, ToolNode, and PromptTemplate, and the business can be customized and extended.
29-
- Flexible orchestration can be performed based on existing components to generate integrated components for use in business services.
30-
31-
<a href="/img/eino/en_eino_graph_2.png" target="_blank"><img src="/img/eino/en_eino_graph_2.png" width="100%" /></a>
32-
33-
## Eino Components
34-
35-
> One of Eino's goals is: to collect and improve the component system in the context of AI applications, so that the business can easily find some common AI components, facilitating the iteration of the business.
36-
>
37-
> Eino will provide components with a relatively good abstraction around the scenarios of AI applications, and provide some common implementations around this abstraction.
38-
39-
- The abstract definition of Eino components is in: [eino/components](https://github.com/cloudwego/eino/tree/main/components)
40-
- The implementation of Eino components is in: [eino-ext/components](https://github.com/cloudwego/eino-ext/tree/main/components)
41-
42-
## Eino application scenarios
43-
44-
Thanks to the lightweight and in-field affinity properties of Eino, users can introduce powerful large model capabilities to their existing microservices with just a few lines of code, allowing traditional microservices to evolve with AI genes.
45-
46-
When people hear the term "Graph Orchestration", their first reaction might be to segment and layer the implementation logic of the entire application interface, and convert it into an orchestratable Node. The biggest problem encountered in this process is the issue of **long-distance context passing (variable passing across Node nodes)**, whether using the State of Graph/Chain or using Options for transparent passing, the entire orchestration process is extremely complex, far from being as simple as directly making function calls.
47-
48-
Based on the current Graph orchestration capabilities, the scenarios suitable for orchestration have the following characteristics:
49-
50-
- The overall focus is on the semantic processing-related capabilities of the model. Here, semantics are not limited to modalities.
51-
- In orchestration output, there are very few nodes related to Session. Overall, the vast majority of nodes do not have processing logic at the granularity of unenumerable business entities such as users/devices.
52-
- Whether through the State of Graph/Chain or through CallOptions, the methods for reading, writing, or transparently passing user/device granularity information are not convenient.
53-
- Require common aspect capabilities, and build horizontal governance capabilities such as observation, rate limiting, and evaluation based on this.
54-
55-
What is the significance of orchestration: To aggregate, control, and present the context of long-distance orchestration elements in a fixed paradigm.
56-
57-
- Context of long-distance orchestration elements: Generally, orchestration elements are scattered throughout the system of the entire orchestration product, making it difficult for people to have a macroscopic and overall cognition. The role of orchestration is to gather and present this macroscopic information.
58-
- Aggregation control and presentation: It is to easily organize and control the relationship between orchestration elements, facilitating adjustment and display.
59-
60-
Overall, the scenarios where "Graph Orchestration" is applicable are: business-customized AI integration components. That is, to flexibly orchestrate AI-related atomic capabilities and provide simple and easy-to-use scenario-based AI components. Moreover, in this AI component, there is a unified and complete horizontal governance capability.
61-
62-
- When generating the corresponding AI component, the core is to provide common cross-cutting capabilities.
63-
- The logic inside a service interface: Generally speaking, the responsibilities are relatively single, the distribution is relatively concentrated, and the context is relatively cohesive. It does not match the applicable scenarios of "orchestration". The AI integration component can be used as an SDK in the business interface.
64-
- Recommended usage methods
65-
66-
<a href="/img/eino/en_eino_recommend_using_graph.png" target="_blank"><img src="/img/eino/en_eino_recommend_using_graph.png" width="100%" /></a>
67-
68-
- A more challenging approach -- 【Node orchestration of the entire business process】
69-
- Biz Handler typically focuses on business logic and has a relatively light focus on data flow, and is more suitable for development in a function stack call manner.
70-
- If the logical division and combination are carried out in a graph orchestration manner, it will increase the difficulty of business logic development.
71-
72-
<a href="/img/eino/en_eino_not_recommend_of_biz.png" target="_blank"><img src="/img/eino/en_eino_not_recommend_of_biz.png" width="100%" /></a>

content/en/docs/eino/core_modules/_index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ Description: ""
33
date: "2025-07-21"
44
lastmod: ""
55
tags: []
6-
title: 'Eino: 核心模块'
6+
title: 'Eino: Core Modules'
77
weight: 3
88
---
99

10-
Eino 中的核心模块有如下几个部分:
10+
Eino’s core modules include the following parts:
1111

12-
- **Components 组件**[Eino: Components 组件](/zh/docs/eino/core_modules/components)
12+
- **Components**: [Eino: Components](/en/docs/eino/core_modules/components)
1313

14-
Eino 抽象出来的大模型应用中常用的组件,例如 `ChatModel``Embedding``Retriever` 等,这是实现一个大模型应用搭建的积木,是应用能力的基础,也是复杂逻辑编排时的原子对象。
14+
Eino abstracts commonly used components in LLM applications, such as `ChatModel`, `Embedding`, `Retriever`. These are the building blocks for application capabilities and the atomic objects in complex orchestration.
1515

16-
- **Chain/Graph 编排**[Eino: Chain/Graph 编排功能](/zh/docs/eino/core_modules/chain_and_graph_orchestration/chain_graph_introduction)
16+
- **Chain/Graph Orchestration**: [Eino: Chain/Graph Orchestration](/en/docs/eino/core_modules/chain_and_graph_orchestration/chain_graph_introduction)
1717

18-
多个组件混合使用来实现业务逻辑的串联,Eino 提供 Chain/Graph 的编排方式,把业务逻辑串联的复杂度封装在了 Eino 内部,提供易于理解的业务逻辑编排接口,提供统一的横切面治理能力。
18+
Multiple components are combined to implement business logic. Eino provides Chain/Graph orchestration that encapsulates the complexity inside Eino, exposing easy-to-understand interfaces for logic composition and unified cross-cutting governance.
1919

20-
- **Flow 集成工具 (agents)**: [Eino: Flow 集成组件](/zh/docs/eino/core_modules/flow_integration_components)
20+
- **Flow Integration (agents)**: [Eino: Flow Integration Components](/en/docs/eino/core_modules/flow_integration_components)
2121

22-
Eino 把最常用的大模型应用模式封装成简单、易用的工具,让通用场景的大模型应用开发极致简化,目前提供了 `ReAct Agent` `Host Multi Agent`
22+
Eino wraps common LLM application patterns into simple and easy-to-use tools to greatly simplify development for general scenarios. Currently available: `ReAct Agent` and `Host Multi Agent`.

0 commit comments

Comments
 (0)