ai-protocol-adapters 1.0.0-alpha.2 → 1.0.0-alpha.20
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 +7 -7
- package/dist/index.d.mts +862 -648
- package/dist/index.d.ts +862 -648
- package/dist/index.js +2086 -821
- package/dist/index.mjs +2083 -821
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ai-protocol-adapters
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/ai-protocol-adapters)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
## 📦 安装
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install
|
|
22
|
+
npm install ai-protocol-adapters
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
yarn add
|
|
26
|
+
yarn add ai-protocol-adapters
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
pnpm add
|
|
30
|
+
pnpm add ai-protocol-adapters
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## 🚀 快速开始
|
|
@@ -35,7 +35,7 @@ pnpm add @ai-protocol/adapters
|
|
|
35
35
|
### 基础使用
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
import { StreamingProtocolAdapter } from '
|
|
38
|
+
import { StreamingProtocolAdapter } from 'ai-protocol-adapters'
|
|
39
39
|
|
|
40
40
|
// 创建适配器实例
|
|
41
41
|
const adapter = new StreamingProtocolAdapter({
|
|
@@ -103,7 +103,7 @@ const { openaiRequest } = adapter.convertAnthropicToOpenAI(glmRequest)
|
|
|
103
103
|
### 自定义日志器
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
|
-
import { setGlobalLogger, StreamingProtocolAdapter } from '
|
|
106
|
+
import { setGlobalLogger, StreamingProtocolAdapter } from 'ai-protocol-adapters'
|
|
107
107
|
|
|
108
108
|
// 使用自定义日志器
|
|
109
109
|
setGlobalLogger({
|