Skip to content

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

chore(evals): move to tool calling instead of function calling (#3430)

Hassieb Pakzad663ded0743d0
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 306beb6d28..efb8e6d64f 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -58,9 +58,9 @@
"@aws-sdk/lib-storage": "^3.645.0",
"@aws-sdk/s3-request-presigner": "^3.554.0",
"@clickhouse/client": "^1.4.0",
- "@langchain/anthropic": "^0.1.21",
- "@langchain/core": "^0.1.61",
- "@langchain/openai": "^0.0.33",
+ "@langchain/anthropic": "^0.3.1",
+ "@langchain/core": "^0.3.3",
+ "@langchain/openai": "^0.3.0",
"@opentelemetry/api": ">=1.0.0 <1.9.0",
"@prisma/client": "^5.17.0",
"@react-email/components": "^0.0.19",
@@ -73,7 +73,7 @@
"exponential-backoff": "^3.1.1",
"ioredis": "^5.4.1",
"kysely": "^0.27.4",
- "langchain": "^0.2.6",
+ "langchain": "^0.3.2",
"lodash": "^4.17.21",
"next-auth": "^4.24.7",
"nodemailer": "^6.9.13",
diff --git a/packages/shared/src/server/llm/fetchLLMCompletion.ts b/packages/shared/src/server/llm/fetchLLMCompletion.ts
index c6d44247d1..e61a5263e3 100644
--- a/packages/shared/src/server/llm/fetchLLMCompletion.ts
+++ b/packages/shared/src/server/llm/fetchLLMCompletion.ts
@@ -1,3 +1,5 @@
+import { type ZodSchema } from "zod";
+
import { ChatAnthropic } from "@langchain/anthropic";
import {
AIMessage,
@@ -12,20 +14,12 @@ import {
import { IterableReadableStream } from "@langchain/core/utils/stream";
import { ChatOpenAI } from "@langchain/openai";
-import {
- ChatMessage,
- ChatMessageRole,
- LLMFunctionCall,
- ModelParams,
- LLMAdapter,
-} from "./types";
-import zodToJsonSchema from "zod-to-json-schema";
-import { JsonOutputFunctionsParser } from "langchain/output_parsers";
+import { ChatMessage, ChatMessageRole, ModelParams, LLMAdapter } from "./types";
type LLMCompletionParams = {
messages: ChatMessage[];
modelParams: ModelParams;
- functionCall?: LLMFunctionCall;
+ structuredOutputSchema?: ZodSchema;
callbacks?: BaseCallbackHandler[];
baseURL?: string;
apiKey?: string;
@@ -51,7 +45,7 @@ export async function fetchLLMCompletion(
export async function fetchLLMCompletion(
params: LLMCompletionParams & {
streaming: false;
- functionCall: LLMFunctionCall;
+ structuredOutputSchema: ZodSchema;
}
): Promise<unknown>;
@@ -121,18 +115,10 @@ export async function fetchLLMCompletion(
throw new Error("This model provider is not supported.");
}
- if (params.functionCall) {
- const functionCallingModel = chatModel.bind({
- functions: [
- {
- ...params.functionCall,
- parameters: zodToJsonSchema(params.functionCall.parameters),
- },
- ],
- function_call: { name: params.functionCall.name },
- });
- const outputParser = new JsonOutputFunctionsParser();
- return await functionCallingModel.pipe(outputParser).invoke(finalMessages);
+ if (params.structuredOutputSchema) {
+ return await (chatModel as ChatOpenAI) // Typecast necessary due to https://github.com/langchain-ai/langchainjs/issues/6795
+ .withStructuredOutput(params.structuredOutputSchema)
+ .invoke(finalMessages);
}
/*
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c0c319990e..00c54a44c2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -132,14 +132,14 @@ importers:
specifier: ^1.4.0
version: 1.4.0
'@langchain/anthropic':
- specifier: ^0.1.21
+ specifier: ^0.3.1
'@langchain/core':
- specifier: ^0.1.61
+ specifier: ^0.3.3
'@langchain/openai':
- specifier: ^0.0.33
+ specifier: ^0.3.0
'@opentelemetry/api':
specifier: '>=1.0.0 <1.9.0'
version: 1.8.0
@@ -180,8 +180,8 @@ importers:
specifier: ^0.27.4
version: 0.27.4
langchain:
- specifier: ^0.2.6
+ specifier: ^0.3.2
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -278,7 +278,7 @@ importers:
version: 5.4.5
vitest:
specifier: ^1.5.3
web:
dependencies:
@@ -322,14 +322,14 @@ importers:
specifier: ^3.3.4
'@langchain/anthropic':
- specifier: ^0.1.21
+ specifier: ^0.3.1
'@langchain/core':
- specifier: ^0.1.61
+ specifier: ^0.3.3
'@langchain/openai':
- specifier: ^0.0.33
+ specifier: ^0.3.0
'@langfuse/ee':
specifier: workspace:*
version: link:../ee
@@ -559,8 +559,8 @@ importers:
specifier: ^0.27.4
version: 0.27.4
langchain:
- specifier: ^0.2.6
+ specifier: ^0.3.2
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -676,7 +676,7 @@ importers:
'@testing-library/jest-dom':
specifier: ^6.4.6
'@testing-library/react':
specifier: ^15.0.7
@@ -938,10 +938,10 @@ importers:
version: 5.4.5
vite:
specifier: ^5.2.13
- version: 5.2.13(@types/[email protected])([email protected])
+ version: 5.2.13(@types/[email protected])([email protected])
vitest:
specifier: ^1.5.3
packages:
@@ -977,8 +977,8 @@ packages:
resolution: {integrity: sha512-90X8pU2szlvw0AJo9EZMbYc2eQKkmO7mAdC4tD4r5co2Mm56MT37MIG8EyB7p4WRheuzGxuLDxJ63mF6+Zajiw==}
hasBin: true
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-fqdt74RTdplnaFOYhwNjjK/Ec09Dqv9ekYr7PuC6GdhV1RWkziqbpJBewn42CYYqCr92JeX6g+IXVgXmq9l7XQ==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-IjLt0gd3L4jlOfilxVXTifn42FnVffMgDC04RJK1KDZpmkBWLv0XC92MVVmkxrFZNS/7l3xWgP/I3nqtX1sQHw==}
'@anthropic-ai/[email protected]':
resolution: {integrity: sha512-EHRKbxlxlc8W4KCBEseByJ7YwyYCmgu9OyN59H9+IYIGPoKv8tXyQXinkeGDI+cI8Tiuz9wk2jZb/kK7AyvL7g==}
@@ -1444,8 +1444,8 @@ packages:
'@codemirror/[email protected]':
resolution: {integrity: sha512-dO4hcF0fGT9tu1Pj1D2PvGvxjeGkbC6RGcZw6Qs74TH+Ed1gw98jmUgd2axWvIZEqTeTuFrg1lEB1KV6cK9h1A==}
- '@codemirror/[email protected]':
- resolution: {integrity: sha512-qnY+b7j1UNcTS31Eenuc/5YJB6gQOzkUoNmJQc0rznwqSRpeaWWpjkWy2C/MPTcePpsKJEM26hXrOXl1+nceXg==}
+ '@codemirror/[email protected]':
+ resolution: {integrity: sha512-Fq7eWOl1Rcbrfn6jD8FPCj9Auaxdm5nIK5RYOeW7ughnd/rY5AmPg6b+CfsG39ZHdwiwe8lde3q8uR7CF5S0yQ==}
'@codemirror/[email protected]':
resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==}
@@ -1909,8 +1909,8 @@ packages:
resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==}
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
- '@eslint-community/[email protected]':
- resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==}
+ '@eslint-community/[email protected]':
+ resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==}
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
'@eslint/[email protected]':
@@ -2165,29 +2165,27 @@ packages:
'@js-sdsl/[email protected]':
resolution: {integrity: sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==}
- '@langchain/[email protected]':
- resolution: {integrity: sha512-7L5UDhO93UYfBwdaGxIqc5ZGSQ4wgMyYdENflLYhA9Aeho+BSHd0Krqh6zEHNGy4p+OrCElyDy58G8yiDEpxvw==}
- engines: {node: '>=18'}
-
- '@langchain/[email protected]':
- resolution: {integrity: sha512-+fjyYi8wy6x1P+Ee1RWfIIEyxd9Ee9jksEwvrggPwwI/p45kIDTdYTblXsM13y4mNWTiACyLSdbwnPaxxdoz+w==}
- engines: {node: '>=18'}
-
- '@langchain/[email protected]':
- resolution: {integrity: sha512-L096itIBQ5XNsy5BCCPqIQEk/x4rzI+U4BhYT+fDBYtljESshIi/WzXdmiGfY/6MpVjB76jNuaRgMDmo1m9NeQ==}
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-mE2zfv2IeogDgP53IYlfqZuXbmACkQDtBkg1Nriasrzvr1g+1Q85pfyUCnxc05p4S2IplbJhvoBtgdQUTGenqw==}
engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.21 <0.4.0'
- '@langchain/[email protected]':
- resolution: {integrity: sha512-hTBo9y9bHtFvMT5ySBW7TrmKhLSA91iNahigeqAFBVrLmBDz+6rzzLFc1mpq6JEAR3fZKdaUXqso3nB23jIpTw==}
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-WAtkmhbdl2T41qzimTzhb3pXCHQxO4onqxzPxgdf3KftQdTwLq0YYBDhozRMZLNAd/+cfH0ymZGaZSsnc9Ogsg==}
engines: {node: '>=18'}
- '@langchain/[email protected]':
- resolution: {integrity: sha512-gZd+0IOxpiKuh1m6KTT5vtUoOO72GEYyoU4+c6qAUucOEqQS0Vvz3lMGyNWLjK4x4Xpd+r8GAF5mj/jvghwP1A==}
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-yXrz5Qn3t9nq3NQAH2l4zZOI4ev2CFdLC5kvmi5SdW4bggRuM40SXTUAY3VRld4I5eocYfk82VbrlA+6dvN5EA==}
engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.26 <0.4.0'
- '@langchain/[email protected]':
- resolution: {integrity: sha512-cXWgKE3sdWLSqAa8ykbCcUsUF1Kyr5J3HOWYGuobhPEycXW4WI++d5DhzdpL238mzoEXTi90VqfSCra37l5YqA==}
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-djI4uw9rlkAb5iMhtLED+xJebDdAG935AdP4eRTB02R7OB/act55Bj9wsskhZsvuyQRpO4O1wQOp85s6T6GWmw==}
engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.21 <0.4.0'
resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==}
@@ -2383,8 +2381,8 @@ packages:
'@types/react':
optional: true
- resolution: {integrity: sha512-qI8TV3M7ShITEEc8Ih15A2vLzZGLhD+/UPNwck/hcls2gwg7dyRjNGXcQYHKLB5Q7PuTRfrTkAoPa2VV1s67Ag==}
+ resolution: {integrity: sha512-oyumoJgB6jDV8JFzRqjBo2daUuHpzDjoO/e3IrRhhHo/FxJlaVhET6mcNrKHUq2E+R+q3ql0qAtvQ4rfWHhAeQ==}
peerDependencies:
'@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
@@ -4896,6 +4894,9 @@ packages:
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
+
resolution: {integrity: sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==}
@@ -5004,8 +5005,8 @@ packages:
resolution: {integrity: sha512-NrNXHJCexZtcbR9K1hsv1fSbwAwnhv7ql7l331aKvW0sej5H0NY1o64BHe0AA2ZoQuTm7NE6fyNW079MOWXe4Q==}
- '@types/[email protected]':
- resolution: {integrity: sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==}
resolution: {integrity: sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==}
@@ -5040,6 +5041,9 @@ packages:
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==}
+
resolution: {integrity: sha512-iLR+1vTTJ3p0QaOUq6ACbY1mzKTODFDT/XedZI8BksOotFmL4ForwDfRQ/DZeuTHR7/2i4lI1D203gdfxuqTlA==}
@@ -5100,6 +5104,9 @@ packages:
resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==}
+
resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==}
@@ -5623,6 +5630,10 @@ packages:
resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}
+ resolution: {integrity: sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==}
+ engines: {node: '>= 0.4'}
+
resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==}
engines: {node: '>= 0.4'}
@@ -5779,9 +5790,6 @@ packages:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA==}
-
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
@@ -5895,8 +5903,8 @@ packages:
resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==}
- resolution: {integrity: sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==}
+ resolution: {integrity: sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA==}
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
@@ -6395,6 +6403,15 @@ packages:
supports-color:
optional: true
+ resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
engines: {node: '>=0.10.0'}
@@ -6626,8 +6643,8 @@ packages:
resolution: {integrity: sha512-w+9yAVHoHhysCa+gln7AzbO9CdjFcL/wN/5dd+XW/Msl2d/4+WisEaCF1nty0xbAKaxdaJfgLB2296U7zZB7BA==}
- resolution: {integrity: sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==}
+ resolution: {integrity: sha512-Z+OMe9M/V6Ep9n/52+b7lkvYEps26z4Yz3vjWL1V61W0q+VLF1pOHhMY17sa4roz4AWmULSI8E6SAojZA5L0YQ==}
resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
@@ -7092,14 +7109,14 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
- resolution: {integrity: sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==}
- hasBin: true
-
resolution: {integrity: sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==}
hasBin: true
+ resolution: {integrity: sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==}
+ hasBin: true
+
resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
@@ -7319,6 +7336,9 @@ packages:
resolution: {integrity: sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==}
+ resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==}
+
resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==}
engines: {node: '>= 14'}
@@ -7691,9 +7711,6 @@ packages:
resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==}
- resolution: {integrity: sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ==}
-
resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
engines: {node: '>= 0.4'}
@@ -8163,6 +8180,9 @@ packages:
resolution: {integrity: sha512-L7wURW1fH9Qaext0VzaUDpFGVQgjkdE3Dgsy9/+yXyGEpBKnylTd0mU0bfbNkKDlXRb6TEsZkwuflu1B8uQbJQ==}
+ resolution: {integrity: sha512-Pk3l3WOgM9joguZY2k52+jH82RtABRgB5RdGFZNUGbOKGMVlNmafcPA3b0ITcCZPu1L9UclP1tne6aw7ZI4Myg==}
+
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -8294,176 +8314,57 @@ packages:
resolution: {integrity: sha512-dyNKv2KRvYOQPLCAOCjjQuCk4YFd33BvGdf/o5bC7FiW+BB6snA81Zt+2wT9QDFzKqxKa5rrOmvlK/anehCcgA==}
engines: {node: '>=14.0.0'}
- resolution: {integrity: sha512-iZ0l7BDVfoifqZlDl1gy3JP5mIdhYjWiToPlDnlmfHD748cw3okvF0gZo0ruT4nbftnQcaM7JzPUiNC43UPfgg==}
+ resolution: {integrity: sha512-kd2kz1cS/PIVrLEDFlrZsAasQfPLbY1UqCZbRKa3/QcpB33/n6xPDvXSMfBuKhvNj0bjW6MXDR9HZTduXjJBgg==}
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
- '@browserbasehq/sdk': '*'
- '@gomomento/sdk': ^1.51.1
- '@gomomento/sdk-core': ^1.51.1
- '@gomomento/sdk-web': ^1.51.1
- '@mendable/firecrawl-js': ^0.0.13
- '@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
+ '@langchain/anthropic': '*'
+ '@langchain/aws': '*'
+ '@langchain/cohere': '*'
+ '@langchain/core': '>=0.2.21 <0.4.0'
+ '@langchain/google-genai': '*'
+ '@langchain/google-vertexai': '*'
+ '@langchain/groq': '*'
+ '@langchain/mistralai': '*'
+ '@langchain/ollama': '*'
axios: '*'
- cheerio: ^1.0.0-rc.12
- chromadb: '*'
- convex: ^1.3.1
- couchbase: ^4.3.0
- d3-dsv: ^2.0.0
- epub2: ^3.0.1
- faiss-node: '*'
- fast-xml-parser: '*'
+ cheerio: '*'
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.20
- weaviate-ts-client: '*'
- web-auth-library: ^1.0.3
- ws: ^8.14.2
- youtube-transcript: ^1.0.6
- youtubei.js: ^9.1.0
+ typeorm: '*'
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
- '@browserbasehq/sdk':
- optional: true
- '@gomomento/sdk':
- optional: true
- '@gomomento/sdk-core':
- optional: true
- '@gomomento/sdk-web':
- optional: true
- '@mendable/firecrawl-js':
+ '@langchain/anthropic':
optional: true
- '@notionhq/client':
+ '@langchain/aws':
optional: true
- '@pinecone-database/pinecone':
+ '@langchain/cohere':
optional: true
- '@supabase/supabase-js':
+ '@langchain/google-genai':
optional: true
- '@vercel/kv':
+ '@langchain/google-vertexai':
optional: true
- '@xata.io/client':
+ '@langchain/groq':
optional: true
- apify-client:
+ '@langchain/mistralai':
optional: true
- assemblyai:
+ '@langchain/ollama':
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
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
-
- resolution: {integrity: sha512-WnKI4g9kU2bHQP136orXr2bcRdgz9iiTBpTN0jWt9IlScUKnJBoD0aa2HOzHURQKeQDnt2JwqVmQ6Depf5uDLQ==}
- resolution: {integrity: sha512-EUWHIH6fiOCGRYdzgwGoXwJxCMyUrL+bmUcxoVmkXoXoAGDOVinz8bqJLKbxotsQWqM64NKKsW85OTIutgNaMQ==}
+ resolution: {integrity: sha512-dW+z6s538zBswFFP2w/xzvVef7y2+yNt6GkmRCeLtwfpbMaM4di7JboK3vmnZ+0/LjNb2ukiMmgsTNKu/Y43cg==}
peerDependencies:
- '@langchain/core': '*'
- langchain: '*'
openai: '*'
peerDependenciesMeta:
- '@langchain/core':
- optional: true
- langchain:
- optional: true
openai:
optional: true
@@ -8934,21 +8835,6 @@ packages:
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
- resolution: {integrity: sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==}
-
- resolution: {integrity: sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==}
-
- resolution: {integrity: sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q==}
-
- resolution: {integrity: sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==}
-
- resolution: {integrity: sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==}
-
resolution: {integrity: sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==}
@@ -9196,10 +9082,6 @@ packages:
resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- resolution: {integrity: sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
@@ -9281,13 +9163,14 @@ packages:
resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-WWSxhC/69ZhYWxH/OBsLEirIjUcfpQ5+ihkXKp06hmeYXgBBIUCa9IptMzYx6NdkiOCsSGYCnTIsxaic3AjRCQ==}
- hasBin: true
-
- resolution: {integrity: sha512-xmiNcdA9QJ5wffHpZDpIsge6AsPTETJ6h5iqDNuFQ7qGSNtonHn8Qe0VHy4UwLE8rBWiSqh4j+iSvuYZSeKkPg==}
+ resolution: {integrity: sha512-Aa6i4oBR1tV8E2d2p3MvXg57X98i8gZtHq4bQNX274qLKZVX7PXXq5P1FMonTXOrX3zwvkqN1iNccn3XK3CwVg==}
hasBin: true
+ peerDependencies:
+ zod: ^3.23.8
+ peerDependenciesMeta:
+ zod:
+ optional: true
resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==}
@@ -9536,6 +9419,9 @@ packages:
resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
+ resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==}
+
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
@@ -9622,6 +9508,10 @@ packages:
resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==}
engines: {node: ^10 || ^12 || >=14}
+ resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==}
+ engines: {node: ^10 || ^12 || >=14}
+
resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==}
engines: {node: '>=4'}
@@ -10462,6 +10352,10 @@ packages:
resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==}
@@ -10791,8 +10685,8 @@ packages:
uglify-js:
optional: true
- resolution: {integrity: sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==}
+ resolution: {integrity: sha512-JuPVaB7s1gdFKPKTelwUyRq5Sid2A3Gko2S0PncwdBq7kN9Ti9HPWDQ06MPsEDGsZeVESjKEnyGy68quBk1w6g==}
engines: {node: '>=10'}
hasBin: true
@@ -11527,8 +11421,8 @@ packages:
resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
engines: {node: '>= 6'}
- resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==}
+ resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==}
engines: {node: '>= 14'}
hasBin: true
@@ -11607,16 +11501,15 @@ snapshots:
'@antfu/[email protected]': {}
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
dependencies:
- '@types/node': 18.19.39
+ '@types/node': 18.19.50
'@types/node-fetch': 2.6.11
abort-controller: 3.0.0
agentkeepalive: 4.5.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
@@ -12185,7 +12078,7 @@ snapshots:
dependencies:
'@babel/highlight': 7.24.7
- picocolors: 1.0.1
+ picocolors: 1.1.0
'@babel/[email protected]': {}
@@ -12310,7 +12203,7 @@ snapshots:
'@babel/helper-validator-identifier': 7.24.7
chalk: 2.4.2
js-tokens: 4.0.0
- picocolors: 1.0.1
+ picocolors: 1.1.0
dependencies:
@@ -12432,7 +12325,7 @@ snapshots:
'@babel/parser': 7.25.6
'@babel/template': 7.25.0
'@babel/types': 7.25.6
- debug: 4.3.6
+ debug: 4.3.7
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -12505,7 +12398,7 @@ snapshots:
'@codemirror/view': 6.26.2
'@lezer/common': 1.2.1
- '@codemirror/[email protected]':
+ '@codemirror/[email protected]':
dependencies:
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
@@ -12908,7 +12801,7 @@ snapshots:
'@eslint-community/[email protected]': {}
- '@eslint-community/[email protected]': {}
+ '@eslint-community/[email protected]': {}
'@eslint/[email protected]':
dependencies:
@@ -13327,110 +13220,23 @@ snapshots:
'@js-sdsl/[email protected]': {}
- dependencies:
- '@anthropic-ai/sdk': 0.21.1
- fast-xml-parser: 4.3.6
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - encoding
- - langchain
- - openai
-
dependencies:
- '@anthropic-ai/sdk': 0.21.1
- fast-xml-parser: 4.3.6
+ '@anthropic-ai/sdk': 0.27.3
+ '@langchain/core': 0.3.3([email protected]([email protected]))
+ fast-xml-parser: 4.5.0
zod: 3.23.8
zod-to-json-schema: 3.23.2([email protected])
transitivePeerDependencies:
- encoding
- - langchain
- - openai
dependencies:
ansi-styles: 5.2.0
camelcase: 6.3.0
decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
- mustache: 4.2.0
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- ansi-styles: 5.2.0
- camelcase: 6.3.0
- decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
- mustache: 4.2.0
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- ansi-styles: 5.2.0
- camelcase: 6.3.0
- decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
- mustache: 4.2.0
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- ansi-styles: 5.2.0
- camelcase: 6.3.0
- decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
- mustache: 4.2.0
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- ansi-styles: 5.2.0
- camelcase: 6.3.0
- decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
+ js-tiktoken: 1.0.14
mustache: 4.2.0
p-queue: 6.6.2
p-retry: 4.6.2
@@ -13438,86 +13244,22 @@ snapshots:
zod: 3.23.8
zod-to-json-schema: 3.23.2([email protected])
transitivePeerDependencies:
- - langchain
- openai
dependencies:
- ansi-styles: 5.2.0
- camelcase: 6.3.0
- decamelize: 1.2.0
- js-tiktoken: 1.0.12
- ml-distance: 4.0.1
- mustache: 4.2.0
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 10.0.0
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- js-tiktoken: 1.0.12
- openai: 4.47.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - encoding
- - langchain
-
- dependencies:
- js-tiktoken: 1.0.12
- openai: 4.47.1
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - encoding
- - langchain
-
- dependencies:
- js-tiktoken: 1.0.12
- openai: 4.52.0
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- transitivePeerDependencies:
- - encoding
- - langchain
-
- dependencies:
- js-tiktoken: 1.0.12
- openai: 4.52.0
+ '@langchain/core': 0.3.3([email protected]([email protected]))
+ js-tiktoken: 1.0.14
+ openai: 4.62.1([email protected])
zod: 3.23.8
zod-to-json-schema: 3.23.2([email protected])
transitivePeerDependencies:
- encoding
- - langchain
dependencies:
- js-tiktoken: 1.0.12
- transitivePeerDependencies:
- - langchain
- - openai
-
- dependencies:
- js-tiktoken: 1.0.12
- transitivePeerDependencies:
- - langchain
- - openai
+ '@langchain/core': 0.3.3([email protected]([email protected]))
+ js-tiktoken: 1.0.14
'@lezer/[email protected]': {}
@@ -13627,7 +13369,7 @@ snapshots:
'@mui/core-downloads-tracker': 5.16.7
- '@mui/types': 7.2.16(@types/[email protected])
+ '@mui/types': 7.2.17(@types/[email protected])
'@mui/utils': 5.16.6(@types/[email protected])([email protected])
'@types/react-transition-group': 4.4.11
clsx: 2.1.1
@@ -13703,7 +13445,7 @@ snapshots:
'@babel/runtime': 7.24.7
'@mui/private-theming': 5.16.6(@types/[email protected])([email protected])
- '@mui/types': 7.2.16(@types/[email protected])
+ '@mui/types': 7.2.17(@types/[email protected])
'@mui/utils': 5.16.6(@types/[email protected])([email protected])
clsx: 2.1.1
csstype: 3.1.3
@@ -13718,7 +13460,7 @@ snapshots:
optionalDependencies:
'@types/react': 18.2.79
optionalDependencies:
'@types/react': 18.2.79
@@ -13735,8 +13477,8 @@ snapshots:
dependencies:
'@babel/runtime': 7.24.7
- '@mui/types': 7.2.16(@types/[email protected])
- '@types/prop-types': 15.7.12
+ '@mui/types': 7.2.17(@types/[email protected])
+ '@types/prop-types': 15.7.13
clsx: 2.1.1
prop-types: 15.8.1
react: 18.2.0
@@ -16723,7 +16465,7 @@ snapshots:
lz-string: 1.5.0
pretty-format: 27.5.1
dependencies:
'@adobe/css-tools': 4.4.0
'@babel/runtime': 7.24.7
@@ -16737,7 +16479,7 @@ snapshots:
'@jest/globals': 29.7.0
'@types/jest': 29.5.12
- vitest: 1.5.3(@types/[email protected])([email protected])
+ vitest: 1.5.3(@types/[email protected])
dependencies:
@@ -16904,11 +16646,11 @@ snapshots:
dependencies:
'@types/eslint': 8.56.12
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
dependencies:
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
'@types/json-schema': 7.0.15
@@ -16922,6 +16664,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
dependencies:
'@types/node': 20.12.11
@@ -17062,7 +16806,7 @@ snapshots:
dependencies:
undici-types: 5.26.5
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
undici-types: 5.26.5
@@ -17108,6 +16852,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -17168,6 +16914,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -17576,7 +17324,7 @@ snapshots:
'@vue/shared': 3.4.27
entities: 4.5.0
estree-walker: 2.0.2
- source-map-js: 1.2.0
+ source-map-js: 1.2.1
dependencies:
@@ -17592,8 +17340,8 @@ snapshots:
'@vue/shared': 3.4.27
estree-walker: 2.0.2
magic-string: 0.30.11
- postcss: 8.4.41
- source-map-js: 1.2.0
+ postcss: 8.4.47
+ source-map-js: 1.2.1
dependencies:
@@ -17884,6 +17632,8 @@ snapshots:
dependencies:
dequal: 2.0.3
+
dependencies:
call-bind: 1.0.7
@@ -18096,8 +17846,6 @@ snapshots:
-
dependencies:
buffer: 5.7.1
@@ -18156,8 +17904,8 @@ snapshots:
dependencies:
- caniuse-lite: 1.0.30001655
- electron-to-chromium: 1.5.13
+ caniuse-lite: 1.0.30001662
+ electron-to-chromium: 1.5.26
node-releases: 2.0.18
update-browserslist-db: 1.1.0([email protected])
@@ -18243,7 +17991,7 @@ snapshots:
@@ -18406,7 +18154,7 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.0
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
acorn: 8.12.1
estree-walker: 3.0.3
periscopic: 3.1.0
@@ -18414,7 +18162,7 @@ snapshots:
dependencies:
'@codemirror/autocomplete': 6.17.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])
- '@codemirror/commands': 6.6.0
+ '@codemirror/commands': 6.6.2
'@codemirror/language': 6.10.2
'@codemirror/lint': 6.8.1
'@codemirror/search': 6.5.6
@@ -18623,7 +18371,7 @@ snapshots:
dependencies:
mdn-data: 2.0.30
- source-map-js: 1.2.0
+ source-map-js: 1.2.1
@@ -18801,6 +18549,10 @@ snapshots:
dependencies:
ms: 2.1.2
+ dependencies:
+ ms: 2.1.3
+
@@ -18995,7 +18747,7 @@ snapshots:
@@ -19319,7 +19071,7 @@ snapshots:
dependencies:
'@eslint-community/eslint-utils': 4.4.0([email protected])
- '@eslint-community/regexpp': 4.11.0
+ '@eslint-community/regexpp': 4.11.1
eslint: 8.57.0
eslint-compat-utils: 0.5.1([email protected])
@@ -19393,7 +19145,7 @@ snapshots:
builtins: 5.1.0
eslint: 8.57.0
eslint-plugin-es-x: 7.8.0([email protected])
- get-tsconfig: 4.8.0
+ get-tsconfig: 4.8.1
globals: 13.24.0
ignore: 5.3.2
is-builtin-module: 3.2.1
@@ -19497,7 +19249,7 @@ snapshots:
eslint: 8.57.0
optionalDependencies:
'@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
transitivePeerDependencies:
- supports-color
- typescript
@@ -19725,11 +19477,11 @@ snapshots:
dependencies:
strnum: 1.0.5
dependencies:
strnum: 1.0.5
@@ -19948,6 +19700,10 @@ snapshots:
dependencies:
resolve-pkg-maps: 1.0.0
+ dependencies:
+ resolve-pkg-maps: 1.0.0
+
dependencies:
basic-ftp: 5.0.5
@@ -20439,8 +20195,6 @@ snapshots:
is-alphabetical: 2.0.1
is-decimal: 2.0.1
-
dependencies:
call-bind: 1.0.7
@@ -20569,7 +20323,7 @@ snapshots:
dependencies:
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
dependencies:
@@ -21170,6 +20924,10 @@ snapshots:
dependencies:
base64-js: 1.5.1
+ dependencies:
+ base64-js: 1.5.1
+
@@ -21296,149 +21054,39 @@ snapshots:
dependencies:
- binary-extensions: 2.3.0
- js-tiktoken: 1.0.12
+ '@langchain/core': 0.3.3([email protected]([email protected]))
+ '@langchain/openai': 0.3.0(@langchain/[email protected]([email protected]([email protected])))
+ '@langchain/textsplitters': 0.1.0(@langchain/[email protected]([email protected]([email protected])))
+ js-tiktoken: 1.0.14
js-yaml: 4.1.0
jsonpointer: 5.0.1
- langchainhub: 0.0.11
- ml-distance: 4.0.1
openapi-types: 12.1.3
p-retry: 4.6.2
uuid: 10.0.0
- yaml: 2.4.5
+ yaml: 2.5.1
zod: 3.23.8
zod-to-json-schema: 3.23.2([email protected])
optionalDependencies:
- '@aws-sdk/client-s3': 3.627.0
- '@aws-sdk/credential-provider-node': 3.624.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])
- axios: 1.6.8
- fast-xml-parser: 4.4.1
- handlebars: 4.7.8
- html-to-text: 9.0.5
- ignore: 5.3.2
- ioredis: 5.4.1
- jsdom: 20.0.3
- playwright: 1.43.1
- puppeteer: 19.11.1([email protected])
- ws: 8.16.0
- transitivePeerDependencies:
- - encoding
- - openai
-
- dependencies:
- binary-extensions: 2.3.0
- js-tiktoken: 1.0.12
- js-yaml: 4.1.0
- jsonpointer: 5.0.1
- langchainhub: 0.0.11
- ml-distance: 4.0.1
- openapi-types: 12.1.3
- p-retry: 4.6.2
- uuid: 10.0.0
- yaml: 2.4.5
- zod: 3.23.8
- zod-to-json-schema: 3.23.2([email protected])
- optionalDependencies:
- '@aws-sdk/client-s3': 3.627.0
- '@aws-sdk/credential-provider-node': 3.624.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])
+ '@langchain/anthropic': 0.3.1(@langchain/[email protected]([email protected]([email protected])))
axios: 1.6.8
- fast-xml-parser: 4.4.1
handlebars: 4.7.8
- html-to-text: 9.0.5
- ignore: 5.3.2
- ioredis: 5.4.1
- jsdom: 20.0.3
- playwright: 1.43.1
- puppeteer: 19.11.1([email protected])
- ws: 8.16.0
transitivePeerDependencies:
- encoding
- openai
-
- dependencies:
- '@types/uuid': 9.0.8
- commander: 10.0.1
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- optionalDependencies:
- openai: 4.47.1
-
- dependencies:
- '@types/uuid': 9.0.8
- commander: 10.0.1
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- optionalDependencies:
- openai: 4.52.0
-
dependencies:
- '@types/uuid': 9.0.8
+ '@types/uuid': 10.0.0
commander: 10.0.1
p-queue: 6.6.2
p-retry: 4.6.2
- uuid: 9.0.1
- optionalDependencies:
- openai: 4.47.1
-
- dependencies:
- '@types/uuid': 9.0.8
- commander: 10.0.1
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- optionalDependencies:
- openai: 4.52.0
-
- dependencies:
- '@types/uuid': 9.0.8
- commander: 10.0.1
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
- optionalDependencies:
- openai: 4.52.0
-
- dependencies:
- '@types/uuid': 9.0.8
- commander: 10.0.1
- p-queue: 6.6.2
- p-retry: 4.6.2
- uuid: 9.0.1
+ semver: 7.6.3
+ uuid: 10.0.0
optionalDependencies:
- openai: 4.52.0
+ openai: 4.62.1([email protected])
@@ -22071,27 +21719,6 @@ snapshots:
- dependencies:
- ml-array-sum: 1.1.6
-
- dependencies:
- is-any-array: 2.0.1
-
-
- dependencies:
- ml-array-mean: 1.1.6
- ml-distance-euclidean: 2.0.0
- ml-tree-similarity: 1.0.0
-
- dependencies:
- binary-search: 1.3.6
- num-sort: 2.1.0
-
dependencies:
acorn: 8.12.1
@@ -22349,8 +21976,6 @@ snapshots:
dependencies:
path-key: 4.0.0
-
@@ -22438,29 +22063,17 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
dependencies:
- '@types/node': 18.19.39
+ '@types/node': 18.19.50
'@types/node-fetch': 2.6.11
abort-controller: 3.0.0
agentkeepalive: 4.5.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
-
- dependencies:
- '@types/node': 18.19.39
- '@types/node-fetch': 2.6.11
- abort-controller: 3.0.0
- agentkeepalive: 4.5.0
- form-data-encoder: 1.7.2
- formdata-node: 4.4.1
- node-fetch: 2.7.0
- web-streams-polyfill: 3.3.3
+ optionalDependencies:
+ zod: 3.23.8
transitivePeerDependencies:
- encoding
@@ -22695,7 +22308,7 @@ snapshots:
dependencies:
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
estree-walker: 3.0.3
is-reference: 3.0.2
@@ -22750,6 +22363,8 @@ snapshots:
+
@@ -22793,7 +22408,7 @@ snapshots:
dependencies:
lilconfig: 3.1.1
- yaml: 2.4.5
+ yaml: 2.5.1
optionalDependencies:
postcss: 8.4.41
ts-node: 10.9.2(@types/[email protected])([email protected])
@@ -22828,6 +22443,12 @@ snapshots:
picocolors: 1.0.1
source-map-js: 1.2.0
+ dependencies:
+ nanoid: 3.3.7
+ picocolors: 1.1.0
+ source-map-js: 1.2.1
+
@@ -23773,6 +23394,8 @@ snapshots:
+
dependencies:
buffer-from: 1.1.2
@@ -24017,9 +23640,9 @@ snapshots:
'@ampproject/remapping': 2.3.0
'@jridgewell/sourcemap-codec': 1.5.0
'@jridgewell/trace-mapping': 0.3.25
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
acorn: 8.12.1
- aria-query: 5.3.0
+ aria-query: 5.3.1
axobject-query: 4.1.0
code-red: 1.0.4
css-tree: 2.3.1
@@ -24131,10 +23754,10 @@ snapshots:
jest-worker: 27.5.1
schema-utils: 3.3.0
serialize-javascript: 6.0.2
- terser: 5.31.6
+ terser: 5.33.0
webpack: 5.93.0
dependencies:
'@jridgewell/source-map': 0.3.6
acorn: 8.12.1
@@ -24492,7 +24115,7 @@ snapshots:
dependencies:
browserslist: 4.23.3
escalade: 3.2.0
- picocolors: 1.0.1
+ picocolors: 1.1.0
dependencies:
@@ -24627,13 +24250,13 @@ snapshots:
- terser
optional: true
dependencies:
cac: 6.7.14
debug: 4.3.5([email protected])
pathe: 1.1.2
picocolors: 1.0.1
- vite: 5.2.13(@types/[email protected])([email protected])
+ vite: 5.2.13(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@types/node'
- less
@@ -24654,7 +24277,7 @@ snapshots:
fsevents: 2.3.3
optional: true
dependencies:
esbuild: 0.20.2
postcss: 8.4.41
@@ -24662,7 +24285,7 @@ snapshots:
optionalDependencies:
'@types/node': 20.11.29
fsevents: 2.3.3
- terser: 5.31.6
+ terser: 5.33.0
dependencies:
@@ -24674,7 +24297,7 @@ snapshots:
fsevents: 2.3.3
optional: true
dependencies:
esbuild: 0.20.2
postcss: 8.4.38
@@ -24682,9 +24305,9 @@ snapshots:
optionalDependencies:
'@types/node': 20.11.29
fsevents: 2.3.3
- terser: 5.31.6
+ terser: 5.33.0
dependencies:
'@vitest/expect': 1.5.3
'@vitest/runner': 1.5.3
@@ -24708,7 +24331,6 @@ snapshots:
why-is-node-running: 2.2.2
optionalDependencies:
'@types/node': 20.10.5
- jsdom: 20.0.3
transitivePeerDependencies:
- less
- lightningcss
@@ -24719,7 +24341,7 @@ snapshots:
- terser
optional: true
dependencies:
'@vitest/expect': 1.5.3
'@vitest/runner': 1.5.3
@@ -24738,8 +24360,8 @@ snapshots:
strip-literal: 2.0.0
tinybench: 2.6.0
tinypool: 0.8.4
- vite: 5.2.11(@types/[email protected])([email protected])
- vite-node: 1.5.3(@types/[email protected])([email protected])
+ vite: 5.2.11(@types/[email protected])([email protected])
+ vite-node: 1.5.3(@types/[email protected])([email protected])
why-is-node-running: 2.2.2
optionalDependencies:
'@types/node': 20.11.29
@@ -24801,7 +24423,7 @@ snapshots:
dependencies:
'@types/eslint-scope': 3.7.7
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
'@webassemblyjs/ast': 1.12.1
'@webassemblyjs/wasm-edit': 1.12.1
'@webassemblyjs/wasm-parser': 1.12.1
@@ -24976,7 +24598,7 @@ snapshots:
diff --git a/web/package.json b/web/package.json
index 71eaf7da56..92bf3914aa 100644
--- a/web/package.json
+++ b/web/package.json
@@ -35,9 +35,9 @@
"@headlessui/tailwindcss": "0.2.1",
"@heroicons/react": "^2.1.3",
"@hookform/resolvers": "^3.3.4",
- "@langchain/anthropic": "^0.1.21",
- "@langchain/core": "^0.1.61",
- "@langchain/openai": "^0.0.33",
+ "@langchain/anthropic": "^0.3.1",
+ "@langchain/core": "^0.3.3",
+ "@langchain/openai": "^0.3.0",
"@langfuse/ee": "workspace:*",
"@langfuse/shared": "workspace:*",
"@marsidev/react-turnstile": "^0.5.4",
@@ -114,7 +114,7 @@
"ip-address": "^9.0.5",
"js-tiktoken": "^1.0.12",
"kysely": "^0.27.4",
- "langchain": "^0.2.6",
+ "langchain": "^0.3.2",
"lodash": "^4.17.21",
"lucide-react": "^0.436.0",
"next": "^14.2.6",
diff --git a/web/src/features/public-api/components/LLMApiKeyList.tsx b/web/src/features/public-api/components/LLMApiKeyList.tsx
index 7885530b69..e187cd8777 100644
--- a/web/src/features/public-api/components/LLMApiKeyList.tsx
+++ b/web/src/features/public-api/components/LLMApiKeyList.tsx
@@ -82,7 +82,7 @@ export function LlmApiKeyList(props: { projectId: string }) {
<TableHead className="text-primary md:table-cell">
Provider
</TableHead>
- <TableHead className="hidden text-primary md:table-cell">
+ <TableHead className="text-primary md:table-cell">
Adapter
</TableHead>
<TableHead className="text-primary md:table-cell">
@@ -109,9 +109,7 @@ export function LlmApiKeyList(props: { projectId: string }) {
{apiKey.createdAt.toLocaleDateString()}
</TableCell>
<TableCell className="font-mono">{apiKey.provider}</TableCell>
- <TableCell className="hidden font-mono">
- {apiKey.adapter}
- </TableCell>
+ <TableCell className="font-mono">{apiKey.adapter}</TableCell>
<TableCell className="max-w-md overflow-auto font-mono">
{apiKey.baseURL ?? "default"}
</TableCell>
diff --git a/worker/src/__tests__/network.ts b/worker/src/__tests__/network.ts
index ac44a22378..61bb7ffc4e 100644
--- a/worker/src/__tests__/network.ts
+++ b/worker/src/__tests__/network.ts
@@ -13,11 +13,20 @@ const DEFAULT_RESPONSE = {
message: {
role: "assistant",
content: null,
- function_call: {
- name: "evaluate",
- arguments:
- '{"score":0.2,"reasoning":"The language used in the conversation was respectful and there were no personal attacks. However, there were some sarcastic comments which could be perceived as slightly negative."}',
- },
+ tool_calls: [
+ {
+ function: {
+ name: "extract",
+ arguments: JSON.stringify({
+ score: 0,
+ reasoning:
+ "The provided text is a harmless play on words that poses no risk of harm or offense. It is a lighthearted joke that uses wordplay to create humor without targeting or derogating any group of people.",
+ }),
+ type: "tool_call",
+ id: "call_cJ6HLI1gZSIRJVOrFsChO1SI",
+ },
+ },
+ ],
},
logprobs: null,
finish_reason: "stop",
@@ -47,7 +56,7 @@ function ErrorCompletionHandler(status: number, statusText: string) {
new HttpResponse(null, {
status,
statusText,
- }),
+ })
);
}
@@ -69,7 +78,7 @@ export class OpenAIServer {
this.hasActiveKey = hasActiveKey;
this.internalServer = setupServer(
- ...(useDefaultResponse ? [JsonCompletionHandler(DEFAULT_RESPONSE)] : []),
+ ...(useDefaultResponse ? [JsonCompletionHandler(DEFAULT_RESPONSE)] : [])
);
if (hasActiveKey) {
this.internalServer.events.on("response:bypass", async ({ response }) => {
diff --git a/worker/src/features/evaluation/eval-service.ts b/worker/src/features/evaluation/eval-service.ts
index a345779ce6..4382674129 100644
--- a/worker/src/features/evaluation/eval-service.ts
+++ b/worker/src/features/evaluation/eval-service.ts
@@ -49,7 +49,7 @@ export const createEvalJobs = async ({
return;
}
logger.info(
- `Creating eval jobs for trace ${event.traceId} on project ${event.projectId}`,
+ `Creating eval jobs for trace ${event.traceId} on project ${event.projectId}`
);
for (const config of configs) {
@@ -64,7 +64,7 @@ export const createEvalJobs = async ({
const condition = tableColumnsToSqlFilterAndPrefix(
validatedFilter,
evalTableCols,
- "traces",
+ "traces"
);
const joinedQuery = Prisma.sql`
@@ -88,7 +88,7 @@ export const createEvalJobs = async ({
// if we matched a trace, we might want to create a job
if (traces.length > 0) {
logger.info(
- `Eval job for config ${config.id} matched trace ids ${JSON.stringify(traces.map((t) => t.id))}`,
+ `Eval job for config ${config.id} matched trace ids ${JSON.stringify(traces.map((t) => t.id))}`
);
const jobExecutionId = randomUUID();
@@ -96,7 +96,7 @@ export const createEvalJobs = async ({
// deduplication: if a job exists already for a trace event, we do not create a new one.
if (existingJob.length > 0) {
logger.info(
- `Eval job for config ${config.id} and trace ${event.traceId} already exists`,
+ `Eval job for config ${config.id} and trace ${event.traceId} already exists`
);
continue;
}
@@ -108,14 +108,14 @@ export const createEvalJobs = async ({
const random = Math.random();
if (random > parseFloat(config.sampling)) {
logger.info(
- `Eval job for config ${config.id} and trace ${event.traceId} was sampled out`,
+ `Eval job for config ${config.id} and trace ${event.traceId} was sampled out`
);
continue;
}
}
logger.info(
- `Creating eval job for config ${config.id} and trace ${event.traceId}`,
+ `Creating eval job for config ${config.id} and trace ${event.traceId}`
);
await prisma.jobExecution.create({
@@ -150,7 +150,7 @@ export const createEvalJobs = async ({
delay: config.delay, // milliseconds
removeOnComplete: true,
removeOnFail: 1_000,
- },
+ }
);
} else {
// if we do not have a match, and execution exists, we mark the job as cancelled
@@ -158,7 +158,7 @@ export const createEvalJobs = async ({
logger.info(`Eval job for config ${config.id} did not match trace`);
if (existingJob.length > 0) {
logger.info(
- `Cancelling eval job for config ${config.id} and trace ${event.traceId}`,
+ `Cancelling eval job for config ${config.id} and trace ${event.traceId}`
);
await kyselyPrisma.$kysely
.updateTable("job_executions")
@@ -178,7 +178,7 @@ export const evaluate = async ({
event: z.infer<typeof EvalExecutionEvent>;
}) => {
logger.info(
- `Evaluating job ${event.jobExecutionId} for project ${event.projectId}`,
+ `Evaluating job ${event.jobExecutionId} for project ${event.projectId}`
);
// first, fetch all the context required for the evaluation
const job = await kyselyPrisma.$kysely
@@ -219,12 +219,12 @@ export const evaluate = async ({
.executeTakeFirstOrThrow();
logger.info(
- `Evaluating job ${job.id} for project ${event.projectId} with template ${template.id}. Searching for context...`,
+ `Evaluating job ${job.id} for project ${event.projectId} with template ${template.id}. Searching for context...`
);
// selectedcolumnid is not safe to use, needs validation in extractVariablesFromTrace()
const parsedVariableMapping = variableMappingList.parse(
- config.variable_mapping,
+ config.variable_mapping
);
// extract the variables which need to be inserted into the prompt
@@ -232,22 +232,22 @@ export const evaluate = async ({
event.projectId,
template.vars,
job.job_input_trace_id,
- parsedVariableMapping,
+ parsedVariableMapping
);
logger.info(
- `Evaluating job ${event.jobExecutionId} extracted variables ${JSON.stringify(mappingResult)} `,
+ `Evaluating job ${event.jobExecutionId} extracted variables ${JSON.stringify(mappingResult)} `
);
// compile the prompt and send out the LLM request
const prompt = compileHandlebarString(template.prompt, {
...Object.fromEntries(
- mappingResult.map(({ var: key, value }) => [key, value]),
+ mappingResult.map(({ var: key, value }) => [key, value])
),
});
logger.info(
- `Evaluating job ${event.jobExecutionId} compiled prompt ${prompt}`,
+ `Evaluating job ${event.jobExecutionId} compiled prompt ${prompt}`
);
const parsedOutputSchema = z
@@ -261,7 +261,7 @@ export const evaluate = async ({
throw new InvalidRequestError("Output schema not found");
}
- const openAIFunction = z.object({
+ const evalScoreSchema = z.object({
score: z.number().describe(parsedOutputSchema.score),
reasoning: z.string().describe(parsedOutputSchema.reasoning),
});
@@ -280,10 +280,10 @@ export const evaluate = async ({
if (!parsedKey.success) {
// this will fail the eval execution if a user deletes the API key.
logger.error(
- `Evaluating job ${event.jobExecutionId} did not find API key for provider ${template.provider} and project ${event.projectId}. Eval will fail. ${parsedKey.error}`,
+ `Evaluating job ${event.jobExecutionId} did not find API key for provider ${template.provider} and project ${event.projectId}. Eval will fail. ${parsedKey.error}`
);
throw new LangfuseNotFoundError(
- `API key for provider ${template.provider} and project ${event.projectId} not found.`,
+ `API key for provider ${template.provider} and project ${event.projectId} not found.`
);
}
@@ -300,20 +300,16 @@ export const evaluate = async ({
adapter: parsedKey.data.adapter,
...modelParams,
},
- functionCall: {
- name: "evaluate",
- description: "some description",
- parameters: openAIFunction,
- },
+ structuredOutputSchema: evalScoreSchema,
});
} catch (e) {
throw new ApiError(`Failed to fetch LLM completion: ${e}`);
}
- const parsedLLMOutput = openAIFunction.parse(completion);
+ const parsedLLMOutput = evalScoreSchema.parse(completion);
logger.info(
- `Evaluating job ${event.jobExecutionId} Parsed LLM output ${JSON.stringify(parsedLLMOutput)}`,
+ `Evaluating job ${event.jobExecutionId} Parsed LLM output ${JSON.stringify(parsedLLMOutput)}`
);
// persist the score and update the job status
@@ -332,7 +328,7 @@ export const evaluate = async ({
});
logger.info(
- `Evaluating job ${event.jobExecutionId} persisted score ${scoreId} for trace ${job.job_input_trace_id}`,
+ `Evaluating job ${event.jobExecutionId} persisted score ${scoreId} for trace ${job.job_input_trace_id}`
);
await kyselyPrisma.$kysely
@@ -344,13 +340,13 @@ export const evaluate = async ({
.execute();
logger.info(
- `Eval job ${job.id} for project ${event.projectId} completed with score ${parsedLLMOutput.score}`,
+ `Eval job ${job.id} for project ${event.projectId} completed with score ${parsedLLMOutput.score}`
);
};
export function compileHandlebarString(
handlebarString: string,
- context: Record<string, any>,
+ context: Record<string, any>
): string {
const template = Handlebars.compile(handlebarString, { noEscape: true });
return template(context);
@@ -361,14 +357,14 @@ export async function extractVariablesFromTrace(
variables: string[],
traceId: string,
// this here are variables which were inserted by users. Need to validate before DB query.
- variableMapping: z.infer<typeof variableMappingList>,
+ variableMapping: z.infer<typeof variableMappingList>
) {
const mappingResult: { var: string; value: string }[] = [];
// find the context for each variable of the template
for (const variable of variables) {
const mapping = variableMapping.find(
- (m) => m.templateVariable === variable,
+ (m) => m.templateVariable === variable
);
if (!mapping) {
@@ -386,7 +382,7 @@ export async function extractVariablesFromTrace(
// if no column was found, we still process with an empty variable
if (!safeInternalColumn?.id) {
logger.error(
- `No column found for variable ${variable} and column ${mapping.selectedColumnId}`,
+ `No column found for variable ${variable} and column ${mapping.selectedColumnId}`
);
mappingResult.push({ var: variable, value: "" });
continue;
@@ -395,9 +391,7 @@ export async function extractVariablesFromTrace(
const trace = await kyselyPrisma.$kysely
.selectFrom("traces as t")
.select(
- sql`${sql.raw(safeInternalColumn.internal)}`.as(
- safeInternalColumn.id,
- ),
+ sql`${sql.raw(safeInternalColumn.internal)}`.as(safeInternalColumn.id)
) // query the internal column name raw
.where("id", "=", traceId)
.where("project_id", "=", projectId)
@@ -406,10 +400,10 @@ export async function extractVariablesFromTrace(
// user facing errors
if (!trace) {
logger.error(
- `Trace ${traceId} for project ${projectId} not found. Eval will succeed without trace input. Please ensure the mapped data on the trace exists and consider extending the job delay.`,
+ `Trace ${traceId} for project ${projectId} not found. Eval will succeed without trace input. Please ensure the mapped data on the trace exists and consider extending the job delay.`
);
throw new LangfuseNotFoundError(
- `Trace ${traceId} for project ${projectId} not found. Eval will succeed without trace input. Please ensure the mapped data on the trace exists and consider extending the job delay.`,
+ `Trace ${traceId} for project ${projectId} not found. Eval will succeed without trace input. Please ensure the mapped data on the trace exists and consider extending the job delay.`
);
}
@@ -425,7 +419,7 @@ export async function extractVariablesFromTrace(
if (!mapping.objectName) {
logger.info(
- `No object name found for variable ${variable} and object ${mapping.langfuseObject}`,
+ `No object name found for variable ${variable} and object ${mapping.langfuseObject}`
);
mappingResult.push({ var: variable, value: "" });
continue;
@@ -433,7 +427,7 @@ export async function extractVariablesFromTrace(
if (!safeInternalColumn?.id) {
logger.warn(
- `No column found for variable ${variable} and column ${mapping.selectedColumnId}`,
+ `No column found for variable ${variable} and column ${mapping.selectedColumnId}`
);
mappingResult.push({ var: variable, value: "" });
continue;
@@ -442,9 +436,7 @@ export async function extractVariablesFromTrace(
const observation = await kyselyPrisma.$kysely
.selectFrom("observations as o")
.select(
- sql`${sql.raw(safeInternalColumn.internal)}`.as(
- safeInternalColumn.id,
- ),
+ sql`${sql.raw(safeInternalColumn.internal)}`.as(safeInternalColumn.id)
) // query the internal column name raw
.where("trace_id", "=", traceId)
.where("project_id", "=", projectId)
@@ -455,10 +447,10 @@ export async function extractVariablesFromTrace(
// user facing errors
if (!observation) {
logger.error(
- `Observation ${mapping.objectName} for trace ${traceId} not found. Please ensure the mapped data exists and consider extending the job delay.`,
+ `Observation ${mapping.objectName} for trace ${traceId} not found. Please ensure the mapped data exists and consider extending the job delay.`
);
throw new LangfuseNotFoundError(
- `Observation ${mapping.objectName} for trace ${traceId} not found. Please ensure the mapped data exists and consider extending the job delay.`,
+ `Observation ${mapping.objectName} for trace ${traceId} not found. Please ensure the mapped data exists and consider extending the job delay.`
);
}