modelfusion 0.100.0 → 0.102.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +1432 -0
  2. package/core/api/BaseUrlApiConfiguration.d.ts +7 -6
  3. package/core/api/BaseUrlPartsApiConfiguration.cjs +53 -0
  4. package/core/api/BaseUrlPartsApiConfiguration.d.ts +26 -0
  5. package/core/api/BaseUrlPartsApiConfiguration.js +49 -0
  6. package/core/api/index.cjs +1 -0
  7. package/core/api/index.d.ts +1 -0
  8. package/core/api/index.js +1 -0
  9. package/model-function/generate-image/ImageGenerationModel.d.ts +12 -2
  10. package/model-function/generate-image/PromptTemplateImageGenerationModel.cjs +3 -3
  11. package/model-function/generate-image/PromptTemplateImageGenerationModel.d.ts +2 -2
  12. package/model-function/generate-image/PromptTemplateImageGenerationModel.js +3 -3
  13. package/model-function/generate-image/generateImage.cjs +9 -7
  14. package/model-function/generate-image/generateImage.d.ts +2 -0
  15. package/model-function/generate-image/generateImage.js +9 -7
  16. package/model-provider/automatic1111/Automatic1111ApiConfiguration.cjs +8 -9
  17. package/model-provider/automatic1111/Automatic1111ApiConfiguration.d.ts +7 -9
  18. package/model-provider/automatic1111/Automatic1111ApiConfiguration.js +8 -9
  19. package/model-provider/automatic1111/Automatic1111Error.cjs +7 -31
  20. package/model-provider/automatic1111/Automatic1111Error.d.ts +2 -11
  21. package/model-provider/automatic1111/Automatic1111Error.js +6 -28
  22. package/model-provider/automatic1111/Automatic1111Facade.cjs +10 -1
  23. package/model-provider/automatic1111/Automatic1111Facade.d.ts +7 -0
  24. package/model-provider/automatic1111/Automatic1111Facade.js +8 -0
  25. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.cjs +26 -29
  26. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.d.ts +24 -10
  27. package/model-provider/automatic1111/Automatic1111ImageGenerationModel.js +26 -29
  28. package/model-provider/automatic1111/Automatic1111ImageGenerationPrompt.d.ts +0 -1
  29. package/model-provider/automatic1111/index.cjs +1 -3
  30. package/model-provider/automatic1111/index.d.ts +1 -1
  31. package/model-provider/automatic1111/index.js +0 -1
  32. package/model-provider/openai/OpenAIImageGenerationModel.cjs +25 -31
  33. package/model-provider/openai/OpenAIImageGenerationModel.d.ts +2 -3
  34. package/model-provider/openai/OpenAIImageGenerationModel.js +25 -31
  35. package/model-provider/stability/StabilityApiConfiguration.cjs +12 -5
  36. package/model-provider/stability/StabilityApiConfiguration.d.ts +7 -8
  37. package/model-provider/stability/StabilityApiConfiguration.js +12 -5
  38. package/model-provider/stability/StabilityError.cjs +7 -31
  39. package/model-provider/stability/StabilityError.d.ts +2 -11
  40. package/model-provider/stability/StabilityError.js +6 -28
  41. package/model-provider/stability/StabilityFacade.cjs +11 -3
  42. package/model-provider/stability/StabilityFacade.d.ts +10 -2
  43. package/model-provider/stability/StabilityFacade.js +9 -2
  44. package/model-provider/stability/StabilityImageGenerationModel.cjs +39 -50
  45. package/model-provider/stability/StabilityImageGenerationModel.d.ts +37 -22
  46. package/model-provider/stability/StabilityImageGenerationModel.js +39 -50
  47. package/model-provider/stability/index.cjs +1 -3
  48. package/model-provider/stability/index.d.ts +1 -1
  49. package/model-provider/stability/index.js +0 -1
  50. package/package.json +15 -15
