{"_id":"z-chat-completion","_rev":"7-0d719f1c9ffafab8f261bbc98c81365a","name":"z-chat-completion","dist-tags":{"latest":"0.1.9"},"versions":{"0.1.3":{"name":"z-chat-completion","version":"0.1.3","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.3","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"976824b53699ad09132bb64dd54d00ea13295467","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.3.tgz","fileCount":4,"integrity":"sha512-zJFtNKxmlUJNh9dm5jpbYGpsckqs0DrZR2P/i0Nf0zWwLznTTBRRKNgfpp9Sj00CWHTefRbRpRSGlSbiwjru7w==","signatures":[{"sig":"MEUCIQDJjTdSEIWLZvY9jlSNrLEEQ16fvKhHa5RTHzUxH199zgIgH8Qtn06DCHzOW/v8oS+2dtXHSm8tXpR8O7oMN6uwzvU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8247},"main":"./dist/index.js","type":"module","types":"./index.ts","module":"index.ts","shasum":"976824b53699ad09132bb64dd54d00ea13295467","engines":{"bun":">=1.1.0"},"exports":{"types":"./index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepare":"bun run build","release":"standard-version && bun publish","prerelease":"bun run build && bun run test"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-zJFtNKxmlUJNh9dm5jpbYGpsckqs0DrZR2P/i0Nf0zWwLznTTBRRKNgfpp9Sj00CWHTefRbRpRSGlSbiwjru7w==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completions","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.3_1759680882859_0.8159372832968164","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"z-chat-completion","version":"0.1.4","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.4","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"553a239973e27f24228c5a0385b9f6846f5388fd","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.4.tgz","fileCount":4,"integrity":"sha512-hu9AGySskY2a6ycJhF7s9NImBOJdeJnE3hAMenmY9fWPkB8H2Oqg5HoyktuypmJ3DL2dc2rqx98UoKQb/IFdig==","signatures":[{"sig":"MEQCIFaC9yEBDaSdDLWvgR9hb3CVUWGnde2KCZSNeC4jgrm0AiB2NG5t2e//HH5b/M8Gq39HXASv3GQ3zU25F+cS5z8YLQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7837},"main":"./dist/index.js","type":"module","types":"./index.ts","module":"index.ts","shasum":"553a239973e27f24228c5a0385b9f6846f5388fd","engines":{"bun":">=1.1.0"},"exports":{"types":"./index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepare":"bun run build","release":"standard-version && bun publish","prerelease":"bun run build && bun run test"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-hu9AGySskY2a6ycJhF7s9NImBOJdeJnE3hAMenmY9fWPkB8H2Oqg5HoyktuypmJ3DL2dc2rqx98UoKQb/IFdig==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completions","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.4_1759691392573_0.41314859655853686","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"z-chat-completion","version":"0.1.5","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.5","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"344dc56f3059d0337e4bb0bb3a2c1fb120535862","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.5.tgz","fileCount":4,"integrity":"sha512-tVWSHz2xpVBBryR7xLXWuOn0ogvT5ScIzz1yuH0+wUDOTTAGuvJeoJiUQgWAdgxMALIp/2Ig8letESCcR/UhGQ==","signatures":[{"sig":"MEQCIFxbE1F6Q266FPNnIIFohSRImAuodgB9cXHFqlhCHbZmAiAtBxAEekM/cizjndGeCHoyVG5mPquOOL5yz/vRil4hoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7849},"main":"./dist/index.js","type":"module","types":"./src/index.ts","module":"src/index.ts","shasum":"344dc56f3059d0337e4bb0bb3a2c1fb120535862","engines":{"bun":">=1.1.0"},"exports":{"types":"./src/index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepare":"bun run build","release":"standard-version && bun publish","prerelease":"bun run build && bun run test"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-tVWSHz2xpVBBryR7xLXWuOn0ogvT5ScIzz1yuH0+wUDOTTAGuvJeoJiUQgWAdgxMALIp/2Ig8letESCcR/UhGQ==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completions","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.5_1759769609794_0.10429726219035707","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"z-chat-completion","version":"0.1.6","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.6","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"d40a5f517e8cadca44d244d8427c1354f5b9a12b","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.6.tgz","fileCount":5,"integrity":"sha512-t/sw/k2DMVE8Hmc3Y4Fh32EZbZfhanmhVhoYjCY0uzTHPQqg/2P97oEQ0BOH0lcvlUy8a4s7BMG2XNkeN5KzCQ==","signatures":[{"sig":"MEYCIQDRYS2iTXwJPxvKMGfmO6227j5IZsSVcZ3HPLjADAI7WAIhAPu11UIuyNiaad8dKsBgbpjqviUyZuEt/ygqjt4fK+8R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10106},"main":"./dist/index.js","type":"module","types":"./src/index.ts","module":"src/index.ts","shasum":"d40a5f517e8cadca44d244d8427c1354f5b9a12b","engines":{"bun":">=1.1.0"},"exports":{"types":"./src/index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepare":"bun run build","release":"standard-version && bun publish","prerelease":"bun run build && bun run test"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-t/sw/k2DMVE8Hmc3Y4Fh32EZbZfhanmhVhoYjCY0uzTHPQqg/2P97oEQ0BOH0lcvlUy8a4s7BMG2XNkeN5KzCQ==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completions","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.6_1759769667693_0.43665040301636093","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"z-chat-completion","version":"0.1.7","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.7","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"e050920147a46bbfb30ee8b4388f60deae98a210","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.7.tgz","fileCount":5,"integrity":"sha512-wJLz+WKNkF8tSeBP9/LCayeGx0rIsVdGbJinPkNpSAlmoG1omu2b4BuC3dnwJ3uoclBjuipLooiHFV/EUb3Wxg==","signatures":[{"sig":"MEYCIQCiscidGyOCLiTmL9d470za6wAp6f1qZVpHJqVz6bZHnwIhALOkxk8djkc2pYO+UWS7uEmxqkMwkrzypyQZsHkJj5Cp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10119},"main":"./dist/index.js","type":"module","types":"./src/index.ts","module":"src/index.ts","shasum":"e050920147a46bbfb30ee8b4388f60deae98a210","engines":{"bun":">=1.1.0"},"exports":{"types":"./src/index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepack":"bun run build && bun run test","prepare":"bunx husky","prepublishOnly":"bunx standard-version"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-wJLz+WKNkF8tSeBP9/LCayeGx0rIsVdGbJinPkNpSAlmoG1omu2b4BuC3dnwJ3uoclBjuipLooiHFV/EUb3Wxg==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completion","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","husky":"^9.1.7","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.7_1760552916882_0.41061224768740145","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"z-chat-completion","version":"0.1.8","keywords":["bun","openai","zod"],"author":"snomiao <snomiao@gmail.com>","license":"MIT","_id":"z-chat-completion@0.1.8","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"homepage":"https://github.com/snomiao/z-chat#readme","dist":{"shasum":"faaaf78d6d762944cd86a3c4a99ca042ffea5643","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.8.tgz","fileCount":5,"integrity":"sha512-ujpcGOi7acC0VgOl3cxLjEIhDZWWRZYOyTwk9tUy0g9WmH9mAZ5bfgdRl/1sIEaYWx8PNWdkzoJclO5z1GgxLA==","signatures":[{"sig":"MEUCID63Hhjb31+kmil7ev/BQUO4WfSphw4cBWzgy9cEVz30AiEA39xycP8q3MBwhoyKm2bwRAiHG00pVPSgfBTyrHT8230=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10097},"main":"./dist/index.js","type":"module","types":"./src/index.ts","module":"src/index.ts","shasum":"faaaf78d6d762944cd86a3c4a99ca042ffea5643","engines":{"bun":">=1.1.0"},"exports":{"types":"./src/index.ts","import":"./dist/index.js"},"scripts":{"lint":"bun check","test":"bun test","build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","prepack":"bun run build && bun run test && bunx standard-version","prepare":"bunx husky"},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"_integrity":"sha512-ujpcGOi7acC0VgOl3cxLjEIhDZWWRZYOyTwk9tUy0g9WmH9mAZ5bfgdRl/1sIEaYWx8PNWdkzoJclO5z1GgxLA==","repository":"https://github.com/snomiao/z-chat","_npmVersion":"10.8.3","description":"Zod-first helpers for OpenAI chat completion","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.11","openai":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"keyv":"^5.5.3","husky":"^9.1.7","p-map":"^7.0.3","rambda":"^10.3.2","@types/bun":"^1.2.23","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^22.0.0","@keyv/sqlite":"^4.0.5","standard-version":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/z-chat-completion_0.1.8_1760552939329_0.4871204484374687","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"z-chat-completion","version":"0.1.9","description":"Zod-first helpers for OpenAI chat completion","keywords":["bun","openai","zod"],"homepage":"https://github.com/snomiao/z-chat#readme","license":"MIT","author":{"name":"snomiao","email":"snomiao@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/snomiao/z-chat.git"},"type":"module","sideEffects":false,"main":"./dist/index.js","module":"src/index.ts","types":"./src/index.ts","exports":{"types":"./src/index.ts","import":"./dist/index.js"},"scripts":{"build":"bun build --outdir dist src/index.ts --target node --packages=external","clean":"rm -rf dist","fmt":"tsgo && oxlint && oxfmt","prepack":"bun run build && bun run test","prepare":"husky","release":"standard-version && bun publish","test":"bun test"},"dependencies":{"@typescript/native-preview":"^7.0.0-dev.20260118.1","openai":"latest","zod":"latest"},"devDependencies":{"@keyv/sqlite":"^4.0.6","@types/bun":"^1.3.6","@types/jest":"^30.0.0","@types/node":"^22.19.7","husky":"^9.1.7","keyv":"^5.5.5","oxfmt":"^0.24.0","oxlint":"^1.39.0","p-map":"^7.0.4","rambda":"^10.3.4","semantic-release":"^25.0.2","standard-version":"^9.5.0"},"peerDependencies":{"openai":"latest","zod":"latest"},"engines":{"bun":">=1.1.0"},"gitHead":"6b60bccb799944122e737176bc0778c5a43a9f71","_id":"z-chat-completion@0.1.9","bugs":{"url":"https://github.com/snomiao/z-chat/issues"},"_nodeVersion":"24.5.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-FLoj54rAUkegG4egVTQ8f/EIgYyHOZRrsoHd0K+iYgWk6iqfdHvorUjDxQP+15qiTGZEJ/E3pIoIsp0zmyFKgA==","shasum":"421f9f697940db970973743a80a6ce4efd4e71f5","tarball":"https://registry.npmjs.org/z-chat-completion/-/z-chat-completion-0.1.9.tgz","fileCount":12,"unpackedSize":18986,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDmHTl4xpm3+Gzv4405VYd4wCidBW7XuL9eTGhVr30MrAiEA8LKNrPFPZDj3Qw2irZlEKPQwYplwEJTjd4vIavxgCR4="}]},"_npmUser":{"name":"snomiao","email":"snomiao@gmail.com"},"directories":{},"maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/z-chat-completion_0.1.9_1768804328284_0.5023645959627558"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-05T16:14:42.858Z","modified":"2026-01-19T06:32:08.533Z","0.1.3":"2025-10-05T16:14:43.067Z","0.1.4":"2025-10-05T19:09:52.790Z","0.1.5":"2025-10-06T16:53:29.982Z","0.1.6":"2025-10-06T16:54:27.910Z","0.1.7":"2025-10-15T18:28:37.064Z","0.1.8":"2025-10-15T18:28:59.520Z","0.1.9":"2026-01-19T06:32:08.417Z"},"author":{"name":"snomiao","email":"snomiao@gmail.com"},"license":"MIT","homepage":"https://github.com/snomiao/z-chat#readme","keywords":["bun","openai","zod"],"repository":{"type":"git","url":"git+https://github.com/snomiao/z-chat.git"},"description":"Zod-first helpers for OpenAI chat completion","maintainers":[{"name":"snomiao","email":"snomiao@gmail.com"}],"readme":"# z-chat\n\nType-safe helpers for building OpenAI chat completions that always match a Zod schema. `zChatCompletion` wraps the Chat Completions API with a template literal tag so you can keep prompts readable while guaranteeing the structure of the model response.\n\n## Features\n\n- Validate every model response against a Zod schema before your code sees it\n- Use ergonomic template literal prompts with embedded dynamic values\n- Swap between OpenAI models or reuse your own `OpenAI` client instance\n- Built for Bun first, but works anywhere the official OpenAI SDK runs\n\n## Installation\n\nRequires Bun ≥ 1.1.0 and an `OPENAI_API_KEY` with access to the Chat Completions API.\n\n```bash\nbun add z-chat-completion\n# or, with npm / pnpm / yarn\nnpm install z-chat-completion\n```\n\n## Quick Start\n\n```ts\nimport { z } from \"zod\";\nimport zChat from \"z-chat-completion\";\n\nconst { joke, rating } = await zChat(\n  z.object({\n    joke: z.string(),\n    rating: z.number().int().min(1).max(5),\n  }),\n)`\n  Tell me a ${\"short\"} joke about ${\"bun\"}.\n`;\n\nconsole.log(joke, rating);\n```\n\nBehind the scenes `zChatCompletion` renders the template literal, calls `client.chat.completions.create`, and parses the JSON response with the schema you provide. If the model returns malformed or empty content, a descriptive error is thrown so you can retry or surface the failure.\n\n## API\n\n### `zChatCompletion(schema, options?)`\n\n- **schema**: Any `ZodObject` describing the JSON shape you expect from the model.\n- **options.client**: (optional) Provide an existing `OpenAI` client if you manage authentication elsewhere. Useful for testing or sharing rate limits.\n- **options.model**: (optional) Name of the chat completion model to call. Defaults to `gpt-5-mini`.\n\nThe function returns a template literal tag (`ZChatTemplate`) that resolves to a parsed value whose type is inferred from the schema.\n\n### Error handling\n\n- Throws `Error(\"NO_CONTENT...\")` when the API response does not include any message content.\n- Throws the underlying Zod validation error if the JSON payload cannot be parsed or does not satisfy the schema. Catch these to implement retries, fallbacks, or richer logging.\n\n## Advanced Usage\n\n```ts\nimport OpenAI from \"openai\";\nimport { z } from \"zod\";\nimport { zChatCompletion } from \"z-chat-completion\";\n\nconst schema = z.object({ summary: z.string() });\nconst client = new OpenAI({\n  apiKey: process.env.OPENAI_API_KEY!,\n  baseURL: \"https://api.openai.com/v1\",\n});\n\nconst chat = zChatCompletion(schema, {\n  client,\n  model: \"gpt-5-mini\",\n});\n\nconst { summary } = await chat`\n  Summarize the latest release notes for this project.\n`;\n```\n\n- Supply your own client to share configuration (proxies, retries) across multiple helpers.\n- Override `model` per template; see `docs/model-select-2025-10.md` for current guidance on model trade-offs.\n- Use any `ZodObject`, including nested schemas and discriminated unions, to express complex outputs.\n\n## Testing & Mocking\n\n`zChatCompletion` accepts a mocked client, making it straightforward to exercise in tests:\n\n```ts\nimport { z } from \"zod\";\nimport { describe, expect, it } from \"bun:test\";\nimport { zChatCompletion } from \"z-chat-completion\";\n\nconst schema = z.object({ name: z.string() });\nconst mockClient = {\n  chat: {\n    completions: {\n      create: async () => ({\n        choices: [{ message: { content: JSON.stringify({ name: \"Ada\" }) } }],\n      }),\n    },\n  },\n};\n\ndescribe(\"zChatCompletion\", () => {\n  it(\"parses responses\", async () => {\n    const chat = zChatCompletion(schema, { client: mockClient as any });\n    expect(await chat`Who am I thinking of?`).toEqual({ name: \"Ada\" });\n  });\n});\n```\n\n## Development\n\n```bash\nbun install       # install dependencies\nbun test          # run test suite\nbun run build     # emit compiled artifacts to ./dist\nbun check         # Bun type checker & lint pass\n```\n\nTo try a live call against the API, execute `bun src/index.ts` (the inline smoke test only runs when the file is executed directly).\n\n## Release Workflow\n\nReleases use `standard-version` for changelog + versioning and `bun publish` for distribution.\n\n```bash\nbun run prerelease   # build + test\nbun run release      # bump version, tag, and publish (requires auth)\n```\n\nIf you want to simulate the publish step locally without pushing, run `bun run release -- --dry-run`.\n\n## License\n\nMIT © snomiao\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/snomiao/z-chat/issues"}}