@aigne/aigne-hub 0.4.0 → 0.4.2
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 +44 -0
- package/README.md +47 -18
- package/package.json +18 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.2](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.4.1...aigne-hub-v0.4.2) (2025-08-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/anthropic bumped to 0.10.7
|
|
11
|
+
* @aigne/bedrock bumped to 0.8.11
|
|
12
|
+
* @aigne/core bumped to 1.43.1
|
|
13
|
+
* @aigne/deepseek bumped to 0.7.11
|
|
14
|
+
* @aigne/default-memory bumped to 1.0.11
|
|
15
|
+
* @aigne/gemini bumped to 0.8.11
|
|
16
|
+
* @aigne/ollama bumped to 0.7.11
|
|
17
|
+
* @aigne/open-router bumped to 0.7.11
|
|
18
|
+
* @aigne/openai bumped to 0.10.11
|
|
19
|
+
* @aigne/transport bumped to 0.11.2
|
|
20
|
+
* @aigne/xai bumped to 0.7.11
|
|
21
|
+
* devDependencies
|
|
22
|
+
* @aigne/openai bumped to 0.10.11
|
|
23
|
+
* @aigne/test-utils bumped to 0.5.19
|
|
24
|
+
|
|
25
|
+
## [0.4.1](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.4.0...aigne-hub-v0.4.1) (2025-08-04)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @aigne/anthropic bumped to 0.10.6
|
|
33
|
+
* @aigne/bedrock bumped to 0.8.10
|
|
34
|
+
* @aigne/core bumped to 1.43.0
|
|
35
|
+
* @aigne/deepseek bumped to 0.7.10
|
|
36
|
+
* @aigne/default-memory bumped to 1.0.10
|
|
37
|
+
* @aigne/gemini bumped to 0.8.10
|
|
38
|
+
* @aigne/ollama bumped to 0.7.10
|
|
39
|
+
* @aigne/open-router bumped to 0.7.10
|
|
40
|
+
* @aigne/openai bumped to 0.10.10
|
|
41
|
+
* @aigne/transport bumped to 0.11.1
|
|
42
|
+
* @aigne/xai bumped to 0.7.10
|
|
43
|
+
* devDependencies
|
|
44
|
+
* @aigne/openai bumped to 0.10.10
|
|
45
|
+
* @aigne/test-utils bumped to 0.5.18
|
|
46
|
+
|
|
3
47
|
## [0.4.0](https://github.com/AIGNE-io/aigne-framework/compare/aigne-hub-v0.3.2...aigne-hub-v0.4.0) (2025-08-01)
|
|
4
48
|
|
|
5
49
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @aigne/aigne-hub
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<picture>
|
|
5
|
+
<source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo-dark.svg" media="(prefers-color-scheme: dark)">
|
|
6
|
+
<source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" media="(prefers-color-scheme: light)">
|
|
7
|
+
<img src="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/logo.svg" alt="AIGNE Logo" width="400" />
|
|
8
|
+
</picture>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
3
11
|
[](https://star-history.com/#AIGNE-io/aigne-framework)
|
|
4
12
|
[](https://github.com/AIGNE-io/aigne-framework/issues)
|
|
5
13
|
[](https://codecov.io/gh/AIGNE-io/aigne-framework)
|
|
@@ -19,41 +27,58 @@ It enables you to switch providers without changing your client-side logic.
|
|
|
19
27
|
The AIGNE Hub backend supports the following AI providers via a single, unified API:
|
|
20
28
|
|
|
21
29
|
```ts
|
|
22
|
-
type AIProvider =
|
|
30
|
+
type AIProvider =
|
|
31
|
+
| "openai"
|
|
32
|
+
| "anthropic"
|
|
33
|
+
| "bedrock"
|
|
34
|
+
| "deepseek"
|
|
35
|
+
| "google"
|
|
36
|
+
| "ollama"
|
|
37
|
+
| "openRouter"
|
|
38
|
+
| "xai";
|
|
23
39
|
```
|
|
40
|
+
|
|
24
41
|
## Example models:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
|
|
43
|
+
* openai/gpt-4o-mini
|
|
44
|
+
* anthropic/claude-3-sonnet
|
|
45
|
+
* bedrock/us.amazon.titan-text-lite-v1
|
|
46
|
+
* google/gemini-pro
|
|
47
|
+
* xai/grok-1
|
|
48
|
+
* openRouter/mistralai/mistral-7b-instruct
|
|
49
|
+
* ollama/llama3
|
|
32
50
|
|
|
33
51
|
## Features
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
|
|
53
|
+
* 🔌 Unified LLM Access: Route all requests through one endpoint
|
|
54
|
+
* 🧠 Multi-provider Support: Choose from any supported vendor via the model name
|
|
55
|
+
* 🔐 API Key Security: Use accessKey to manage authentication and authorization
|
|
56
|
+
* 💬 Chat Completions: Works with standard messages format ({ role, content })
|
|
57
|
+
* 🌊 Streaming Support: Enable streaming: true for real-time token-level responses
|
|
58
|
+
* 🧱 Framework Compatible: Seamless integration with the AIGNE Framework
|
|
40
59
|
|
|
41
60
|
## Installation
|
|
61
|
+
|
|
42
62
|
### Using npm
|
|
43
63
|
|
|
44
64
|
```
|
|
45
65
|
npm install @aigne/aigne-hub @aigne/core
|
|
46
66
|
```
|
|
67
|
+
|
|
47
68
|
### Using yarn
|
|
69
|
+
|
|
48
70
|
```
|
|
49
71
|
yarn add @aigne/aigne-hub @aigne/core
|
|
50
72
|
```
|
|
73
|
+
|
|
51
74
|
### Using pnpm
|
|
75
|
+
|
|
52
76
|
```
|
|
53
77
|
pnpm add @aigne/aigne-hub @aigne/core
|
|
54
78
|
```
|
|
55
79
|
|
|
56
80
|
## Basic Usage
|
|
81
|
+
|
|
57
82
|
```typescript
|
|
58
83
|
import { AIGNEHubChatModel } from "@aigne/aigne-hub";
|
|
59
84
|
|
|
@@ -79,7 +104,9 @@ console.log(result);
|
|
|
79
104
|
}
|
|
80
105
|
*/
|
|
81
106
|
```
|
|
107
|
+
|
|
82
108
|
## Streaming Usage
|
|
109
|
+
|
|
83
110
|
```typescript
|
|
84
111
|
import { AIGNEHubChatModel } from "@aigne/aigne-hub";
|
|
85
112
|
|
|
@@ -110,13 +137,15 @@ for await (const chunk of stream) {
|
|
|
110
137
|
console.log(fullText); // Output: "Hello! How can I assist you today?"
|
|
111
138
|
console.log(json); // { model: "gpt-4o", usage: { inputTokens: 10, outputTokens: 9 } }
|
|
112
139
|
```
|
|
140
|
+
|
|
113
141
|
## Configuration Options
|
|
142
|
+
|
|
114
143
|
```typescript
|
|
115
144
|
interface ClientChatModelOptions {
|
|
116
|
-
url: string;
|
|
117
|
-
accessKey: string;
|
|
118
|
-
model: string;
|
|
119
|
-
modelOptions?: object;
|
|
145
|
+
url: string; // Your AIGNE Hub endpoint
|
|
146
|
+
accessKey: string; // API access key
|
|
147
|
+
model: string; // Model name with provider prefix (e.g. openai/gpt-4o-mini)
|
|
148
|
+
modelOptions?: object; // Optional model-specific parameters
|
|
120
149
|
}
|
|
121
150
|
```
|
|
122
151
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/aigne-hub",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "AIGNE Hub SDK for integrating with Hub AI models",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://www.aigne.io/framework",
|
|
10
10
|
"license": "Elastic-2.0",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/AIGNE-io/aigne-framework"
|
|
14
14
|
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/AIGNE-io/aigne-framework/issues"
|
|
17
|
+
},
|
|
15
18
|
"files": [
|
|
16
19
|
"lib/cjs",
|
|
17
20
|
"lib/dts",
|
|
@@ -42,18 +45,18 @@
|
|
|
42
45
|
"openai": "^5.8.3",
|
|
43
46
|
"ufo": "^1.6.1",
|
|
44
47
|
"zod": "^3.25.67",
|
|
45
|
-
"@aigne/anthropic": "^0.10.
|
|
46
|
-
"@aigne/bedrock": "^0.8.
|
|
47
|
-
"@aigne/core": "^1.
|
|
48
|
-
"@aigne/
|
|
49
|
-
"@aigne/
|
|
50
|
-
"@aigne/ollama": "^0.7.
|
|
51
|
-
"@aigne/
|
|
52
|
-
"@aigne/openai": "^0.10.
|
|
48
|
+
"@aigne/anthropic": "^0.10.7",
|
|
49
|
+
"@aigne/bedrock": "^0.8.11",
|
|
50
|
+
"@aigne/core": "^1.43.1",
|
|
51
|
+
"@aigne/default-memory": "^1.0.11",
|
|
52
|
+
"@aigne/deepseek": "^0.7.11",
|
|
53
|
+
"@aigne/ollama": "^0.7.11",
|
|
54
|
+
"@aigne/gemini": "^0.8.11",
|
|
55
|
+
"@aigne/openai": "^0.10.11",
|
|
56
|
+
"@aigne/open-router": "^0.7.11",
|
|
53
57
|
"@aigne/platform-helpers": "^0.5.0",
|
|
54
|
-
"@aigne/
|
|
55
|
-
"@aigne/
|
|
56
|
-
"@aigne/xai": "^0.7.9"
|
|
58
|
+
"@aigne/transport": "^0.11.2",
|
|
59
|
+
"@aigne/xai": "^0.7.11"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
62
|
"@types/bun": "^1.2.18",
|
|
@@ -62,8 +65,8 @@
|
|
|
62
65
|
"npm-run-all": "^4.1.5",
|
|
63
66
|
"rimraf": "^6.0.1",
|
|
64
67
|
"typescript": "^5.8.3",
|
|
65
|
-
"@aigne/test-utils": "^0.5.
|
|
66
|
-
"@aigne/openai": "^0.10.
|
|
68
|
+
"@aigne/test-utils": "^0.5.19",
|
|
69
|
+
"@aigne/openai": "^0.10.11"
|
|
67
70
|
},
|
|
68
71
|
"scripts": {
|
|
69
72
|
"lint": "tsc --noEmit",
|