@live-assistant/gemini 0.1.0 → 0.3.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 +28 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# @live-assistant/gemini
|
|
2
2
|
|
|
3
|
-
The Gemini Live implementation of `AssistantSession`: one WebSocket, its setup
|
|
3
|
+
The Gemini Live implementation of `AssistantSession`: one WebSocket, its setup
|
|
4
|
+
handshake, and the frames in both directions — binary JSON frames, 16 kHz in,
|
|
5
|
+
24 kHz out, generic tool calls and cancellations.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @live-assistant/gemini @live-assistant/core
|
|
9
|
+
```
|
|
4
10
|
|
|
5
11
|
```ts
|
|
12
|
+
import { GeminiLiveSession } from '@live-assistant/gemini';
|
|
13
|
+
|
|
6
14
|
const session = new GeminiLiveSession();
|
|
7
|
-
|
|
15
|
+
// `wsUrl` defaults to the constrained endpoint; the token carries the rest.
|
|
16
|
+
await session.connect({ token, model });
|
|
8
17
|
```
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
Hand it to an `AssistantController` rather than driving it yourself — the
|
|
20
|
+
controller is what turns a socket into a conversation.
|
|
21
|
+
|
|
22
|
+
## The one thing to know
|
|
23
|
+
|
|
24
|
+
**The session's configuration lives in the token, not in `connect`.** Gemini
|
|
25
|
+
fixes the system instruction, the tools and the voice when the token is minted
|
|
26
|
+
and discards a setup frame sent by the client, so a tool the token did not
|
|
27
|
+
declare does not exist — with no error. Mint with
|
|
28
|
+
[`@live-assistant/token-server`](https://www.npmjs.com/package/@live-assistant/token-server)
|
|
29
|
+
and declare your tools there.
|
|
30
|
+
|
|
31
|
+
Tokens are single-use. Reusing one closes the socket during the handshake, which
|
|
32
|
+
surfaces as `closed_before_ready`.
|
|
33
|
+
|
|
34
|
+
See the [overview](https://github.com/Recipely-Team/live-assistant#readme).
|
|
11
35
|
|
|
12
|
-
|
|
36
|
+
A working app that puts this together: [`examples/expo-app`](https://github.com/Recipely-Team/live-assistant/tree/main/examples/expo-app).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-assistant/gemini",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Gemini Live adapter for @live-assistant/core: the socket, its setup handshake and the frames in both directions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Recep Tayyip Ekşi",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@live-assistant/core": "0.
|
|
43
|
+
"@live-assistant/core": "0.3.0"
|
|
44
44
|
}
|
|
45
45
|
}
|