From 3beb8b4dc1510f202220dc43d8f6b4cd5035d89c Mon Sep 17 00:00:00 2001 From: Lars Grammel Date: Sat, 20 Jan 2024 10:49:15 +0100 Subject: [PATCH] v0.128.0 --- CHANGELOG.md | 29 ++++++++++++++ examples/babyagi-agent/package.json | 2 +- examples/basic/package.json | 2 +- examples/chatbot-next-js/package.json | 2 +- examples/cloudflare-workers/package.json | 2 +- examples/image-generator-next-js/package.json | 2 +- .../middle-school-math-agent/package.json | 2 +- examples/pdf-chat-terminal/package.json | 2 +- examples/pdf-to-tweet/package.json | 2 +- .../package.json | 2 +- examples/voice-recording-next-js/package.json | 2 +- examples/wikipedia-agent/package.json | 2 +- packages/@modelfusion-pinecone/package.json | 2 +- packages/@modelfusion-sqlite-vss/package.json | 2 +- packages/@modelfusion-vercel-ai/package.json | 2 +- .../modelfusion-experimental/package.json | 2 +- packages/modelfusion/package.json | 2 +- pnpm-lock.yaml | 40 +++++++++---------- test-environments/commonjs/package.json | 2 +- tools/google-custom-search-tool/package.json | 2 +- tools/mathjs-tool/package.json | 2 +- tools/mediawiki-search-tool/package.json | 2 +- tools/serpapi-tool/package.json | 2 +- 23 files changed, 70 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff414f13..1879ef71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## v0.128.0 - 2024-01-20 + +### Changed + +- **breaking change**: ModelFusion uses `Uint8Array` instead of `Buffer` for better cross-platform compatibility (see also ["Goodbye, Node.js Buffer"](https://sindresorhus.com/blog/goodbye-nodejs-buffer)). This can lead to breaking changes in your code if you use `Buffer`-specific methods. +- **breaking change**: Image content in multi-modal instruction and chat inputs (e.g. for GPT Vision) is passed in the `image` property (instead of `base64Image`) and supports both base64 strings and `Uint8Array` inputs: + + ```ts + const image = fs.readFileSync(path.join("data", "example-image.png"), { + encoding: "base64", + }); + + const textStream = await streamText({ + model: openai.ChatTextGenerator({ + model: "gpt-4-vision-preview", + maxGenerationTokens: 1000, + }), + + prompt: [ + openai.ChatMessage.user([ + { type: "text", text: "Describe the image in detail:\n\n" }, + { type: "image", image, mimeType: "image/png" }, + ]), + ], + }); + ``` + +- OpenAI-compatible providers with predefined API configurations have a customized provider name that shows up in the events. + ## v0.127.0 - 2024-01-15 ### Changed diff --git a/examples/babyagi-agent/package.json b/examples/babyagi-agent/package.json index d31c6941..69c0a7b4 100644 --- a/examples/babyagi-agent/package.json +++ b/examples/babyagi-agent/package.json @@ -12,7 +12,7 @@ "commander": "10.0.1", "dotenv": "16.3.1", "jsdom": "^22.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "serpapi": "^2.0.0" }, "devDependencies": { diff --git a/examples/basic/package.json b/examples/basic/package.json index 0fec05f8..0080c170 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -12,7 +12,7 @@ "@pinecone-database/pinecone": "0.1.6", "dotenv": "16.3.1", "secure-json-parse": "2.7.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "nanoid": "3.3.6", "better-sqlite3": "9.0.0", diff --git a/examples/chatbot-next-js/package.json b/examples/chatbot-next-js/package.json index 3816ed29..ceef8cb4 100644 --- a/examples/chatbot-next-js/package.json +++ b/examples/chatbot-next-js/package.json @@ -20,7 +20,7 @@ "@emotion/styled": "11.10.8", "@mui/icons-material": "5.11.16", "@mui/material": "5.12.2", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "next": "13.5.1", "react": "18.2.0", diff --git a/examples/cloudflare-workers/package.json b/examples/cloudflare-workers/package.json index 0ea277c3..e326252f 100644 --- a/examples/cloudflare-workers/package.json +++ b/examples/cloudflare-workers/package.json @@ -15,6 +15,6 @@ "wrangler": "^3.22.1" }, "dependencies": { - "modelfusion": "0.127.0" + "modelfusion": "0.128.0" } } diff --git a/examples/image-generator-next-js/package.json b/examples/image-generator-next-js/package.json index b2937304..7d3d02c8 100644 --- a/examples/image-generator-next-js/package.json +++ b/examples/image-generator-next-js/package.json @@ -20,7 +20,7 @@ "dependencies": { "@emotion/react": "^11.11.0", "@emotion/styled": "^11.11.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "next": "13.5.1", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/middle-school-math-agent/package.json b/examples/middle-school-math-agent/package.json index 56fff2d6..e820709a 100644 --- a/examples/middle-school-math-agent/package.json +++ b/examples/middle-school-math-agent/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@modelfusion/mathjs-tool": "0.1.1", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "dotenv": "16.3.1", "zod": "3.22.4" }, diff --git a/examples/pdf-chat-terminal/package.json b/examples/pdf-chat-terminal/package.json index 99e05162..9dd76562 100644 --- a/examples/pdf-chat-terminal/package.json +++ b/examples/pdf-chat-terminal/package.json @@ -9,7 +9,7 @@ }, "private": true, "dependencies": { - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "commander": "10.0.1", "dotenv": "16.3.1", "pdfjs-dist": "3.6.172" diff --git a/examples/pdf-to-tweet/package.json b/examples/pdf-to-tweet/package.json index ce85a3c9..08f14501 100644 --- a/examples/pdf-to-tweet/package.json +++ b/examples/pdf-to-tweet/package.json @@ -9,7 +9,7 @@ }, "private": true, "dependencies": { - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "commander": "10.0.1", "dotenv": "16.3.1", diff --git a/examples/speech-streaming-vite-react-fastify/package.json b/examples/speech-streaming-vite-react-fastify/package.json index 84fc24b7..6517762c 100644 --- a/examples/speech-streaming-vite-react-fastify/package.json +++ b/examples/speech-streaming-vite-react-fastify/package.json @@ -19,7 +19,7 @@ "clsx": "^2.0.0", "dotenv": "16.3.1", "fastify": "^4.23.2", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/voice-recording-next-js/package.json b/examples/voice-recording-next-js/package.json index eba9add8..083fdda7 100644 --- a/examples/voice-recording-next-js/package.json +++ b/examples/voice-recording-next-js/package.json @@ -18,7 +18,7 @@ "@emotion/styled": "11.10.8", "@mui/icons-material": "5.11.16", "@mui/material": "5.12.2", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "formidable": "2.1.1", "next": "13.5.1", diff --git a/examples/wikipedia-agent/package.json b/examples/wikipedia-agent/package.json index f8b0baab..6575c0ae 100644 --- a/examples/wikipedia-agent/package.json +++ b/examples/wikipedia-agent/package.json @@ -14,7 +14,7 @@ "dotenv": "16.3.1", "html-to-text": "9.0.5", "jsdom": "^22.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "modelfusion-experimental": "0.5.0", "zod": "3.22.4" }, diff --git a/packages/@modelfusion-pinecone/package.json b/packages/@modelfusion-pinecone/package.json index 6887fac5..d871260f 100644 --- a/packages/@modelfusion-pinecone/package.json +++ b/packages/@modelfusion-pinecone/package.json @@ -54,7 +54,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0" + "modelfusion": "0.128.0" }, "peerDependencies": { "modelfusion": ">=0.72.0 <1.0.0-0", diff --git a/packages/@modelfusion-sqlite-vss/package.json b/packages/@modelfusion-sqlite-vss/package.json index 61480574..a1fae5db 100644 --- a/packages/@modelfusion-sqlite-vss/package.json +++ b/packages/@modelfusion-sqlite-vss/package.json @@ -54,7 +54,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "sqlite-vss": "^0.1.2", "better-sqlite3": "^9.0.0" }, diff --git a/packages/@modelfusion-vercel-ai/package.json b/packages/@modelfusion-vercel-ai/package.json index 6508bb47..7f03f2ff 100644 --- a/packages/@modelfusion-vercel-ai/package.json +++ b/packages/@modelfusion-vercel-ai/package.json @@ -56,7 +56,7 @@ "ai": ">= 2.2.27", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0" + "modelfusion": "0.128.0" }, "peerDependencies": { "modelfusion": ">=0.89.0", diff --git a/packages/modelfusion-experimental/package.json b/packages/modelfusion-experimental/package.json index ee9a8185..4d2f89b2 100644 --- a/packages/modelfusion-experimental/package.json +++ b/packages/modelfusion-experimental/package.json @@ -76,6 +76,6 @@ "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", "fastify": "^4.0.0", - "modelfusion": "0.127.0" + "modelfusion": "0.128.0" } } diff --git a/packages/modelfusion/package.json b/packages/modelfusion/package.json index fa7f54ea..17534b01 100644 --- a/packages/modelfusion/package.json +++ b/packages/modelfusion/package.json @@ -1,7 +1,7 @@ { "name": "modelfusion", "description": "The TypeScript library for building AI applications.", - "version": "0.127.0", + "version": "0.128.0", "author": "Lars Grammel", "license": "MIT", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a722c5b..ab64f968 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,7 +103,7 @@ importers: specifier: ^22.1.0 version: 22.1.0 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist serpapi: specifier: ^2.0.0 @@ -143,7 +143,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -186,7 +186,7 @@ importers: specifier: 5.12.2 version: 5.12.2(@emotion/react@11.10.8)(@emotion/styled@11.10.8)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -229,7 +229,7 @@ importers: examples/cloudflare-workers: dependencies: modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist devDependencies: '@cloudflare/workers-types': @@ -251,7 +251,7 @@ importers: specifier: ^11.11.0 version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.15)(react@18.2.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist next: specifier: 13.5.1 @@ -291,7 +291,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -310,7 +310,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist pdfjs-dist: specifier: 3.6.172 @@ -329,7 +329,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -369,7 +369,7 @@ importers: specifier: ^4.23.2 version: 4.25.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -448,7 +448,7 @@ importers: specifier: 2.1.1 version: 2.1.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -494,7 +494,7 @@ importers: specifier: ^22.1.0 version: 22.1.0 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -534,7 +534,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../modelfusion/dist publishDirectory: dist @@ -562,7 +562,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../modelfusion/dist sqlite-vss: specifier: ^0.1.2 @@ -593,7 +593,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../modelfusion/dist publishDirectory: dist @@ -678,7 +678,7 @@ importers: specifier: ^4.0.0 version: 4.25.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../modelfusion/dist publishDirectory: dist @@ -688,7 +688,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist test-environments/esm: @@ -718,7 +718,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -747,7 +747,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -772,7 +772,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -801,7 +801,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.127.0 + specifier: 0.128.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 diff --git a/test-environments/commonjs/package.json b/test-environments/commonjs/package.json index ebd7b212..3f8b5469 100644 --- a/test-environments/commonjs/package.json +++ b/test-environments/commonjs/package.json @@ -6,7 +6,7 @@ "start": "node src/index.js" }, "dependencies": { - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "dotenv": "16.3.1" } } diff --git a/tools/google-custom-search-tool/package.json b/tools/google-custom-search-tool/package.json index e68de7de..2f5f70f2 100644 --- a/tools/google-custom-search-tool/package.json +++ b/tools/google-custom-search-tool/package.json @@ -55,7 +55,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/mathjs-tool/package.json b/tools/mathjs-tool/package.json index 4d56d20c..0e6e07dd 100644 --- a/tools/mathjs-tool/package.json +++ b/tools/mathjs-tool/package.json @@ -58,7 +58,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/mediawiki-search-tool/package.json b/tools/mediawiki-search-tool/package.json index 3ac1533d..9d0889cd 100644 --- a/tools/mediawiki-search-tool/package.json +++ b/tools/mediawiki-search-tool/package.json @@ -56,7 +56,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/serpapi-tool/package.json b/tools/serpapi-tool/package.json index ae01f48c..d115fa20 100644 --- a/tools/serpapi-tool/package.json +++ b/tools/serpapi-tool/package.json @@ -58,7 +58,7 @@ "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", "eslint-config-prettier": "9.1.0", - "modelfusion": "0.127.0", + "modelfusion": "0.128.0", "zod": "3.22.4" }, "peerDependencies": {