modelfusion 0.0.44 → 0.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 +17 -17
- package/package.json +3 -3
package/README.md
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
#
|
1
|
+
# ModelFusion
|
2
2
|
|
3
3
|
> ### Build AI applications, chatbots, and agents with JavaScript and TypeScript.
|
4
4
|
|
5
5
|
[](https://twitter.com/lgrammel)
|
6
|
-
[](https://www.npmjs.com/package/modelfusion)
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
8
8
|
|
9
9
|
[Introduction](#introduction) | [Quick Install](#quick-install) | [Usage](#usage-examples) | [Features](#features) | [Integrations](#integrations) | [Documentation](#documentation) | [Examples](#more-examples) | [ai-utils.dev](https://ai-utils.dev)
|
10
10
|
|
11
11
|
## Disclaimer
|
12
12
|
|
13
|
-
|
13
|
+
ModelFusion is currently in its initial development phase. **Until version 1.0 there may be frequent breaking changes.**
|
14
14
|
|
15
15
|
## Introduction
|
16
16
|
|
17
|
-
|
17
|
+
ModelFusion is a library for building AI apps, chatbots, and agents. It provides abstractions for working with AI models, vector indices, and tools. It was designed with the following goals in mind:
|
18
18
|
|
19
|
-
- **Provide type inference and validation**:
|
20
|
-
- **Flexibility and control**: AI application development can be complex and unique to each project. With
|
19
|
+
- **Provide type inference and validation**: ModelFusion uses TypeScript and [Zod](https://github.com/colinhacks/zod) to infer types whereever possible and to validate AI responses.
|
20
|
+
- **Flexibility and control**: AI application development can be complex and unique to each project. With ModelFusion, you have complete control over the prompts, the model settings, and the control flow of your application. You can also access the full responses from the models and metadata easily to build what you need.
|
21
21
|
- **Integrate support features**: Essential features like logging, retries, throttling, and error handling are integrated and easily configurable.
|
22
22
|
|
23
23
|
## Quick Install
|
24
24
|
|
25
25
|
```sh
|
26
|
-
npm install
|
26
|
+
npm install modelfusion
|
27
27
|
```
|
28
28
|
|
29
29
|
You need to install `zod` and a matching version of `zod-to-json-schema` (peer dependencies):
|
@@ -100,7 +100,7 @@ const { textStream } = await streamText(
|
|
100
100
|
|
101
101
|
#### Metadata and original responses
|
102
102
|
|
103
|
-
Most
|
103
|
+
Most ModelFusion model functions return rich results that include the original response and metadata.
|
104
104
|
|
105
105
|
```ts
|
106
106
|
const { text, response, metadata } = await generateText(
|
@@ -382,47 +382,47 @@ const { chunks } = await retrieveTextChunks(
|
|
382
382
|
|
383
383
|
## More Examples
|
384
384
|
|
385
|
-
### [Basic Examples](https://github.com/lgrammel/
|
385
|
+
### [Basic Examples](https://github.com/lgrammel/modelfusion/tree/main/examples/basic)
|
386
386
|
|
387
387
|
Examples for the individual functions and objects.
|
388
388
|
|
389
|
-
### [PDF to Tweet](https://github.com/lgrammel/
|
389
|
+
### [PDF to Tweet](https://github.com/lgrammel/modelfusion/tree/main/examples/pdf-to-tweet)
|
390
390
|
|
391
391
|
> _terminal app_, _PDF parsing_, _recursive information extraction_, _in memory vector index, \_style example retrieval_, _OpenAI GPT-4_, _cost calculation_
|
392
392
|
|
393
393
|
Extracts information about a topic from a PDF and writes a tweet in your own style about it.
|
394
394
|
|
395
|
-
### [AI Chat (Next.JS)](https://github.com/lgrammel/
|
395
|
+
### [AI Chat (Next.JS)](https://github.com/lgrammel/modelfusion/tree/main/examples/ai-chat-next-js)
|
396
396
|
|
397
397
|
> _Next.js app_, _OpenAI GPT-3.5-turbo_, _streaming_, _abort handling_
|
398
398
|
|
399
399
|
A basic web chat with an AI assistant, implemented as a Next.js app.
|
400
400
|
|
401
|
-
### [Image generator (Next.js)](https://github.com/lgrammel/
|
401
|
+
### [Image generator (Next.js)](https://github.com/lgrammel/modelfusion/tree/main/examples/image-generator-next-js)
|
402
402
|
|
403
403
|
> _Next.js app_, _Stability AI image generation_
|
404
404
|
|
405
405
|
Create an 19th century painting image for your input.
|
406
406
|
|
407
|
-
### [Voice recording and transcription (Next.js)](https://github.com/lgrammel/
|
407
|
+
### [Voice recording and transcription (Next.js)](https://github.com/lgrammel/modelfusion/tree/main/examples/voice-recording-next-js)
|
408
408
|
|
409
409
|
> _Next.js app_, _OpenAI Whisper_
|
410
410
|
|
411
411
|
Record audio with push-to-talk and transcribe it using Whisper, implemented as a Next.js app. The app shows a list of the transcriptions.
|
412
412
|
|
413
|
-
### [BabyAGI Classic](https://github.com/lgrammel/
|
413
|
+
### [BabyAGI Classic](https://github.com/lgrammel/modelfusion/tree/main/examples/baby-agi)
|
414
414
|
|
415
415
|
> _terminal app_, _agent_, _BabyAGI_, _OpenAI text-davinci-003_
|
416
416
|
|
417
417
|
TypeScript implementation of the classic [BabyAGI](https://github.com/yoheinakajima/babyagi/blob/main/classic/babyagi.py) by [@yoheinakajima](https://twitter.com/yoheinakajima) without embeddings.
|
418
418
|
|
419
|
-
### [Middle school math](https://github.com/lgrammel/
|
419
|
+
### [Middle school math](https://github.com/lgrammel/modelfusion/tree/main/examples/middle-school-math)
|
420
420
|
|
421
421
|
> _terminal app_, _agent_, _tools_, _GPT-4_
|
422
422
|
|
423
423
|
Small agent that solves middle school math problems. It uses a calculator tool to solve the problems.
|
424
424
|
|
425
|
-
### [Terminal Chat (llama.cpp)](https://github.com/lgrammel/
|
425
|
+
### [Terminal Chat (llama.cpp)](https://github.com/lgrammel/modelfusion/tree/main/examples/terminal-chat-llamacpp)
|
426
426
|
|
427
427
|
> _Terminal app_, _chat_, _llama.cpp_
|
428
428
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "modelfusion",
|
3
3
|
"description": "Build AI applications, chatbots, and agents with JavaScript and TypeScript.",
|
4
|
-
"version": "0.0
|
4
|
+
"version": "0.1.0",
|
5
5
|
"author": "Lars Grammel",
|
6
6
|
"license": "MIT",
|
7
7
|
"keywords": [
|
@@ -20,10 +20,10 @@
|
|
20
20
|
"homepage": "https://ai-utils.dev/",
|
21
21
|
"repository": {
|
22
22
|
"type": "git",
|
23
|
-
"url": "https://github.com/lgrammel/
|
23
|
+
"url": "https://github.com/lgrammel/modelfusion"
|
24
24
|
},
|
25
25
|
"bugs": {
|
26
|
-
"url": "https://github.com/lgrammel/
|
26
|
+
"url": "https://github.com/lgrammel/modelfusion/issues"
|
27
27
|
},
|
28
28
|
"type": "module",
|
29
29
|
"sideEffects": false,
|