package/CHANGELOG.md ADDED
@@ -0,0 +1,1432 @@
1
+ # Changelog
2
+
3
+ ## v0.102.0 - 2023-12-22
4
+
5
+ ### Added
6
+
7
+ - You can specify `numberOfGenerations` on image generation models and create multiple images by using the `fullResponse: true` option. Example:
8
+
9
+ ```ts
10
+ // generate 2 images:
11
+ const { images } = await generateImage(
12
+ openai.ImageGenerator({
13
+ model: "dall-e-3",
14
+ numberOfGenerations: 2,
15
+ size: "1024x1024",
16
+ }),
17
+ "the wicked witch of the west in the style of early 19th century painting",
18
+ { fullResponse: true }
19
+ );
20
+ ```
21
+
22
+ - **breaking change**: Image generation models use a generalized `numberOfGenerations` parameter (instead of model specific parameters) to specify the number of generations.
23
+
24
+ ## v0.101.0 - 2023-12-22
25
+
26
+ ### Changed
27
+
28
+ - Automatic1111 Stable Diffusion Web UI configuration has separate configuration of host, port, and path.
29
+
30
+ ### Fixed
31
+
32
+ - Automatic1111 Stable Diffusion Web UI uses negative prompt and seed.
33
+
34
+ ## v0.100.0 - 2023-12-17
35
+
36
+ ### Added
37
+
38
+ - `ollama.ChatTextGenerator` model that calls the Ollama chat API.
39
+ - Ollama chat messages and prompts are exposed through `ollama.ChatMessage` and `ollama.ChatPrompt`
40
+ - OpenAI chat messages and prompts are exposed through `openai.ChatMessage` and `openai.ChatPrompt`
41
+ - Mistral chat messages and prompts are exposed through `mistral.ChatMessage` and `mistral.ChatPrompt`
42
+
43
+ ### Changed
44
+
45
+ - **breaking change**: renamed `ollama.TextGenerator` to `ollama.CompletionTextGenerator`
46
+ - **breaking change**: renamed `mistral.TextGenerator` to `mistral.ChatTextGenerator`
47
+
48
+ ## v0.99.0 - 2023-12-16
49
+
50
+ ### Added
51
+
52
+ - You can specify `numberOfGenerations` on text generation models and access multiple generations by using the `fullResponse: true` option. Example:
53
+
54
+ ```ts
55
+ // generate 2 texts:
56
+ const { texts } = await generateText(
57
+ openai.CompletionTextGenerator({
58
+ model: "gpt-3.5-turbo-instruct",
59
+ numberOfGenerations: 2,
60
+ maxGenerationTokens: 1000,
61
+ }),
62
+ "Write a short story about a robot learning to love:\n\n",
63
+ { fullResponse: true }
64
+ );
65
+ ```
66
+
67
+ - **breaking change**: Text generation models use a generalized `numberOfGenerations` parameter (instead of model specific parameters) to specify the number of generations.
68
+
69
+ ### Changed
70
+
71
+ - **breaking change**: Renamed `maxCompletionTokens` text generation model setting to `maxGenerationTokens`.
72
+
73
+ ## v0.98.0 - 2023-12-16
74
+
75
+ ### Changed
76
+
77
+ - **breaking change**: `responseType` option was changed into `fullResponse` option and uses a boolean value to make discovery easy. The response values from the full response have been renamed for clarity. For base64 image generation, you can use the `imageBase64` value from the full response:
78
+
79
+ ```ts
80
+ const { imageBase64 } = await generateImage(model, prompt, {
81
+ fullResponse: true,
82
+ });
83
+ ```
84
+
85
+ ### Improved
86
+
87
+ - Better docs for the OpenAI chat settings. Thanks [@bearjaws](https://github.com/bearjaws) for the contribution!
88
+
89
+ ### Fixed
90
+
91
+ - Streaming OpenAI chat text generation when setting `n:2` or higher returns only the stream from the first choice.
92
+
93
+ ## v0.97.0 - 2023-12-14
94
+
95
+ ### Added
96
+
97
+ - **breaking change**: Ollama image (vision) support. This changes the Ollama prompt format. You can add `.withTextPrompt()` to existing Ollama text generators to get a text prompt like before.
98
+
99
+ Vision example:
100
+
101
+ ```ts
102
+ import { ollama, streamText } from "modelfusion";
103
+
104
+ const textStream = await streamText(
105
+ ollama.TextGenerator({
106
+ model: "bakllava",
107
+ maxCompletionTokens: 1024,
108
+ temperature: 0,
109
+ }),
110
+ {
111
+ prompt: "Describe the image in detail",
112
+ images: [image], // base-64 encoded png or jpeg
113
+ }
114
+ );
115
+ ```
116
+
117
+ ### Changed
118
+
119
+ - **breaking change**: Switch Ollama settings to camelCase to align with the rest of the library.
120
+
121
+ ## v0.96.0 - 2023-12-14
122
+
123
+ ### Added
124
+
125
+ - [Mistral platform support](https://modelfusion.dev/integration/model-provider/mistral)
126
+
127
+ ## v0.95.0 - 2023-12-10
128
+
129
+ ### Added
130
+
131
+ - `cachePrompt` parameter for llama.cpp models. Thanks [@djwhitt](https://github.com/djwhitt) for the contribution!
132
+
133
+ ## v0.94.0 - 2023-12-10
134
+
135
+ ### Added
136
+
137
+ - Prompt template for neural-chat models.
138
+
139
+ ## v0.93.0 - 2023-12-10
140
+
141
+ ### Added
142
+
143
+ - Optional response prefix for instruction prompts to guide the LLM response.
144
+
145
+ ### Changed
146
+
147
+ - **breaking change**: Renamed prompt format to prompt template to align with the commonly used language (e.g. from model cards).
148
+
149
+ ## v0.92.1 - 2023-12-10
150
+
151
+ ### Changed
152
+
153
+ - Improved Ollama error handling.
154
+
155
+ ## v0.92.0 - 2023-12-09
156
+
157
+ ### Changed
158
+
159
+ - **breaking change**: setting global function observers and global logging has changed.
160
+ You can call methods on a `modelfusion` import:
161
+
162
+ ```ts
163
+ import { modelfusion } from "modelfusion";
164
+
165
+ modelfusion.setLogFormat("basic-text");
166
+ ```
167
+
168
+ - Cleaned output when using `detailed-object` log format.
169
+
170
+ ## v0.91.0 - 2023-12-09
171
+
172
+ ### Added
173
+
174
+ - `Whisper.cpp` [transcription (speech-to-text) model](https://modelfusion.dev/integration/model-provider/whispercpp) support.
175
+
176
+ ```ts
177
+ import { generateTranscription, whispercpp } from "modelfusion";
178
+
179
+ const data = await fs.promises.readFile("data/test.wav");
180
+
181
+ const transcription = await generateTranscription(whispercpp.Transcriber(), {
182
+ type: "wav",
183
+ data,
184
+ });
185
+ ```
186
+
187
+ ### Improved
188
+
189
+ - Better error reporting.
190
+
191
+ ## v0.90.0 - 2023-12-03
192
+
193
+ ### Added
194
+
195
+ - Temperature and language settings to OpenAI transcription model.
196
+
197
+ ## v0.89.0 - 2023-11-30
198
+
199
+ ### Added
200
+
201
+ - `maxValuesPerCall` setting for `OpenAITextEmbeddingModel` to enable different configurations, e.g. for Azure. Thanks [@nanotronic](https://github.com/nanotronic) for the contribution!
202
+
203
+ ## v0.88.0 - 2023-11-28
204
+
205
+ ### Added
206
+
207
+ - Multi-modal chat prompts. Supported by OpenAI vision chat models and by BakLLaVA prompt format.
208
+
209
+ ### Changed
210
+
211
+ - **breaking change**: renamed `ChatPrompt` to `TextChatPrompt` to distinguish it from multi-modal chat prompts.
212
+
213
+ ## v0.87.0 - 2023-11-27
214
+
215
+ ### Added
216
+
217
+ - **experimental**: `modelfusion/extension` export with functions and classes that are necessary to implement providers in 3rd party node modules. See [lgrammel/modelfusion-example-provider](https://github.com/lgrammel/modelfusion-example-provider) for an example.
218
+
219
+ ## v0.85.0 - 2023-11-26
220
+
221
+ ### Added
222
+
223
+ - `OpenAIChatMessage` function call support.
224
+
225
+ ## v0.84.0 - 2023-11-26
226
+
227
+ ### Added
228
+
229
+ - Support for OpenAI-compatible chat APIs. See [OpenAI Compatible](https://modelfusion.dev/integration/model-provider/openaicompatible) for details.
230
+
231
+ ```ts
232
+ import {
233
+ BaseUrlApiConfiguration,
234
+ openaicompatible,
235
+ generateText,
236
+ } from "modelfusion";
237
+
238
+ const text = await generateText(
239
+ openaicompatible
240
+ .ChatTextGenerator({
241
+ api: new BaseUrlApiConfiguration({
242
+ baseUrl: "https://api.fireworks.ai/inference/v1",
243
+ headers: {
244
+ Authorization: `Bearer ${process.env.FIREWORKS_API_KEY}`,
245
+ },
246
+ }),
247
+ model: "accounts/fireworks/models/mistral-7b",
248
+ })
249
+ .withTextPrompt(),
250
+
251
+ "Write a story about a robot learning to love"
252
+ );
253
+ ```
254
+
255
+ ## v0.83.0 - 2023-11-26
256
+
257
+ ### Added
258
+
259
+ - Introduce `uncheckedSchema()` facade function as an easier way to create unchecked ModelFusion schemas. This aligns the API with `zodSchema()`.
260
+
261
+ ### Changed
262
+
263
+ - **breaking change**: Renamed `InstructionPrompt` interface to `MultiModalInstructionPrompt` to clearly distinguish it from `TextInstructionPrompt`.
264
+ - **breaking change**: Renamed `.withBasicPrompt` methods for image generation models to `.withTextPrompt` to align with text generation models.
265
+
266
+ ## v0.82.0 - 2023-11-25
267
+
268
+ ### Added
269
+
270
+ - Introduce `zodSchema()` facade function as an easier way to create new ModelFusion Zod schemas. This clearly distinguishes it from `ZodSchema` that is also part of the zod library.
271
+
272
+ ## v0.81.0 - 2023-11-25
273
+
274
+ **breaking change**: `generateStructure` and `streamStructure` redesign. The new API does not require function calling and `StructureDefinition` objects any more. This makes it more flexible and it can be used in 3 ways:
275
+
276
+ - with OpenAI function calling:
277
+
278
+ ```ts
279
+ const model = openai
280
+ .ChatTextGenerator({ model: "gpt-3.5-turbo" })
281
+ .asFunctionCallStructureGenerationModel({
282
+ fnName: "...",
283
+ fnDescription: "...",
284
+ });
285
+ ```
286
+
287
+ - with OpenAI JSON format:
288
+
289
+ ```ts
290
+ const model = openai
291
+ .ChatTextGenerator({
292
+ model: "gpt-4-1106-preview",
293
+ temperature: 0,
294
+ maxCompletionTokens: 1024,
295
+ responseFormat: { type: "json_object" },
296
+ })
297
+ .asStructureGenerationModel(
298
+ jsonStructurePrompt((instruction: string, schema) => [
299
+ OpenAIChatMessage.system(
300
+ "JSON schema: \n" +
301
+ JSON.stringify(schema.getJsonSchema()) +
302
+ "\n\n" +
303
+ "Respond only using JSON that matches the above schema."
304
+ ),
305
+ OpenAIChatMessage.user(instruction),
306
+ ])
307
+ );
308
+ ```
309
+
310
+ - with Ollama (and a capable model, e.g., OpenHermes 2.5):
311
+ ```ts
312
+ const model = ollama
313
+ .TextGenerator({
314
+ model: "openhermes2.5-mistral",
315
+ maxCompletionTokens: 1024,
316
+ temperature: 0,
317
+ format: "json",
318
+ raw: true,
319
+ stopSequences: ["\n\n"], // prevent infinite generation
320
+ })
321
+ .withPromptFormat(ChatMLPromptFormat.instruction())
322
+ .asStructureGenerationModel(
323
+ jsonStructurePrompt((instruction: string, schema) => ({
324
+ system:
325
+ "JSON schema: \n" +
326
+ JSON.stringify(schema.getJsonSchema()) +
327
+ "\n\n" +
328
+ "Respond only using JSON that matches the above schema.",
329
+ instruction,
330
+ }))
331
+ );
332
+ ```
333
+
334
+ See [generateStructure](https://modelfusion.dev/guide/function/generate-structure) for details on the new API.
335
+
336
+ ## v0.80.0 - 2023-11-24
337
+
338
+ ### Changed
339
+
340
+ - **breaking change**: Restructured multi-modal instruction prompts and `OpenAIChatMessage.user()`
341
+
342
+ ## v0.79.0 - 2023-11-23
343
+
344
+ ### Added
345
+
346
+ - Multi-tool usage from open source models
347
+
348
+ Use `TextGenerationToolCallsOrGenerateTextModel` and related helper methods `.asToolCallsOrTextGenerationModel()` to create custom prompts & parsers.
349
+
350
+ Examples:
351
+
352
+ - `examples/basic/src/model-provider/ollama/ollama-use-tools-or-generate-text-openhermes-example.ts`
353
+ - `examples/basic/src/model-provider/llamacpp/llamacpp-use-tools-or-generate-text-openhermes-example.ts`
354
+
355
+ Example prompt format:
356
+
357
+ - `examples/basic/src/tool/prompts/open-hermes.ts` for OpenHermes 2.5
358
+
359
+ ## v0.78.0 - 2023-11-23
360
+
361
+ ### Removed
362
+
363
+ - **breaking change**: Removed `FunctionListToolCallPromptFormat`. See `examples/basic/src/model-provide/ollama/ollama-use-tool-mistral-example.ts` for how to implement a `ToolCallPromptFormat` for your tool.
364
+
365
+ ## v0.77.0 - 2023-11-23
366
+
367
+ ### Changed
368
+
369
+ - **breaking change**: Rename `Speech` to `SpeechGenerator` in facades
370
+ - **breaking change**: Rename `Transcription` to `Transcriber` in facades
371
+
372
+ ## v0.76.0 - 2023-11-23
373
+
374
+ ### Added
375
+
376
+ - Anthropic Claude 2.1 support
377
+
378
+ ## v0.75.0 - 2023-11-22
379
+
380
+ Introducing model provider facades:
381
+
382
+ ```ts
383
+ const image = await generateImage(
384
+ openai.ImageGenerator({ model: "dall-e-3", size: "1024x1024" }),
385
+ "the wicked witch of the west in the style of early 19th century painting"
386
+ );
387
+ ```
388
+
389
+ ### Added
390
+
391
+ - Model provider facades. You can e.g. use `ollama.TextGenerator(...)` instead of `new OllamaTextGenerationModel(...)`.
392
+
393
+ ### Changed
394
+
395
+ - **breaking change**: Fixed method name `isParallizable` to `isParallelizable` in `EmbeddingModel`.
396
+
397
+ ### Removed
398
+
399
+ - **breaking change**: removed `HuggingFaceImageDescriptionModel`. Image description models will be replaced by multi-modal vision models.
400
+
401
+ ## v0.74.1 - 2023-11-22
402
+
403
+ ### Improved
404
+
405
+ - Increase OpenAI chat streaming resilience.
406
+
407
+ ## v0.74.0 - 2023-11-21
408
+
409
+ Prompt format and tool calling improvements.
410
+
411
+ ### Added
412
+
413
+ - text prompt format. Use simple text prompts, e.g. with `OpenAIChatModel`:
414
+ ```ts
415
+ const textStream = await streamText(
416
+ new OpenAIChatModel({
417
+ model: "gpt-3.5-turbo",
418
+ }).withTextPrompt(),
419
+ "Write a short story about a robot learning to love."
420
+ );
421
+ ```
422
+ - `.withTextPromptFormat` to `LlamaCppTextGenerationModel` for simplified prompt construction:
423
+ ```ts
424
+ const textStream = await streamText(
425
+ new LlamaCppTextGenerationModel({
426
+ // ...
427
+ }).withTextPromptFormat(Llama2PromptFormat.text()),
428
+ "Write a short story about a robot learning to love."
429
+ );
430
+ ```
431
+ - `.asToolCallGenerationModel()` to `OllamaTextGenerationModel` to simplify tool calls.
432
+
433
+ ### Improved
434
+
435
+ - better error reporting when using exponent backoff retries
436
+
437
+ ### Removed
438
+
439
+ - **breaking change**: removed `input` from `InstructionPrompt` (was Alpaca-specific, `AlpacaPromptFormat` still supports it)
440
+
441
+ ## v0.73.1 - 2023-11-19
442
+
443
+ Remove section newlines from Llama 2 prompt format.
444
+
445
+ ## v0.73.0 - 2023-11-19
446
+
447
+ Ollama edge case and error handling improvements.
448
+
449
+ ## v0.72.0 - 2023-11-19
450
+
451
+ **Breaking change**: the tool calling API has been reworked to support multiple parallel tool calls. This required multiple breaking changes (see below). Check out the updated [tools documentation](https://modelfusion.dev/guide/tools/) for details.
452
+
453
+ ### Changed
454
+
455
+ - `Tool` has `parameters` and `returnType` schemas (instead of `inputSchema` and `outputSchema`).
456
+ - `useTool` uses `generateToolCall` under the hood. The return value and error handling has changed.
457
+ - `useToolOrGenerateText` has been renamed to `useToolsOrGenerateText`. It uses `generateToolCallsOrText` under the hood. The return value and error handling has changed. It can invoke several tools in parallel and returns an array of tool results.
458
+ - The `maxRetries` parameter in `guard` has been replaced by a `maxAttempt` parameter.
459
+
460
+ ### Removed
461
+
462
+ - `generateStructureOrText` has been removed.
463
+
464
+ ## v0.71.0 - 2023-11-17
465
+
466
+ ### Added
467
+
468
+ - Experimental generateToolCallsOrText function for generating a multiple parallel tool call using the OpenAI chat/tools API.
469
+
470
+ ## v0.70.0 - 2023-11-16
471
+
472
+ ### Added
473
+
474
+ - ChatML prompt format.
475
+
476
+ ### Changed
477
+
478
+ - **breaking change**: `ChatPrompt` structure and terminology has changed to align more closely with OpenAI and similar chat prompts. This is also in preparation for integrating images and function calls results into chat prompts.
479
+ - **breaking change**: Prompt formats are namespaced. Use e.g. `Llama2PromptFormat.chat()` instead of `mapChatPromptToLlama2Format()`. See [Prompt Format](https://modelfusion.dev/guide/function/generate-text#prompt-format) for documentation of the new prompt formats.
480
+
481
+ ## v0.69.0 - 2023-11-15
482
+
483
+ ### Added
484
+
485
+ - Experimental generateToolCall function for generating a single tool call using the OpenAI chat/tools API.
486
+
487
+ ## v0.68.0 - 2023-11-14
488
+
489
+ ### Changed
490
+
491
+ - Refactored JSON parsing to use abstracted schemas. You can use `parseJSON` and `safeParseJSON` to securely parse JSON objects and optionally type-check them using any schema (e.g. a Zod schema).
492
+
493
+ ## v0.67.0 - 2023-11-12
494
+
495
+ ### Added
496
+
497
+ - Ollama 0.1.9 support: `format` (for forcing JSON output) and `raw` settings
498
+ - Improved Ollama settings documentation
499
+
500
+ ## v0.66.0 - 2023-11-12
501
+
502
+ ### Added
503
+
504
+ - Support for fine-tuned OpenAI `gpt-4-0613` models
505
+ - Support for `trimWhitespace` model setting in `streamText` calls
506
+
507
+ ## v0.65.0 - 2023-11-12
508
+
509
+ ### Added
510
+
511
+ - Image support for `OpenAIChatMessage.user`
512
+ - `mapInstructionPromptToBakLLaVA1ForLlamaCppFormat` prompt format
513
+
514
+ ### Changed
515
+
516
+ - **breaking change**: `VisionInstructionPrompt` was replaced by an optional `image` field in `InstructionPrompt`.
517
+
518
+ ## v0.64.0 - 2023-11-11
519
+
520
+ ### Added
521
+
522
+ - Support for OpenAI vision model.
523
+ - Example: `examples/basic/src/model-provider/openai/openai-chat-stream-text-vision-example.ts`
524
+
525
+ ## v0.63.0 - 2023-11-08
526
+
527
+ ### Added
528
+
529
+ - Support for OpenAI chat completion `seed` and `responseFormat` options.
530
+
531
+ ## v0.62.0 - 2023-11-08
532
+
533
+ ### Added
534
+
535
+ - OpenAI speech generation support. Shoutout to [@bjsi](https://github.com/bjsi) for the awesome contribution!
536
+
537
+ ## v0.61.0 - 2023-11-07
538
+
539
+ ### Added
540
+
541
+ - OpenAI `gpt-3.5-turbo-1106`, `gpt-4-1106-preview`, `gpt-4-vision-preview` chat models.
542
+ - OpenAI `Dalle-E-3` image model.
543
+
544
+ ### Changed
545
+
546
+ - **breaking change**: `OpenAIImageGenerationModel` requires a `model` parameter.
547
+
548
+ ## v0.60.0 - 2023-11-06
549
+
550
+ ### Added
551
+
552
+ - Support image input for multi-modal Llama.cpp models (e.g. Llava, Bakllava).
553
+
554
+ ### Changed
555
+
556
+ - **breaking change**: Llama.cpp prompt format has changed to support images. Use `.withTextPrompt()` to get a text prompt format.
557
+
558
+ ## v0.59.0 - 2023-11-06
559
+
560
+ ### Added
561
+
562
+ - ElevenLabs `eleven_turbo_v2` support.
563
+
564
+ ## v0.58 - 2023-11-05
565
+
566
+ ### Fixed
567
+
568
+ - **breaking change**: Uncaught errors were caused by custom Promises. ModelFusion uses only standard Promises. To get full responses from model function, you need to use the `{ returnType: "full" }` option instead of calling `.asFullResponse()` on the result.
569
+
570
+ ## v0.57.1 - 2023-11-05
571
+
572
+ ### Improved
573
+
574
+ - ModelFusion server error logging and reporting.
575
+
576
+ ### Fixed
577
+
578
+ - ModelFusion server creates directory for runs automatically when errors are thrown.
579
+
580
+ ## v0.57.0 - 2023-11-04
581
+
582
+ ### Added
583
+
584
+ - Support for [Cohere v3 embeddings](https://txt.cohere.com/introducing-embed-v3/).
585
+
586
+ ## v0.56.0 - 2023-11-04
587
+
588
+ ### Added
589
+
590
+ - [Ollama model provider](https://modelfusion.dev/integration/model-provider/ollama) for text embeddings.
591
+
592
+ ## v0.55.1 - 2023-11-04
593
+
594
+ ### Fixed
595
+
596
+ - Llama.cpp embeddings are invoked sequentially to avoid rejection by the server.
597
+
598
+ ## v0.55.0 - 2023-11-04
599
+
600
+ ### Added
601
+
602
+ - [Ollama model provider](https://modelfusion.dev/integration/model-provider/ollama) for text generation and text streaming.
603
+
604
+ ## v0.54.0 - 2023-10-29
605
+
606
+ Adding experimental ModelFusion server, flows, and browser utils.
607
+
608
+ ### Added
609
+
610
+ - ModelFusion server (separate export 'modelfusion/server') with a Fastify plugin for running ModelFusion flows on a server.
611
+ - ModelFusion flows.
612
+ - ModelFusion browser utils (separate export 'modelfusion/browser') for dealing with audio data and invoking ModelFusion flows on the server (`invokeFlow`).
613
+
614
+ ### Changed
615
+
616
+ - **breaking change**: `readEventSource` and `readEventSourceStream` are part of 'modelfusion/browser'.
617
+
618
+ ## v0.53.2 - 2023-10-26
619
+
620
+ ### Added
621
+
622
+ - Prompt callback option for `streamStructure`
623
+
624
+ ### Improved
625
+
626
+ - Inline JSDoc comments for the model functions.
627
+
628
+ ## v0.53.1 - 2023-10-25
629
+
630
+ ### Fixed
631
+
632
+ - Abort signals and errors during streaming are caught and forwarded correctly.
633
+
634
+ ## v0.53.0 - 2023-10-23
635
+
636
+ ### Added
637
+
638
+ - `executeFunction` utility function for tracing execution time, parameters, and result of composite functions and non-ModelFusion functions.
639
+
640
+ ## v0.52.0 - 2023-10-23
641
+
642
+ ### Changed
643
+
644
+ - Streaming results and `AsyncQueue` objects can be used by several consumers. Each consumer will receive all values. This means that you can e.g. forward the same text stream to speech generation and the client.
645
+
646
+ ## v0.51.0 - 2023-10-23
647
+
648
+ ElevenLabs improvements.
649
+
650
+ ### Added
651
+
652
+ - ElevenLabs model settings `outputFormat` and `optimizeStreamingLatency`.
653
+
654
+ ### Fixed
655
+
656
+ - Default ElevenLabs model is `eleven_monolingual_v1`.
657
+
658
+ ## v0.50.0 - 2023-10-22
659
+
660
+ ### Added
661
+
662
+ - `parentCallId` event property
663
+ - Tracing for `useTool`, `useToolOrGenerateText`, `upsertIntoVectorIndex`, and `guard`
664
+
665
+ ### Changed
666
+
667
+ - **breaking change**: rename `embedding` event type to `embed`
668
+ - **breaking change**: rename `image-generation` event type to `generate-image`
669
+ - **breaking change**: rename `speech-generation` event type to `generate-speech`
670
+ - **breaking change**: rename `speech-streaming` event type to `stream-speech`
671
+ - **breaking change**: rename `structure-generation` event type to `generate-structure`
672
+ - **breaking change**: rename `structure-or-text-generation` event type to `generate-structure-or-text`
673
+ - **breaking change**: rename `structure-streaming` event type to `stream-structure`
674
+ - **breaking change**: rename `text-generation` event type to `generate-text`
675
+ - **breaking change**: rename `text-streaming` event type to `stream-text`
676
+ - **breaking change**: rename `transcription` event type to `generate-transcription`
677
+
678
+ ## v0.49.0 - 2023-10-21
679
+
680
+ ### Added
681
+
682
+ - Speech synthesis streaming supports string inputs.
683
+ - Observability for speech synthesis streaming.
684
+
685
+ ### Changed
686
+
687
+ - **breaking change**: split `synthesizeSpeech` into `generateSpeech` and `streamSpeech` functions
688
+ - **breaking change**: renamed `speech-synthesis` event to `speech-generation`
689
+ - **breaking change**: renamed `transcribe` to `generateTranscription`
690
+ - **breaking change**: renamed `LmntSpeechSynthesisModel` to `LmntSpeechModel`
691
+ - **breaking change**: renamed `ElevenLabesSpeechSynthesisModel` to `ElevenLabsSpeechModel`
692
+ - **breaking change**: renamed `OpenAITextGenerationModel` to `OpenAICompletionModel`
693
+
694
+ ### Removed
695
+
696
+ - **breaking change**: `describeImage` model function. Use `generateText` instead (with e.g. `HuggingFaceImageDescriptionModel`).
697
+
698
+ ## v0.48.0 - 2023-10-20
699
+
700
+ ### Added
701
+
702
+ - Duplex streaming for speech synthesis.
703
+ - Elevenlabs duplex streaming support.
704
+
705
+ ### Changed
706
+
707
+ - Schema is using data in return type (breaking change for tools).
708
+
709
+ ## v0.47.0 - 2023-10-14
710
+
711
+ ### Added
712
+
713
+ - Prompt formats for image generation. You can use `.withPromptFormat()` or `.withBasicPrompt()` to apply a prompt format to an image generation model.
714
+
715
+ ### Changed
716
+
717
+ - **breaking change**: `generateImage` returns a Buffer with the binary image data instead of a base-64 encoded string. You can call `.asBase64Text()` on the response to get a base64 encoded string.
718
+
719
+ ## v0.46.0 - 2023-10-14
720
+
721
+ ### Added
722
+
723
+ - `.withChatPrompt()` and `.withInstructionPrompt()` shorthand methods.
724
+
725
+ ## v0.45.0 - 2023-10-14
726
+
727
+ ### Changed
728
+
729
+ - Updated Zod to 3.22.4. You need to use Zod 3.22.4 or higher in your project.
730
+
731
+ ## v0.44.0 - 2023-10-13
732
+
733
+ ### Added
734
+
735
+ - Store runs in AsyncLocalStorage for convienience (Node.js only).
736
+
737
+ ## v0.43.0 - 2023-10-12
738
+
739
+ ### Added
740
+
741
+ - Guard function.
742
+
743
+ ## v0.42.0 - 2023-10-11
744
+
745
+ ### Added
746
+
747
+ - Anthropic model support (Claude 2, Claude instant).
748
+
749
+ ## v0.41.0 - 2023-10-05
750
+
751
+ ### Changed
752
+
753
+ **breaking change**: generics simplification to enable dynamic model usage. Models can be used more easily as function parameters.
754
+
755
+ - `output` renamed to `value` in `asFullResponse()`
756
+ - model settings can no longer be configured as a model options parameter. Use `.withSettings()` instead.
757
+
758
+ ## v0.40.0 - 2023-10-04
759
+
760
+ ### Changed
761
+
762
+ **breaking change**: moved Pinecone integration into `@modelfusion/pinecone` module.
763
+
764
+ ## v0.39.0 - 2023-10-03
765
+
766
+ ### Added
767
+
768
+ - `readEventSource` for parsing a server-sent event stream using the JavaScript EventSource.
769
+
770
+ ### Changed
771
+
772
+ **breaking change**: generalization to use Schema instead of Zod.
773
+
774
+ - `MemoryVectorIndex.deserialize` requires a `Schema`, e.g. `new ZodSchema` (from ModelFusion).
775
+ - `readEventSourceStream` requires a `Schema`.
776
+ - `UncheckedJsonSchema[Schema/StructureDefinition]` renamed to `Unchecked[Schema/StructureDefinition]`.
777
+
778
+ ## v0.38.0 - 2023-10-02
779
+
780
+ ### Changed
781
+
782
+ **breaking change**: Generalized embeddings beyond text embedding.
783
+
784
+ - `embedText` renamed to `embed`.
785
+ - `embedTexts` renamed to `embedMany`
786
+ - Removed filtering from `VectorIndexRetriever` query (still available as a setting).
787
+
788
+ ## v0.37.0 - 2023-10-02
789
+
790
+ ### Added
791
+
792
+ - `VectorIndexRetriever` supports a filter option that is passed to the vector index.
793
+ - `MemoryVectorIndex` supports filter functions that are applied to the objects before calculating the embeddings.
794
+
795
+ ## v0.36.0 - 2023-10-02
796
+
797
+ ### Added
798
+
799
+ - `basic-text` logger logs function ids when available.
800
+ - `retrieve` produces events for logging and observability.
801
+
802
+ ## v0.35.2 - 2023-09-27
803
+
804
+ ### Fixed
805
+
806
+ - Support empty stop sequences when calling OpenAI text and chat models.
807
+
808
+ ## v0.35.1 - 2023-09-27
809
+
810
+ ### Fixed
811
+
812
+ - Fixed bugs in `streamStructure` partial JSON parsing.
813
+
814
+ ## v0.35.0 - 2023-09-26
815
+
816
+ ### Added
817
+
818
+ - `streamStructure` for streaming structured responses, e.g. from OpenAI function calls. Thanks [@bjsi](https://github.com/bjsi) for the input!
819
+
820
+ ## v0.34.0 - 2023-09-25
821
+
822
+ ### Added
823
+
824
+ - First version of event source utilities: `AsyncQueue`, `createEventSourceStream`, `readEventSourceStream`.
825
+
826
+ ## v0.33.1 - 2023-09-24
827
+
828
+ ### Fixed
829
+
830
+ - Remove resolution part from type definitions.
831
+
832
+ ## v0.33.0 - 2023-09-19
833
+
834
+ ### Changed
835
+
836
+ **breaking change**: Generalized vector store upsert/retrieve beyond text chunks:
837
+
838
+ - `upsertTextChunks` renamed to `upsertIntoVectorStore`. Syntax has changed.
839
+ - `retrieveTextChunks` renamed to `retrieve`
840
+ - `SimilarTextChunksFromVectorIndexRetriever` renamed to `VectorIndexRetriever`
841
+
842
+ ## v0.32.0 - 2023-09-19
843
+
844
+ ### Added
845
+
846
+ - OpenAI gpt-3.5-turbo-instruct model support.
847
+ - Autocomplete for Stability AI models (thanks [@Danielwinkelmann](https://github.com/Danielwinkelmann)!)
848
+
849
+ ### Changed
850
+
851
+ - Downgrade Zod version to 3.21.4 because of https://github.com/colinhacks/zod/issues/2697
852
+
853
+ ## v0.31.0 - 2023-09-13
854
+
855
+ ### Changed
856
+
857
+ - **breaking change**: Renamed chat format construction functions to follow the pattern `map[Chat|Instruction]PromptTo[FORMAT]Format()`, e.g. `mapInstructionPromptToAlpacaFormat()`, for easy auto-completion.
858
+
859
+ ### Removed
860
+
861
+ - **breaking change**: The prompts for `generateStructure` and `generateStructureOrText` have been simplified. You can remove the `OpenAIChatPrompt.forStructureCurried` (and similar) parts.
862
+
863
+ ## v0.30.0 - 2023-09-10
864
+
865
+ ### Added
866
+
867
+ - You can directly pass JSON schemas into `generateStructure` and `generateStructureOrText` calls without validation using `UncheckedJsonSchemaStructureDefinition`. This is useful when you need more flexility and don't require type inference. See `examples/basic/src/util/schema/generate-structure-unchecked-json-schema-example.ts`.
868
+
869
+ ### Changed
870
+
871
+ - **BREAKING CHANGE**: renamed `generateJson` and `generateJsonOrText` to `generateStructure` and `generateStructureOrText`.
872
+ - **BREAKING CHANGE**: introduced `ZodSchema` and `ZodStructureDefinition`. These are required for `generateStructure` and `generateStructureOrText` calls and in tools.
873
+ - **BREAKING CHANGE**: renamed the corresponding methods and objects.
874
+
875
+ Why this breaking change?
876
+
877
+ ModelFusion is currently tied to Zod, but there are many other type checking libraries out there, and Zod does not map perfectly to JSON Schema (which is used in OpenAI function calling).
878
+ Enabling you to use JSON Schema directly in ModelFusion is a first step towards decoupling ModelFusion from Zod.
879
+ You can also configure your own schema adapters that e.g. use Ajv or another library.
880
+ Since this change already affected all JSON generation calls and tools, I included other changes that I had planned in the same area (e.g., renaming to generateStructure and making it more consistent).
881
+
882
+ ## v0.29.0 - 2023-09-09
883
+
884
+ ### Added
885
+
886
+ - `describeImage` model function for image captioning and OCR. HuggingFace provider available.
887
+
888
+ ## v0.28.0 - 2023-09-09
889
+
890
+ ### Added
891
+
892
+ - BaseUrlApiConfiguration class for setting up API configurations with custom base URLs and headers.
893
+
894
+ ## v0.27.0 - 2023-09-07
895
+
896
+ ### Added
897
+
898
+ - Support for running OpenAI on Microsoft Azure.
899
+
900
+ ### Changed
901
+
902
+ - **Breaking change**: Introduce API configuration. This affects setting the baseUrl, throttling, and retries.
903
+ - Improved Helicone support via `HeliconeOpenAIApiConfiguration`.
904
+
905
+ ## v0.26.0 - 2023-09-06
906
+
907
+ ### Added
908
+
909
+ - LMNT speech synthesis support.
910
+
911
+ ## v0.25.0 - 2023-09-05
912
+
913
+ ### Changed
914
+
915
+ - Separated cost calculation from Run.
916
+
917
+ ## v0.24.1 - 2023-09-04
918
+
919
+ ### Added
920
+
921
+ - Exposed `logitBias` setting for OpenAI chat and text generation models.
922
+
923
+ ## v0.24.0 - 2023-09-02
924
+
925
+ ### Added
926
+
927
+ - Support for fine-tuned OpenAI models (for the `davinci-002`, `babbage-002`, and `gpt-3.5-turbo` base models).
928
+
929
+ ## v0.23.0 - 2023-08-31
930
+
931
+ ### Added
932
+
933
+ - Function logging support.
934
+ - Usage information for events.
935
+ - Filtering of model settings for events.
936
+
937
+ ## v0.22.0 - 2023-08-28
938
+
939
+ ### Changed
940
+
941
+ - **Breaking change**: Restructured the function call events.
942
+
943
+ ## v0.21.0 - 2023-08-26
944
+
945
+ ### Changed
946
+
947
+ - **Breaking change**: Reworked the function observer system. See [Function observers](https://modelfusion.dev/guide/util/observer) for details on how to use the new system.
948
+
949
+ ## v0.20.0 - 2023-08-24
950
+
951
+ ### Changed
952
+
953
+ - **Breaking change**: Use `.asFullResponse()` to get full responses from model functions (replaces the `fullResponse: true` option).
954
+
955
+ ## v0.19.0 - 2023-08-23
956
+
957
+ ### Added
958
+
959
+ - Support for "babbage-002" and "davinci-002" OpenAI base models.
960
+
961
+ ### Fixed
962
+
963
+ - Choose correct tokenizer for older OpenAI text models.
964
+
965
+ ## v0.18.0 - 2023-08-22
966
+
967
+ ### Added
968
+
969
+ - Support for ElevenLabs speech synthesis parameters.
970
+
971
+ ## v0.17.0 - 2023-08-21
972
+
973
+ ### Added
974
+
975
+ - `generateSpeech` function to generate speech from text.
976
+ - ElevenLabs support.
977
+
978
+ ## v0.15.0 - 2023-08-21
979
+
980
+ ### Changed
981
+
982
+ - Introduced unified `stopSequences` and `maxCompletionTokens` properties for all text generation models. **Breaking change**: `maxCompletionTokens` and `stopSequences` are part of the base TextGenerationModel. Specific names for these properties in models have been replaced by this, e.g. `maxTokens` in OpenAI models is `maxCompletionTokens`.
983
+
984
+ ## v0.14.0 - 2023-08-17
985
+
986
+ ### Changed
987
+
988
+ - **Breaking change**: Renamed prompt mappings (and related code) to prompt format.
989
+ - Improved type inference for WebSearchTool and executeTool.
990
+
991
+ ## v0.12.0 - 2023-08-15
992
+
993
+ ### Added
994
+
995
+ - JsonTextGenerationModel and InstructionWithSchemaPrompt to support generateJson on text generation models.
996
+
997
+ ## v0.11.0 - 2023-08-14
998
+
999
+ ### Changed
1000
+
1001
+ - WebSearchTool signature updated.
1002
+
1003
+ ## v0.10.0 - 2023-08-13
1004
+
1005
+ ### Added
1006
+
1007
+ - Convenience functions to create OpenAI chat messages from tool calls and results.
1008
+
1009
+ ## v0.9.0 - 2023-08-13
1010
+
1011
+ ### Added
1012
+
1013
+ - `WebSearchTool` definition to support the SerpAPI tool (separate package: `@modelfusion/serpapi-tools`)
1014
+
1015
+ ## v0.8.0 - 2023-08-12
1016
+
1017
+ ### Added
1018
+
1019
+ - `executeTool` function that directly executes a single tool and records execution metadata.
1020
+
1021
+ ### Changed
1022
+
1023
+ - Reworked event system and introduced RunFunctionEvent.
1024
+
1025
+ ## v0.7.0 - 2023-08-10
1026
+
1027
+ ### Changed
1028
+
1029
+ - **Breaking change**: Model functions return a simple object by default to make the 95% use case easier. You can use the `fullResponse` option to get a richer response object that includes the original model response and metadata.
1030
+
1031
+ ## v0.6.0 - 2023-08-07
1032
+
1033
+ ### Added
1034
+
1035
+ - `splitTextChunk` function.
1036
+
1037
+ ### Changed
1038
+
1039
+ - **Breaking change**: Restructured text splitter functions.
1040
+
1041
+ ## v0.5.0 - 2023-08-07
1042
+
1043
+ ### Added
1044
+
1045
+ - `splitTextChunks` function.
1046
+ - Chat with PDF demo.
1047
+
1048
+ ### Changed
1049
+
1050
+ - **Breaking change**: Renamed VectorIndexSimilarTextChunkRetriever to SimilarTextChunksFromVectorIndexRetriever.
1051
+ - **Breaking change**: Renamed 'content' property in TextChunk to 'text.
1052
+
1053
+ ### Removed
1054
+
1055
+ - `VectorIndexTextChunkStore`
1056
+
1057
+ ## v0.4.1 - 2023-08-06
1058
+
1059
+ ### Fixed
1060
+
1061
+ - Type inference bug in `trimChatPrompt`.
1062
+
1063
+ ## v0.4.0 - 2023-08-06
1064
+
1065
+ ### Added
1066
+
1067
+ - HuggingFace text embedding support.
1068
+
1069
+ ## v0.3.0 - 2023-08-05
1070
+
1071
+ ### Added
1072
+
1073
+ - Helicone observability integration.
1074
+
1075
+ ## v0.2.0 - 2023-08-04
1076
+
1077
+ ### Added
1078
+
1079
+ - Instruction prompts can contain optional `input` property.
1080
+ - Alpaca instruction prompt mapping.
1081
+ - Vicuna chat prompt mapping.
1082
+
1083
+ ## v0.1.1 - 2023-08-02
1084
+
1085
+ ### Changed
1086
+
1087
+ - Docs updated to ModelFusion.
1088
+
1089
+ ## v0.1.0 - 2023-08-01
1090
+
1091
+ ### Changed
1092
+
1093
+ - **Breaking Change**: Renamed to `modelfusion` (from `ai-utils.js`).
1094
+
1095
+ ## v0.0.43 - 2023-08-01
1096
+
1097
+ ### Changed
1098
+
1099
+ - **Breaking Change**: model functions return rich objects that include the result, the model response and metadata. This enables you to access the original model response easily when you need it and also use the metadata outside of runs.
1100
+
1101
+ ## v0.0.42 - 2023-07-31
1102
+
1103
+ ### Added
1104
+
1105
+ - `trimChatPrompt()` function to fit chat prompts into the context window and leave enough space for the completion.
1106
+ - `maxCompletionTokens` property on TextGenerationModels.
1107
+
1108
+ ### Changed
1109
+
1110
+ - Renamed `withMaxTokens` to `withMaxCompletionTokens` on TextGenerationModels.
1111
+
1112
+ ### Removed
1113
+
1114
+ - `composeRecentMessagesOpenAIChatPrompt` function (use `trimChatPrompt` instead).
1115
+
1116
+ ## v0.0.41 - 2023-07-30
1117
+
1118
+ ### Added
1119
+
1120
+ - ChatPrompt concept (with chat prompt mappings for text, OpenAI chat, and Llama 2 prompts).
1121
+
1122
+ ### Changed
1123
+
1124
+ - Renamed prompt mappings and changed into functions.
1125
+
1126
+ ## v0.0.40 - 2023-07-30
1127
+
1128
+ ### Added
1129
+
1130
+ - Prompt mapping support for text generation and streaming.
1131
+ - Added instruction prompt concept and mapping.
1132
+ - Option to specify context window size for Llama.cpp text generation models.
1133
+
1134
+ ### Changed
1135
+
1136
+ - Renamed 'maxTokens' to 'contextWindowSize' where applicable.
1137
+ - Restructured how tokenizers are exposed by text generation models.
1138
+
1139
+ ## v0.0.39 - 2023-07-26
1140
+
1141
+ ### Added
1142
+
1143
+ - llama.cpp embedding support.
1144
+
1145
+ ## v0.0.38 - 2023-07-24
1146
+
1147
+ ### Changed
1148
+
1149
+ - `zod` and `zod-to-json-schema` are peer dependencies and no longer included in the package.
1150
+
1151
+ ## v0.0.37 - 2023-07-23
1152
+
1153
+ ### Changed
1154
+
1155
+ - `generateJsonOrText`, `useToolOrGenerateText`, `useTool` return additional information in the response (e.g. the parameters and additional text).
1156
+
1157
+ ## v0.0.36 - 2023-07-23
1158
+
1159
+ ### Changed
1160
+
1161
+ - Renamed `callTool` to `useTool` and `callToolOrGenerateText` to `useToolOrGenerateText`.
1162
+
1163
+ ## v0.0.35 - 2023-07-22
1164
+
1165
+ ### Added
1166
+
1167
+ - `generateJsonOrText`
1168
+ - Tools: `Tool` class, `callTool`, `callToolOrGenerateText`
1169
+
1170
+ ### Changed
1171
+
1172
+ - Restructured "generateJson" arguments.
1173
+
1174
+ ## v0.0.34 - 2023-07-18
1175
+
1176
+ ### Removed
1177
+
1178
+ - `asFunction` model function variants. Use JavaScript lamba functions instead.
1179
+
1180
+ ## v0.0.33 - 2023-07-18
1181
+
1182
+ ### Added
1183
+
1184
+ - OpenAIChatAutoFunctionPrompt to call the OpenAI functions API with multiple functions in 'auto' mode.
1185
+
1186
+ ## v0.0.32 - 2023-07-15
1187
+
1188
+ ### Changed
1189
+
1190
+ - Changed the prompt format of the generateJson function.
1191
+
1192
+ ## v0.0.31 - 2023-07-14
1193
+
1194
+ ### Changed
1195
+
1196
+ - Reworked interaction with vectors stores. Removed VectorDB, renamed VectorStore to VectorIndex, and introduced upsertTextChunks and retrieveTextChunks functions.
1197
+
1198
+ ## v0.0.30 - 2023-07-13
1199
+
1200
+ ### Fixed
1201
+
1202
+ - Bugs related to performance. not being available.
1203
+
1204
+ ## v0.0.29 - 2023-07-13
1205
+
1206
+ ### Added
1207
+
1208
+ - Llama.cpp tokenization support.
1209
+
1210
+ ### Changed
1211
+
1212
+ - Split Tokenizer API into BasicTokenizer and FullTokenizer.
1213
+ - Introduce countTokens function (replacing Tokenizer.countTokens).
1214
+
1215
+ ## v0.0.28 - 2023-07-12
1216
+
1217
+ ### Added
1218
+
1219
+ - Events for streamText.
1220
+
1221
+ ## v0.0.27 - 2023-07-11
1222
+
1223
+ ### Added
1224
+
1225
+ - TextDeltaEventSource for Client/Server streaming support.
1226
+
1227
+ ### Fixed
1228
+
1229
+ - End-of-stream bug in Llama.cpp text streaming.
1230
+
1231
+ ## v0.0.26 - 2023-07-11
1232
+
1233
+ ### Added
1234
+
1235
+ - Streaming support for Cohere text generation models.
1236
+
1237
+ ## v0.0.25 - 2023-07-10
1238
+
1239
+ ### Added
1240
+
1241
+ - Streaming support for OpenAI text completion models.
1242
+ - OpenAI function streaming support (in low-level API).
1243
+
1244
+ ## v0.0.24 - 2023-07-09
1245
+
1246
+ ### Added
1247
+
1248
+ - Generalized text streaming (async string iterable, useful for command line streaming).
1249
+ - Streaming support for Llama.cpp text generation.
1250
+
1251
+ ## v0.0.23 - 2023-07-08
1252
+
1253
+ ### Added
1254
+
1255
+ - Llama.cpp text generation support.
1256
+
1257
+ ## v0.0.22 - 2023-07-08
1258
+
1259
+ ### Changed
1260
+
1261
+ - Convert all main methods (e.g. `model.generateText(...)`) to a functional API (i.e., `generateText(model, ...)`).
1262
+
1263
+ ## v0.0.21 - 2023-07-07
1264
+
1265
+ ### New
1266
+
1267
+ - JSON generation model.
1268
+
1269
+ ## v0.0.20 - 2023-07-02
1270
+
1271
+ ### New
1272
+
1273
+ - Automatic1111 image generation provider.
1274
+
1275
+ ## v0.0.19 - 2023-06-30
1276
+
1277
+ ### New
1278
+
1279
+ - Cost calculation for OpenAI image generation and transcription models.
1280
+
1281
+ ## v0.0.18 - 2023-06-28
1282
+
1283
+ ### New
1284
+
1285
+ - Cost calculation for Open AI text generation, chat and embedding models.
1286
+
1287
+ ### Changed
1288
+
1289
+ - Renamed RunContext to Run. Introduced DefaultRun.
1290
+ - Changed events and observers.
1291
+
1292
+ ## v0.0.17 - 2023-06-14
1293
+
1294
+ ### New
1295
+
1296
+ 1. Updated OpenAI models.
1297
+ 1. Low-level support for OpenAI chat functions API (via `OpenAIChatModel.callApi`).
1298
+ 1. TranscriptionModel and OpenAITranscriptionModel (using `whisper`)
1299
+
1300
+ ### Changed
1301
+
1302
+ 1. Single optional parameter for functions/method that contains run, functionId, etc.
1303
+
1304
+ ## v0.0.16 - 2023-06-13
1305
+
1306
+ ### Fixed
1307
+
1308
+ 1. Retry is not attempted when you ran out of OpenAI credits.
1309
+ 1. Vercel edge function support (switched to nanoid for unique IDs).
1310
+
1311
+ ### Changed
1312
+
1313
+ 1. Improved OpenAI chat streaming API.
1314
+ 1. Changed `asFunction` variants from namespaced functions into stand-alone functions.
1315
+
1316
+ ## v0.0.15 - 2023-06-12
1317
+
1318
+ ### Changed
1319
+
1320
+ 1. Documentation update.
1321
+
1322
+ ## v0.0.14 - 2023-06-11
1323
+
1324
+ ### Changed
1325
+
1326
+ 1. Major rework of embedding APIs.
1327
+
1328
+ ## v0.0.13 - 2023-06-10
1329
+
1330
+ ### Changed
1331
+
1332
+ 1. Major rework of text and image generation APIs.
1333
+
1334
+ ## v0.0.12 - 2023-06-06
1335
+
1336
+ ## v0.0.11 - 2023-06-05
1337
+
1338
+ ### Changed
1339
+
1340
+ 1. Various renames.
1341
+
1342
+ ## v0.0.10 - 2023-06-04
1343
+
1344
+ ### New
1345
+
1346
+ 1. Pinecone VectorDB support
1347
+ 1. Cohere tokenization support
1348
+
1349
+ ## v0.0.9 - 2023-06-03
1350
+
1351
+ ### New
1352
+
1353
+ 1. OpenAI DALL-E image generation support
1354
+ 1. `generateImage` function
1355
+ 1. Throttling and retries on model level
1356
+
1357
+ ## v0.0.8 - 2023-06-02
1358
+
1359
+ ### New
1360
+
1361
+ 1. Stability AI image generation support
1362
+ 1. Image generation Next.js example
1363
+
1364
+ ### Changed
1365
+
1366
+ 1. Updated PDF to tweet example with style transfer
1367
+
1368
+ ## v0.0.7 - 2023-06-01
1369
+
1370
+ ### New
1371
+
1372
+ 1. Hugging Face text generation support
1373
+ 1. Memory vector DB
1374
+
1375
+ ## v0.0.6 - 2023-05-31
1376
+
1377
+ ### New
1378
+
1379
+ 1. Cohere embedding API support
1380
+
1381
+ ### Changes
1382
+
1383
+ 1. Restructured retry logic
1384
+ 1. `embed` embeds many texts at once
1385
+
1386
+ ## v0.0.5 - 2023-05-30
1387
+
1388
+ ### New
1389
+
1390
+ 1. Cohere text generation support
1391
+ 1. OpenAI chat streams can be returned as delta async iterables
1392
+ 1. Documentation of integration APIs and models
1393
+
1394
+ ## v0.0.4 - 2023-05-29
1395
+
1396
+ ### New
1397
+
1398
+ 1. OpenAI embedding support
1399
+ 1. Text embedding functions
1400
+ 1. Chat streams can be returned as ReadableStream or AsyncIterable
1401
+ 1. Basic examples under `examples/basic`
1402
+ 1. Initial documentation available at [modelfusion.dev](https://modelfusion.dev)
1403
+
1404
+ ## v0.0.3 - 2023-05-28
1405
+
1406
+ ### New
1407
+
1408
+ 1. Voice recording and transcription Next.js app example.
1409
+ 1. OpenAI transcription support (Whisper).
1410
+
1411
+ ## v0.0.2 - 2023-05-27
1412
+
1413
+ ### New
1414
+
1415
+ 1. BabyAGI Example in TypeScript
1416
+ 1. TikToken for OpenAI: We've added tiktoken to aid in tokenization and token counting, including those for message and prompt overhead tokens in chat.
1417
+ 1. Tokenization-based Recursive Splitter: A new splitter that operates recursively using tokenization.
1418
+ 1. Prompt Management Utility: An enhancement to fit recent chat messages into the context window.
1419
+
1420
+ ## v0.0.1 - 2023-05-26
1421
+
1422
+ ### New
1423
+
1424
+ 1. AI Chat Example using Next.js: An example demonstrating AI chat implementation using Next.js.
1425
+ 1. PDF to Twitter Thread Example: This shows how a PDF can be converted into a Twitter thread.
1426
+ 1. OpenAI Chat Completion Streaming Support: A feature providing real-time response capabilities using OpenAI's chat completion streaming.
1427
+ 1. OpenAI Chat and Text Completion Support: This addition enables the software to handle both chat and text completions from OpenAI.
1428
+ 1. Retry Management: A feature to enhance resilience by managing retry attempts for tasks.
1429
+ 1. Task Progress Reporting and Abort Signals: This allows users to track the progress of tasks and gives the ability to abort tasks when needed.
1430
+ 1. Recursive Character Splitter: A feature to split text into characters recursively for more detailed text analysis.
1431
+ 1. Recursive Text Mapping: This enables recursive mapping of text, beneficial for tasks like summarization or extraction.
1432
+ 1. Split-Map-Filter-Reduce for Text Processing: A process chain developed for sophisticated text handling, allowing operations to split, map, filter, and reduce text data.