@amux.ai/adapter-qwen 0.1.1 → 0.1.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/README.md +87 -0
- package/package.json +8 -3
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @amux.ai/adapter-qwen
|
|
2
|
+
|
|
3
|
+
> Qwen (Tongyi Qianwen) adapter for Amux
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@amux.ai/adapter-qwen)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Official Qwen (Tongyi Qianwen) adapter for Amux. Qwen API is OpenAI-compatible, so this adapter extends the OpenAI adapter with Qwen-specific configurations.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @amux.ai/llm-bridge @amux.ai/adapter-qwen
|
|
16
|
+
# or
|
|
17
|
+
npm install @amux.ai/llm-bridge @amux.ai/adapter-qwen
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### As Inbound Adapter
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { createBridge } from '@amux.ai/llm-bridge'
|
|
26
|
+
import { qwenAdapter } from '@amux.ai/adapter-qwen'
|
|
27
|
+
import { openaiAdapter } from '@amux.ai/adapter-openai'
|
|
28
|
+
|
|
29
|
+
const bridge = createBridge({
|
|
30
|
+
inbound: qwenAdapter,
|
|
31
|
+
outbound: openaiAdapter,
|
|
32
|
+
config: {
|
|
33
|
+
apiKey: process.env.OPENAI_API_KEY
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### As Outbound Adapter
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { createBridge } from '@amux.ai/llm-bridge'
|
|
42
|
+
import { openaiAdapter } from '@amux.ai/adapter-openai'
|
|
43
|
+
import { qwenAdapter } from '@amux.ai/adapter-qwen'
|
|
44
|
+
|
|
45
|
+
const bridge = createBridge({
|
|
46
|
+
inbound: openaiAdapter,
|
|
47
|
+
outbound: qwenAdapter,
|
|
48
|
+
config: {
|
|
49
|
+
apiKey: process.env.QWEN_API_KEY
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const response = await bridge.chat({
|
|
54
|
+
model: 'gpt-4',
|
|
55
|
+
messages: [{ role: 'user', content: 'Hello!' }]
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Supported Features
|
|
60
|
+
|
|
61
|
+
- ✅ Chat completions
|
|
62
|
+
- ✅ Streaming
|
|
63
|
+
- ✅ Function/Tool calling
|
|
64
|
+
- ✅ Vision (image inputs)
|
|
65
|
+
- ✅ System prompts
|
|
66
|
+
|
|
67
|
+
## Supported Models
|
|
68
|
+
|
|
69
|
+
- `qwen-turbo`
|
|
70
|
+
- `qwen-plus`
|
|
71
|
+
- `qwen-max`
|
|
72
|
+
- `qwen-vl-plus`
|
|
73
|
+
- `qwen-vl-max`
|
|
74
|
+
|
|
75
|
+
## API Compatibility
|
|
76
|
+
|
|
77
|
+
Qwen API is OpenAI-compatible. For detailed API documentation, see [Qwen API Documentation](https://help.aliyun.com/zh/dashscope/).
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT © [isboyjc](https://github.com/isboyjc)
|
|
82
|
+
|
|
83
|
+
## Links
|
|
84
|
+
|
|
85
|
+
- [Documentation](https://github.com/isboyjc/amux#readme)
|
|
86
|
+
- [GitHub Repository](https://github.com/isboyjc/amux)
|
|
87
|
+
- [Issue Tracker](https://github.com/isboyjc/amux/issues)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amux.ai/adapter-qwen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Qwen adapter for Amux",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amux",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"url": "https://github.com/isboyjc/amux.git",
|
|
15
15
|
"directory": "packages/adapter-qwen"
|
|
16
16
|
},
|
|
17
|
+
"homepage": "https://github.com/isboyjc/amux#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/isboyjc/amux/issues"
|
|
20
|
+
},
|
|
17
21
|
"license": "MIT",
|
|
18
22
|
"author": "isboyjc",
|
|
19
23
|
"type": "module",
|
|
@@ -28,10 +32,11 @@
|
|
|
28
32
|
"module": "./dist/index.js",
|
|
29
33
|
"types": "./dist/index.d.ts",
|
|
30
34
|
"files": [
|
|
31
|
-
"dist"
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
32
37
|
],
|
|
33
38
|
"dependencies": {
|
|
34
|
-
"@amux.ai/llm-bridge": "0.
|
|
39
|
+
"@amux.ai/llm-bridge": "0.3.0"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
42
|
"@types/node": "^20.11.5",
|