@equos/node-sdk 1.0.1 → 1.1.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/README.md +66 -11
- package/dist/types/agent.type.d.ts +2 -0
- package/dist/types/avatar.type.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,29 +13,71 @@ npm install @equos/node-sdk
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
|
+
|
|
17
|
+
### Setup Equos Client
|
|
16
18
|
```ts
|
|
17
19
|
import { Equos } from '@equos/node-sdk';
|
|
18
20
|
|
|
19
|
-
const
|
|
21
|
+
const client = Equos.client(process.env.EQUOS_API_KEY!);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
You don't have an api key ? [Create one here](https://studio.equos.ai)
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
### Create Avatar
|
|
27
|
+
```ts
|
|
28
|
+
import { EquosAvatar, CreateEquosAvatarRequest } from '@equos/node-sdk';
|
|
22
29
|
|
|
23
30
|
|
|
31
|
+
const data: CreateEquosAvatarRequest = {
|
|
32
|
+
identity: "equos-avatar-jeremy",
|
|
33
|
+
name: "Jeremy"
|
|
34
|
+
refImage: "<base64 data url of the reference image>" // 5Mo max.
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
// Create an avatar.
|
|
25
|
-
const
|
|
26
|
-
|
|
38
|
+
const avatar: EquosAvatar = await client.avatars.create(data);
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Create Agent
|
|
43
|
+
|
|
44
|
+
```ts
|
|
27
45
|
console.log(avatar);
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
import {
|
|
48
|
+
EquosAgent,
|
|
49
|
+
CreateEquosAgentRequest,
|
|
50
|
+
AgentProvider,
|
|
51
|
+
OpenaiRealtimeVoices,
|
|
52
|
+
OpenaiRealtimeModels
|
|
53
|
+
} from '@equos/node-sdk';
|
|
54
|
+
|
|
30
55
|
|
|
31
|
-
const
|
|
56
|
+
const data: CreateEquosAgentRequest = {
|
|
57
|
+
instructions: "You are a Korean teacher..."
|
|
58
|
+
provider: AgentProvider.openai,
|
|
59
|
+
config: {
|
|
60
|
+
voice: OpenaiRealtimeVoices.ash,
|
|
61
|
+
model: OpenaiRealtimeModels.gpt_realtime
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const agent: EquosAgent = await client.agents.create(data);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Start a Session
|
|
70
|
+
This will create and start a session. The avatar will join the room as soon as possible.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
const sessionOptions: CreateEquosSessionRequest = {
|
|
32
74
|
name: 'Equos Session',
|
|
33
75
|
agent: {
|
|
34
|
-
|
|
35
|
-
},
|
|
76
|
+
id: "<your agent id>"
|
|
77
|
+
}, // agent accepts either an object with id of existing agent, or CreateEquosAgent object.
|
|
36
78
|
avatar: {
|
|
37
|
-
id: avatar
|
|
38
|
-
},
|
|
79
|
+
id: "<your avatar id>"
|
|
80
|
+
}, // avatar accepts either an object with id of existing avatar, or CreateEquosAvatar object.
|
|
39
81
|
consumerIdentity: {
|
|
40
82
|
identity: 'client-identity',
|
|
41
83
|
name: 'Client Name'
|
|
@@ -46,5 +88,18 @@ const result = await client.sessions.create(sessionOptions);
|
|
|
46
88
|
|
|
47
89
|
console.log(result.session);
|
|
48
90
|
console.log(result.consumerAccessToken);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Stop a Session
|
|
94
|
+
```ts
|
|
95
|
+
const session = await client.sessions.stop("<session id>");
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Reach Us
|
|
99
|
+
- Equos Slack Community: [Join Equos Community Slack](https://join.slack.com/t/equosaicommunity/shared_invite/zt-3d8oy19au-jZpsJB0i~gdL0jbDswdzzQ)
|
|
100
|
+
- Support: [Support Form](https://docs.google.com/forms/d/e/1FAIpQLSdoK7LvORdQf7KOQKvhhlESStJcKc3bDB9HPsEet6LuOmVUfQ/viewform)
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
49
103
|
|
|
50
|
-
|
|
104
|
+
- Official Documentation: [https://docs.equos.ai](https://docs.equos.ai)
|
|
105
|
+
- Equos NodeJS Usage Examples: [https://github.com/EquosAI/equos-examples/tree/main/examples/equos-nextjs-integration](https://github.com/EquosAI/equos-examples/tree/main/examples/equos-nextjs-integration)
|
|
@@ -44,6 +44,7 @@ export interface GeminiAgentConfig {
|
|
|
44
44
|
export interface CreateEquosAgentRequest {
|
|
45
45
|
instructions: string;
|
|
46
46
|
provider: AgentProvider;
|
|
47
|
+
client?: string | null;
|
|
47
48
|
config: OpenaiAgentConfig | GeminiAgentConfig;
|
|
48
49
|
}
|
|
49
50
|
export interface EquosAgent {
|
|
@@ -51,6 +52,7 @@ export interface EquosAgent {
|
|
|
51
52
|
organizationId: string;
|
|
52
53
|
instructions: string;
|
|
53
54
|
provider: AgentProvider;
|
|
55
|
+
client?: string;
|
|
54
56
|
config: OpenaiAgentConfig | GeminiAgentConfig;
|
|
55
57
|
createdAt: Date;
|
|
56
58
|
updatedAt: Date;
|
|
@@ -3,6 +3,7 @@ export interface CreateEquosAvatarRequest {
|
|
|
3
3
|
identity: string;
|
|
4
4
|
name: string;
|
|
5
5
|
refImage: string;
|
|
6
|
+
client?: string | null;
|
|
6
7
|
agentId?: string;
|
|
7
8
|
agent?: CreateEquosAgentRequest;
|
|
8
9
|
}
|
|
@@ -11,6 +12,7 @@ export interface EquosAvatar {
|
|
|
11
12
|
organizationId: string;
|
|
12
13
|
identity: string;
|
|
13
14
|
name: string;
|
|
15
|
+
client?: string;
|
|
14
16
|
thumbnailUrl: string;
|
|
15
17
|
createdAt: Date;
|
|
16
18
|
updatedAt: Date;
|