Skip to content

Commit 9f13789

Browse files
committed
translate
1 parent 927196c commit 9f13789

6 files changed

Lines changed: 16 additions & 28 deletions

File tree

src/content/docs/blades/get-started/quick-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Quick Start
33
---
4-
Blades is a multimodal AI Agent framework based on the Go language, supporting custom models, tools, memory, middleware, etc. It is suitable for multi-turn conversations, chain-of-thought reasoning, and structured output scenarios.
4+
Blades is a multimodal AI Agent framework based on the Go language, supporting custom models, tools, memory, middleware, etc., suitable for multi-turn dialogue, chain-of-thought reasoning, and structured output scenarios.
55

66
## Environment Setup
77
Ensure you have Go 1.24+ installed, then initialize your project and import Blades with the following commands:
@@ -13,7 +13,7 @@ go get github.com/go-kratos/blades
1313
```
1414
**Prerequisites**
1515

16-
Before running, you need to prepare authentication and address configuration on the model side (variable names may differ across providers; the key is to ensure the API Key and Base URL are usable):
16+
Before running, you need to configure environment variables for the model side (different ModelProvider variable names may vary; the key is to ensure the API Key and Base URL are available):
1717
- OPENAI_BASE_URL
1818
- OPENAI_API_KEY
1919
- OPENAI_MODEL
@@ -80,16 +80,16 @@ export OPENAI_API_KEY=your-api-key
8080
## Core Concepts Overview
8181
| **<font style="color:#000000;">Component</font>** | **<font style="color:#000000;">Description</font>** |
8282
| --- | --- |
83-
| **<font style="color:#000000;">Agent</font>** | <font style="color:#000000;">The agent interface, used to integrate and coordinate multiple functional components such as models, tools, and memory</font> |
83+
| **<font style="color:#000000;">Agent</font>** | <font style="color:#000000;">Agent interface for integrating and coordinating various functional agents such as models, tools, and memory</font> |
8484
| **<font style="color:#000000;">Tool</font>** | <font style="color:#000000;">External capability plugins (e.g., calling APIs, querying databases)</font> |
8585
| **<font style="color:#000000;">Memory</font>** | <font style="color:#000000;">Conversation memory management, supporting multi-turn context</font> |
86-
| **<font style="color:#000000;">Middleware</font>** | <font style="color:#000000;">Middleware mechanism for cross-cutting concerns like logging, rate limiting, and authentication</font> |
87-
| **<font style="color:#000000;">ModelProvider</font>** | <font style="color:#000000;">Model adapters (e.g., OpenAI, DeepSeek) with a unified calling interface</font> |
86+
| **<font style="color:#000000;">Middleware</font>** | <font style="color:#000000;">Middleware mechanism for cross-cutting concerns such as logging, rate limiting, and authentication</font> |
87+
| **<font style="color:#000000;">ModelProvider</font>** | <font style="color:#000000;">Model adapter (e.g., OpenAI, DeepSeek), providing a unified calling interface</font> |
8888

8989

9090
## More Examples
9191
:::tip
92-
The project provides a variety of usage examples covering:
92+
The project provides a wealth of usage examples, covering:
9393

9494
+ Multi-tool calling (Function Calling)
9595
+ Streaming responses

src/content/docs/blades/get-started/run.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
title: "Building Generative Agents"
33
---
44

5-
# Building Generative Agents
5+
# Synchronous Invocation
66

77
This section explains how to run an Agent using Blades' synchronous mode: after calling runner.Run(...), it blocks and waits until the model generates a complete response and returns the Message all at once.
88

99
**Applicable Scenarios**
1010
- You want to receive the complete answer in one go (suitable for: API responses, batch processing, single-turn Q&A)
11-
- Streaming output is not required (e.g., terminal streaming, Websocket, SSE, etc.)
11+
- Streaming output is not required (e.g., terminal streaming, WebSocket, SSE, etc.)
1212

13-
### Creating an Agent (Synchronous Call)
13+
### Creating an Agent
1414

1515
In Blades, to create an agent, use the **NewAgent** method, which is used to create a new Agent instance. **Agent** is the core component in the Blades framework, responsible for coordinating resources such as models, tools, prompts, etc., to execute various AI tasks.
1616

17-
An example usage of this method is as follows:
17+
The usage example of this method is as follows:
1818

1919
```go
2020
// Configure OpenAI API key and base URL using environment variables:

