@llumiverse/core 0.23.0 → 0.24.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 +141 -218
- package/lib/cjs/CompletionStream.js +65 -0
- package/lib/cjs/CompletionStream.js.map +1 -1
- package/lib/cjs/Driver.js +14 -0
- package/lib/cjs/Driver.js.map +1 -1
- package/lib/cjs/conversation-utils.js +457 -0
- package/lib/cjs/conversation-utils.js.map +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/stream.js.map +1 -1
- package/lib/esm/CompletionStream.js +65 -0
- package/lib/esm/CompletionStream.js.map +1 -1
- package/lib/esm/Driver.js +14 -0
- package/lib/esm/Driver.js.map +1 -1
- package/lib/esm/conversation-utils.js +447 -0
- package/lib/esm/conversation-utils.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/stream.js.map +1 -1
- package/lib/types/CompletionStream.d.ts.map +1 -1
- package/lib/types/Driver.d.ts +11 -0
- package/lib/types/Driver.d.ts.map +1 -1
- package/lib/types/conversation-utils.d.ts +112 -0
- package/lib/types/conversation-utils.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/stream.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/CompletionStream.ts +70 -1
- package/src/Driver.ts +20 -0
- package/src/conversation-utils.ts +497 -0
- package/src/index.ts +1 -0
- package/src/stream.ts +1 -0
package/README.md
CHANGED
|
@@ -1,300 +1,223 @@
|
|
|
1
|
-
# Llumiverse - Universal LLM
|
|
1
|
+
# Llumiverse - The Universal, Lightweight LLM Driver
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
[](https://badge.fury.io/js/%40llumiverse%2Fcore)
|
|
5
5
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Llumiverse** is the unified connectivity layer for the Large Language Model ecosystem. It provides a robust, modular, and strongly-typed interface for interacting with almost any AI provider in Node.js, Bun, and TypeScript environments.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> **Think of it as the "JDBC" or "ODBC" for LLMs.**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
It solely focuses on **abstracting the connection and execution protocol**, letting you switch providers with zero code changes. It does **not** enforce prompt templating, rigid chain structures, or "magic" orchestration logic. You build the application; we handle the plumbing.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
| --- | :-: | :-: | :-: | :-: | :-: |
|
|
15
|
-
| AWS Bedrock | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
16
|
-
| Azure OpenAI | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
17
|
-
| Google Vertex AI | ✅ | ✅ | ✅ | ✅ | By Request |
|
|
18
|
-
| Groq | ✅ | ✅ | ✅ | N/A | N/A |
|
|
19
|
-
| HuggingFace Inference Endpoints | ✅ | ✅ | N/A | N/A | N/A |
|
|
20
|
-
| IBM WatsonX | ✅ | ✅ | ✅ | N/A | By Request |
|
|
21
|
-
| Mistral AI | ✅ | ✅ | ✅ | N/A | By Request |
|
|
22
|
-
| OpenAI | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
23
|
-
| Replicate | ✅ | ✅ | ✅ | N/A | ✅ |
|
|
24
|
-
| Together AI| ✅ | ✅ | ✅ | N/A | By Request |
|
|
13
|
+
### Why Llumiverse?
|
|
25
14
|
|
|
26
|
-
|
|
15
|
+
* **🚫 No Vendor Lock-in:** Switch from OpenAI to Vertex AI to Bedrock in minutes.
|
|
16
|
+
* **🧩 Modular & Lightweight:** Install only what you need. Zero bloat.
|
|
17
|
+
* **🛡️ Type-Safe:** First-class TypeScript support with normalized interfaces for completion, streaming, and tool use.
|
|
18
|
+
* **⚡ Universal Support:** Works in Node.js, serverless functions, and Bun.
|
|
27
19
|
|
|
20
|
+
---
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* node v22+, or bun 1.0+
|
|
22
|
+
### Supported Platforms
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
| Provider | Completion | Chat | Streaming | Multimodal | Tool Calling | Embeddings |
|
|
25
|
+
| :--- | :-: | :-: | :-: | :-: | :-: | :-: |
|
|
26
|
+
| **AWS Bedrock** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
27
|
+
| **Azure Foundry** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
28
|
+
| **Azure OpenAI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
29
|
+
| **Google Vertex AI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
30
|
+
| **Groq** | ✅ | ✅ | ✅ | N/A | ✅ | N/A |
|
|
31
|
+
| **HuggingFace** | ✅ | ✅ | ✅ | N/A | N/A | N/A |
|
|
32
|
+
| **IBM WatsonX** | ✅ | ✅ | ✅ | N/A | N/A | ✅ |
|
|
33
|
+
| **Mistral AI** | ✅ | ✅ | ✅ | N/A | ✅ | ✅ |
|
|
34
|
+
| **OpenAI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
35
|
+
| **OpenAI Compatible** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
36
|
+
| **Replicate** | ✅ | ✅ | ✅ | N/A | N/A | N/A |
|
|
37
|
+
| **Together AI** | ✅ | ✅ | ✅ | N/A | N/A | N/A |
|
|
38
|
+
| **xAI (Grok)** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
---
|
|
36
41
|
|
|
37
|
-
|
|
38
|
-
npm install @llumiverse/core @llumiverse/drivers
|
|
39
|
-
```
|
|
42
|
+
### Llumiverse vs. The Rest
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
**Vs. LangChain / LlamaIndex:**
|
|
45
|
+
These are **application frameworks** that provide high-level abstractions for chains, memory, and RAG. Llumiverse is a **driver** library. It operates at a lower level.
|
|
46
|
+
* *Use Llumiverse if:* You want full control over your prompt logic, you want to build your own custom framework, or you simply need a clean, unified way to call an API without the weight of a massive dependency tree.
|
|
47
|
+
* *Use LangChain if:* You want pre-built "chains" and are okay with higher complexity and abstraction overhead.
|
|
42
48
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
3. If you want to develop a new llumiverse driver for an unsupported LLM provider you only need to install `@llumiverse/core`
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
npm install @llumiverse/core
|
|
51
|
-
```
|
|
49
|
+
**Vs. Vercel AI SDK:**
|
|
50
|
+
Vercel's SDK is fantastic for frontend/full-stack React/Next.js applications.
|
|
51
|
+
* *Use Llumiverse if:* You are building backend services, background workers, CLI tools, or generic Node.js applications where frontend-specific hooks aren't relevant. Llumiverse is environment-agnostic.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
---
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## Requirements
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
* Node.js 22+
|
|
58
|
+
* Bun 1.0+ (experimental support)
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
import { OpenAIDriver } from "@llumiverse/drivers";
|
|
60
|
+
## Installation
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
62
|
+
**For most use cases (recommended):**
|
|
63
|
+
```bash
|
|
64
|
+
npm install @llumiverse/core @llumiverse/drivers
|
|
66
65
|
```
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
In this example, we will instantiate the Bedrock driver using credentials from the Shared Credentials File (i.e. ~/.aws/credentials).
|
|
71
|
-
Learn more on how to [setup AWS credentials in node](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html).
|
|
67
|
+
* `@llumiverse/core`: The interfaces, types, and base abstractions.
|
|
68
|
+
* `@llumiverse/drivers`: The concrete implementations for all supported providers.
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
import { BedrockDriver } from "@llumiverse/drivers";
|
|
70
|
+
## Quick Start
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
region: 'us-west-2'
|
|
78
|
-
});
|
|
79
|
-
```
|
|
72
|
+
### 1. Initialize a Driver
|
|
80
73
|
|
|
81
|
-
|
|
74
|
+
Each driver takes normalized options but may require specific credentials (API keys, regions, project IDs).
|
|
82
75
|
|
|
83
|
-
|
|
76
|
+
```typescript
|
|
77
|
+
// OpenAI
|
|
78
|
+
import { OpenAIDriver } from "@llumiverse/drivers";
|
|
79
|
+
const driver = new OpenAIDriver({ apiKey: process.env.OPENAI_API_KEY });
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
// Google Vertex AI
|
|
86
82
|
import { VertexAIDriver } from "@llumiverse/drivers";
|
|
87
83
|
const driver = new VertexAIDriver({
|
|
88
|
-
project:
|
|
84
|
+
project: process.env.GOOGLE_PROJECT_ID,
|
|
89
85
|
region: 'us-central1'
|
|
90
86
|
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Replicate driver
|
|
94
|
-
|
|
95
|
-
```javascript
|
|
96
|
-
import { ReplicateDriver } from "@llumiverse/drivers";
|
|
97
|
-
|
|
98
|
-
const driver = new ReplicateDriver({
|
|
99
|
-
apiKey: "YOUR_REPLICATE_API_KEY"
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### TogetherAI driver
|
|
104
|
-
|
|
105
|
-
```javascript
|
|
106
|
-
import { TogetherAIDriver } from "@llumiverse/drivers";
|
|
107
|
-
|
|
108
|
-
const driver = new TogetherAIDriver({
|
|
109
|
-
apiKey: "YOUR_TOGETHER_AI_API_KEY"
|
|
110
|
-
});
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### HuggingFace driver
|
|
114
|
-
|
|
115
|
-
```javascript
|
|
116
|
-
import { HuggingFaceIEDriver } from "@llumiverse/drivers";
|
|
117
|
-
|
|
118
|
-
const driver = new HuggingFaceIEDriver({
|
|
119
|
-
apiKey: "YOUR_HUGGINGFACE_API_KEY",
|
|
120
|
-
endpoint_url: "YOUR_HUGGINGFACE_ENDPOINT",
|
|
121
|
-
});
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Listing available models
|
|
125
|
-
|
|
126
|
-
Once you instantiated a driver you can list the available models. Some drivers accept an argument for the `listModel` method to search for matching models. Some drivers like for example `replicate` are listing a preselected set of models. To list other models you need to perform a search by giving a text query as an argument.
|
|
127
|
-
|
|
128
|
-
In the following example, we are assuming that we have already instantiated a driver, which is available as the `driver` variable.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
```javascript
|
|
132
|
-
import { AIModel } from "@llumiverse/core";
|
|
133
|
-
|
|
134
|
-
// instantiate the desired driver
|
|
135
|
-
const driver = createDriverInstance();
|
|
136
87
|
|
|
137
|
-
//
|
|
138
|
-
|
|
88
|
+
// AWS Bedrock (uses local AWS credentials automatically)
|
|
89
|
+
import { BedrockDriver } from "@llumiverse/drivers";
|
|
90
|
+
const driver = new BedrockDriver({ region: 'us-west-2' });
|
|
139
91
|
|
|
140
|
-
|
|
141
|
-
for (const model of models) {
|
|
142
|
-
console.log(`${model.name} [${model.id}]`);
|
|
143
|
-
}
|
|
92
|
+
// ... and many more!
|
|
144
93
|
```
|
|
145
94
|
|
|
146
|
-
### Execute a
|
|
147
|
-
|
|
148
|
-
To execute a prompt we need to create a prompt in the LLumiverse format and pass it to the driver `execute` method.
|
|
149
|
-
|
|
150
|
-
The prompt format is very similar to the OpenAI prompt format. It is an array of messages with a `content` and a `role` property. The roles can be any of `"user" | "system" | "assistant" | "safety"`.
|
|
151
|
-
|
|
152
|
-
The `safety` role is similar to `system` but has a greater precedence over the other messages. Thus, it will override any `user` or `system` message that is saying something contrary to the `safety` message.
|
|
153
|
-
|
|
154
|
-
In order to execute a prompt we also need to specify a target model, given a model ID which is known by the target LLM. We may also specify execution options like `temperature`, `max_tokens` etc.
|
|
155
|
-
|
|
156
|
-
In the following example, we are again assuming that we have already instantiated a driver, which is available as the `driver` variable.
|
|
157
|
-
|
|
158
|
-
Also, we are assuming the model ID we want to target is available as the `model` variable. To get a list of the existing models (and their IDs) you can list the model as we shown in the previous example
|
|
159
|
-
|
|
160
|
-
Here is an example of model IDs depending on the driver type:
|
|
161
|
-
* OpenAI: `gpt-3.5-turbo`
|
|
162
|
-
* Bedrock: `arn:aws:bedrock:us-west-2::foundation-model/cohere.command-text-v14`
|
|
163
|
-
* VertexAI: `text-bison`
|
|
164
|
-
* Replicate: `meta/llama-2-70b-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3`
|
|
165
|
-
* TogetherAI: `mistralai/Mistral-7B-instruct-v0.1`
|
|
166
|
-
* HuggingFace: `aws-mistral-7b-instruct-v0-1-015`
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
```javascript
|
|
170
|
-
import { PromptRole, PromptSegment } from "@llumiverse/core";
|
|
95
|
+
### 2. Execute a Prompt (Standard)
|
|
171
96
|
|
|
97
|
+
The execution API is normalized. You send a `PromptSegment[]` and get a `Completion` object, regardless of the provider.
|
|
172
98
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const model = "the-model-id"; // change with your desired model ID
|
|
99
|
+
```typescript
|
|
100
|
+
import { PromptRole } from "@llumiverse/core";
|
|
176
101
|
|
|
177
|
-
//
|
|
178
|
-
const prompt
|
|
102
|
+
// 1. Create a generic prompt
|
|
103
|
+
const prompt = [
|
|
104
|
+
{
|
|
105
|
+
role: PromptRole.system,
|
|
106
|
+
content: "You are a helpful coding assistant."
|
|
107
|
+
},
|
|
179
108
|
{
|
|
180
109
|
role: PromptRole.user,
|
|
181
|
-
content:
|
|
110
|
+
content: "Write a hello world in Python."
|
|
182
111
|
}
|
|
183
|
-
]
|
|
112
|
+
];
|
|
184
113
|
|
|
185
|
-
//
|
|
186
|
-
console.log(`\n# Executing prompt on ${model} model: ${prompt}`);
|
|
114
|
+
// 2. Execute against ANY driver
|
|
187
115
|
const response = await driver.execute(prompt, {
|
|
188
|
-
model,
|
|
189
|
-
temperature: 0.
|
|
116
|
+
model: "gpt-4o", // or "gemini-1.5-pro", "anthropic.claude-3-sonnet-20240229-v1:0", etc.
|
|
117
|
+
temperature: 0.7,
|
|
190
118
|
max_tokens: 1024
|
|
191
119
|
});
|
|
192
120
|
|
|
193
|
-
console.log(
|
|
194
|
-
console.log('# Response took', response.execution_time, 'ms')
|
|
195
|
-
console.log('# Token usage:', response.token_usage);
|
|
121
|
+
console.log(response.result[0].value);
|
|
196
122
|
```
|
|
197
123
|
|
|
124
|
+
### 3. Stream a Response
|
|
198
125
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
In this example, we will execute a prompt and will stream the result to display it on the console as it is returned by the target LLM platform.
|
|
202
|
-
|
|
203
|
-
**Note** that some models don't support streaming. In that case, the driver will simulate a streaming using a single chunk of text corresponding to the entire response.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
```javascript
|
|
207
|
-
import { PromptRole, PromptSegment } from "@llumiverse/core";
|
|
208
|
-
|
|
209
|
-
// instantiate the desired driver
|
|
210
|
-
const driver = createDriverInstance();
|
|
211
|
-
const model = "the-model-id"; // change with your desired model ID
|
|
212
|
-
|
|
213
|
-
// create the prompt.
|
|
214
|
-
const prompt: PromptSegment[] = [
|
|
215
|
-
{
|
|
216
|
-
role: PromptRole.user,
|
|
217
|
-
content: 'Please, write a short story about winter in Paris, in no more than 512 characters.'
|
|
218
|
-
}
|
|
219
|
-
]
|
|
126
|
+
Streaming is standardized into an `AsyncIterable`.
|
|
220
127
|
|
|
221
|
-
|
|
222
|
-
console.log(`\n# Executing prompt on model ${model} in streaming mode: ${prompt}`);
|
|
128
|
+
```typescript
|
|
223
129
|
const stream = await driver.stream(prompt, {
|
|
224
|
-
model,
|
|
225
|
-
temperature: 0.
|
|
226
|
-
max_tokens: 1024
|
|
130
|
+
model: "gpt-4o",
|
|
131
|
+
temperature: 0.7
|
|
227
132
|
});
|
|
228
133
|
|
|
229
|
-
// print the streaming response as it comes
|
|
230
134
|
for await (const chunk of stream) {
|
|
231
135
|
process.stdout.write(chunk);
|
|
232
136
|
}
|
|
233
137
|
|
|
234
|
-
//
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
console.log('\n# LLM response:', streamingResponse.result)
|
|
238
|
-
console.log('# Response took', streamingResponse.execution_time, 'ms')
|
|
239
|
-
console.log('# Token usage:', streamingResponse.token_usage);
|
|
138
|
+
// Access the full assembled response afterwards if needed
|
|
139
|
+
console.log("\nFull response:", stream.completion.result[0].value);
|
|
240
140
|
```
|
|
241
141
|
|
|
242
|
-
### Generate
|
|
243
|
-
|
|
244
|
-
LLumiverse drivers expose a method to generate vector embeddings for a given text.
|
|
245
|
-
Drivers supporting embeddings as of v0.10.0 are `bedrock`, `openai`, `vertexai`.
|
|
246
|
-
If embeddings are not yet supported the generateEmbeddings method will throws an error.
|
|
142
|
+
### 4. Generate Embeddings
|
|
247
143
|
|
|
248
|
-
|
|
144
|
+
Embeddings are normalized to a simple `{ values: number[] }` structure.
|
|
249
145
|
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const driver = new VertexAIDriver({
|
|
254
|
-
project: 'your-project-id',
|
|
255
|
-
region: 'us-central1' // your zone
|
|
146
|
+
```typescript
|
|
147
|
+
const embedding = await driver.generateEmbeddings({
|
|
148
|
+
content: "Llumiverse is awesome."
|
|
256
149
|
});
|
|
257
150
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
// print the vector
|
|
261
|
-
console.log('Embeddings: ', v.values);
|
|
151
|
+
console.log(embedding.values); // [0.012, -0.34, ...]
|
|
262
152
|
```
|
|
263
153
|
|
|
264
|
-
|
|
265
|
-
Depending on the driver, the result may contain additional properties.
|
|
154
|
+
## Advanced Features
|
|
266
155
|
|
|
267
|
-
|
|
156
|
+
### Tool Calling (Function Calling)
|
|
268
157
|
|
|
269
|
-
|
|
158
|
+
Llumiverse normalizes tool definitions across providers (OpenAI, Bedrock, Vertex, etc.), allowing you to define tools once and use them anywhere.
|
|
270
159
|
|
|
271
|
-
```
|
|
272
|
-
import {
|
|
160
|
+
```typescript
|
|
161
|
+
import { ToolDefinition } from "@llumiverse/core";
|
|
273
162
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
163
|
+
// 1. Define the tool
|
|
164
|
+
const getWeatherTool: ToolDefinition = {
|
|
165
|
+
name: "get_weather",
|
|
166
|
+
description: "Get the current weather in a given location",
|
|
167
|
+
input_schema: {
|
|
168
|
+
type: "object",
|
|
169
|
+
properties: {
|
|
170
|
+
location: { type: "string" },
|
|
171
|
+
unit: { type: "string", enum: ["celsius", "fahrenheit"] }
|
|
172
|
+
},
|
|
173
|
+
required: ["location"]
|
|
174
|
+
}
|
|
175
|
+
};
|
|
278
176
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
model: "
|
|
282
|
-
|
|
177
|
+
// 2. Execute with tools
|
|
178
|
+
const response = await driver.execute(prompt, {
|
|
179
|
+
model: "gpt-4o",
|
|
180
|
+
tools: [getWeatherTool]
|
|
283
181
|
});
|
|
284
182
|
|
|
285
|
-
//
|
|
286
|
-
|
|
183
|
+
// 3. Handle the tool use
|
|
184
|
+
if (response.tool_use) {
|
|
185
|
+
for (const tool of response.tool_use) {
|
|
186
|
+
console.log(`Executing ${tool.tool_name} with args:`, tool.tool_input);
|
|
187
|
+
// ... call your actual function ...
|
|
188
|
+
}
|
|
189
|
+
}
|
|
287
190
|
```
|
|
288
191
|
|
|
289
|
-
|
|
192
|
+
### Structured Outputs (JSON Schemas)
|
|
290
193
|
|
|
194
|
+
Enforce a specific JSON structure for the response. Llumiverse handles the schema conversion for the underlying provider (e.g., using `response_format` for OpenAI or equivalent techniques for others).
|
|
291
195
|
|
|
292
|
-
|
|
196
|
+
```typescript
|
|
197
|
+
const schema = {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
sentiment: { type: "string", enum: ["positive", "neutral", "negative"] },
|
|
201
|
+
confidence: { type: "number" }
|
|
202
|
+
},
|
|
203
|
+
required: ["sentiment", "confidence"]
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const response = await driver.execute(prompt, {
|
|
207
|
+
model: "gpt-4o",
|
|
208
|
+
result_schema: schema
|
|
209
|
+
});
|
|
293
210
|
|
|
294
|
-
|
|
295
|
-
|
|
211
|
+
// The result is automatically parsed
|
|
212
|
+
const data = response.result[0].value;
|
|
213
|
+
console.log(data.sentiment); // "positive"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Contributing
|
|
296
217
|
|
|
218
|
+
We welcome contributions! Whether it's a new driver, a bug fix, or a docs improvement.
|
|
219
|
+
Please see [CONTRIBUTING.md](https://github.com/vertesia/llumiverse/blob/main/CONTRIBUTING.md) for details.
|
|
297
220
|
|
|
298
221
|
## License
|
|
299
222
|
|
|
300
|
-
|
|
223
|
+
Apache 2.0
|
|
@@ -18,6 +18,7 @@ class DefaultCompletionStream {
|
|
|
18
18
|
this.completion = undefined;
|
|
19
19
|
this.chunks = 0;
|
|
20
20
|
const accumulatedResults = []; // Accumulate CompletionResult[] from chunks
|
|
21
|
+
const accumulatedToolUse = new Map(); // Accumulate tool_use by id
|
|
21
22
|
this.driver.logger.debug(`[${this.driver.provider}] Streaming Execution of ${this.options.model} with prompt`);
|
|
22
23
|
const start = Date.now();
|
|
23
24
|
let finish_reason = undefined;
|
|
@@ -42,6 +43,43 @@ class DefaultCompletionStream {
|
|
|
42
43
|
promptTokens = Math.max(promptTokens, chunk.token_usage.prompt ?? 0);
|
|
43
44
|
resultTokens = Math.max(resultTokens ?? 0, chunk.token_usage.result ?? 0);
|
|
44
45
|
}
|
|
46
|
+
// Accumulate tool_use from chunks
|
|
47
|
+
// Note: During streaming, tool_input comes as string chunks that need concatenation
|
|
48
|
+
if (chunk.tool_use && chunk.tool_use.length > 0) {
|
|
49
|
+
for (const tool of chunk.tool_use) {
|
|
50
|
+
const existing = accumulatedToolUse.get(tool.id);
|
|
51
|
+
if (existing) {
|
|
52
|
+
// Merge tool input (for streaming where arguments come as string pieces)
|
|
53
|
+
if (tool.tool_input !== null && tool.tool_input !== undefined) {
|
|
54
|
+
const existingInput = existing.tool_input;
|
|
55
|
+
const newInput = tool.tool_input;
|
|
56
|
+
if (typeof existingInput === 'string' && typeof newInput === 'string') {
|
|
57
|
+
// Concatenate string arguments
|
|
58
|
+
existing.tool_input = existingInput + newInput;
|
|
59
|
+
}
|
|
60
|
+
else if (existingInput && typeof existingInput === 'object' && newInput && typeof newInput === 'object') {
|
|
61
|
+
// Merge objects
|
|
62
|
+
existing.tool_input = { ...existingInput, ...newInput };
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
existing.tool_input = tool.tool_input;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Update tool name if provided (might come in later chunk)
|
|
69
|
+
if (tool.tool_name) {
|
|
70
|
+
existing.tool_name = tool.tool_name;
|
|
71
|
+
}
|
|
72
|
+
// Update actual ID if provided (OpenAI sends id only in first chunk)
|
|
73
|
+
if (tool._actual_id) {
|
|
74
|
+
existing._actual_id = tool._actual_id;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// New tool call
|
|
79
|
+
accumulatedToolUse.set(tool.id, { ...tool });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
45
83
|
if (Array.isArray(chunk.result) && chunk.result.length > 0) {
|
|
46
84
|
// Process each result in the chunk, combining consecutive text/JSON
|
|
47
85
|
for (const result of chunk.result) {
|
|
@@ -115,6 +153,27 @@ class DefaultCompletionStream {
|
|
|
115
153
|
// Allows for checking for truthy-ness on token_usage, rather than it's internals. For testing and downstream usage.
|
|
116
154
|
const tokens = resultTokens ?
|
|
117
155
|
{ prompt: promptTokens, result: resultTokens, total: resultTokens + promptTokens, } : undefined;
|
|
156
|
+
// Convert accumulated tool_use Map to array
|
|
157
|
+
const toolUseArray = accumulatedToolUse.size > 0 ? Array.from(accumulatedToolUse.values()) : undefined;
|
|
158
|
+
// Finalize tool calls: restore actual IDs and parse JSON arguments
|
|
159
|
+
if (toolUseArray) {
|
|
160
|
+
for (const tool of toolUseArray) {
|
|
161
|
+
// Restore actual ID from OpenAI (was stored in _actual_id during streaming)
|
|
162
|
+
if (tool._actual_id) {
|
|
163
|
+
tool.id = tool._actual_id;
|
|
164
|
+
delete tool._actual_id;
|
|
165
|
+
}
|
|
166
|
+
// Parse tool_input strings as JSON if needed (streaming sends arguments as string chunks)
|
|
167
|
+
if (typeof tool.tool_input === 'string') {
|
|
168
|
+
try {
|
|
169
|
+
tool.tool_input = JSON.parse(tool.tool_input);
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// Keep as string if not valid JSON
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
118
177
|
this.completion = {
|
|
119
178
|
result: accumulatedResults, // Return the accumulated CompletionResult[] instead of text
|
|
120
179
|
prompt: this.prompt,
|
|
@@ -122,7 +181,13 @@ class DefaultCompletionStream {
|
|
|
122
181
|
token_usage: tokens,
|
|
123
182
|
finish_reason: finish_reason,
|
|
124
183
|
chunks: this.chunks,
|
|
184
|
+
tool_use: toolUseArray,
|
|
125
185
|
};
|
|
186
|
+
// Build conversation context for multi-turn support
|
|
187
|
+
const conversation = this.driver.buildStreamingConversation(this.prompt, accumulatedResults, toolUseArray, this.options);
|
|
188
|
+
if (conversation !== undefined) {
|
|
189
|
+
this.completion.conversation = conversation;
|
|
190
|
+
}
|
|
126
191
|
try {
|
|
127
192
|
if (this.completion) {
|
|
128
193
|
this.driver.validateResult(this.completion, this.options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompletionStream.js","sourceRoot":"","sources":["../../src/CompletionStream.ts"],"names":[],"mappings":";;;AAGA,MAAa,uBAAuB;IAKb;IACR;IACA;IALX,M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,20 @@ class AbstractDriver {
|
|
|
171
171
|
async listTrainableModels() {
|
|
172
172
|
return [];
|
|
173
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Build the conversation context after streaming completion.
|
|
176
|
+
* Override this in driver implementations that support multi-turn conversations.
|
|
177
|
+
*
|
|
178
|
+
* @param prompt - The prompt that was sent (includes prior conversation context)
|
|
179
|
+
* @param result - The completion results from the streamed response
|
|
180
|
+
* @param toolUse - The tool calls from the streamed response (if any)
|
|
181
|
+
* @param options - The execution options
|
|
182
|
+
* @returns The updated conversation context, or undefined if not supported
|
|
183
|
+
*/
|
|
184
|
+
buildStreamingConversation(_prompt, _result, _toolUse, _options) {
|
|
185
|
+
// Default implementation returns undefined - drivers can override
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
174
188
|
async requestImageGeneration(_prompt, _options) {
|
|
175
189
|
throw new Error("Image generation not implemented.");
|
|
176
190
|
//Cannot be made abstract, as abstract methods are required in the derived class
|
package/lib/cjs/Driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Driver.js","sourceRoot":"","sources":["../../src/Driver.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAyDH,oCAQC;AA/DD,+DAA0F;AAC1F,oDAAyD;AACzD,+CAmB4B;AAC5B,mDAAiD;AAEjD,6FAA6F;AAC7F,SAAS,yBAAyB,CAAC,aAA2C;IAC1E,OAAO,CAAC,CAAC,QAAa,EAAE,UAAgB,EAAE,GAAG,IAAmC,EAAE,EAAE;QAChF,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC/B,gDAAgD;YAChD,aAAa,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,yDAAyD;YACzD,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;QACjD,CAAC;aAAM,CAA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