From 1f45c335e664e4edc30cb39e4a733b2da2339a7f Mon Sep 17 00:00:00 2001 From: Lars Grammel Date: Sat, 13 Jan 2024 19:14:19 +0100 Subject: [PATCH] v0.123.0 --- CHANGELOG.md | 37 +++++++++++++++++ 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, 78 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d185469bf..25edec380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## v0.123.0 - 2024-01-13 + +### Added + +- `classify` model function ([docs](https://modelfusion.dev/guide/function/classify)) for classifying values. The `SemanticClassifier` has been renamed to `EmbeddingSimilarityClassifier` and can be used in conjunction with `classify`: + + ```ts + import { classify, EmbeddingSimilarityClassifier, openai } from "modelfusion"; + + const classifier = new EmbeddingSimilarityClassifier({ + embeddingModel: openai.TextEmbedder({ model: "text-embedding-ada-002" }), + similarityThreshold: 0.82, + clusters: [ + { + name: "politics" as const, + values: [ + "they will save the country!", + // ... + ], + }, + { + name: "chitchat" as const, + values: [ + "how's the weather today?", + // ... + ], + }, + ], + }); + + // strongly typed result: + const result = await classify({ + model: classifier, + value: "don't you love politics?", + }); + ``` + ## v0.122.0 - 2024-01-13 ### Changed diff --git a/examples/babyagi-agent/package.json b/examples/babyagi-agent/package.json index 479e4b405..8b5a457dc 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.122.0", + "modelfusion": "0.123.0", "serpapi": "^2.0.0" }, "devDependencies": { diff --git a/examples/basic/package.json b/examples/basic/package.json index 1cb458f40..fe39f08db 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.122.0", + "modelfusion": "0.123.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 d60335246..6bdb55547 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.122.0", + "modelfusion": "0.123.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 b7c949a4d..25ebac5bc 100644 --- a/examples/cloudflare-workers/package.json +++ b/examples/cloudflare-workers/package.json @@ -15,6 +15,6 @@ "wrangler": "^3.22.1" }, "dependencies": { - "modelfusion": "0.122.0" + "modelfusion": "0.123.0" } } diff --git a/examples/image-generator-next-js/package.json b/examples/image-generator-next-js/package.json index 4f059b9e6..5dd1e6eb0 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.122.0", + "modelfusion": "0.123.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 0c05f0cd5..79bf6ada6 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.122.0", + "modelfusion": "0.123.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 e9788801b..919fc2f8b 100644 --- a/examples/pdf-chat-terminal/package.json +++ b/examples/pdf-chat-terminal/package.json @@ -9,7 +9,7 @@ }, "private": true, "dependencies": { - "modelfusion": "0.122.0", + "modelfusion": "0.123.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 021542669..89446a477 100644 --- a/examples/pdf-to-tweet/package.json +++ b/examples/pdf-to-tweet/package.json @@ -9,7 +9,7 @@ }, "private": true, "dependencies": { - "modelfusion": "0.122.0", + "modelfusion": "0.123.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 a10dc5108..28812f872 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.122.0", + "modelfusion": "0.123.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 9467f4552..0950d0744 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.122.0", + "modelfusion": "0.123.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 5ca742c52..762a002d1 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.122.0", + "modelfusion": "0.123.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 9bd57c3af..bc606ef4d 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.122.0" + "modelfusion": "0.123.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 9793847c8..7713fb227 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.122.0", + "modelfusion": "0.123.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 fefcf4822..559271369 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.122.0" + "modelfusion": "0.123.0" }, "peerDependencies": { "modelfusion": ">=0.89.0", diff --git a/packages/modelfusion-experimental/package.json b/packages/modelfusion-experimental/package.json index e3e8b1304..111c95b7e 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.122.0" + "modelfusion": "0.123.0" } } diff --git a/packages/modelfusion/package.json b/packages/modelfusion/package.json index c0d6b6063..4e9b72b78 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.122.0", + "version": "0.123.0", "author": "Lars Grammel", "license": "MIT", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22eef4c6b..e8c54a455 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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.0 version: link:../../packages/modelfusion/dist modelfusion-experimental: specifier: 0.5.0 @@ -229,7 +229,7 @@ importers: examples/cloudflare-workers: dependencies: modelfusion: - specifier: 0.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.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.122.0 + specifier: 0.123.0 version: link:../modelfusion/dist publishDirectory: dist @@ -675,7 +675,7 @@ importers: specifier: ^4.0.0 version: 4.25.1 modelfusion: - specifier: 0.122.0 + specifier: 0.123.0 version: link:../modelfusion/dist publishDirectory: dist @@ -685,7 +685,7 @@ importers: specifier: 16.3.1 version: 16.3.1 modelfusion: - specifier: 0.122.0 + specifier: 0.123.0 version: link:../../packages/modelfusion/dist test-environments/esm: @@ -715,7 +715,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.122.0 + specifier: 0.123.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -744,7 +744,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.122.0 + specifier: 0.123.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -769,7 +769,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.122.0 + specifier: 0.123.0 version: link:../../packages/modelfusion/dist zod: specifier: 3.22.4 @@ -798,7 +798,7 @@ importers: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) modelfusion: - specifier: 0.122.0 + specifier: 0.123.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 357791d40..86f784ecb 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.122.0", + "modelfusion": "0.123.0", "dotenv": "16.3.1" } } diff --git a/tools/google-custom-search-tool/package.json b/tools/google-custom-search-tool/package.json index 68b09d7a6..3673b156a 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.122.0", + "modelfusion": "0.123.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/mathjs-tool/package.json b/tools/mathjs-tool/package.json index d5bf255c9..08c746bbf 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.122.0", + "modelfusion": "0.123.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/mediawiki-search-tool/package.json b/tools/mediawiki-search-tool/package.json index 7f2a8590d..b95126ad0 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.122.0", + "modelfusion": "0.123.0", "zod": "3.22.4" }, "peerDependencies": { diff --git a/tools/serpapi-tool/package.json b/tools/serpapi-tool/package.json index 417815401..b1bb03687 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.122.0", + "modelfusion": "0.123.0", "zod": "3.22.4" }, "peerDependencies": {