Skip to content

Commit 9741625

Browse files
feat(eino): update zh and en docs (#1499)
1 parent 4bf31fb commit 9741625

File tree

142 files changed

+17637
-3817
lines changed

Some content is hidden

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

142 files changed

+17637
-3817
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tech-doc-hugo
1414
# IDE files
1515
.idea
1616
.vscode
17+
.trae
1718

1819
# hugo
1920
.hugo_build.lock

_typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ mmaped = "mmaped"
1414
exten = "exten"
1515
invokable = "invokable"
1616
typ = "typ"
17+
Rabit = "Rabit"

content/en/docs/eino/FAQ.md

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
Description: ""
3-
date: "2025-12-11"
3+
date: "2026-01-20"
44
lastmod: ""
55
tags: []
66
title: FAQ
77
weight: 6
88
---
99

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
10+
# Q: cannot use openapi3.TypeObject (untyped string constant "object") as *openapi3.Types value in struct literalcannot use types (variable of type string) as *openapi3.Types value in struct literal
1111

1212
Ensure the `github.com/getkin/kin-openapi` dependency version does not exceed `v0.118.0`. Starting from Eino `v0.6.0`, Eino no longer depends on the `kin-openapi` library.
1313

@@ -59,8 +59,10 @@ toolCallChecker := func(ctx context.Context, sr *schema.StreamReader[*schema.Mes
5959
// finish
6060
break
6161
}
62+
6263
return false, err
6364
}
65+
6466
if len(msg.ToolCalls) > 0 {
6567
return true, nil
6668
}
@@ -69,10 +71,10 @@ toolCallChecker := func(ctx context.Context, sr *schema.StreamReader[*schema.Mes
6971
}
7072
```
7173

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:
74+
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:
7375

7476
> 💡
75-
> Add prompt constraints such as: If a tool is required, output only the tool call; do not output text.
77+
> Add prompt constraints such as: "If a tool is required, output only the tool call; do not output text."
7678
>
7779
> Models vary in how much they adhere to such prompts. Tune and validate for your chosen model.
7880
@@ -82,18 +84,16 @@ Older versions of `sonic` are incompatible with `go1.24`. Upgrade to `v1.13.2` o
8284

8385
# Q: Tool input deserialization failed: `failed to invoke tool call {tool_call_id}: unmarshal input fail`
8486

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 models response exceeds limits.
87+
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.
8688

87-
# Q: How can I implement batch processing nodes in Eino (like Cozes batch nodes)?
89+
# Q: How can I implement batch processing nodes in Eino (like Coze's batch nodes)?
8890

8991
Eino currently does not support batch processing. Two options:
9092

9193
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.
9294
2. Implement a custom batch node and handle batching inside the node.
9395

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.
96+
Code example: [https://github.com/cloudwego/eino-examples/tree/main/compose/batch](https://github.com/cloudwego/eino-examples/tree/main/compose/batch)
9797

9898
# Q: Does Eino support structured model outputs?
9999

@@ -105,19 +105,15 @@ Yes, in two steps:
105105
- Prompt the model explicitly to output structured data.
106106
2. After obtaining a structured message, use `schema.NewMessageJSONParser` to parse the message into your target struct.
107107

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?
108+
# Q: How to access Reasoning Content / "thinking" output from a chat model?
113109

114110
If the model implementation supports Reasoning Content, it is stored in the `ReasoningContent` field of the output `Message`.
115111

116112
# Q: Errors include `context deadline exceeded`, `timeout`, or `context canceled`
117113

118114
Cases:
119115

120-
1. `context.canceled`: While executing a graph or agent, the user code passed a cancelable context and triggered cancellation. Investigate your applications context-cancel logic. This is unrelated to the Eino framework.
116+
1. `context.canceled`: While executing a graph or agent, the user code passed a cancelable context and triggered cancellation. Investigate your application's context-cancel logic. This is unrelated to the Eino framework.
121117
2. `context deadline exceeded`: Two common possibilities:
122118
1. During graph or agent execution, the user code passed a context with a timeout, which was reached.
123119
2. A `ChatModel` or other external resource has its own timeout configured (or its HTTP client does), which was reached.
@@ -126,11 +122,11 @@ Inspect the thrown error for `node path: [node name x]`. If the node name is not
126122

127123
If you suspect 2-a, trace upstream to find where a timeout was set on the context (common sources include FaaS platforms, gateways, etc.).
128124

129-
If you suspect 2-b, check whether the node itself configures a timeout (e.g., Ark ChatModel `Timeout`, or OpenAI ChatModel via an `HttpClient` with `Timeout`). If none are configured but timeouts still occur, it may be the SDKs default timeout. Known defaults: Ark SDK 10 minutes; Deepseek SDK 5 minutes.
125+
If you suspect 2-b, check whether the node itself configures a timeout (e.g., Ark ChatModel `Timeout`, or OpenAI ChatModel via an `HttpClient` with `Timeout`). If none are configured but timeouts still occur, it may be the SDK's default timeout. Known defaults: Ark SDK 10 minutes; Deepseek SDK 5 minutes.
130126

131127
# Q: How to access parent graph `State` within a subgraph?
132128

133-
If the subgraph and parent graph have different `State` types, use `ProcessState[ParentStateType]()` to process the parents state. If they share the same `State` type, make the types distinct (for example, with a type alias: `type NewParentStateType StateType`).
129+
If the subgraph and parent graph have different `State` types, use `ProcessState[ParentStateType]()` to process the parent's state. If they share the same `State` type, make the types distinct (for example, with a type alias: `type NewParentStateType StateType`).
134130

135131
# Q: How does `eino-ext` adapt multimodal input/output for supported models?
136132

@@ -150,4 +146,33 @@ If schema migration is complex, use the helper tooling in the [JSONSchema conver
150146

151147
# Q: Which ChatModels in `eino-ext` support the Responses API form?
152148

153-
By default, ChatModels generated by `eino-ext` do not support the Responses API; they support only the Chat Completions API. A special case is the Ark Chat Model, which implicitly supports the Responses API when you set `Cache.APIType = ResponsesAPI`.
149+
- In `eino-ext`, currently only the ARK Chat Model can create a ResponsesAPI ChatModel via **NewResponsesAPIChatModel**. Other models do not support creating or using ResponsesAPI.
150+
- In `eino-byted-ext`, only bytedgpt supports creating Response API via **NewResponsesAPIChatModel**. Other chatmodels have not implemented Response API Client.
151+
- Version `components/model/gemini/v0.1.16` already supports `thought_signature` passback. Check if your gemini version meets the requirement. If using bytedgemini (code.byted.org/flow/eino-byted-ext/components/model/bytedgemini) chatmodel implementation, check if its dependency `components/model/gemini` is the latest version, or directly upgrade gemini via go get.
152+
- Replace the currently used bytedgpt package with [code.byted.org/flow/eino-byted-ext/components/model/bytedgemini](http://code.byted.org/flow/eino-byted-ext/components/model/bytedgemini) implementation, upgrade to the latest version, and check the example code to confirm how to pass BaseURL.
153+
- If you encounter this error, please confirm whether the base url filled in when generating chat model is the chat completion URL or the ResponseAPI URL. In most cases, it's an incorrect ResponseAPI Base URL being passed.
154+
155+
# Q: How to troubleshoot ChatModel call errors? For example: [NodeRunError] failed to create chat completion: error, status code: 400, status: 400 Bad Request.
156+
157+
This type of error comes from the model API (such as GPT, Ark, Gemini, etc.). The general approach is to check whether the actual HTTP Request to the model API has missing fields, incorrect field values, wrong BaseURL, etc. It's recommended to print the actual HTTP Request via logs and verify/modify the HTTP Request through direct HTTP requests (such as sending Curl from command line or using Postman). After identifying the problem, modify the corresponding Eino code accordingly.
158+
159+
For how to print the actual HTTP Request to the model API via logs, refer to this code example: [https://github.com/cloudwego/eino-examples/tree/main/components/model/httptransport](https://github.com/cloudwego/eino-examples/tree/main/components/model/httptransport)
160+
161+
# Q: The gemini chat model created under eino-ext repository doesn't support passing multimodal via Image URL? How to adapt?
162+
163+
Currently, the gemini Chat model under the Eino-ext repository has added support for passing URL types. Use `go get github.com/cloudwego/eino-ext/components/model/gemini` to update to [components/model/gemini/v0.1.22](https://github.com/cloudwego/eino-ext/releases/tag/components%2Fmodel%2Fgemini%2Fv0.1.22), the latest version, and test whether passing Image URL meets your business requirements.
164+
165+
# Q: Before calling tools (including MCP tools), JSON Unmarshal failure error occurs. How to solve it?
166+
167+
The Argument field in the Tool Call generated by ChatModel is a string. When the Eino framework calls the tool based on this Argument string, it first performs JSON Unmarshal. At this point, if the Argument string is not valid JSON, JSON Unmarshal will fail with an error like: `failed to call mcp tool: failed to marshal request: json: error calling MarshalJSON for type json.RawMessage: unexpected end of JSON input`
168+
169+
The fundamental solution to this problem is to rely on the model to output valid Tool Call Arguments. From an engineering perspective, we can try to fix some common JSON format issues, such as extra prefixes/suffixes, special character escaping issues, missing braces, etc., but cannot guarantee 100% correction. A similar fix implementation can be found in the code example: [https://github.com/cloudwego/eino-examples/tree/main/components/tool/middlewares/jsonfix](https://github.com/cloudwego/eino-examples/tree/main/components/tool/middlewares/jsonfix)
170+
171+
# Q: How to visualize the topology structure of a graph/chain/workflow?
172+
173+
Use the `GraphCompileCallback` mechanism to export the topology structure during `graph.Compile`. A code example for exporting to mermaid diagram: [https://github.com/cloudwego/eino-examples/tree/main/devops/visualize](https://github.com/cloudwego/eino-examples/tree/main/devops/visualize)
174+
175+
## Q: In Eino, when using Flow/React Agent scenarios, how to get the Tool Call Message and the Tool Result of the tool invocation?
176+
177+
- For getting intermediate results in Flow/React Agent scenarios, refer to the document [Eino: ReAct Agent User Manual](/docs/eino/core_modules/flow_integration_components/react_agent_manual)
178+
- Additionally, you can replace Flow/React Agent with ADK's ChatModel Agent. For details, refer to [Eino ADK: Overview](/docs/eino/core_modules/eino_adk/agent_preview)

content/en/docs/eino/_index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Description: Eino is a Golang-based AI application development framework
3-
date: "2025-12-09"
3+
date: "2026-01-20"
44
lastmod: ""
55
linktitle: Eino
66
menu:
@@ -11,4 +11,3 @@ tags: []
1111
title: Eino User Manual
1212
weight: 6
1313
---
14-

0 commit comments

Comments
 (0)