From 6dc6918f0fb0244ed12ad5448fbf72812e0ebaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Go=CC=81mez=20Bachiller?= Date: Mon, 23 Sep 2024 17:28:49 +0200 Subject: [PATCH] feat: update examples --- examples/ai-core/Makefile | 20 +- examples/ai-core/pnpm-lock.yaml | 911 ------------------ .../ai-core/src/complex/math-agent/agent.ts | 36 +- .../src/generate-object/ollama-enum.ts | 25 + .../ollama-log-metadata-middleware.ts | 38 + .../src/generate-text/ollama-multi-step.ts | 43 + .../ai-core/src/stream-object/ollama-array.ts | 27 + 7 files changed, 160 insertions(+), 940 deletions(-) delete mode 100644 examples/ai-core/pnpm-lock.yaml create mode 100755 examples/ai-core/src/generate-object/ollama-enum.ts create mode 100755 examples/ai-core/src/generate-text/ollama-log-metadata-middleware.ts create mode 100755 examples/ai-core/src/generate-text/ollama-multi-step.ts create mode 100755 examples/ai-core/src/stream-object/ollama-array.ts diff --git a/examples/ai-core/Makefile b/examples/ai-core/Makefile index 737fefe..219bedc 100644 --- a/examples/ai-core/Makefile +++ b/examples/ai-core/Makefile @@ -72,17 +72,19 @@ registry_stream-multimodal: # generate-object -.PHONY: generate-object generate-object-run generate-object-all generate-object_ollama generate-object_ollama-array generate-object_ollama-date-parsing generate-object_ollama-full-result generate-object_ollama-json generate-object_ollama-multimodal generate-object_ollama-no-schema generate-object_ollama-raw-json-schema generate-object_ollama-tool +.PHONY: generate-object generate-object-run generate-object-all generate-object_ollama generate-object_ollama-array generate-object_ollama-date-parsing generate-object_ollama-enum generate-object_ollama-full-result generate-object_ollama-json generate-object_ollama-multimodal generate-object_ollama-no-schema generate-object_ollama-raw-json-schema generate-object_ollama-tool generate-object: generate-object-run generate-object-all generate-object-run: echo - examples/generate-object: -generate-object-all: generate-object_ollama generate-object_ollama-array generate-object_ollama-date-parsing generate-object_ollama-full-result generate-object_ollama-json generate-object_ollama-multimodal generate-object_ollama-no-schema generate-object_ollama-raw-json-schema generate-object_ollama-tool +generate-object-all: generate-object_ollama generate-object_ollama-array generate-object_ollama-date-parsing generate-object_ollama-enum generate-object_ollama-full-result generate-object_ollama-json generate-object_ollama-multimodal generate-object_ollama-no-schema generate-object_ollama-raw-json-schema generate-object_ollama-tool generate-object_ollama: $(call RUN_EXAMPLE_TARGET,$@) generate-object_ollama-array: $(call RUN_EXAMPLE_TARGET,$@) generate-object_ollama-date-parsing: $(call RUN_EXAMPLE_TARGET,$@) +generate-object_ollama-enum: + $(call RUN_EXAMPLE_TARGET,$@) generate-object_ollama-full-result: $(call RUN_EXAMPLE_TARGET,$@) generate-object_ollama-json: @@ -98,11 +100,11 @@ generate-object_ollama-tool: # generate-text -.PHONY: generate-text generate-text-run generate-text-all generate-text_ollama generate-text_ollama-completion generate-text_ollama-completion-chat generate-text_ollama-custom-fetch generate-text_ollama-custom-headers generate-text_ollama-full-result generate-text_ollama-multimodal generate-text_ollama-multimodal-base64 generate-text_ollama-multimodal-url generate-text_ollama-system-message-a generate-text_ollama-system-message-b generate-text_ollama-tool-call generate-text_ollama-tool-call-raw-json-schema +.PHONY: generate-text generate-text-run generate-text-all generate-text_ollama generate-text_ollama-completion generate-text_ollama-completion-chat generate-text_ollama-custom-fetch generate-text_ollama-custom-headers generate-text_ollama-full-result generate-text_ollama-log-metadata-middleware generate-text_ollama-multi-step generate-text_ollama-multimodal generate-text_ollama-multimodal-base64 generate-text_ollama-multimodal-url generate-text_ollama-system-message-a generate-text_ollama-system-message-b generate-text_ollama-tool-call generate-text_ollama-tool-call-raw-json-schema generate-text: generate-text-run generate-text-all generate-text-run: echo - examples/generate-text: -generate-text-all: generate-text_ollama generate-text_ollama-completion generate-text_ollama-completion-chat generate-text_ollama-custom-fetch generate-text_ollama-custom-headers generate-text_ollama-full-result generate-text_ollama-multimodal generate-text_ollama-multimodal-base64 generate-text_ollama-multimodal-url generate-text_ollama-system-message-a generate-text_ollama-system-message-b generate-text_ollama-tool-call generate-text_ollama-tool-call-raw-json-schema +generate-text-all: generate-text_ollama generate-text_ollama-completion generate-text_ollama-completion-chat generate-text_ollama-custom-fetch generate-text_ollama-custom-headers generate-text_ollama-full-result generate-text_ollama-log-metadata-middleware generate-text_ollama-multi-step generate-text_ollama-multimodal generate-text_ollama-multimodal-base64 generate-text_ollama-multimodal-url generate-text_ollama-system-message-a generate-text_ollama-system-message-b generate-text_ollama-tool-call generate-text_ollama-tool-call-raw-json-schema generate-text_ollama: $(call RUN_EXAMPLE_TARGET,$@) generate-text_ollama-completion: @@ -115,6 +117,10 @@ generate-text_ollama-custom-headers: $(call RUN_EXAMPLE_TARGET,$@) generate-text_ollama-full-result: $(call RUN_EXAMPLE_TARGET,$@) +generate-text_ollama-log-metadata-middleware: + $(call RUN_EXAMPLE_TARGET,$@) +generate-text_ollama-multi-step: + $(call RUN_EXAMPLE_TARGET,$@) generate-text_ollama-multimodal: $(call RUN_EXAMPLE_TARGET,$@) generate-text_ollama-multimodal-base64: @@ -132,13 +138,15 @@ generate-text_ollama-tool-call-raw-json-schema: # stream-object -.PHONY: stream-object stream-object-run stream-object-all stream-object_ollama stream-object_ollama-fullstream stream-object_ollama-json stream-object_ollama-no-schema stream-object_ollama-object stream-object_ollama-on-finish stream-object_ollama-raw-json-schema stream-object_ollama-token-usage stream-object_ollama-tool +.PHONY: stream-object stream-object-run stream-object-all stream-object_ollama stream-object_ollama-array stream-object_ollama-fullstream stream-object_ollama-json stream-object_ollama-no-schema stream-object_ollama-object stream-object_ollama-on-finish stream-object_ollama-raw-json-schema stream-object_ollama-token-usage stream-object_ollama-tool stream-object: stream-object-run stream-object-all stream-object-run: echo - examples/stream-object: -stream-object-all: stream-object_ollama stream-object_ollama-fullstream stream-object_ollama-json stream-object_ollama-no-schema stream-object_ollama-object stream-object_ollama-on-finish stream-object_ollama-raw-json-schema stream-object_ollama-token-usage stream-object_ollama-tool +stream-object-all: stream-object_ollama stream-object_ollama-array stream-object_ollama-fullstream stream-object_ollama-json stream-object_ollama-no-schema stream-object_ollama-object stream-object_ollama-on-finish stream-object_ollama-raw-json-schema stream-object_ollama-token-usage stream-object_ollama-tool stream-object_ollama: $(call RUN_EXAMPLE_TARGET,$@) +stream-object_ollama-array: + $(call RUN_EXAMPLE_TARGET,$@) stream-object_ollama-fullstream: $(call RUN_EXAMPLE_TARGET,$@) stream-object_ollama-json: diff --git a/examples/ai-core/pnpm-lock.yaml b/examples/ai-core/pnpm-lock.yaml deleted file mode 100644 index e7ffa24..0000000 --- a/examples/ai-core/pnpm-lock.yaml +++ /dev/null @@ -1,911 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - ai: - specifier: latest - version: 3.1.3(react@18.3.1)(solid-js@1.8.17)(svelte@4.2.16)(vue@3.4.27(typescript@5.1.3))(zod@3.22.4) - zod: - specifier: 3.22.4 - version: 3.22.4 - zod-to-json-schema: - specifier: 3.22.4 - version: 3.22.4(zod@3.22.4) - devDependencies: - '@types/node': - specifier: 20.11.20 - version: 20.11.20 - tsx: - specifier: 4.7.1 - version: 4.7.1 - typescript: - specifier: 5.1.3 - version: 5.1.3 - -packages: - - '@ai-sdk/provider-utils@0.0.6': - resolution: {integrity: sha512-SxOZgSxnaVlW04/SjfMoAD45kWOWTWx0QcZrHaQnePooLhyk5AqQpgauPijL803uoJPCKfzd0UBv1gSKvWiU0A==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.0.0 - peerDependenciesMeta: - zod: - optional: true - - '@ai-sdk/provider@0.0.3': - resolution: {integrity: sha512-0B8P6VZpJ6F9yS9BpmJBYSqIaIfeRtL5tD5SP+qgR8y0pPwalIbRMUFiLz9YUT6g70MJsCLpm/2/fX3cfAYCJw==} - engines: {node: '>=18'} - - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@babel/helper-string-parser@7.24.1': - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.24.5': - resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.24.5': - resolution: {integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/types@7.24.5': - resolution: {integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==} - engines: {node: '>=6.9.0'} - - '@esbuild/aix-ppc64@0.19.12': - resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.19.12': - resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.19.12': - resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.19.12': - resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.19.12': - resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.19.12': - resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - - '@esbuild/freebsd-arm64@0.19.12': - resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.19.12': - resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.19.12': - resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.19.12': - resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.19.12': - resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.19.12': - resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.19.12': - resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.19.12': - resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.19.12': - resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.19.12': - resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.19.12': - resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-x64@0.19.12': - resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-x64@0.19.12': - resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - - '@esbuild/sunos-x64@0.19.12': - resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.19.12': - resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.19.12': - resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.19.12': - resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - - '@types/diff-match-patch@1.0.36': - resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==} - - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - - '@types/node@20.11.20': - resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} - - '@vue/compiler-core@3.4.27': - resolution: {integrity: sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==} - - '@vue/compiler-dom@3.4.27': - resolution: {integrity: sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==} - - '@vue/compiler-sfc@3.4.27': - resolution: {integrity: sha512-nDwntUEADssW8e0rrmE0+OrONwmRlegDA1pD6QhVeXxjIytV03yDqTey9SBDiALsvAd5U4ZrEKbMyVXhX6mCGA==} - - '@vue/compiler-ssr@3.4.27': - resolution: {integrity: sha512-CVRzSJIltzMG5FcidsW0jKNQnNRYC8bT21VegyMMtHmhW3UOI7knmUehzswXLrExDLE6lQCZdrhD4ogI7c+vuw==} - - '@vue/reactivity@3.4.27': - resolution: {integrity: sha512-kK0g4NknW6JX2yySLpsm2jlunZJl2/RJGZ0H9ddHdfBVHcNzxmQ0sS0b09ipmBoQpY8JM2KmUw+a6sO8Zo+zIA==} - - '@vue/runtime-core@3.4.27': - resolution: {integrity: sha512-7aYA9GEbOOdviqVvcuweTLe5Za4qBZkUY7SvET6vE8kyypxVgaT1ixHLg4urtOlrApdgcdgHoTZCUuTGap/5WA==} - - '@vue/runtime-dom@3.4.27': - resolution: {integrity: sha512-ScOmP70/3NPM+TW9hvVAz6VWWtZJqkbdf7w6ySsws+EsqtHvkhxaWLecrTorFxsawelM5Ys9FnDEMt6BPBDS0Q==} - - '@vue/server-renderer@3.4.27': - resolution: {integrity: sha512-dlAMEuvmeA3rJsOMJ2J1kXU7o7pOxgsNHVr9K8hB3ImIkSuBrIdy0vF66h8gf8Tuinf1TK3mPAz2+2sqyf3KzA==} - peerDependencies: - vue: 3.4.27 - - '@vue/shared@3.4.27': - resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - ai@3.1.3: - resolution: {integrity: sha512-65ngr71PaLFzCa+rj/B9u2y3qlJsrUpc0i4WAcsd05/rxeY7RV8soLScCHeqB9v1yVdLBak8K6ftkGHXubtmag==} - engines: {node: '>=18'} - peerDependencies: - react: ^18.2.0 - solid-js: ^1.7.7 - svelte: ^3.0.0 || ^4.0.0 - vue: ^3.3.4 - zod: ^3.0.0 - peerDependenciesMeta: - react: - optional: true - solid-js: - optional: true - svelte: - optional: true - vue: - optional: true - zod: - optional: true - - aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} - - axobject-query@4.0.0: - resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - - css-tree@2.3.1: - resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - - diff-match-patch@1.0.5: - resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==} - - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} - engines: {node: '>=0.12'} - - esbuild@0.19.12: - resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} - engines: {node: '>=12'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - - eventsource-parser@1.1.2: - resolution: {integrity: sha512-v0eOBUbiaFojBu2s2NPBfYUoRR9GjcDNvCXVaqEf5vVfpIAh9f8RCo4vXTP8c63QRKCFwoLpMpTdPwwhEKVgzA==} - engines: {node: '>=14.18'} - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - get-tsconfig@4.7.5: - resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==} - - is-reference@3.0.2: - resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - json-schema@0.4.0: - resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} - - jsondiffpatch@0.6.0: - resolution: {integrity: sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - - locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - magic-string@0.30.10: - resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} - - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - - nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - - picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - - postcss@8.4.38: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} - engines: {node: ^10 || ^12 || >=14} - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - - secure-json-parse@2.7.0: - resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} - - seroval-plugins@1.0.5: - resolution: {integrity: sha512-8+pDC1vOedPXjKG7oz8o+iiHrtF2WswaMQJ7CKFpccvSYfrzmvKY9zOJWCg+881722wIHfwkdnRmiiDm9ym+zQ==} - engines: {node: '>=10'} - peerDependencies: - seroval: ^1.0 - - seroval@1.0.5: - resolution: {integrity: sha512-TM+Z11tHHvQVQKeNlOUonOWnsNM+2IBwZ4vwoi4j3zKzIpc5IDw8WPwCfcc8F17wy6cBcJGbZbFOR0UCuTZHQA==} - engines: {node: '>=10'} - - solid-js@1.8.17: - resolution: {integrity: sha512-E0FkUgv9sG/gEBWkHr/2XkBluHb1fkrHywUgA6o6XolPDCJ4g1HaLmQufcBBhiF36ee40q+HpG/vCZu7fLpI3Q==} - - solid-swr-store@0.10.7: - resolution: {integrity: sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g==} - engines: {node: '>=10'} - peerDependencies: - solid-js: ^1.2 - swr-store: ^0.10 - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sswr@2.0.0: - resolution: {integrity: sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w==} - peerDependencies: - svelte: ^4.0.0 - - svelte@4.2.16: - resolution: {integrity: sha512-mQwHpqHD2PmFcCyHaZ7XiTqposaLvJ75WpYcyY5/ce3qxbYtwQpZ+M7ZKP+2CG5U6kfnBZBpPLyofhlE6ROrnQ==} - engines: {node: '>=16'} - - swr-store@0.10.6: - resolution: {integrity: sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw==} - engines: {node: '>=10'} - - swr@2.2.0: - resolution: {integrity: sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==} - peerDependencies: - react: ^16.11.0 || ^17.0.0 || ^18.0.0 - - swrev@4.0.0: - resolution: {integrity: sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==} - - swrv@1.0.4: - resolution: {integrity: sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==} - peerDependencies: - vue: '>=3.2.26 < 4' - - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - - tsx@4.7.1: - resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} - engines: {node: '>=18.0.0'} - hasBin: true - - typescript@5.1.3: - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - use-sync-external-store@1.2.2: - resolution: {integrity: sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - - vue@3.4.27: - resolution: {integrity: sha512-8s/56uK6r01r1icG/aEOHqyMVxd1bkYcSe9j8HcKtr/xTOFWvnzIVTehNW+5Yt89f+DLBe4A569pnZLS5HzAMA==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - - zod-to-json-schema@3.22.4: - resolution: {integrity: sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==} - peerDependencies: - zod: ^3.22.4 - - zod-to-json-schema@3.22.5: - resolution: {integrity: sha512-+akaPo6a0zpVCCseDed504KBJUQpEW5QZw7RMneNmKw+fGaML1Z9tUNLnHHAC8x6dzVRO1eB2oEMyZRnuBZg7Q==} - peerDependencies: - zod: ^3.22.4 - - zod@3.22.4: - resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - -snapshots: - - '@ai-sdk/provider-utils@0.0.6(zod@3.22.4)': - dependencies: - '@ai-sdk/provider': 0.0.3 - eventsource-parser: 1.1.2 - nanoid: 3.3.6 - secure-json-parse: 2.7.0 - optionalDependencies: - zod: 3.22.4 - - '@ai-sdk/provider@0.0.3': - dependencies: - json-schema: 0.4.0 - - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - - '@babel/helper-string-parser@7.24.1': {} - - '@babel/helper-validator-identifier@7.24.5': {} - - '@babel/parser@7.24.5': - dependencies: - '@babel/types': 7.24.5 - - '@babel/types@7.24.5': - dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.24.5 - to-fast-properties: 2.0.0 - - '@esbuild/aix-ppc64@0.19.12': - optional: true - - '@esbuild/android-arm64@0.19.12': - optional: true - - '@esbuild/android-arm@0.19.12': - optional: true - - '@esbuild/android-x64@0.19.12': - optional: true - - '@esbuild/darwin-arm64@0.19.12': - optional: true - - '@esbuild/darwin-x64@0.19.12': - optional: true - - '@esbuild/freebsd-arm64@0.19.12': - optional: true - - '@esbuild/freebsd-x64@0.19.12': - optional: true - - '@esbuild/linux-arm64@0.19.12': - optional: true - - '@esbuild/linux-arm@0.19.12': - optional: true - - '@esbuild/linux-ia32@0.19.12': - optional: true - - '@esbuild/linux-loong64@0.19.12': - optional: true - - '@esbuild/linux-mips64el@0.19.12': - optional: true - - '@esbuild/linux-ppc64@0.19.12': - optional: true - - '@esbuild/linux-riscv64@0.19.12': - optional: true - - '@esbuild/linux-s390x@0.19.12': - optional: true - - '@esbuild/linux-x64@0.19.12': - optional: true - - '@esbuild/netbsd-x64@0.19.12': - optional: true - - '@esbuild/openbsd-x64@0.19.12': - optional: true - - '@esbuild/sunos-x64@0.19.12': - optional: true - - '@esbuild/win32-arm64@0.19.12': - optional: true - - '@esbuild/win32-ia32@0.19.12': - optional: true - - '@esbuild/win32-x64@0.19.12': - optional: true - - '@jridgewell/gen-mapping@0.3.5': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/sourcemap-codec@1.4.15': {} - - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - - '@types/diff-match-patch@1.0.36': {} - - '@types/estree@1.0.5': {} - - '@types/node@20.11.20': - dependencies: - undici-types: 5.26.5 - - '@vue/compiler-core@3.4.27': - dependencies: - '@babel/parser': 7.24.5 - '@vue/shared': 3.4.27 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.2.0 - - '@vue/compiler-dom@3.4.27': - dependencies: - '@vue/compiler-core': 3.4.27 - '@vue/shared': 3.4.27 - - '@vue/compiler-sfc@3.4.27': - dependencies: - '@babel/parser': 7.24.5 - '@vue/compiler-core': 3.4.27 - '@vue/compiler-dom': 3.4.27 - '@vue/compiler-ssr': 3.4.27 - '@vue/shared': 3.4.27 - estree-walker: 2.0.2 - magic-string: 0.30.10 - postcss: 8.4.38 - source-map-js: 1.2.0 - - '@vue/compiler-ssr@3.4.27': - dependencies: - '@vue/compiler-dom': 3.4.27 - '@vue/shared': 3.4.27 - - '@vue/reactivity@3.4.27': - dependencies: - '@vue/shared': 3.4.27 - - '@vue/runtime-core@3.4.27': - dependencies: - '@vue/reactivity': 3.4.27 - '@vue/shared': 3.4.27 - - '@vue/runtime-dom@3.4.27': - dependencies: - '@vue/runtime-core': 3.4.27 - '@vue/shared': 3.4.27 - csstype: 3.1.3 - - '@vue/server-renderer@3.4.27(vue@3.4.27(typescript@5.1.3))': - dependencies: - '@vue/compiler-ssr': 3.4.27 - '@vue/shared': 3.4.27 - vue: 3.4.27(typescript@5.1.3) - - '@vue/shared@3.4.27': {} - - acorn@8.11.3: {} - - ai@3.1.3(react@18.3.1)(solid-js@1.8.17)(svelte@4.2.16)(vue@3.4.27(typescript@5.1.3))(zod@3.22.4): - dependencies: - '@ai-sdk/provider': 0.0.3 - '@ai-sdk/provider-utils': 0.0.6(zod@3.22.4) - eventsource-parser: 1.1.2 - json-schema: 0.4.0 - jsondiffpatch: 0.6.0 - nanoid: 3.3.6 - secure-json-parse: 2.7.0 - solid-swr-store: 0.10.7(solid-js@1.8.17)(swr-store@0.10.6) - sswr: 2.0.0(svelte@4.2.16) - swr: 2.2.0(react@18.3.1) - swr-store: 0.10.6 - swrv: 1.0.4(vue@3.4.27(typescript@5.1.3)) - zod-to-json-schema: 3.22.5(zod@3.22.4) - optionalDependencies: - react: 18.3.1 - solid-js: 1.8.17 - svelte: 4.2.16 - vue: 3.4.27(typescript@5.1.3) - zod: 3.22.4 - - aria-query@5.3.0: - dependencies: - dequal: 2.0.3 - - axobject-query@4.0.0: - dependencies: - dequal: 2.0.3 - - chalk@5.3.0: {} - - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - '@types/estree': 1.0.5 - acorn: 8.11.3 - estree-walker: 3.0.3 - periscopic: 3.1.0 - - css-tree@2.3.1: - dependencies: - mdn-data: 2.0.30 - source-map-js: 1.2.0 - - csstype@3.1.3: {} - - dequal@2.0.3: {} - - diff-match-patch@1.0.5: {} - - entities@4.5.0: {} - - esbuild@0.19.12: - optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 - - estree-walker@2.0.2: {} - - estree-walker@3.0.3: - dependencies: - '@types/estree': 1.0.5 - - eventsource-parser@1.1.2: {} - - fsevents@2.3.3: - optional: true - - get-tsconfig@4.7.5: - dependencies: - resolve-pkg-maps: 1.0.0 - - is-reference@3.0.2: - dependencies: - '@types/estree': 1.0.5 - - js-tokens@4.0.0: {} - - json-schema@0.4.0: {} - - jsondiffpatch@0.6.0: - dependencies: - '@types/diff-match-patch': 1.0.36 - chalk: 5.3.0 - diff-match-patch: 1.0.5 - - locate-character@3.0.0: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - magic-string@0.30.10: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - - mdn-data@2.0.30: {} - - nanoid@3.3.6: {} - - nanoid@3.3.7: {} - - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.5 - estree-walker: 3.0.3 - is-reference: 3.0.2 - - picocolors@1.0.0: {} - - postcss@8.4.38: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.2.0 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - resolve-pkg-maps@1.0.0: {} - - secure-json-parse@2.7.0: {} - - seroval-plugins@1.0.5(seroval@1.0.5): - dependencies: - seroval: 1.0.5 - - seroval@1.0.5: {} - - solid-js@1.8.17: - dependencies: - csstype: 3.1.3 - seroval: 1.0.5 - seroval-plugins: 1.0.5(seroval@1.0.5) - - solid-swr-store@0.10.7(solid-js@1.8.17)(swr-store@0.10.6): - dependencies: - solid-js: 1.8.17 - swr-store: 0.10.6 - - source-map-js@1.2.0: {} - - sswr@2.0.0(svelte@4.2.16): - dependencies: - svelte: 4.2.16 - swrev: 4.0.0 - - svelte@4.2.16: - dependencies: - '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - '@types/estree': 1.0.5 - acorn: 8.11.3 - aria-query: 5.3.0 - axobject-query: 4.0.0 - code-red: 1.0.4 - css-tree: 2.3.1 - estree-walker: 3.0.3 - is-reference: 3.0.2 - locate-character: 3.0.0 - magic-string: 0.30.10 - periscopic: 3.1.0 - - swr-store@0.10.6: - dependencies: - dequal: 2.0.3 - - swr@2.2.0(react@18.3.1): - dependencies: - react: 18.3.1 - use-sync-external-store: 1.2.2(react@18.3.1) - - swrev@4.0.0: {} - - swrv@1.0.4(vue@3.4.27(typescript@5.1.3)): - dependencies: - vue: 3.4.27(typescript@5.1.3) - - to-fast-properties@2.0.0: {} - - tsx@4.7.1: - dependencies: - esbuild: 0.19.12 - get-tsconfig: 4.7.5 - optionalDependencies: - fsevents: 2.3.3 - - typescript@5.1.3: {} - - undici-types@5.26.5: {} - - use-sync-external-store@1.2.2(react@18.3.1): - dependencies: - react: 18.3.1 - - vue@3.4.27(typescript@5.1.3): - dependencies: - '@vue/compiler-dom': 3.4.27 - '@vue/compiler-sfc': 3.4.27 - '@vue/runtime-dom': 3.4.27 - '@vue/server-renderer': 3.4.27(vue@3.4.27(typescript@5.1.3)) - '@vue/shared': 3.4.27 - optionalDependencies: - typescript: 5.1.3 - - zod-to-json-schema@3.22.4(zod@3.22.4): - dependencies: - zod: 3.22.4 - - zod-to-json-schema@3.22.5(zod@3.22.4): - dependencies: - zod: 3.22.4 - - zod@3.22.4: {} diff --git a/examples/ai-core/src/complex/math-agent/agent.ts b/examples/ai-core/src/complex/math-agent/agent.ts index f4e0e2f..5b6eef3 100755 --- a/examples/ai-core/src/complex/math-agent/agent.ts +++ b/examples/ai-core/src/complex/math-agent/agent.ts @@ -8,34 +8,24 @@ import { z } from 'zod' import { buildProgram } from '../../tools/command' -const problem = - 'A taxi driver earns $9461 per 1-hour work. ' + - 'If he works 12 hours a day and in 1 hour he uses 12-liters petrol with price $134 for 1-liter. ' + - 'How much money does he earn in one day?' - async function main(model: OllamaChatModelId) { - console.log(`PROBLEM: ${problem}\n`) - - const response = await generateText({ - maxToolRoundtrips: 10, + const { text: answer } = await generateText({ + maxSteps: 10, model: ollama(model), - prompt: problem, + onStepFinish: async ({ toolResults }) => { + console.log(`STEP RESULTS: ${JSON.stringify(toolResults, null, 2)}`) + }, + prompt: + 'A taxi driver earns $9461 per 1-hour work. ' + + 'If he works 12 hours a day and in 1 hour he uses 14-liters petrol with price $134 for 1-liter. ' + + 'How much money does he earn in one day?', system: 'You are solving math problems. ' + 'Reason step by step. ' + - 'Use the tool `calculate` when necessary. ' + + 'Use the calculator when necessary. ' + 'The calculator can only do simple additions, subtractions, multiplications, and divisions. ' + - 'When you give the final answer, provide an explanation for how you got it using the `answer` tool.', - toolChoice: 'required', + 'When you give the final answer, provide an explanation for how you got it.', tools: { - answer: tool({ - description: 'A tool for providing the final answer.', - execute: async ({ answer }) => { - console.log(`ANSWER: ${answer}`) - process.exit(0) - }, - parameters: z.object({ answer: z.string() }), - }), calculate: tool({ description: 'A tool for evaluating mathematical expressions. Example expressions: ' + @@ -46,7 +36,7 @@ async function main(model: OllamaChatModelId) { }, }) - console.error(JSON.stringify(response, null, 2)) + console.log(`FINAL ANSWER: ${answer}`) } -buildProgram('firefunction-v2', main).catch(console.error) +buildProgram('qwen2.5', main).catch(console.error) diff --git a/examples/ai-core/src/generate-object/ollama-enum.ts b/examples/ai-core/src/generate-object/ollama-enum.ts new file mode 100755 index 0000000..e83069d --- /dev/null +++ b/examples/ai-core/src/generate-object/ollama-enum.ts @@ -0,0 +1,25 @@ +#! /usr/bin/env -S pnpm tsx + +import { generateObject } from 'ai' +import { ollama } from 'ollama-ai-provider' + +import { buildProgram } from '../tools/command' + +async function main(model: Parameters[0]) { + const result = await generateObject({ + enum: ['action', 'comedy', 'drama', 'horror', 'sci-fi'], + model: ollama(model), + output: 'enum', + prompt: + 'Classify the genre of this movie plot: ' + + '"A group of astronauts travel through a wormhole in search of a ' + + 'new habitable planet for humanity."', + }) + + console.log(result.object) + console.log() + console.log('Token usage:', result.usage) + console.log('Finish reason:', result.finishReason) +} + +buildProgram('llama3.1', main).catch(console.error) diff --git a/examples/ai-core/src/generate-text/ollama-log-metadata-middleware.ts b/examples/ai-core/src/generate-text/ollama-log-metadata-middleware.ts new file mode 100755 index 0000000..8590b53 --- /dev/null +++ b/examples/ai-core/src/generate-text/ollama-log-metadata-middleware.ts @@ -0,0 +1,38 @@ +#! /usr/bin/env -S pnpm tsx + +import { + Experimental_LanguageModelV1Middleware as LanguageModelV1Middleware, + experimental_wrapLanguageModel as wrapLanguageModel, + generateText, +} from 'ai' +import { ollama } from 'ollama-ai-provider' + +import { buildProgram } from '../tools/command' + +const logProviderMetadataMiddleware: LanguageModelV1Middleware = { + transformParams: async ({ params }) => { + console.log( + 'providerMetadata: ' + JSON.stringify(params.providerMetadata, null, 2), + ) + return params + }, +} + +async function main(model: Parameters[0]) { + const { text } = await generateText({ + experimental_providerMetadata: { + myMiddleware: { + example: 'value', + }, + }, + model: wrapLanguageModel({ + middleware: logProviderMetadataMiddleware, + model: ollama(model), + }), + prompt: 'Invent a new holiday and describe its traditions.', + }) + + console.log(text) +} + +buildProgram('llama3.1', main).catch(console.error) diff --git a/examples/ai-core/src/generate-text/ollama-multi-step.ts b/examples/ai-core/src/generate-text/ollama-multi-step.ts new file mode 100755 index 0000000..cf82ff4 --- /dev/null +++ b/examples/ai-core/src/generate-text/ollama-multi-step.ts @@ -0,0 +1,43 @@ +#! /usr/bin/env -S pnpm tsx + +import { generateText, tool } from 'ai' +import { ollama } from 'ollama-ai-provider' +import { z } from 'zod' + +import { buildProgram } from '../tools/command' + +async function main(model: Parameters[0]) { + const { text, usage } = await generateText({ + maxSteps: 5, + model: ollama(model), + onStepFinish: (step) => { + console.log(JSON.stringify(step, null, 2)) + }, + prompt: 'What is the weather in my current location?', + + tools: { + currentLocation: tool({ + description: 'Get the current location.', + execute: async () => { + const locations = ['New York', 'London', 'Paris'] + return { + location: locations[Math.floor(Math.random() * locations.length)], + } + }, + parameters: z.object({}), + }), + weather: tool({ + description: 'Get the weather in a location', + execute: async ({ location }) => ({ + location, + temperature: 72 + Math.floor(Math.random() * 21) - 10, + }), + parameters: z.object({ + location: z.string().describe('The location to get the weather for'), + }), + }), + }, + }) +} + +buildProgram('qwen2.5', main).catch(console.error) diff --git a/examples/ai-core/src/stream-object/ollama-array.ts b/examples/ai-core/src/stream-object/ollama-array.ts new file mode 100755 index 0000000..d8cce40 --- /dev/null +++ b/examples/ai-core/src/stream-object/ollama-array.ts @@ -0,0 +1,27 @@ +#! /usr/bin/env -S pnpm tsx + +import { streamObject } from 'ai' +import { ollama } from 'ollama-ai-provider' +import { z } from 'zod' + +import { buildProgram } from '../tools/command' + +async function main(model: Parameters[0]) { + const { elementStream: destinations } = await streamObject({ + model: ollama(model), + output: 'array', + prompt: 'What are the top 5 cities for short vacations in Europe?', + schema: z.object({ + attractions: z.array(z.string()).describe('List of major attractions.'), + city: z.string(), + country: z.string(), + description: z.string(), + }), + }) + + for await (const destination of destinations) { + console.log(destination) // destination is a complete array element + } +} + +buildProgram('llama3.1', main).catch(console.error)