Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat: adds prompt playground (#1443)

Hassieb Pakzadda3eccd6ae87
diff --git a/.env.dev.example b/.env.dev.example
index d4644213ec..a11a8a73b0 100644
--- a/.env.dev.example
+++ b/.env.dev.example
@@ -31,6 +31,10 @@ S3_SECRET_ACCESS_KEY=
S3_BUCKET_NAME=
S3_REGION=
+# Prompt playground
+OPENAI_API_KEY=""
+ANTHROPIC_API_KEY=""
+
# Set during docker build of application
# Used to disable environment verification at build time
# DOCKER_BUILD=1
\ No newline at end of file
diff --git a/.env.local.example b/.env.local.example
index a8b46ee67d..29a036972b 100644
--- a/.env.local.example
+++ b/.env.local.example
@@ -12,3 +12,8 @@ NEXTAUTH_URL="http://localhost:3000"
# feature flag to enable experimental features locally
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES="false"
SALT="salt"
+
+
+# Prompt playground
+OPENAI_API_KEY=""
+ANTHROPIC_API_KEY=""
\ No newline at end of file
diff --git a/.env.prod.example b/.env.prod.example
index 17fc926e53..d1c697f39e 100644
--- a/.env.prod.example
+++ b/.env.prod.example
@@ -65,6 +65,9 @@ SALT="salt"
# DB_EXPORT_PAGE_SIZE=1000
+# Prompt playground
+# OPENAI_API_KEY=""
+# ANTHROPIC_API_KEY=""
### START Langfuse Cloud Config
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 56321b54d1..08463aacaf 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -155,6 +155,15 @@ importers:
'@hookform/resolvers':
specifier: ^3.3.4
version: 3.3.4([email protected])
+ '@langchain/anthropic':
+ specifier: ^0.1.8
+ version: 0.1.8
+ '@langchain/core':
+ specifier: ^0.1.49
+ version: 0.1.49
+ '@langchain/openai':
+ specifier: ^0.0.23
+ version: 0.0.23
'@langfuse/shared':
specifier: workspace:*
version: link:../packages/shared
@@ -275,6 +284,9 @@ importers:
'@trpc/server':
specifier: ^10.45.0
version: 10.45.2
+ ai:
+ specifier: ^3.0.11
bcryptjs:
specifier: ^2.4.3
version: 2.4.3
@@ -308,6 +320,9 @@ importers:
kysely:
specifier: ^0.27.3
version: 0.27.3
+ langchain:
+ specifier: ^0.1.28
+ version: 0.1.28(@aws-sdk/[email protected])(@aws-sdk/[email protected])([email protected])
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -624,6 +639,38 @@ packages:
hasBin: true
dev: false
+ /@anthropic-ai/[email protected]:
+ resolution: {integrity: sha512-xDfL/OblarYcwTSN2xBhynXJTkaTaxr8/v1fRKdT3grOZ4TrzIdrFfaTM771proR4g3uLe76PFSF3+gPjI6Gpw==}
+ dependencies:
+ '@types/node': 18.19.25
+ '@types/node-fetch': 2.6.11
+ abort-controller: 3.0.0
+ agentkeepalive: 4.5.0
+ digest-fetch: 1.3.0
+ form-data-encoder: 1.7.2
+ formdata-node: 4.4.1
+ node-fetch: 2.7.0
+ web-streams-polyfill: 3.3.3
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ /@anthropic-ai/[email protected]:
+ resolution: {integrity: sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==}
+ dependencies:
+ '@types/node': 18.19.25
+ '@types/node-fetch': 2.6.11
+ abort-controller: 3.0.0
+ agentkeepalive: 4.5.0
+ digest-fetch: 1.3.0
+ form-data-encoder: 1.7.2
+ formdata-node: 4.4.1
+ node-fetch: 2.7.0
+ web-streams-polyfill: 3.3.3
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
/@anthropic-ai/[email protected]:
resolution: {integrity: sha512-EHRKbxlxlc8W4KCBEseByJ7YwyYCmgu9OyN59H9+IYIGPoKv8tXyQXinkeGDI+cI8Tiuz9wk2jZb/kK7AyvL7g==}
dependencies:
@@ -2296,6 +2343,335 @@ packages:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.4.15
+ /@langchain/[email protected]:
+ resolution: {integrity: sha512-MW/0TtVyaEmFn7gmWRhH5qB8F5knDXDq4Arqd3MiP3u/8VqYF5tBa2ur4nsrsjH8keGpOPnTeZW3sDwoZgBnSQ==}
+ engines: {node: '>=18'}
+ dependencies:
+ '@anthropic-ai/sdk': 0.17.2
+ '@langchain/core': 0.1.49
+ fast-xml-parser: 4.3.6
+ zod: 3.22.4
+ zod-to-json-schema: 3.22.5([email protected])
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ resolution: {integrity: sha512-8QvA/Gx95ijUxmH3amj1La6Rl9NmMCnif802q/Y2zze+SW2bgeF7brC6n2BIui2GYUQlCDBoga/QZ2lPqPM6vg==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@aws-crypto/sha256-js': ^5.0.0
+ '@aws-sdk/client-bedrock-agent-runtime': ^3.485.0
+ '@aws-sdk/client-bedrock-runtime': ^3.422.0
+ '@aws-sdk/client-dynamodb': ^3.310.0
+ '@aws-sdk/client-kendra': ^3.352.0
+ '@aws-sdk/client-lambda': ^3.310.0
+ '@aws-sdk/client-sagemaker-runtime': ^3.310.0
+ '@aws-sdk/client-sfn': ^3.310.0
+ '@aws-sdk/credential-provider-node': ^3.388.0
+ '@azure/search-documents': ^12.0.0
+ '@clickhouse/client': ^0.2.5
+ '@cloudflare/ai': '*'
+ '@datastax/astra-db-ts': ^0.1.4
+ '@elastic/elasticsearch': ^8.4.0
+ '@getmetal/metal-sdk': '*'
+ '@getzep/zep-js': ^0.9.0
+ '@gomomento/sdk': ^1.51.1
+ '@gomomento/sdk-core': ^1.51.1
+ '@google-ai/generativelanguage': ^0.2.1
+ '@gradientai/nodejs-sdk': ^1.2.0
+ '@huggingface/inference': ^2.6.4
+ '@mozilla/readability': '*'
+ '@opensearch-project/opensearch': '*'
+ '@pinecone-database/pinecone': '*'
+ '@planetscale/database': ^1.8.0
+ '@qdrant/js-client-rest': ^1.2.0
+ '@raycast/api': ^1.55.2
+ '@rockset/client': ^0.9.1
+ '@smithy/eventstream-codec': ^2.0.5
+ '@smithy/protocol-http': ^3.0.6
+ '@smithy/signature-v4': ^2.0.10
+ '@smithy/util-utf8': ^2.0.0
+ '@supabase/postgrest-js': ^1.1.1
+ '@supabase/supabase-js': ^2.10.0
+ '@tensorflow-models/universal-sentence-encoder': '*'
+ '@tensorflow/tfjs-converter': '*'
+ '@tensorflow/tfjs-core': '*'
+ '@upstash/redis': ^1.20.6
+ '@upstash/vector': ^1.0.2
+ '@vercel/kv': ^0.2.3
+ '@vercel/postgres': ^0.5.0
+ '@writerai/writer-sdk': ^0.40.2
+ '@xata.io/client': ^0.28.0
+ '@xenova/transformers': ^2.5.4
+ '@zilliz/milvus2-sdk-node': '>=2.2.7'
+ better-sqlite3: ^9.4.0
+ cassandra-driver: ^4.7.2
+ cborg: ^4.1.1
+ chromadb: '*'
+ closevector-common: 0.1.3
+ closevector-node: 0.1.6
+ closevector-web: 0.1.6
+ cohere-ai: '*'
+ convex: ^1.3.1
+ couchbase: ^4.3.0
+ discord.js: ^14.14.1
+ dria: ^0.0.3
+ faiss-node: ^0.5.1
+ firebase-admin: ^11.9.0 || ^12.0.0
+ google-auth-library: ^8.9.0
+ googleapis: ^126.0.1
+ hnswlib-node: ^1.4.2
+ html-to-text: ^9.0.5
+ interface-datastore: ^8.2.11
+ ioredis: ^5.3.2
+ it-all: ^3.0.4
+ jsdom: '*'
+ jsonwebtoken: ^9.0.2
+ llmonitor: ^0.5.9
+ lodash: ^4.17.21
+ lunary: ^0.6.11
+ mongodb: '>=5.2.0'
+ mysql2: ^3.3.3
+ neo4j-driver: '*'
+ node-llama-cpp: '*'
+ pg: ^8.11.0
+ pg-copy-streams: ^6.0.5
+ pickleparser: ^0.2.1
+ portkey-ai: ^0.1.11
+ redis: '*'
+ replicate: ^0.18.0
+ typeorm: ^0.3.12
+ typesense: ^1.5.3
+ usearch: ^1.1.1
+ vectordb: ^0.1.4
+ voy-search: 0.6.2
+ weaviate-ts-client: '*'
+ web-auth-library: ^1.0.3
+ ws: ^8.14.2
+ peerDependenciesMeta:
+ '@aws-crypto/sha256-js':
+ optional: true
+ '@aws-sdk/client-bedrock-agent-runtime':
+ optional: true
+ '@aws-sdk/client-bedrock-runtime':
+ optional: true
+ '@aws-sdk/client-dynamodb':
+ optional: true
+ '@aws-sdk/client-kendra':
+ optional: true
+ '@aws-sdk/client-lambda':
+ optional: true
+ '@aws-sdk/client-sagemaker-runtime':
+ optional: true
+ '@aws-sdk/client-sfn':
+ optional: true
+ '@aws-sdk/credential-provider-node':
+ optional: true
+ '@azure/search-documents':
+ optional: true
+ '@clickhouse/client':
+ optional: true
+ '@cloudflare/ai':
+ optional: true
+ '@datastax/astra-db-ts':
+ optional: true
+ '@elastic/elasticsearch':
+ optional: true
+ '@getmetal/metal-sdk':
+ optional: true
+ '@getzep/zep-js':
+ optional: true
+ '@gomomento/sdk':
+ optional: true
+ '@gomomento/sdk-core':
+ optional: true
+ '@google-ai/generativelanguage':
+ optional: true
+ '@gradientai/nodejs-sdk':
+ optional: true
+ '@huggingface/inference':
+ optional: true
+ '@mozilla/readability':
+ optional: true
+ '@opensearch-project/opensearch':
+ optional: true
+ '@pinecone-database/pinecone':
+ optional: true
+ '@planetscale/database':
+ optional: true
+ '@qdrant/js-client-rest':
+ optional: true
+ '@raycast/api':
+ optional: true
+ '@rockset/client':
+ optional: true
+ '@smithy/eventstream-codec':
+ optional: true
+ '@smithy/protocol-http':
+ optional: true
+ '@smithy/signature-v4':
+ optional: true
+ '@smithy/util-utf8':
+ optional: true
+ '@supabase/postgrest-js':
+ optional: true
+ '@supabase/supabase-js':
+ optional: true
+ '@tensorflow-models/universal-sentence-encoder':
+ optional: true
+ '@tensorflow/tfjs-converter':
+ optional: true
+ '@tensorflow/tfjs-core':
+ optional: true
+ '@upstash/redis':
+ optional: true
+ '@upstash/vector':
+ optional: true
+ '@vercel/kv':
+ optional: true
+ '@vercel/postgres':
+ optional: true
+ '@writerai/writer-sdk':
+ optional: true
+ '@xata.io/client':
+ optional: true
+ '@xenova/transformers':
+ optional: true
+ '@zilliz/milvus2-sdk-node':
+ optional: true
+ better-sqlite3:
+ optional: true
+ cassandra-driver:
+ optional: true
+ cborg:
+ optional: true
+ chromadb:
+ optional: true
+ closevector-common:
+ optional: true
+ closevector-node:
+ optional: true
+ closevector-web:
+ optional: true
+ cohere-ai:
+ optional: true
+ convex:
+ optional: true
+ couchbase:
+ optional: true
+ discord.js:
+ optional: true
+ dria:
+ optional: true
+ faiss-node:
+ optional: true
+ firebase-admin:
+ optional: true
+ google-auth-library:
+ optional: true
+ googleapis:
+ optional: true
+ hnswlib-node:
+ optional: true
+ html-to-text:
+ optional: true
+ interface-datastore:
+ optional: true
+ ioredis:
+ optional: true
+ it-all:
+ optional: true
+ jsdom:
+ optional: true
+ jsonwebtoken:
+ optional: true
+ llmonitor:
+ optional: true
+ lodash:
+ optional: true
+ lunary:
+ optional: true
+ mongodb:
+ optional: true
+ mysql2:
+ optional: true
+ neo4j-driver:
+ optional: true
+ node-llama-cpp:
+ optional: true
+ pg:
+ optional: true
+ pg-copy-streams:
+ optional: true
+ pickleparser:
+ optional: true
+ portkey-ai:
+ optional: true
+ redis:
+ optional: true
+ replicate:
+ optional: true
+ typeorm:
+ optional: true
+ typesense:
+ optional: true
+ usearch:
+ optional: true
+ vectordb:
+ optional: true
+ voy-search:
+ optional: true
+ weaviate-ts-client:
+ optional: true
+ web-auth-library:
+ optional: true
+ ws:
+ optional: true
+ dependencies:
+ '@aws-sdk/credential-provider-node': 3.535.0
+ '@langchain/core': 0.1.49
+ '@langchain/openai': 0.0.23
+ expr-eval: 2.0.2
+ flat: 5.0.2
+ langsmith: 0.1.14
+ lodash: 4.17.21
+ uuid: 9.0.1
+ zod: 3.22.4
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ /@langchain/[email protected]:
+ resolution: {integrity: sha512-RzJ3DHA+bzvsbw0lPWzg2CiC1x+KEe0qhe50vgBVUt8bDVROiCTao3i6TyRtIofhtVj9uosfmR+IQYiME5zz0A==}
+ engines: {node: '>=18'}
+ dependencies:
+ ansi-styles: 5.2.0
+ camelcase: 6.3.0
+ decamelize: 1.2.0
+ js-tiktoken: 1.0.10
+ langsmith: 0.1.14
+ ml-distance: 4.0.1
+ p-queue: 6.6.2
+ p-retry: 4.6.2
+ uuid: 9.0.1
+ zod: 3.22.4
+ zod-to-json-schema: 3.22.5([email protected])
+ dev: false
+
+ /@langchain/[email protected]:
+ resolution: {integrity: sha512-H5yv2hKQ5JVa6jC1wQxiN2299lJbPc5JUv93c6IUw+0jr0kFqH48NWbcythz1UFj2rOpZdaFJSYJs2nr9bhVLg==}
+ engines: {node: '>=18'}
+ dependencies:
+ '@langchain/core': 0.1.49
+ js-tiktoken: 1.0.10
+ openai: 4.29.2
+ zod: 3.22.4
+ zod-to-json-schema: 3.22.5([email protected])
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==}
engines: {node: '>= 0.4'}
@@ -5439,6 +5815,10 @@ packages:
'@types/ms': 0.7.34
dev: false
+ resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==}
+ dev: false
+
resolution: {integrity: sha512-u5/YPJHo1tvkSF2CE0USEkxon82Z5DBy2xR+qfyYNszpX9qcs4sT6uq2kBbj4BXY1+DBGDPnrhMZV3pKWGNukw==}
dependencies:
@@ -5536,6 +5916,13 @@ packages:
resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==}
dev: false
+ resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==}
+ dependencies:
+ '@types/node': 20.11.29
+ form-data: 4.0.0
+ dev: false
+
resolution: {integrity: sha512-NrNXHJCexZtcbR9K1hsv1fSbwAwnhv7ql7l331aKvW0sej5H0NY1o64BHe0AA2ZoQuTm7NE6fyNW079MOWXe4Q==}
dependencies:
@@ -5628,7 +6015,6 @@ packages:
resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==}
- dev: true
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
@@ -6063,6 +6449,79 @@ packages:
pretty-format: 29.7.0
dev: true
+ resolution: {integrity: sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==}
+ dependencies:
+ '@babel/parser': 7.24.0
+ '@vue/shared': 3.4.21
+ entities: 4.5.0
+ estree-walker: 2.0.2
+ source-map-js: 1.1.0
+ dev: false
+
+ resolution: {integrity: sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==}
+ dependencies:
+ '@vue/compiler-core': 3.4.21
+ '@vue/shared': 3.4.21
+ dev: false
+
+ resolution: {integrity: sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==}
+ dependencies:
+ '@babel/parser': 7.24.0
+ '@vue/compiler-core': 3.4.21
+ '@vue/compiler-dom': 3.4.21
+ '@vue/compiler-ssr': 3.4.21
+ '@vue/shared': 3.4.21
+ estree-walker: 2.0.2
+ magic-string: 0.30.8
+ postcss: 8.4.36
+ source-map-js: 1.1.0
+ dev: false
+
+ resolution: {integrity: sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==}
+ dependencies:
+ '@vue/compiler-dom': 3.4.21
+ '@vue/shared': 3.4.21
+ dev: false
+
+ resolution: {integrity: sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==}
+ dependencies:
+ '@vue/shared': 3.4.21
+ dev: false
+
+ resolution: {integrity: sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==}
+ dependencies:
+ '@vue/reactivity': 3.4.21
+ '@vue/shared': 3.4.21
+ dev: false
+
+ resolution: {integrity: sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==}
+ dependencies:
+ '@vue/runtime-core': 3.4.21
+ '@vue/shared': 3.4.21
+ csstype: 3.1.3
+ dev: false
+
+ resolution: {integrity: sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==}
+ peerDependencies:
+ vue: 3.4.21
+ dependencies:
+ '@vue/compiler-ssr': 3.4.21
+ '@vue/shared': 3.4.21
+ vue: 3.4.21([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==}
+ dev: false
+
resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
deprecated: Use your platform's native atob() and btoa() methods instead
@@ -6131,6 +6590,13 @@ packages:
transitivePeerDependencies:
- supports-color
+ resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==}
+ engines: {node: '>= 8.0.0'}
+ dependencies:
+ humanize-ms: 1.2.1
+ dev: false
+
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
engines: {node: '>=8'}
@@ -6139,6 +6605,43 @@ packages:
indent-string: 4.0.0
dev: false
+ resolution: {integrity: sha512-fDrYnVTdMJuS/qYUq0T/CX3WDuTfcZFie9LkgnoQ2layfUG2Wzh/mpfkfYXFEq/mqnpep3xUtECOB1weyyvwUg==}
+ engines: {node: '>=14.6'}
+ 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
+ dependencies:
+ eventsource-parser: 1.0.0
+ jsondiffpatch: 0.6.0
+ nanoid: 3.3.6
+ react: 18.2.0
+ solid-js: 1.8.16
+ solid-swr-store: 0.10.7([email protected])([email protected])
+ sswr: 2.0.0([email protected])
+ svelte: 4.2.12
+ swr: 2.2.0([email protected])
+ swr-store: 0.10.6
+ swrv: 1.0.4([email protected])
+ vue: 3.4.21([email protected])
+ zod: 3.22.4
+ zod-to-json-schema: 3.22.5([email protected])
+ dev: false
+
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
dependencies:
@@ -6183,7 +6686,6 @@ packages:
resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
engines: {node: '>=10'}
- dev: true
resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
@@ -6276,7 +6778,6 @@ packages:
resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}
dependencies:
dequal: 2.0.3
- dev: true
resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==}
@@ -6474,6 +6975,12 @@ packages:
dequal: 2.0.3
dev: true
+ resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==}
+ dependencies:
+ dequal: 2.0.3
+ dev: false
+
resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -6556,6 +7063,10 @@ packages:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+ resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==}
+ dev: false
+
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
@@ -6576,6 +7087,10 @@ packages:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
+ resolution: {integrity: sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA==}
+ dev: false
+
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
dependencies:
@@ -6788,7 +7303,6 @@ packages:
resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
engines: {node: '>=10'}
- dev: true
resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==}
@@ -6847,6 +7361,10 @@ packages:
resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
dev: true
+ resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==}
+ dev: false
+
resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==}
dependencies:
@@ -7021,6 +7539,16 @@ packages:
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
dev: true
+ resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==}
+ 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
+ dev: false
+
resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==}
dev: true
@@ -7230,6 +7758,10 @@ packages:
shebang-command: 2.0.0
which: 2.0.2
+ resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==}
+ dev: false
+
resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==}
engines: {node: '>=8'}
@@ -7246,6 +7778,14 @@ packages:
resolution: {integrity: sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==}
dev: false
+ resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
+ dependencies:
+ mdn-data: 2.0.30
+ source-map-js: 1.1.0
+ dev: false
+
resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
dev: true
@@ -7443,6 +7983,11 @@ packages:
ms: 2.1.2
supports-color: 5.5.0
+ resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
dev: false
@@ -7605,7 +8150,6 @@ packages:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
- dev: true
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
@@ -7642,6 +8186,10 @@ packages:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
+ resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==}
+ dev: false
+
resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -7656,6 +8204,13 @@ packages:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
+ resolution: {integrity: sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==}
+ dependencies:
+ base-64: 0.1.0
+ md5: 2.3.0
+ dev: false
+
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
@@ -8101,7 +8656,7 @@ packages:
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])
+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.8.0([email protected])
eslint-plugin-react: 7.34.1([email protected])
eslint-plugin-react-hooks: 4.6.0([email protected])
@@ -8174,7 +8729,7 @@ packages:
enhanced-resolve: 5.16.0
eslint: 8.57.0
eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])
+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])
fast-glob: 3.3.2
get-tsconfig: 4.7.3
is-core-module: 2.13.1
@@ -8196,7 +8751,7 @@ packages:
debug: 4.3.4([email protected])
enhanced-resolve: 5.16.0
eslint: 8.57.0
- eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
+ eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected])
eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])
fast-glob: 3.3.2
get-tsconfig: 4.7.3
@@ -8234,12 +8789,12 @@ packages:
debug: 3.2.7
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dev: true
resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==}
engines: {node: '>=4'}
peerDependencies:
@@ -8260,10 +8815,39 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
- '@typescript-eslint/parser': 7.3.1([email protected])([email protected])
+ '@typescript-eslint/parser': 6.21.0([email protected])([email protected])
debug: 3.2.7
eslint: 8.57.0
- eslint-import-resolver-node: 0.3.9
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ '@typescript-eslint/parser': '*'
+ eslint: '*'
+ eslint-import-resolver-node: '*'
+ eslint-import-resolver-typescript: '*'
+ eslint-import-resolver-webpack: '*'
+ peerDependenciesMeta:
+ '@typescript-eslint/parser':
+ optional: true
+ eslint:
+ optional: true
+ eslint-import-resolver-node:
+ optional: true
+ eslint-import-resolver-typescript:
+ optional: true
+ eslint-import-resolver-webpack:
+ optional: true
+ dependencies:
+ '@typescript-eslint/parser': 7.3.1([email protected])([email protected])
+ debug: 3.2.7
+ eslint: 8.57.0
+ eslint-import-resolver-node: 0.3.9
transitivePeerDependencies:
- supports-color
dev: true
@@ -8291,7 +8875,7 @@ packages:
ignore: 5.3.1
dev: true
resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}
engines: {node: '>=4'}
peerDependencies:
@@ -8684,7 +9268,6 @@ packages:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
dependencies:
'@types/estree': 1.0.5
- dev: true
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
@@ -8722,6 +9305,11 @@ packages:
engines: {node: '>=0.8.x'}
dev: false
+ resolution: {integrity: sha512-9jgfSCa3dmEme2ES3mPByGXfgZ87VbP97tng1G2nWwWx6bV2nYxm2AWCrbQjXToSe+yYlqaZNtxffR9IeQr95g==}
+ engines: {node: '>=14.18'}
+ dev: false
+
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
engines: {node: '>=10'}
@@ -8771,6 +9359,10 @@ packages:
resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==}
dev: false
+ resolution: {integrity: sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==}
+ dev: false
+
resolution: {integrity: sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==}
engines: {node: '>= 0.10.0'}
@@ -8878,6 +9470,13 @@ packages:
strnum: 1.0.5
dev: false
+ resolution: {integrity: sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==}
+ hasBin: true
+ dependencies:
+ strnum: 1.0.5
+ dev: false
+
resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
dependencies:
@@ -8973,6 +9572,11 @@ packages:
rimraf: 3.0.2
dev: true
+ resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
+ hasBin: true
+ dev: false
+
resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==}
dev: true
@@ -9000,6 +9604,10 @@ packages:
cross-spawn: 7.0.3
signal-exit: 4.1.0
+ resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==}
+ dev: false
+
resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==}
engines: {node: '>= 14.17'}
@@ -9013,6 +9621,14 @@ packages:
combined-stream: 1.0.8
mime-types: 2.1.35
+ resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==}
+ engines: {node: '>= 12.20'}
+ dependencies:
+ node-domexception: 1.0.0
+ web-streams-polyfill: 4.0.0-beta.3
+ dev: false
+
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
engines: {node: '>=12.20.0'}
@@ -9549,6 +10165,12 @@ packages:
engines: {node: '>=16.17.0'}
dev: true
+ resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==}
+ dependencies:
+ ms: 2.1.3
+ dev: false
+
resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==}
dev: false
@@ -9715,6 +10337,10 @@ packages:
engines: {node: '>= 0.10'}
dev: false
+ resolution: {integrity: sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ==}
+ dev: false
+
resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
engines: {node: '>= 0.4'}
@@ -9761,6 +10387,10 @@ packages:
has-tostringtag: 1.0.2
dev: true
+ resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==}
+ dev: false
+
resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==}
engines: {node: '>=6'}
@@ -9930,6 +10560,12 @@ packages:
'@types/estree': 1.0.5
dev: false
+ resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==}
+ dependencies:
+ '@types/estree': 1.0.5
+ dev: false
+
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
@@ -10785,6 +11421,16 @@ packages:
resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==}
dev: true
+ resolution: {integrity: sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+ dependencies:
+ '@types/diff-match-patch': 1.0.36
+ chalk: 5.3.0
+ diff-match-patch: 1.0.5
+ dev: false
+
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
dependencies:
@@ -10792,6 +11438,11 @@ packages:
optionalDependencies:
graceful-fs: 4.2.11
+ resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
engines: {node: '>=4.0'}
@@ -10849,6 +11500,267 @@ packages:
resolution: {integrity: sha512-lG03Ru+XyOJFsjH3OMY6R/9U38IjDPfnOfDgO3ynhbDr+Dz8fak+X6L62vqu3iybQnj+lG84OttBuU9KY3L9kA==}
engines: {node: '>=14.0.0'}
+ resolution: {integrity: sha512-LNuILtOSFptfOqDwUwQAl7B0dYrBtxzVZ6lDhc5DA8rk+pyTCy12HQO7t8bGqC8oQlEPYPKaom8VRlvfupUBTw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@aws-sdk/client-s3': ^3.310.0
+ '@aws-sdk/client-sagemaker-runtime': ^3.310.0
+ '@aws-sdk/client-sfn': ^3.310.0
+ '@aws-sdk/credential-provider-node': ^3.388.0
+ '@azure/storage-blob': ^12.15.0
+ '@gomomento/sdk': ^1.51.1
+ '@gomomento/sdk-core': ^1.51.1
+ '@gomomento/sdk-web': ^1.51.1
+ '@google-ai/generativelanguage': ^0.2.1
+ '@google-cloud/storage': ^6.10.1 || ^7.7.0
+ '@notionhq/client': ^2.2.10
+ '@pinecone-database/pinecone': '*'
+ '@supabase/supabase-js': ^2.10.0
+ '@vercel/kv': ^0.2.3
+ '@xata.io/client': ^0.28.0
+ apify-client: ^2.7.1
+ assemblyai: ^4.0.0
+ axios: '*'
+ cheerio: ^1.0.0-rc.12
+ chromadb: '*'
+ convex: ^1.3.1
+ couchbase: ^4.2.10
+ d3-dsv: ^2.0.0
+ epub2: ^3.0.1
+ faiss-node: '*'
+ fast-xml-parser: '*'
+ google-auth-library: ^8.9.0
+ handlebars: ^4.7.8
+ html-to-text: ^9.0.5
+ ignore: ^5.2.0
+ ioredis: ^5.3.2
+ jsdom: '*'
+ mammoth: ^1.6.0
+ mongodb: '>=5.2.0'
+ node-llama-cpp: '*'
+ notion-to-md: ^3.1.0
+ officeparser: ^4.0.4
+ pdf-parse: 1.1.1
+ peggy: ^3.0.2
+ playwright: ^1.32.1
+ puppeteer: ^19.7.2
+ pyodide: ^0.24.1
+ redis: ^4.6.4
+ sonix-speech-recognition: ^2.1.1
+ srt-parser-2: ^1.2.3
+ typeorm: ^0.3.12
+ weaviate-ts-client: '*'
+ web-auth-library: ^1.0.3
+ ws: ^8.14.2
+ youtube-transcript: ^1.0.6
+ youtubei.js: ^9.1.0
+ peerDependenciesMeta:
+ '@aws-sdk/client-s3':
+ optional: true
+ '@aws-sdk/client-sagemaker-runtime':
+ optional: true
+ '@aws-sdk/client-sfn':
+ optional: true
+ '@aws-sdk/credential-provider-node':
+ optional: true
+ '@azure/storage-blob':
+ optional: true
+ '@gomomento/sdk':
+ optional: true
+ '@gomomento/sdk-core':
+ optional: true
+ '@gomomento/sdk-web':
+ optional: true
+ '@google-ai/generativelanguage':
+ optional: true
+ '@google-cloud/storage':
+ optional: true
+ '@notionhq/client':
+ optional: true
+ '@pinecone-database/pinecone':
+ optional: true
+ '@supabase/supabase-js':
+ optional: true
+ '@vercel/kv':
+ optional: true
+ '@xata.io/client':
+ optional: true
+ apify-client:
+ optional: true
+ assemblyai:
+ optional: true
+ axios:
+ optional: true
+ cheerio:
+ optional: true
+ chromadb:
+ optional: true
+ convex:
+ optional: true
+ couchbase:
+ optional: true
+ d3-dsv:
+ optional: true
+ epub2:
+ optional: true
+ faiss-node:
+ optional: true
+ fast-xml-parser:
+ optional: true
+ google-auth-library:
+ optional: true
+ handlebars:
+ optional: true
+ html-to-text:
+ optional: true
+ ignore:
+ optional: true
+ ioredis:
+ optional: true
+ jsdom:
+ optional: true
+ mammoth:
+ optional: true
+ mongodb:
+ optional: true
+ node-llama-cpp:
+ optional: true
+ notion-to-md:
+ optional: true
+ officeparser:
+ optional: true
+ pdf-parse:
+ optional: true
+ peggy:
+ optional: true
+ playwright:
+ optional: true
+ puppeteer:
+ optional: true
+ pyodide:
+ optional: true
+ redis:
+ optional: true
+ sonix-speech-recognition:
+ optional: true
+ srt-parser-2:
+ optional: true
+ typeorm:
+ optional: true
+ weaviate-ts-client:
+ optional: true
+ web-auth-library:
+ optional: true
+ ws:
+ optional: true
+ youtube-transcript:
+ optional: true
+ youtubei.js:
+ optional: true
+ dependencies:
+ '@anthropic-ai/sdk': 0.9.1
+ '@aws-sdk/client-s3': 3.536.0
+ '@aws-sdk/credential-provider-node': 3.535.0
+ '@langchain/community': 0.0.41(@aws-sdk/[email protected])([email protected])
+ '@langchain/core': 0.1.49
+ '@langchain/openai': 0.0.23
+ binary-extensions: 2.3.0
+ expr-eval: 2.0.2
+ js-tiktoken: 1.0.10
+ js-yaml: 4.1.0
+ jsonpointer: 5.0.1
+ langchainhub: 0.0.8
+ langsmith: 0.1.14
+ ml-distance: 4.0.1
+ openapi-types: 12.1.3
+ p-retry: 4.6.2
+ uuid: 9.0.1
+ yaml: 2.4.1
+ zod: 3.22.4
+ zod-to-json-schema: 3.22.5([email protected])
+ transitivePeerDependencies:
+ - '@aws-crypto/sha256-js'
+ - '@aws-sdk/client-bedrock-agent-runtime'
+ - '@aws-sdk/client-bedrock-runtime'
+ - '@aws-sdk/client-dynamodb'
+ - '@aws-sdk/client-kendra'
+ - '@aws-sdk/client-lambda'
+ - '@azure/search-documents'
+ - '@clickhouse/client'
+ - '@cloudflare/ai'
+ - '@datastax/astra-db-ts'
+ - '@elastic/elasticsearch'
+ - '@getmetal/metal-sdk'
+ - '@getzep/zep-js'
+ - '@gradientai/nodejs-sdk'
+ - '@huggingface/inference'
+ - '@mozilla/readability'
+ - '@opensearch-project/opensearch'
+ - '@planetscale/database'
+ - '@qdrant/js-client-rest'
+ - '@raycast/api'
+ - '@rockset/client'
+ - '@smithy/eventstream-codec'
+ - '@smithy/protocol-http'
+ - '@smithy/signature-v4'
+ - '@smithy/util-utf8'
+ - '@supabase/postgrest-js'
+ - '@tensorflow-models/universal-sentence-encoder'
+ - '@tensorflow/tfjs-converter'
+ - '@tensorflow/tfjs-core'
+ - '@upstash/redis'
+ - '@upstash/vector'
+ - '@vercel/postgres'
+ - '@writerai/writer-sdk'
+ - '@xenova/transformers'
+ - '@zilliz/milvus2-sdk-node'
+ - better-sqlite3
+ - cassandra-driver
+ - cborg
+ - closevector-common
+ - closevector-node
+ - closevector-web
+ - cohere-ai
+ - discord.js
+ - dria
+ - encoding
+ - firebase-admin
+ - googleapis
+ - hnswlib-node
+ - interface-datastore
+ - it-all
+ - jsonwebtoken
+ - llmonitor
+ - lodash
+ - lunary
+ - mysql2
+ - neo4j-driver
+ - pg
+ - pg-copy-streams
+ - pickleparser
+ - portkey-ai
+ - replicate
+ - typesense
+ - usearch
+ - vectordb
+ - voy-search
+ dev: false
+
+ resolution: {integrity: sha512-Woyb8YDHgqqTOZvWIbm2CaFDGfZ4NTSyXV687AG4vXEfoNo7cGQp7nhl7wL3ehenKWmNEmcxCLgOZzW8jE6lOQ==}
+ dev: false
+
+ resolution: {integrity: sha512-iEzQLLB7/0nRpAwNBAR7B7N64fyByg5UsNjSvLaCCkQ9AS68PSafjB8xQkyI8QXXrGjU1dEqDRoa8m4SUuRdUw==}
+ dependencies:
+ '@types/uuid': 9.0.8
+ commander: 10.0.1
+ p-queue: 6.6.2
+ p-retry: 4.6.2
+ uuid: 9.0.1
+ dev: false
+
resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==}
dev: true
@@ -10927,6 +11839,10 @@ packages:
lie: 3.1.1
dev: false
+ resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
+ dev: false
+
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
@@ -11086,7 +12002,6 @@ packages:
engines: {node: '>=12'}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
- dev: true
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
@@ -11120,6 +12035,18 @@ packages:
css-mediaquery: 0.1.2
dev: false
+ resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==}
+ dependencies:
+ charenc: 0.0.2
+ crypt: 0.0.2
+ is-buffer: 1.1.6
+ dev: false
+
+ resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
+ dev: false
+
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
engines: {node: '>= 0.6'}
@@ -11238,6 +12165,37 @@ packages:
minimist: 1.2.8
dev: false
+ resolution: {integrity: sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==}
+ dependencies:
+ ml-array-sum: 1.1.6
+ dev: false
+
+ resolution: {integrity: sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==}
+ dependencies:
+ is-any-array: 2.0.1
+ dev: false
+
+ resolution: {integrity: sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q==}
+ dev: false
+
+ resolution: {integrity: sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==}
+ dependencies:
+ ml-array-mean: 1.1.6
+ ml-distance-euclidean: 2.0.0
+ ml-tree-similarity: 1.0.0
+ dev: false
+
+ resolution: {integrity: sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==}
+ dependencies:
+ binary-search: 1.3.6
+ num-sort: 2.1.0
+ dev: false
+
resolution: {integrity: sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==}
dependencies:
@@ -11291,6 +12249,12 @@ packages:
object-assign: 4.1.1
thenify-all: 1.6.0
+ resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
+ engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
+ hasBin: true
+ dev: false
+
resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -11417,7 +12381,6 @@ packages:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
- dev: true
resolution: {integrity: sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==}
@@ -11590,6 +12553,11 @@ packages:
path-key: 4.0.0
dev: true
+ resolution: {integrity: sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==}
+ engines: {node: '>=8'}
+ dev: false
+
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
dev: true
@@ -11738,6 +12706,27 @@ packages:
is-wsl: 2.2.0
dev: false
+ resolution: {integrity: sha512-cPkT6zjEcE4qU5OW/SoDDuXEsdOLrXlAORhzmaguj5xZSPlgKvLhi27sFWhLKj07Y6WKNWxcwIbzm512FzTBNQ==}
+ hasBin: true
+ dependencies:
+ '@types/node': 18.19.25
+ '@types/node-fetch': 2.6.11
+ abort-controller: 3.0.0
+ agentkeepalive: 4.5.0
+ digest-fetch: 1.3.0
+ form-data-encoder: 1.7.2
+ formdata-node: 4.4.1
+ node-fetch: 2.7.0
+ web-streams-polyfill: 3.3.3
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==}
+ dev: false
+
resolution: {integrity: sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==}
dependencies:
@@ -11814,6 +12803,11 @@ packages:
p-map: 2.1.0
dev: false
+ resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
+ engines: {node: '>=4'}
+ dev: false
+
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'}
@@ -11857,6 +12851,14 @@ packages:
aggregate-error: 3.1.0
dev: false
+ resolution: {integrity: sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ eventemitter3: 4.0.7
+ p-timeout: 3.2.0
+ dev: false
+
resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==}
engines: {node: '>=8'}
@@ -11865,6 +12867,13 @@ packages:
retry: 0.13.1
dev: false
+ resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-finally: 1.0.0
+ dev: false
+
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'}
@@ -12011,6 +13020,14 @@ packages:
resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
+ resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==}
+ dependencies:
+ '@types/estree': 1.0.5
+ estree-walker: 3.0.3
+ is-reference: 3.0.2
+ dev: false
+
resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==}
requiresBuild: true
@@ -13354,6 +14371,20 @@ packages:
resolution: {integrity: sha512-1chMo1dST4pFA9RDXAtF0Rbjaut4is7bzFbI1Z26IuMub68pNCILku85aYmeFhvnY//BXUPUhoRMjYcsT93J/Q==}
dev: false
+ resolution: {integrity: sha512-8+pDC1vOedPXjKG7oz8o+iiHrtF2WswaMQJ7CKFpccvSYfrzmvKY9zOJWCg+881722wIHfwkdnRmiiDm9ym+zQ==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ seroval: ^1.0
+ dependencies:
+ seroval: 1.0.5
+ dev: false
+
+ resolution: {integrity: sha512-TM+Z11tHHvQVQKeNlOUonOWnsNM+2IBwZ4vwoi4j3zKzIpc5IDw8WPwCfcc8F17wy6cBcJGbZbFOR0UCuTZHQA==}
+ engines: {node: '>=10'}
+ dev: false
+
resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==}
engines: {node: '>= 0.8.0'}
@@ -13497,6 +14528,25 @@ packages:
smart-buffer: 4.2.0
dev: true
+ resolution: {integrity: sha512-rja94MNU9flF3qQRLNsu60QHKBDKBkVE1DldJZPIfn2ypIn3NV2WpSbGTQIvsyGPBo+9E2IMjwqnqpbgfWuzeg==}
+ dependencies:
+ csstype: 3.1.3
+ seroval: 1.0.5
+ seroval-plugins: 1.0.5([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ solid-js: ^1.2
+ swr-store: ^0.10
+ dependencies:
+ solid-js: 1.8.16
+ swr-store: 0.10.6
+ dev: false
+
resolution: {integrity: sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==}
dependencies:
@@ -13589,6 +14639,15 @@ packages:
resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
dev: true
+ resolution: {integrity: sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w==}
+ peerDependencies:
+ svelte: ^4.0.0
+ dependencies:
+ svelte: 4.2.12
+ swrev: 4.0.0
+ dev: false
+
resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==}
engines: {node: '>=10'}
@@ -13864,6 +14923,54 @@ packages:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==}
+ engines: {node: '>=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.8
+ periscopic: 3.1.0
+ dev: false
+
+ resolution: {integrity: sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw==}
+ engines: {node: '>=10'}
+ dependencies:
+ dequal: 2.0.3
+ dev: false
+
+ resolution: {integrity: sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==}
+ peerDependencies:
+ react: ^16.11.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ use-sync-external-store: 1.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==}
+ dev: false
+
+ resolution: {integrity: sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==}
+ peerDependencies:
+ vue: '>=3.2.26 < 4'
+ dependencies:
+ vue: 3.4.21([email protected])
+ dev: false
+
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
dev: true
@@ -14793,6 +15900,22 @@ packages:
- terser
dev: true
+ resolution: {integrity: sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@vue/compiler-dom': 3.4.21
+ '@vue/compiler-sfc': 3.4.21
+ '@vue/runtime-dom': 3.4.21
+ '@vue/server-renderer': 3.4.21([email protected])
+ '@vue/shared': 3.4.21
+ typescript: 5.4.2
+ dev: false
+
resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}
engines: {node: '>=14'}
@@ -14815,7 +15938,11 @@ packages:
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
engines: {node: '>= 8'}
- dev: true
+
+ resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==}
+ engines: {node: '>= 14'}
+ dev: false
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
@@ -15111,6 +16238,14 @@ packages:
readable-stream: 3.6.2
dev: false
+ resolution: {integrity: sha512-+akaPo6a0zpVCCseDed504KBJUQpEW5QZw7RMneNmKw+fGaML1Z9tUNLnHHAC8x6dzVRO1eB2oEMyZRnuBZg7Q==}
+ peerDependencies:
+ zod: ^3.22.4
+ dependencies:
+ zod: 3.22.4
+ dev: false
+
resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
dev: false
diff --git a/scripts/nuke.sh b/scripts/nuke.sh
index db5f105a3f..80a454554e 100644
--- a/scripts/nuke.sh
+++ b/scripts/nuke.sh
@@ -7,4 +7,6 @@ find . -iname "bin" -type d -prune -print -exec rm -rf '{}' \;
find . -iname "dist" -type d -prune -print -exec rm -rf '{}' \;
find . -iname "out" -type d -prune -print -exec rm -rf '{}' \;
find . -iname ".turbo" -type d -prune -print -exec rm -rf '{}' \;
-find . -iname "tsconfig.tsbuildinfo" -type d -prune -print -exec rm -rf '{}' \;
\ No newline at end of file
+find . -iname "tsconfig.tsbuildinfo" -type d -prune -print -exec rm -rf '{}' \;
+
+pnpm store prune
diff --git a/web/package.json b/web/package.json
index 2e2f0bc2ea..e36cc5ff61 100644
--- a/web/package.json
+++ b/web/package.json
@@ -27,6 +27,9 @@
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.1.1",
"@hookform/resolvers": "^3.3.4",
+ "@langchain/anthropic": "^0.1.8",
+ "@langchain/core": "^0.1.49",
+ "@langchain/openai": "^0.0.23",
"@langfuse/shared": "workspace:*",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.10.2",
@@ -67,6 +70,7 @@
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
+ "ai": "^3.0.11",
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
@@ -78,6 +82,7 @@
"exponential-backoff": "^3.1.1",
"js-tiktoken": "^1.0.10",
"kysely": "^0.27.3",
+ "langchain": "^0.1.28",
"lodash": "^4.17.21",
"lucide-react": "^0.330.0",
"next": "^14.1.0",
diff --git a/web/src/components/layouts/routes.ts b/web/src/components/layouts/routes.ts
index b5ccd3132b..2c0d01183b 100644
--- a/web/src/components/layouts/routes.ts
+++ b/web/src/components/layouts/routes.ts
@@ -9,6 +9,7 @@ import {
Settings,
UsersIcon,
PenSquareIcon,
+ TerminalIcon,
} from "lucide-react";
export type Route = {
@@ -64,6 +65,12 @@ export const ROUTES: Route[] = [
icon: PenSquareIcon,
rbacScope: "prompts:read",
},
+ {
+ name: "Playground",
+ pathname: "/project/[projectId]/playground",
+ icon: TerminalIcon,
+ featureFlag: "playground",
+ },
{
name: "Datasets",
pathname: `/project/[projectId]/datasets`,
diff --git a/web/src/env.mjs b/web/src/env.mjs
index 292fe6fafd..fe243a5ee6 100644
--- a/web/src/env.mjs
+++ b/web/src/env.mjs
@@ -63,6 +63,9 @@ export const env = createEnv({
S3_REGION: z.string().optional(),
// Database exports
DB_EXPORT_PAGE_SIZE: z.number().optional(),
+ // Prompt playground
+ OPENAI_API_KEY: z.string().optional(),
+ ANTHROPIC_API_KEY: z.string().optional(),
},
/**
@@ -133,6 +136,9 @@ export const env = createEnv({
S3_REGION: process.env.S3_REGION,
// Database exports
DB_EXPORT_PAGE_SIZE: process.env.DB_EXPORT_PAGE_SIZE,
+ // Prompt playground
+ OPENAI_API_KEY: process.env.OPENAI_API_KEY,
+ ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY,
},
// Skip validation in Docker builds
// DOCKER_BUILD is set in Dockerfile
diff --git a/web/src/features/feature-flags/available-flags.ts b/web/src/features/feature-flags/available-flags.ts
index 276ffb57fe..512ec96da8 100644
--- a/web/src/features/feature-flags/available-flags.ts
+++ b/web/src/features/feature-flags/available-flags.ts
@@ -1 +1 @@
-export const availableFlags = ["templateFlag"] as const;
+export const availableFlags = ["templateFlag", "playground"] as const;
diff --git a/web/src/features/playground/client/components/ChatMessageComponent.tsx b/web/src/features/playground/client/components/ChatMessageComponent.tsx
new file mode 100644
index 0000000000..306b7845b1
--- /dev/null
+++ b/web/src/features/playground/client/components/ChatMessageComponent.tsx
@@ -0,0 +1,93 @@
+import { capitalize } from "lodash";
+import { MinusCircleIcon } from "lucide-react";
+import { type ChangeEvent, useEffect, useState, useRef } from "react";
+import {
+ ChatMessageRole,
+ type ChatMessageWithId,
+} from "@/src/features/playground/types";
+import { Button } from "@/src/components/ui/button";
+import { Card, CardContent } from "@/src/components/ui/card";
+import { Textarea } from "@/src/components/ui/textarea";
+import { usePlaygroundContext } from "../context";
+
+type ChatMessageProps = {
+ message: ChatMessageWithId;
+};
+export const ChatMessageComponent: React.FC<ChatMessageProps> = ({
+ message,
+}) => {
+ const textAreaRef = useRef<HTMLTextAreaElement | null>(null);
+ const [textAreaRows, setTextAreaRows] = useState(1);
+
+ const { deleteMessage, updateMessage, updatePromptVariables } =
+ usePlaygroundContext();
+
+ const toggleRole = () => {
+ if (message.role === ChatMessageRole.System) return;
+
+ updateMessage(
+ message.id,
+ "role",
+ message.role === ChatMessageRole.User
+ ? ChatMessageRole.Assistant
+ : ChatMessageRole.User,
+ );
+ };
+
+ const handleContentChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
+ updateMessage(message.id, "content", event.target.value);
+ };
+
+ const placeholder = `Enter ${message.role === ChatMessageRole.User ? "a user" : message.role === ChatMessageRole.System ? "a system" : "an assistant"} message here.`;
+
+ useEffect(() => {
+ const textAreaWidth = textAreaRef.current?.clientWidth ?? 0;
+ const charsPerRow = Math.floor(textAreaWidth / 10);
+
+ setTextAreaRows(
+ countContentRows(message.content, charsPerRow || undefined),
+ );
+ }, [message.content]);
+
+ return (
+ <Card>
+ <CardContent className="flex flex-row space-x-1 pt-6">
+ <div className="min-w-[7rem]">
+ <Button onClick={toggleRole} variant="outline">
+ {capitalize(message.role)}
+ </Button>
+ </div>
+
+ <Textarea
+ ref={textAreaRef}
+ className="height-[auto] min-h-10 w-full font-mono focus:outline-none"
+ placeholder={placeholder}
+ value={message.content}
+ onChange={handleContentChange}
+ onBlur={updatePromptVariables}
+ rows={textAreaRows}
+ />
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={() => deleteMessage(message.id)}
+ disabled={message.role === ChatMessageRole.System}
+ >
+ <MinusCircleIcon />
+ </Button>
+ </CardContent>
+ </Card>
+ );
+};
+
+function countContentRows(str: string, charsPerRow = 80) {
+ const lines = str.split("\n");
+
+ const totalRows = lines.reduce((acc, line) => {
+ const additionalRows = Math.max(1, Math.ceil(line.length / charsPerRow));
+
+ return acc + additionalRows;
+ }, 0);
+
+ return totalRows;
+}
diff --git a/web/src/features/playground/client/components/GenerationOutput.tsx b/web/src/features/playground/client/components/GenerationOutput.tsx
new file mode 100644
index 0000000000..c622c5b190
--- /dev/null
+++ b/web/src/features/playground/client/components/GenerationOutput.tsx
@@ -0,0 +1,85 @@
+import { useEffect, useRef, useState } from "react";
+import { Button } from "@/src/components/ui/button";
+import { usePlaygroundContext } from "../context";
+import { CheckIcon, CopyIcon, PlusIcon } from "@radix-ui/react-icons";
+import { ChatMessageRole } from "@/src/features/playground/types";
+import { BracesIcon } from "lucide-react";
+
+export const GenerationOutput = () => {
+ const [isCopied, setIsCopied] = useState(false);
+ const [isAdded, setIsAdded] = useState(false);
+ const [isJson, setIsJson] = useState(false);
+ const scrollAreaRef = useRef<HTMLDivElement | null>(null);
+ const { output, outputJson, addMessage } = usePlaygroundContext();
+
+ const handleCopy = () => {
+ setIsCopied(true);
+ void navigator.clipboard.writeText(isJson ? outputJson : output);
+ setTimeout(() => setIsCopied(false), 1000);
+ };
+
+ const handleAddAssistantMessage = () => {
+ setIsAdded(true);
+ addMessage(ChatMessageRole.Assistant, output);
+ setTimeout(() => setIsAdded(false), 1000);
+ };
+
+ useEffect(() => {
+ if (scrollAreaRef.current) {
+ const scrollElement = scrollAreaRef.current;
+ scrollElement.scrollTop = scrollElement.scrollHeight;
+ }
+ }, [output]);
+
+ const copyButton = output ? (
+ <div className="absolute right-3 top-2 space-x-1 opacity-50">
+ <Button
+ size="icon"
+ variant={isJson ? "default" : "secondary"}
+ onClick={() => {
+ setIsJson((prev) => !prev);
+ }}
+ title="Toggle Input/Output JSON"
+ >
+ <BracesIcon size={15} />
+ </Button>
+
+ <Button
+ size="icon"
+ variant="secondary"
+ onClick={!isCopied ? handleCopy : undefined}
+ title="Copy output"
+ >
+ {isCopied ? <CheckIcon /> : <CopyIcon />}
+ </Button>
+
+ <Button
+ size="icon"
+ variant="secondary"
+ onClick={!isAdded ? handleAddAssistantMessage : undefined}
+ title="Add as assistant message"
+ >
+ {isAdded ? <CheckIcon /> : <PlusIcon />}
+ </Button>
+ </div>
+ ) : null;
+
+ return (
+ <div className="relative h-full overflow-auto">
+ <div
+ className="h-full overflow-auto rounded-lg bg-gray-100 p-4"
+ ref={scrollAreaRef}
+ >
+ <div className="mb-4 flex w-full items-center">
+ <p className="flex-1 text-xs font-semibold">Output</p>
+ {copyButton}
+ </div>
+ <pre
+ className={`whitespace-break-spaces break-words ${isJson ? "text-xs" : ""}`}
+ >
+ {isJson ? outputJson : output}
+ </pre>
+ </div>
+ </div>
+ );
+};
diff --git a/web/src/features/playground/client/components/Messages.tsx b/web/src/features/playground/client/components/Messages.tsx
new file mode 100644
index 0000000000..d747b9aec6
--- /dev/null
+++ b/web/src/features/playground/client/components/Messages.tsx
@@ -0,0 +1,77 @@
+import { PlusCircleIcon } from "lucide-react";
+import { useEffect, useRef } from "react";
+
+import { ChatMessageRole } from "@/src/features/playground/types";
+import { Button } from "@/src/components/ui/button";
+
+import { usePlaygroundContext } from "../context";
+import { ChatMessageComponent } from "./ChatMessageComponent";
+import { GenerationOutput } from "./GenerationOutput";
+
+export const Messages = () => {
+ // Keep scrolling the view with the streamed generation
+ const scrollAreaRef = useRef<HTMLDivElement | null>(null);
+ const { messages } = usePlaygroundContext();
+ const latestMessage = messages[messages.length - 1];
+
+ useEffect(() => {
+ if (scrollAreaRef.current && latestMessage?.content) {
+ const scrollElement = scrollAreaRef.current;
+ scrollElement.scrollTop = scrollElement.scrollHeight;
+ }
+ }, [latestMessage?.content]);
+
+ return (
+ <div className="flex h-full flex-col space-y-4 pr-4">
+ <p className="font-semibold">Messages</p>
+ <div className="h-full overflow-auto scroll-smooth" ref={scrollAreaRef}>
+ <div className="mb-4 flex-1 space-y-4">
+ {messages.map((message) => {
+ return <ChatMessageComponent {...{ message }} key={message.id} />;
+ })}
+ <AddMessageButton />
+ </div>
+ <div></div>
+ </div>
+ <GenerationOutput />
+ <SubmitButton />
+ </div>
+ );
+};
+
+const AddMessageButton = () => {
+ const { addMessage: createMessage, messages } = usePlaygroundContext();
+ const lastMessageRole = messages[messages.length - 1]?.role;
+ const nextMessageRole =
+ lastMessageRole === ChatMessageRole.User
+ ? ChatMessageRole.Assistant
+ : ChatMessageRole.User;
+
+ return (
+ <Button
+ variant="outline"
+ className="w-full space-x-2 py-6"
+ onClick={() => createMessage(nextMessageRole)}
+ >
+ <PlusCircleIcon />
+ <p>Add message</p>
+ </Button>
+ );
+};
+
+const SubmitButton = () => {
+ const { handleSubmit, isStreaming } = usePlaygroundContext();
+
+ return (
+ <Button
+ variant="default"
+ className="w-full space-x-2 py-6"
+ onClick={() => {
+ handleSubmit().catch((err) => console.error(err));
+ }}
+ loading={isStreaming}
+ >
+ <p>Submit ({"\u2318"} + Enter)</p>
+ </Button>
+ );
+};
diff --git a/web/src/features/playground/client/components/ModelParameters.tsx b/web/src/features/playground/client/components/ModelParameters.tsx
new file mode 100644
index 0000000000..f1ed99e523
--- /dev/null
+++ b/web/src/features/playground/client/components/ModelParameters.tsx
@@ -0,0 +1,161 @@
+import {
+ supportedModels,
+ ModelProvider,
+ type UIModelParams,
+} from "@/src/features/playground/types";
+import { Input } from "@/src/components/ui/input";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/src/components/ui/select";
+import { Slider } from "@/src/components/ui/slider";
+
+import { usePlaygroundContext } from "../context";
+
+export const ModelParameters = () => {
+ const { modelParams } = usePlaygroundContext();
+
+ return (
+ <div className="flex flex-col space-y-4">
+ <p className="font-semibold">Model</p>
+ <div className="space-y-6">
+ <ModelParamsSelect
+ title="Provider"
+ modelParamsKey="provider"
+ value={modelParams.provider}
+ options={Object.values(ModelProvider)}
+ />
+ <ModelParamsSelect
+ title="Model name"
+ modelParamsKey="model"
+ value={modelParams.model}
+ options={Object.values(supportedModels[modelParams.provider])}
+ />
+ <ModelParamsSlider
+ title="Temperature"
+ modelParamsKey="temperature"
+ value={modelParams.temperature}
+ min={0}
+ max={modelParams.maxTemperature}
+ step={0.01}
+ tooltip="The sampling temperature. Higher values will make the output more random, while lower values like will make it more focused and deterministic."
+ />
+ <ModelParamsSlider
+ title="Output token limit"
+ modelParamsKey="max_tokens"
+ value={modelParams.max_tokens}
+ min={1}
+ max={4096}
+ step={1}
+ tooltip="The maximum number of tokens that can be generated in the chat completion."
+ />
+ <ModelParamsSlider
+ title="Top P"
+ modelParamsKey="top_p"
+ value={modelParams.top_p}
+ min={0}
+ max={1}
+ step={0.01}
+ tooltip="An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both."
+ />
+ </div>
+ </div>
+ );
+};
+
+type ModelParamsSelectProps = {
+ title: string;
+ modelParamsKey: keyof UIModelParams;
+ value: string;
+ options: string[];
+};
+const ModelParamsSelect = ({
+ title,
+ modelParamsKey,
+ value,
+ options,
+}: ModelParamsSelectProps) => {
+ const { updateModelParams } = usePlaygroundContext();
+
+ return (
+ <div className="space-y-2">
+ <p className="text-xs font-semibold">{title}</p>
+ <Select
+ onValueChange={(value) =>
+ updateModelParams(
+ modelParamsKey,
+ value as (typeof supportedModels)[ModelProvider][number],
+ )
+ }
+ value={value}
+ >
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {options.map((option) => (
+ <SelectItem value={option} key={option}>
+ {option}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ );
+};
+
+type ModelParamsSliderProps = {
+ title: string;
+ modelParamsKey: keyof UIModelParams;
+ value: number;
+ tooltip: string;
+ min: number;
+ max: number;
+ step: number;
+};
+const ModelParamsSlider = ({
+ title,
+ modelParamsKey,
+ value,
+ tooltip,
+ min,
+ max,
+ step,
+}: ModelParamsSliderProps) => {
+ const { updateModelParams } = usePlaygroundContext();
+
+ return (
+ <div className="space-y-3" title={tooltip}>
+ <div className="flex flex-row">
+ <p className="flex-1 text-xs font-semibold">{title}</p>
+ <Input
+ className="h-6 w-14 appearance-none px-2 text-right"
+ type="number"
+ min={min}
+ max={max}
+ step={step}
+ value={value}
+ onChange={(event) => {
+ updateModelParams(
+ modelParamsKey,
+ Math.max(Math.min(parseFloat(event.target.value), max), min),
+ );
+ }}
+ />
+ </div>
+ <Slider
+ min={min}
+ max={max}
+ step={step}
+ onValueChange={(value) => {
+ if (value[0] !== undefined)
+ updateModelParams(modelParamsKey, value[0]);
+ }}
+ value={[value]}
+ />
+ </div>
+ );
+};
diff --git a/web/src/features/playground/client/components/PromptVariableComponent.tsx b/web/src/features/playground/client/components/PromptVariableComponent.tsx
new file mode 100644
index 0000000000..ab806c3147
--- /dev/null
+++ b/web/src/features/playground/client/components/PromptVariableComponent.tsx
@@ -0,0 +1,50 @@
+import { type ChangeEvent } from "react";
+import { usePlaygroundContext } from "../context";
+import { Input } from "@/src/components/ui/input";
+import { CheckCircle2, Circle, Trash2Icon } from "lucide-react";
+import { Button } from "@/src/components/ui/button";
+import { type PromptVariable } from "@/src/features/playground/types";
+
+export const PromptVariableComponent: React.FC<{
+ promptVariable: PromptVariable;
+}> = ({ promptVariable }) => {
+ const { updatePromptVariableValue, deletePromptVariable } =
+ usePlaygroundContext();
+ const { name, value, isUsed } = promptVariable;
+
+ const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {
+ updatePromptVariableValue(name, event.target.value);
+ };
+ const handleDeleteVariable = () => {
+ deletePromptVariable(name);
+ };
+ const displayName = name.slice(0, 10) + (name.length > 10 ? "..." : "");
+ const isUsedIcon = isUsed ? (
+ <CheckCircle2 size={16} color="green" />
+ ) : (
+ <Circle size={16} color="grey" />
+ );
+ const isUsedTooltip = isUsed
+ ? "Variable is in use"
+ : "Variable is not in use";
+
+ return (
+ <div className="my-2 flex flex-row items-center justify-center space-x-2 text-xs">
+ <p title={isUsedTooltip}>{isUsedIcon}</p>
+ <p className="min-w-[90px] font-mono" title={name}>
+ {displayName}
+ </p>
+ <Input value={value} onChange={handleInputChange} placeholder={name} />
+ <Button
+ variant="ghost"
+ size="icon"
+ title="Delete variable"
+ disabled={isUsed}
+ onClick={handleDeleteVariable}
+ className="p-0"
+ >
+ <Trash2Icon size={16} />
+ </Button>
+ </div>
+ );
+};
diff --git a/web/src/features/playground/client/components/Variables.tsx b/web/src/features/playground/client/components/Variables.tsx
new file mode 100644
index 0000000000..7e66c20791
--- /dev/null
+++ b/web/src/features/playground/client/components/Variables.tsx
@@ -0,0 +1,41 @@
+import { usePlaygroundContext } from "../context";
+import { PromptVariableComponent } from "./PromptVariableComponent";
+
+export const Variables = () => {
+ const { promptVariables } = usePlaygroundContext();
+ const renderNoVariables = () => (
+ <div className="text-xs">
+ <p className="mb-2">No variables defined.</p>
+ <p>
+ Use handlebars in your prompts to add a variable:
+ &#123;&#123;exampleVariable&#125;&#125;
+ </p>
+ </div>
+ );
+ const renderVariables = () => (
+ <div className="h-full overflow-auto pr-4">
+ {promptVariables
+ .sort((a, b) => {
+ if (a.isUsed && !b.isUsed) return -1;
+ if (!a.isUsed && b.isUsed) return 1;
+
+ return a.name.localeCompare(b.name);
+ })
+ .map((promptVariable) => {
+ return (
+ <PromptVariableComponent
+ promptVariable={promptVariable}
+ key={promptVariable.name}
+ />
+ );
+ })}
+ </div>
+ );
+
+ return (
+ <div className="flex h-full flex-col space-y-4">
+ <p className="font-semibold">Variables</p>
+ {promptVariables.length === 0 ? renderNoVariables() : renderVariables()}
+ </div>
+ );
+};
diff --git a/web/src/features/playground/client/context/index.tsx b/web/src/features/playground/client/context/index.tsx
new file mode 100644
index 0000000000..73131964b6
--- /dev/null
+++ b/web/src/features/playground/client/context/index.tsx
@@ -0,0 +1,340 @@
+import React, {
+ createContext,
+ type PropsWithChildren,
+ useCallback,
+ useContext,
+ useEffect,
+ useState,
+} from "react";
+
+import { v4 as uuidv4 } from "uuid";
+
+import useCommandEnter from "@/src/features/playground/client/hooks/useCommandEnter";
+import {
+ type ChatMessageWithId,
+ ChatMessageRole,
+ type UIModelParams,
+ type PromptVariable,
+ ModelProvider,
+} from "@/src/features/playground/types";
+import { extractVariables } from "@/src/utils/string";
+
+type PlaygroundContextType = {
+ promptVariables: PromptVariable[];
+ updatePromptVariables: () => void;
+ updatePromptVariableValue: (variable: string, value: string) => void;
+ deletePromptVariable: (variable: string) => void;
+
+ modelParams: UIModelParams;
+ updateModelParams: <Key extends keyof UIModelParams>(
+ key: Key,
+ value: UIModelParams[Key],
+ ) => void;
+
+ messages: ChatMessageWithId[];
+ addMessage: (role: ChatMessageRole, content?: string) => ChatMessageWithId;
+ deleteMessage: (id: string) => void;
+ updateMessage: <Key extends keyof ChatMessageWithId>(
+ id: string,
+ key: Key,
+ value: ChatMessageWithId[Key],
+ ) => void;
+
+ output: string;
+ outputJson: string;
+
+ handleSubmit: () => Promise<void>;
+ isStreaming: boolean;
+};
+
+const PlaygroundContext = createContext<PlaygroundContextType | undefined>(
+ undefined,
+);
+
+export const usePlaygroundContext = () => {
+ const context = useContext(PlaygroundContext);
+ if (!context) {
+ throw new Error(
+ "usePlaygroundContext must be used within a PlaygroundProvider",
+ );
+ }
+ return context;
+};
+
+export const PlaygroundProvider: React.FC<PropsWithChildren> = ({
+ children,
+}) => {
+ const [promptVariables, setPromptVariables] = useState<PromptVariable[]>([]);
+ const [output, setOutput] = useState("");
+ const [outputJson, setOutputJson] = useState("");
+ const [isStreaming, setIsStreaming] = useState(false);
+ const [messages, setMessages] = useState<ChatMessageWithId[]>([
+ createEmptyMessage(ChatMessageRole.System),
+ createEmptyMessage(ChatMessageRole.User),
+ ]);
+ const [modelParams, setModelParams] = useState<UIModelParams>(
+ getDefaultModelParams(ModelProvider.OpenAI),
+ );
+
+ useEffect(() => {
+ setModelParams(getDefaultModelParams(modelParams.provider));
+ }, [modelParams.provider]);
+
+ const updatePromptVariables = useCallback(() => {
+ const messageContents = messages.map((m) => m.content).join("\n");
+ const variables = extractVariables(messageContents)
+ .map((v) => v.trim())
+ .filter(Boolean);
+
+ setPromptVariables((prev) => {
+ // Update isUsed flag
+ const next = prev.reduce<PromptVariable[]>((acc, v) => {
+ const isUsed = variables.includes(v.name);
+
+ if (!isUsed && !v.value) return acc;
+
+ acc.push({ ...v, isUsed: isUsed });
+
+ return acc;
+ }, []);
+
+ // Create new variables if any
+ for (const variable of variables) {
+ if (!next.some((v) => v.name === variable)) {
+ next.push({ name: variable, value: "", isUsed: true });
+ }
+ }
+
+ return next;
+ });
+ }, [messages]);
+
+ useEffect(updatePromptVariables, [messages, updatePromptVariables]);
+
+ const addMessage: PlaygroundContextType["addMessage"] = (role, content) => {
+ const message = createEmptyMessage(role, content);
+ setMessages((prev) => [...prev, message]);
+
+ return message;
+ };
+
+ const updateMessage: PlaygroundContextType["updateMessage"] = (
+ id,
+ key,
+ value,
+ ) => {
+ setMessages((prev) =>
+ prev.map((message) =>
+ message.id === id ? { ...message, [key]: value } : message,
+ ),
+ );
+ };
+
+ const deleteMessage: PlaygroundContextType["deleteMessage"] = (id) => {
+ setMessages((prev) => prev.filter((message) => message.id !== id));
+ };
+
+ const handleSubmit: PlaygroundContextType["handleSubmit"] =
+ useCallback(async () => {
+ try {
+ setIsStreaming(true);
+ setOutput("");
+ setOutputJson("");
+
+ const finalMessages = getFinalMessages(promptVariables, messages);
+ const leftOverVariables = extractVariables(
+ finalMessages.map((m) => m.content).join(""),
+ );
+
+ if (leftOverVariables.length > 0) {
+ throw Error("Error replacing variables. Please check your inputs.");
+ }
+
+ const completionStream = getChatCompletionStream(
+ finalMessages,
+ modelParams,
+ );
+
+ let response = "";
+ for await (const token of completionStream) {
+ response += token;
+ setOutput(response);
+ }
+ setOutputJson(getOutputJson(response, finalMessages, modelParams));
+ } catch (err) {
+ console.error(err);
+
+ alert(err instanceof Error ? err.message : "An error occurred");
+ // TODO: add error handling via toast
+ } finally {
+ setIsStreaming(false);
+ }
+ }, [messages, modelParams, promptVariables]);
+
+ useCommandEnter(!isStreaming, handleSubmit);
+
+ const updateModelParams: PlaygroundContextType["updateModelParams"] = (
+ key,
+ value,
+ ) => {
+ setModelParams((prev) => ({ ...prev, [key]: value }));
+ };
+
+ const updatePromptVariableValue = (variable: string, value: string) => {
+ setPromptVariables((prev) =>
+ prev.map((v) => (v.name === variable ? { ...v, value } : v)),
+ );
+ };
+
+ const deletePromptVariable = (variable: string) => {
+ setPromptVariables((prev) => prev.filter((v) => v.name !== variable));
+ };
+
+ return (
+ <PlaygroundContext.Provider
+ value={{
+ promptVariables,
+ updatePromptVariables,
+ updatePromptVariableValue,
+ deletePromptVariable,
+
+ messages,
+ addMessage,
+ updateMessage,
+ deleteMessage,
+
+ modelParams,
+ updateModelParams,
+
+ output,
+ outputJson,
+ handleSubmit,
+ isStreaming,
+ }}
+ >
+ {children}
+ </PlaygroundContext.Provider>
+ );
+};
+
+async function* getChatCompletionStream(
+ messages: ChatMessageWithId[],
+ modelParams: UIModelParams,
+) {
+ const body = JSON.stringify({ messages, modelParams });
+ const result = await fetch("/api/chatCompletion", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ });
+
+ if (!result.ok) {
+ throw new Error("Failed to fetch data: " + result.statusText);
+ }
+
+ const reader = result.body?.getReader();
+ if (!reader) {
+ throw new Error("Failed to read response body");
+ }
+
+ const decoder = new TextDecoder("utf-8");
+ try {
+ while (true) {
+ const { done, value } = await reader.read();
+ if (done) break;
+
+ const token = decoder.decode(value);
+
+ yield token;
+ }
+ } catch (error) {
+ throw error;
+ } finally {
+ reader.releaseLock();
+ }
+}
+
+function getFinalMessages(
+ promptVariables: PromptVariable[],
+ messages: ChatMessageWithId[],
+) {
+ const missingVariables = promptVariables.filter((v) => !v.value && v.isUsed);
+ if (missingVariables.length > 0) {
+ throw new Error(
+ `Please set a value for the following variables: ${missingVariables
+ .map((v) => v.name)
+ .join(", ")}`,
+ );
+ }
+
+ // Dynamically replace variables in the prompt
+ const finalMessages = messages.map((m) => {
+ let content = m.content;
+ for (const variable of promptVariables) {
+ content = content.replace(
+ new RegExp(`{{\\s*${variable.name}\\s*}}`, "g"),
+ variable.value,
+ );
+ }
+
+ return { ...m, content };
+ });
+ return finalMessages;
+}
+
+function createEmptyMessage(
+ role: ChatMessageRole,
+ content?: string,
+): ChatMessageWithId {
+ return {
+ role,
+ content: content ?? "",
+ id: uuidv4(),
+ };
+}
+
+function getDefaultModelParams(provider: ModelProvider): UIModelParams {
+ switch (provider) {
+ // Docs: https://platform.openai.com/docs/api-reference/chat/create
+ case ModelProvider.OpenAI:
+ return {
+ provider,
+ model: "gpt-3.5-turbo",
+ temperature: 1,
+ maxTemperature: 2,
+ max_tokens: 256,
+ top_p: 1,
+ };
+
+ // Docs: https://docs.anthropic.com/claude/reference/messages_post
+ case ModelProvider.Anthropic:
+ return {
+ provider,
+ model: "claude-3-opus-20240229",
+ temperature: 0,
+ maxTemperature: 1,
+ max_tokens: 256,
+ top_p: 1,
+ };
+ }
+}
+
+function getOutputJson(
+ output: string,
+ messages: ChatMessageWithId[],
+ modelParams: UIModelParams,
+) {
+ return JSON.stringify(
+ {
+ output,
+ input: messages.map((obj) => filterKeyFromObject(obj, "id")),
+ model: filterKeyFromObject(modelParams, "maxTemperature"),
+ },
+ null,
+ 2,
+ );
+}
+
+function filterKeyFromObject<T extends object>(obj: T, key: keyof T) {
+ return Object.fromEntries(Object.entries(obj).filter(([k, _]) => k !== key));
+}
diff --git a/web/src/features/playground/client/hooks/useCommandEnter.ts b/web/src/features/playground/client/hooks/useCommandEnter.ts
new file mode 100644
index 0000000000..fef2874ebc
--- /dev/null
+++ b/web/src/features/playground/client/hooks/useCommandEnter.ts
@@ -0,0 +1,22 @@
+import { useEffect } from "react";
+
+export default function useCommandEnter(
+ isEnabled: boolean,
+ callback: () => Promise<void>,
+) {
+ useEffect(() => {
+ function handleKeyDown(event: KeyboardEvent) {
+ if (
+ isEnabled &&
+ (event.metaKey || event.ctrlKey) &&
+ event.code === "Enter"
+ ) {
+ callback().catch((err) => console.error(err));
+ }
+ }
+
+ document.addEventListener("keydown", handleKeyDown);
+
+ return () => document.removeEventListener("keydown", handleKeyDown);
+ }, [isEnabled, callback]);
+}
diff --git a/web/src/features/playground/client/index.tsx b/web/src/features/playground/client/index.tsx
new file mode 100644
index 0000000000..95057060bd
--- /dev/null
+++ b/web/src/features/playground/client/index.tsx
@@ -0,0 +1,26 @@
+import { PlaygroundProvider } from "./context";
+import { ModelParameters } from "./components/ModelParameters";
+import { Variables } from "./components/Variables";
+import { Messages } from "./components/Messages";
+
+export default function Playground() {
+ return (
+ <PlaygroundProvider>
+ <div className="flex h-full flex-row space-x-8">
+ <div className="h-full basis-3/4 overflow-auto">
+ <Messages />
+ </div>
+ <div className="h-full basis-1/4 pr-2">
+ <div className="flex h-full flex-col">
+ <div className="basis-[55%] ">
+ <ModelParameters />
+ </div>
+ <div className="basis-[45%] overflow-auto">
+ <Variables />
+ </div>
+ </div>
+ </div>
+ </div>
+ </PlaygroundProvider>
+ );
+}
diff --git a/web/src/features/playground/server/chatCompletionHandler.ts b/web/src/features/playground/server/chatCompletionHandler.ts
new file mode 100644
index 0000000000..92a7e0c84d
--- /dev/null
+++ b/web/src/features/playground/server/chatCompletionHandler.ts
@@ -0,0 +1,43 @@
+import { StreamingTextResponse } from "ai";
+import { getToken } from "next-auth/jwt";
+import { type NextRequest, NextResponse } from "next/server";
+
+import { fetchLLMCompletion } from "./fetchLLMCompletion";
+import {
+ type ValidatedChatCompletionBody,
+ validateChatCompletionBody,
+} from "./validateChatCompletionBody";
+
+export default async function chatCompletionHandler(req: NextRequest) {
+ if (!(await getToken({ req })))
+ return NextResponse.json({ message: "Unauthenticated" }, { status: 401 });
+
+ if (req.method !== "POST")
+ return NextResponse.json(
+ { message: "Method not allowed" },
+ { status: 405 },
+ );
+
+ let body: ValidatedChatCompletionBody;
+
+ try {
+ body = validateChatCompletionBody(await req.json());
+ } catch (err) {
+ return NextResponse.json(
+ {
+ message: "Invalid request body",
+ error: err,
+ },
+ { status: 400 },
+ );
+ }
+
+ const { messages, modelParams } = body;
+ const stream = await fetchLLMCompletion({
+ messages,
+ modelParams,
+ streaming: true,
+ });
+
+ return new StreamingTextResponse(stream);
+}
diff --git a/web/src/features/playground/server/fetchLLMCompletion.ts b/web/src/features/playground/server/fetchLLMCompletion.ts
new file mode 100644
index 0000000000..ae266dee16
--- /dev/null
+++ b/web/src/features/playground/server/fetchLLMCompletion.ts
@@ -0,0 +1,77 @@
+import {
+ type ChatMessage,
+ ChatMessageRole,
+ type ModelParams,
+ ModelProvider,
+} from "@/src/features/playground/types";
+import { ChatAnthropic } from "@langchain/anthropic";
+import {
+ AIMessage,
+ HumanMessage,
+ SystemMessage,
+} from "@langchain/core/messages";
+import {
+ BytesOutputParser,
+ StringOutputParser,
+} from "@langchain/core/output_parsers";
+import { ChatOpenAI } from "@langchain/openai";
+
+type LLMCompletionParams = {
+ messages: ChatMessage[];
+ modelParams: ModelParams;
+};
+
+type FetchLLMCompletionParams = LLMCompletionParams & {
+ streaming: boolean;
+};
+
+export async function fetchLLMCompletion(
+ params: LLMCompletionParams & {
+ streaming: true;
+ },
+): Promise<ReadableStream<Uint8Array>>;
+
+export async function fetchLLMCompletion(
+ params: LLMCompletionParams & {
+ streaming: false;
+ },
+): Promise<string>;
+
+export async function fetchLLMCompletion(
+ params: FetchLLMCompletionParams,
+): Promise<string | ReadableStream<Uint8Array>> {
+ const { messages, modelParams, streaming } = params;
+ const finalMessages = messages.map((message) => {
+ if (message.role === ChatMessageRole.User)
+ return new HumanMessage(message.content);
+ if (message.role === ChatMessageRole.System)
+ return new SystemMessage(message.content);
+
+ return new AIMessage(message.content);
+ });
+
+ let chatModel: ChatOpenAI | ChatAnthropic;
+ if (modelParams.provider === ModelProvider.Anthropic) {
+ chatModel = new ChatAnthropic({
+ anthropicApiKey: process.env.ANTHROPIC_API_KEY,
+ modelName: modelParams.model,
+ temperature: modelParams.temperature,
+ maxTokens: modelParams.max_tokens,
+ topP: modelParams.top_p,
+ });
+ } else {
+ chatModel = new ChatOpenAI({
+ openAIApiKey: process.env.OPENAI_API_KEY,
+ modelName: modelParams.model,
+ temperature: modelParams.temperature,
+ maxTokens: modelParams.max_tokens,
+ topP: modelParams.top_p,
+ });
+ }
+
+ if (streaming) {
+ return chatModel.pipe(new BytesOutputParser()).stream(finalMessages);
+ }
+
+ return await chatModel.pipe(new StringOutputParser()).invoke(finalMessages);
+}
diff --git a/web/src/features/playground/server/validateChatCompletionBody.ts b/web/src/features/playground/server/validateChatCompletionBody.ts
new file mode 100644
index 0000000000..81759d2e1b
--- /dev/null
+++ b/web/src/features/playground/server/validateChatCompletionBody.ts
@@ -0,0 +1,45 @@
+import { z } from "zod";
+import {
+ ChatMessageRole,
+ ModelProvider,
+ anthropicModels,
+ openAIModels,
+} from "@/src/features/playground/types";
+
+const OpenAIModelSchema = z.enum([...openAIModels]);
+const AnthropicModelSchema = z.enum([...anthropicModels]);
+const OpenAIModelParamsSchema = z.object({
+ provider: z.literal(ModelProvider.OpenAI),
+ model: OpenAIModelSchema,
+ max_tokens: z.number().optional(),
+ temperature: z.number().optional(),
+ top_p: z.number().optional(),
+});
+const AnthropicModelParamsSchema = z.object({
+ provider: z.literal(ModelProvider.Anthropic),
+ model: AnthropicModelSchema,
+ temperature: z.number().optional(),
+ max_tokens: z.number().optional(),
+ top_p: z.number().optional(),
+});
+const ModelParamsSchema = z.union([
+ OpenAIModelParamsSchema,
+ AnthropicModelParamsSchema,
+]);
+const MessageSchema = z.object({
+ role: z.nativeEnum(ChatMessageRole),
+ content: z.string(),
+ id: z.string().optional(),
+});
+export const ChatCompletionBodySchema = z.object({
+ messages: z.array(MessageSchema),
+ modelParams: ModelParamsSchema,
+});
+
+export const validateChatCompletionBody = (input: unknown) => {
+ return ChatCompletionBodySchema.parse(input);
+};
+
+export type ValidatedChatCompletionBody = z.infer<
+ typeof ChatCompletionBodySchema
+>;
diff --git a/web/src/features/playground/types.ts b/web/src/features/playground/types.ts
new file mode 100644
index 0000000000..c501051a57
--- /dev/null
+++ b/web/src/features/playground/types.ts
@@ -0,0 +1,74 @@
+export type PromptVariable = { name: string; value: string; isUsed: boolean };
+export type ChatMessage = {
+ role: ChatMessageRole;
+ content: string;
+};
+
+export type ChatMessageWithId = ChatMessage & { id: string };
+
+export enum ModelProvider {
+ Anthropic = "anthropic",
+ OpenAI = "openai",
+}
+export enum ChatMessageRole {
+ System = "system",
+ User = "user",
+ Assistant = "assistant",
+}
+export type ModelParams = AnthropicModelParams | OpenAIModelParams;
+export type UIModelParams = Required<
+ AnthropicModelParams | OpenAIModelParams
+> & {
+ maxTemperature: number;
+};
+
+// Generic config
+export type ModelConfig = {
+ max_tokens?: number;
+ temperature?: number;
+ top_p?: number;
+};
+
+// OpenAI
+export type OpenAIModelParams = {
+ provider: ModelProvider.OpenAI;
+ model: OpenAIModel;
+} & ModelConfig;
+
+export const openAIModels = [
+ "gpt-4-turbo-preview",
+ "gpt-4-1106-preview",
+ "gpt-4-0613",
+ "gpt-4-0125-preview",
+ "gpt-4",
+ "gpt-3.5-turbo-16k-0613",
+ "gpt-3.5-turbo-16k",
+ "gpt-3.5-turbo-1106",
+ "gpt-3.5-turbo-0613",
+ "gpt-3.5-turbo-0301",
+ "gpt-3.5-turbo-0125",
+ "gpt-3.5-turbo",
+] as const;
+
+export type OpenAIModel = (typeof openAIModels)[number];
+
+// Anthropic
+export type AnthropicModelParams = {
+ provider: ModelProvider.Anthropic;
+ model: AnthropicModel;
+} & ModelConfig;
+
+export const anthropicModels = [
+ "claude-3-opus-20240229",
+ "claude-3-sonnet-20240229",
+ "claude-3-haiku-20240307",
+ "claude-2.1",
+ "claude-2.0",
+ "claude-instant-1.2",
+] as const;
+
+export type AnthropicModel = (typeof anthropicModels)[number];
+export const supportedModels = {
+ [ModelProvider.Anthropic]: anthropicModels,
+ [ModelProvider.OpenAI]: openAIModels,
+} as const;
diff --git a/web/src/pages/api/chatCompletion.ts b/web/src/pages/api/chatCompletion.ts
new file mode 100644
index 0000000000..7561203b2e
--- /dev/null
+++ b/web/src/pages/api/chatCompletion.ts
@@ -0,0 +1,5 @@
+import chatCompletionHandler from "@/src/features/playground/server/chatCompletionHandler";
+
+export const runtime = "edge";
+
+export default chatCompletionHandler;
diff --git a/web/src/pages/project/[projectId]/playground.tsx b/web/src/pages/project/[projectId]/playground.tsx
new file mode 100644
index 0000000000..fdf2d3ba1a
--- /dev/null
+++ b/web/src/pages/project/[projectId]/playground.tsx
@@ -0,0 +1,18 @@
+import Header from "@/src/components/layouts/header";
+import Playground from "@/src/features/playground/client";
+
+export default function PlaygroundPage() {
+ return (
+ <div className="flex h-[95vh] flex-col">
+ <Header
+ title="Playground"
+ help={{
+ description: "A sandbox to test and iterate your prompts",
+ }}
+ />
+ <div className="flex-1 overflow-auto">
+ <Playground />
+ </div>
+ </div>
+ );
+}
diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css
index 00ab6dfd17..462fede288 100644
--- a/web/src/styles/globals.css
+++ b/web/src/styles/globals.css
@@ -88,3 +88,15 @@
height: 100%;
}
}
+
+@layer base {
+ input[type="number"].appearance-none::-webkit-inner-spin-button,
+ input[type="number"].appearance-none::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+ }
+ input[type="number"].appearance-none {
+ -moz-appearance: textfield;
+ appearance: none;
+ }
+}