@aigne/transport 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +11 -8
- package/README.zh.md +11 -8
- package/lib/cjs/http-client/client.d.ts +1 -1
- package/lib/dts/http-client/client.d.ts +1 -1
- package/lib/esm/http-client/client.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.6.4...transport-v0.7.0) (2025-07-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **example:** use AIGNE cli to run chat-bot example ([#198](https://github.com/AIGNE-io/aigne-framework/issues/198)) ([7085541](https://github.com/AIGNE-io/aigne-framework/commit/708554100692f2a557f7329ea78e46c3c870ce10))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/openai bumped to 0.6.0
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @aigne/agent-library bumped to 1.17.5
|
|
18
|
+
* @aigne/core bumped to 1.28.0
|
|
19
|
+
* @aigne/test-utils bumped to 0.4.12
|
|
20
|
+
|
|
21
|
+
## [0.6.4](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.6.3...transport-v0.6.4) (2025-07-01)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Dependencies
|
|
25
|
+
|
|
26
|
+
* The following workspace dependencies were updated
|
|
27
|
+
* dependencies
|
|
28
|
+
* @aigne/openai bumped to 0.5.0
|
|
29
|
+
* devDependencies
|
|
30
|
+
* @aigne/agent-library bumped to 1.17.4
|
|
31
|
+
* @aigne/core bumped to 1.27.0
|
|
32
|
+
* @aigne/test-utils bumped to 0.4.11
|
|
33
|
+
|
|
3
34
|
## [0.6.3](https://github.com/AIGNE-io/aigne-framework/compare/transport-v0.6.2...transport-v0.6.3) (2025-06-30)
|
|
4
35
|
|
|
5
36
|
|
package/README.md
CHANGED
|
@@ -82,9 +82,9 @@ const httpServer = server.listen(port);
|
|
|
82
82
|
const client = new AIGNEHTTPClient({ url });
|
|
83
83
|
|
|
84
84
|
// Invoke the agent by client
|
|
85
|
-
const response = await client.invoke("chat", {
|
|
85
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
86
86
|
|
|
87
|
-
console.log(response); // Output: {
|
|
87
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
#### Hono Example
|
|
@@ -120,8 +120,8 @@ const server = serve({ port, fetch: honoApp.fetch });
|
|
|
120
120
|
const client = new AIGNEHTTPClient({ url });
|
|
121
121
|
|
|
122
122
|
// Invoke the agent by client
|
|
123
|
-
const response = await client.invoke("chat", {
|
|
124
|
-
console.log(response); // Output: {
|
|
123
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
124
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### HTTP Client
|
|
@@ -131,27 +131,30 @@ import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
|
|
|
131
131
|
|
|
132
132
|
const client = new AIGNEHTTPClient({ url });
|
|
133
133
|
|
|
134
|
-
const response = await client.invoke("chat", {
|
|
134
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
135
135
|
|
|
136
|
-
console.log(response); // Output: {
|
|
136
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
### Streaming Responses
|
|
140
140
|
|
|
141
141
|
```typescript file="test/http-client/http-client.test.ts" region="example-aigne-client-streaming"
|
|
142
|
+
import { isAgentResponseDelta } from "@aigne/core";
|
|
142
143
|
import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
|
|
143
144
|
|
|
144
145
|
const client = new AIGNEHTTPClient({ url });
|
|
145
146
|
|
|
146
147
|
const stream = await client.invoke(
|
|
147
148
|
"chat",
|
|
148
|
-
{
|
|
149
|
+
{ message: "hello" },
|
|
149
150
|
{ streaming: true },
|
|
150
151
|
);
|
|
151
152
|
|
|
152
153
|
let text = "";
|
|
153
154
|
for await (const chunk of stream) {
|
|
154
|
-
if (chunk
|
|
155
|
+
if (isAgentResponseDelta(chunk)) {
|
|
156
|
+
if (chunk.delta.text?.message) text += chunk.delta.text.message;
|
|
157
|
+
}
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
console.log(text); // Output: "Hello world!"
|
package/README.zh.md
CHANGED
|
@@ -82,9 +82,9 @@ const httpServer = server.listen(port);
|
|
|
82
82
|
const client = new AIGNEHTTPClient({ url });
|
|
83
83
|
|
|
84
84
|
// Invoke the agent by client
|
|
85
|
-
const response = await client.invoke("chat", {
|
|
85
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
86
86
|
|
|
87
|
-
console.log(response); // Output: {
|
|
87
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
#### Hono 示例
|
|
@@ -120,8 +120,8 @@ const server = serve({ port, fetch: honoApp.fetch });
|
|
|
120
120
|
const client = new AIGNEHTTPClient({ url });
|
|
121
121
|
|
|
122
122
|
// Invoke the agent by client
|
|
123
|
-
const response = await client.invoke("chat", {
|
|
124
|
-
console.log(response); // Output: {
|
|
123
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
124
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### HTTP 客户端
|
|
@@ -131,27 +131,30 @@ import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
|
|
|
131
131
|
|
|
132
132
|
const client = new AIGNEHTTPClient({ url });
|
|
133
133
|
|
|
134
|
-
const response = await client.invoke("chat", {
|
|
134
|
+
const response = await client.invoke("chat", { message: "hello" });
|
|
135
135
|
|
|
136
|
-
console.log(response); // Output: {
|
|
136
|
+
console.log(response); // Output: {message: "Hello world!"}
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
### 流式响应
|
|
140
140
|
|
|
141
141
|
```typescript file="test/http-client/http-client.test.ts" region="example-aigne-client-streaming"
|
|
142
|
+
import { isAgentResponseDelta } from "@aigne/core";
|
|
142
143
|
import { AIGNEHTTPClient } from "@aigne/transport/http-client/index.js";
|
|
143
144
|
|
|
144
145
|
const client = new AIGNEHTTPClient({ url });
|
|
145
146
|
|
|
146
147
|
const stream = await client.invoke(
|
|
147
148
|
"chat",
|
|
148
|
-
{
|
|
149
|
+
{ message: "hello" },
|
|
149
150
|
{ streaming: true },
|
|
150
151
|
);
|
|
151
152
|
|
|
152
153
|
let text = "";
|
|
153
154
|
for await (const chunk of stream) {
|
|
154
|
-
if (chunk
|
|
155
|
+
if (isAgentResponseDelta(chunk)) {
|
|
156
|
+
if (chunk.delta.text?.message) text += chunk.delta.text.message;
|
|
157
|
+
}
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
console.log(text); // Output: "Hello world!"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Agent, type AgentResponse, type AgentResponseStream, type Context, type ContextEmitEventMap, type ContextEventMap, type ContextUsage, type InvokeOptions, type Message, type MessagePayload, type MessageQueueListener, type Unsubscribe, type UserAgent, type UserContext } from "@aigne/core";
|
|
2
|
-
import type { Args, Listener } from "@aigne/core/utils/typed-event-
|
|
2
|
+
import type { Args, Listener } from "@aigne/core/utils/typed-event-emitter.js";
|
|
3
3
|
import { ClientAgent, type ClientAgentOptions } from "./client-agent.js";
|
|
4
4
|
import { ClientChatModel } from "./client-chat-model.js";
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Agent, type AgentResponse, type AgentResponseStream, type Context, type ContextEmitEventMap, type ContextEventMap, type ContextUsage, type InvokeOptions, type Message, type MessagePayload, type MessageQueueListener, type Unsubscribe, type UserAgent, type UserContext } from "@aigne/core";
|
|
2
|
-
import type { Args, Listener } from "@aigne/core/utils/typed-event-
|
|
2
|
+
import type { Args, Listener } from "@aigne/core/utils/typed-event-emitter.js";
|
|
3
3
|
import { ClientAgent, type ClientAgentOptions } from "./client-agent.js";
|
|
4
4
|
import { ClientChatModel } from "./client-chat-model.js";
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Agent, type AgentResponse, type AgentResponseStream, type Context, type ContextEmitEventMap, type ContextEventMap, type ContextUsage, type InvokeOptions, type Message, type MessagePayload, type MessageQueueListener, type Unsubscribe, type UserAgent, type UserContext } from "@aigne/core";
|
|
2
|
-
import type { Args, Listener } from "@aigne/core/utils/typed-event-
|
|
2
|
+
import type { Args, Listener } from "@aigne/core/utils/typed-event-emitter.js";
|
|
3
3
|
import { ClientAgent, type ClientAgentOptions } from "./client-agent.js";
|
|
4
4
|
import { ClientChatModel } from "./client-chat-model.js";
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/transport",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "AIGNE Transport SDK providing HTTP client and server implementations for communication between AIGNE components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@aigne/openai": "^0.
|
|
42
|
+
"@aigne/openai": "^0.6.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "^1.2.12",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"rimraf": "^6.0.1",
|
|
55
55
|
"typescript": "^5.8.3",
|
|
56
56
|
"uuid": "^11.1.0",
|
|
57
|
-
"@aigne/agent-library": "^1.17.
|
|
58
|
-
"@aigne/
|
|
59
|
-
"@aigne/
|
|
57
|
+
"@aigne/agent-library": "^1.17.5",
|
|
58
|
+
"@aigne/core": "^1.28.0",
|
|
59
|
+
"@aigne/test-utils": "^0.4.12"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"lint": "tsc --noEmit",
|