Skip to content

Commit 04687cb

Browse files
committed
fix missing zod import in type declaration file
1 parent 56c8096 commit 04687cb

File tree

10 files changed

+28
-33
lines changed

10 files changed

+28
-33
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Function calling (or tool calling) is an advanced functionality in chat completi
128128
Here's how to create a tool:
129129

130130
```ts
131-
import * as z from "zod";
131+
import { z } from "zod";
132132
import { tool } from "fluent-ai";
133133

134134
const weatherTool = tool("get_current_weather")
@@ -137,7 +137,7 @@ const weatherTool = tool("get_current_weather")
137137
z.object({
138138
location: z.string(),
139139
unit: z.enum(["celsius", "fahrenheit"]).optional(),
140-
}),
140+
})
141141
);
142142
```
143143

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/fluent-ai/build.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
import type { BuildConfig } from "bun";
21
import dts from "bun-plugin-dts";
32

4-
const defaultBuildConfig: BuildConfig = {
3+
await Bun.build({
54
entrypoints: ["./src/index.ts"],
65
outdir: "./dist",
76
external: ["zod"],
8-
};
9-
10-
await Promise.all([
11-
Bun.build({
12-
...defaultBuildConfig,
13-
plugins: [dts()],
14-
format: "esm",
15-
target: "bun",
16-
naming: "[dir]/[name].js",
17-
}),
18-
Bun.build({
19-
...defaultBuildConfig,
20-
format: "cjs",
21-
target: "bun",
22-
naming: "[dir]/[name].cjs",
23-
}),
24-
]);
7+
plugins: [
8+
dts({
9+
libraries: {
10+
importedLibraries: ["zod"],
11+
},
12+
}),
13+
],
14+
format: "esm",
15+
target: "bun",
16+
naming: "[dir]/[name].js",
17+
});

packages/fluent-ai/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
"description": "A lightweight AI toolkit",
44
"version": "0.4.4",
55
"type": "module",
6-
"main": "./dist/index.cjs",
76
"module": "./dist/index.js",
87
"types": "./dist/index.d.ts",
9-
"exports": {
10-
".": "./src/index.ts"
11-
},
128
"files": [
9+
"src",
1310
"dist"
1411
],
1512
"scripts": {
@@ -46,7 +43,12 @@
4643
"type": "git",
4744
"url": "git+https://github.com/modalityml/fluent-ai.git"
4845
},
46+
"bugs": {
47+
"url": "https://github.com/modalityml/fluent-ai/issues"
48+
},
49+
"homepage": "https://github.com/modalityml/fluent-ai#readme",
50+
"author": "modality",
4951
"prettier": {
5052
"trailingComma": "all"
5153
}
52-
}
54+
}

packages/fluent-ai/src/agent/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22
import { convertMessagesForChatCompletion } from "~/src/agent/message";
33
import {
44
agentToolSchema,

packages/fluent-ai/src/agent/tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22

33
export const agentToolSchema = z.object({
44
name: z.string(),

packages/fluent-ai/src/builder/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22
import { type ChatJob, type ChatTool } from "~/src/job/schema";
33

44
export class ChatBuilder<TProvider extends string = string> {

packages/fluent-ai/src/job/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22

33
const chatToolSchema = z.object({
44
name: z.string(),

packages/fluent-ai/src/workflow/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22

33
const workflowSchema = z.object({
44
name: z.string(),

packages/fluent-ai/test/agent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as z from "zod";
1+
import { z } from "zod";
22
import { test, expect } from "bun:test";
33
import { agent, agentTool, openrouter } from "~/src/index";
44

0 commit comments

Comments
 (0)