@kivox/client 0.1.0-beta.23 → 0.1.0-beta.24
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 -83
- package/dist/index.d.ts +715 -403
- package/dist/index.js +6 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,91 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# typescript
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Unified client for the Kivox API
|
|
8
|
-
- Conversation and voice session management
|
|
9
|
-
- WebSockets, events, and real-time state
|
|
10
|
-
- Audio recording and playback
|
|
11
|
-
- Strongly typed contracts and types in TypeScript
|
|
12
|
-
- Framework-agnostic (Svelte, React, Angular, Vue, Vanilla, etc.)
|
|
13
|
-
|
|
14
|
-
## Documentation
|
|
15
|
-
|
|
16
|
-
<https://docs.kivox.com.co/packages/kivox-client>
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
3
|
+
To install dependencies:
|
|
19
4
|
|
|
20
5
|
```bash
|
|
21
|
-
|
|
22
|
-
npm install @kivox/client
|
|
23
|
-
|
|
24
|
-
# PNPM
|
|
25
|
-
pnpm add @kivox/client
|
|
26
|
-
|
|
27
|
-
# Yarn
|
|
28
|
-
yarn add @kivox/client
|
|
29
|
-
|
|
30
|
-
# Bun
|
|
31
|
-
bun add @kivox/client
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Basic example
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import { KivoxClient } from '@kivox/client';
|
|
38
|
-
|
|
39
|
-
const kivox = new KivoxClient({
|
|
40
|
-
baseUrl: 'http://localhost:8787',
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// List agents
|
|
44
|
-
const agents = await kivox.agents.list();
|
|
45
|
-
|
|
46
|
-
// Connect to an agent
|
|
47
|
-
const session = await kivox.conversations.connect({
|
|
48
|
-
agentId: '019bb51e-e45f-75e3-b828-94fdf231711e',
|
|
49
|
-
onEvent: (event) => {
|
|
50
|
-
switch (event.type) {
|
|
51
|
-
case 'response.delta.text':
|
|
52
|
-
console.log('Text:', event.chunk);
|
|
53
|
-
break;
|
|
54
|
-
case 'response.delta.audio':
|
|
55
|
-
audioPlayer.enqueue(event.audio);
|
|
56
|
-
break;
|
|
57
|
-
case 'response.complete':
|
|
58
|
-
console.log('Response complete');
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// Send a message
|
|
65
|
-
session.sendText('Hello, how can you help me?');
|
|
6
|
+
bun install
|
|
66
7
|
```
|
|
67
8
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
import { KivoxClient } from '@kivox/client';
|
|
9
|
+
To run:
|
|
72
10
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
headers: {
|
|
76
|
-
Authorization: 'Bearer token',
|
|
77
|
-
},
|
|
78
|
-
});
|
|
11
|
+
```bash
|
|
12
|
+
bun run index.ts
|
|
79
13
|
```
|
|
80
14
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- [alpine-chat-app](https://github.com/ekisa-team/kivox/tree/main/examples/alpine-chat-app)
|
|
84
|
-
|
|
85
|
-
## Contributing
|
|
86
|
-
|
|
87
|
-
[CONTRIBUTING.md](https://github.com/ekisa-team/kivox/blob/main/CONTRIBUTING.md)
|
|
88
|
-
|
|
89
|
-
## License
|
|
90
|
-
|
|
91
|
-
[LICENSE](https://github.com/ekisa-team/kivox/blob/main/LICENSE)
|
|
15
|
+
This project was created using `bun init` in bun v1.3.10. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|