src/content/docs/blades/get-started/runstream.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@ title: "Building Streaming Agents"
33
---
44

55
# What is Streaming Invocation
6-
Streaming invocation is an interaction method of "generate while returning": the model continuously pushes responses to the client in chunks while generating content; the client can render or process them in real-time, rather than waiting for the complete result to be returned all at once.
6+
Streaming invocation is an interactive method of "generating while returning": the model continuously pushes responses to the client in chunks as it generates content; the client can render or process them in real-time, rather than waiting for the complete result to be returned all at once.
77

88
**Applicable Scenarios**
99
- Real-time output for chatbots
10-
- Code completion / output while typing
11-
- Real-time translation
12-
- UI requiring low-latency feedback (e.g., answers appearing word by word)
13-
14-
**Characteristics**
15-
- Low perceived latency (faster "first token" time)
16-
- More memory/experience friendly (no need to wait for full response)
10+
- Code completion/output while typing
1711
- More suitable for real-time display or incremental processing
1812

1913
### Streaming Invocation Example
20-
Blades implements streaming invocation through the RunStream method. Its input parameters are largely consistent with the synchronous Run method, but it returns an iterable stream object from which you can continuously receive model output messages within a for range loop.
14+
Blades implements streaming invocation through the RunStream method. Its input parameters are largely the same as the synchronous Run method, but it returns an iterable stream object from which you can continuously receive model output messages within a for range loop.
2115

2216
Example using the **RunStream** method:
2317
```go

src/content/docs/zh-cn/blades/get-started/quick-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ go get github.com/go-kratos/blades
1313
```
1414
**前置条件**
1515

16-
运行前需要准备模型侧的鉴权与地址配置(不同 Provider 变量名可能不同,关键是确保 API Key 与 Base URL 可用):
16+
运行前需要配置模型侧的环境变量(不同 ModelProvider 变量名可能不同,关键是确保 API Key 与 Base URL 可用):
1717
- OPENAI_BASE_URL
1818
- OPENAI_API_KEY
1919
- OPENAI_MODEL

src/content/docs/zh-cn/blades/get-started/run.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
title: "构建生成式智能体"
33
---
44

5-
# 构建生成式智能体
5+
# 同步调用
66

77
本节介绍如何使用 Blades 的同步模式运行一个 Agent:调用 runner.Run(...) 后阻塞等待,直到模型生成完整回复并一次性返回 Message。
88

99
**适用场景**
1010
- 你希望一次拿到完整答案(适合:API 响应、批处理、单轮问答)
1111
- 不需要流式输出(如终端流式打印、Websocket、SSE 等)
1212

13-
### 创建智能体(同步调用)
13+
### 创建智能体
1414

1515
在 Blades 中,想要创建一个智能体,使用 **NewAgent** 方法,该方法用于创建一个新的Agent实例。**Agent** 是 Blades 框架中的核心组件,负责协调模型、工具、提示词等资源来执行各种AI任务。
1616

src/content/docs/zh-cn/blades/get-started/runstream.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ title: "构建流式智能体"
88
**适用场景**
99
- 聊天机器人实时输出
1010
- 代码补全/边打边出
11-
- 实时翻译
12-
- 需要低延迟反馈的 UI(例如逐字出现的回答)
13-
14-
**特点**
15-
- 低延迟感知(更快“看到”首字)
16-
- 更友好的内存/体验(无需等完整响应)
1711
- 更适合做实时展示或增量处理
1812

1913
### 流式调用示例

0 commit comments

Comments
 (0)