Skip to content

Commit

Permalink
v0.105.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel committed Dec 26, 2023
1 parent 10aa6dc commit 1ea5ef0
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 34 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# Changelog

## v0.105.0 - 2023-12-26

### Added

- Tool call support for chat prompts. Assistant messages can contain tool calls, and tool messages can contain tool call results. Tool calls can be used to implement e.g. agents:

```ts
const chat: ChatPrompt = {
system: "You are ...",
messages: [ChatMessage.user({ text: instruction })],
};

while (true) {
const { text, toolResults } = await useToolsOrGenerateText(
openai
.ChatTextGenerator({ model: "gpt-4-1106-preview" })
.withChatPrompt(),
tools, // array of tools
chat
);

// add the assistant and tool messages to the chat:
chat.messages.push(
ChatMessage.assistant({ text, toolResults }),
ChatMessage.tool({ toolResults })
);

if (toolResults == null) {
return; // no more actions, break loop
}

// ... (handle tool results)
}
```

- `streamText` returns a `text` promise when invoked with `fullResponse: true`. After the streaming has finished, the promise resolves with the full text.

```ts
const { text, textStream } = await streamText(
openai.ChatTextGenerator({ model: "gpt-3.5-turbo" }).withTextPrompt(),
"Write a short story about a robot learning to love:",
{ fullResponse: true }
);

// ... (handle streaming)

console.log(await text); // full text
```

## v0.104.0 - 2023-12-24

### Changed
Expand Down
2 changes: 1 addition & 1 deletion examples/babyagi-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"commander": "10.0.1",
"dotenv": "16.0.3",
"jsdom": "^22.1.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"serpapi": "^2.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@pinecone-database/pinecone": "0.1.6",
"dotenv": "16.0.3",
"secure-json-parse": "2.7.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"nanoid": "3.3.6",
"better-sqlite3": "9.0.0",
"sqlite-vss": "0.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/chatbot-next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@emotion/styled": "11.10.8",
"@mui/icons-material": "5.11.16",
"@mui/material": "5.12.2",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"next": "13.5.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"wrangler": "^3.0.0"
},
"dependencies": {
"modelfusion": "0.104.0"
"modelfusion": "0.105.0"
}
}
2 changes: 1 addition & 1 deletion examples/image-generator-next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.11.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"next": "13.5.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middle-school-math-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rimraf build dist .turbo node_modules && pnpm clear"
},
"dependencies": {
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"dotenv": "16.0.3",
"zod": "3.22.4"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/pdf-chat-terminal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"private": true,
"dependencies": {
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"commander": "10.0.1",
"dotenv": "16.0.3",
"pdfjs-dist": "3.6.172"
Expand Down
2 changes: 1 addition & 1 deletion examples/pdf-to-tweet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"private": true,
"dependencies": {
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"commander": "10.0.1",
"dotenv": "16.0.3",
"pdfjs-dist": "3.6.172",
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-streaming-vite-react-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"clsx": "^2.0.0",
"dotenv": "16.0.3",
"fastify": "^4.23.2",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwind-merge": "^1.14.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/wikipedia-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dotenv": "16.0.3",
"html-to-text": "9.0.5",
"jsdom": "^22.1.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"zod": "3.22.4"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "9.1.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"zod": "3.22.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@modelfusion-pinecone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "9.1.0",
"modelfusion": "0.104.0"
"modelfusion": "0.105.0"
},
"peerDependencies": {
"modelfusion": ">=0.72.0 <1.0.0-0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@modelfusion-serpapi-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "9.1.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"zod": "3.22.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@modelfusion-sqlite-vss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "9.1.0",
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"sqlite-vss": "^0.1.2",
"better-sqlite3": "^9.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@modelfusion-vercel-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"ai": ">= 2.2.27",
"eslint": "^8.45.0",
"eslint-config-prettier": "9.1.0",
"modelfusion": "0.104.0"
"modelfusion": "0.105.0"
},
"peerDependencies": {
"modelfusion": ">=0.89.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/modelfusion/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modelfusion",
"description": "The TypeScript library for building multi-modal AI applications.",
"version": "0.104.0",
"version": "0.105.0",
"author": "Lars Grammel",
"license": "MIT",
"keywords": [
Expand Down
50 changes: 33 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-environments/commonjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node src/index.js"
},
"dependencies": {
"modelfusion": "0.104.0",
"modelfusion": "0.105.0",
"dotenv": "16.0.3"
}
}

1 comment on commit 1ea5ef0

@vercel
Copy link

@vercel vercel bot commented on 1ea5ef0 Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.