You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/blades/get-started/quick-started.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Quick Start
3
3
---
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.
5
5
6
6
## Environment Setup
7
7
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
13
13
```
14
14
**Prerequisites**
15
15
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):
|**<fontstyle="color:#000000;">Agent</font>**| <fontstyle="color:#000000;">The agent interface, used to integrate and coordinate multiple functional components such as models, tools, and memory</font> |
83
+
|**<fontstyle="color:#000000;">Agent</font>**| <fontstyle="color:#000000;">Agent interface for integrating and coordinating various functional agents such as models, tools, and memory</font> |
|**<fontstyle="color:#000000;">Middleware</font>**| <fontstyle="color:#000000;">Middleware mechanism for cross-cutting concerns like logging, rate limiting, and authentication</font> |
87
-
|**<fontstyle="color:#000000;">ModelProvider</font>**| <fontstyle="color:#000000;">Model adapters (e.g., OpenAI, DeepSeek) with a unified calling interface</font> |
86
+
|**<fontstyle="color:#000000;">Middleware</font>**| <fontstyle="color:#000000;">Middleware mechanism for cross-cutting concerns such as logging, rate limiting, and authentication</font> |
Copy file name to clipboardExpand all lines: src/content/docs/blades/get-started/run.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,19 @@
2
2
title: "Building Generative Agents"
3
3
---
4
4
5
-
# Building Generative Agents
5
+
# Synchronous Invocation
6
6
7
7
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.
8
8
9
9
**Applicable Scenarios**
10
10
- 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.)
12
12
13
-
### Creating an Agent (Synchronous Call)
13
+
### Creating an Agent
14
14
15
15
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.
16
16
17
-
An example usage of this method is as follows:
17
+
The usage example of this method is as follows:
18
18
19
19
```go
20
20
// Configure OpenAI API key and base URL using environment variables:
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.
7
7
8
8
**Applicable Scenarios**
9
9
- 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)
- More memory/experience friendly (no need to wait for full response)
10
+
- Code completion/output while typing
17
11
- More suitable for real-time display or incremental processing
18
12
19
13
### 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.
0 commit comments