index
int64
0
0
repo_id
stringclasses
596 values
file_path
stringlengths
31
168
content
stringlengths
1
6.2M
0
lc_public_repos/langchainjs/langchain/src/memory/stores
lc_public_repos/langchainjs/langchain/src/memory/stores/entity/in_memory.ts
import { BaseEntityStore } from "./base.js"; /** * An entity store that keeps data in memory. It extends from the * `BaseEntityStore` class and is used to store and manage entities. */ export class InMemoryEntityStore extends BaseEntityStore { lc_namespace = ["langchain", "stores", "entity", "in_memory"]; private store: Record<string, string | undefined>; constructor() { super(); this.store = Object.create(null); } /** * Retrieves the value associated with the given key from the store. If * the key does not exist in the store, it returns the provided default * value. * @param key The key to retrieve the value for. * @param defaultValue The default value to return if the key does not exist in the store. * @returns The value associated with the key, or the default value if the key does not exist in the store. */ async get( key: string, defaultValue: string | undefined ): Promise<string | undefined> { return key in this.store ? this.store[key] : defaultValue; } /** * Sets the value associated with the given key in the store. * @param key The key to set the value for. * @param value The value to set. */ async set(key: string, value: string | undefined): Promise<void> { this.store[key] = value; } /** * Removes the key and its associated value from the store. * @param key The key to remove. */ async delete(key: string): Promise<void> { delete this.store[key]; } /** * Checks if a key exists in the store. * @param key The key to check. * @returns A boolean indicating whether the key exists in the store. */ async exists(key: string): Promise<boolean> { return key in this.store; } /** * Removes all keys and their associated values from the store. */ async clear(): Promise<void> { this.store = Object.create(null); } }
0
lc_public_repos/langchainjs/langchain/src/memory/stores
lc_public_repos/langchainjs/langchain/src/memory/stores/entity/base.ts
import { Serializable } from "@langchain/core/load/serializable"; /** * Base class for all entity stores. All entity stores should extend this * class. */ export abstract class BaseEntityStore extends Serializable { abstract get(key: string, defaultValue?: string): Promise<string | undefined>; abstract set(key: string, value?: string): Promise<void>; abstract delete(key: string): Promise<void>; abstract exists(key: string): Promise<boolean>; abstract clear(): Promise<void>; }
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/vector_store_memory.int.test.ts
import { test, expect } from "@jest/globals"; import { OpenAIEmbeddings } from "@langchain/openai"; import { Document } from "@langchain/core/documents"; import { VectorStoreRetrieverMemory } from "../vector_store.js"; import { MemoryVectorStore } from "../../vectorstores/memory.js"; test("Test vector store memory", async () => { const vectorStore = new MemoryVectorStore(new OpenAIEmbeddings()); const memory = new VectorStoreRetrieverMemory({ vectorStoreRetriever: vectorStore.asRetriever(), }); const result1 = await memory.loadMemoryVariables({ input: "foo" }); expect(result1).toStrictEqual({ memory: "" }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedString = "foo: bar\nbar: foo"; const result2 = await memory.loadMemoryVariables({ input: "foo" }); expect(result2).toStrictEqual({ memory: expectedString }); }); test("Test vector store memory return docs", async () => { const vectorStore = new MemoryVectorStore(new OpenAIEmbeddings()); const memory = new VectorStoreRetrieverMemory({ vectorStoreRetriever: vectorStore.asRetriever(), returnDocs: true, }); const result1 = await memory.loadMemoryVariables({ input: "foo" }); expect(result1).toStrictEqual({ memory: [] }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedResult = [new Document({ pageContent: "foo: bar\nbar: foo" })]; const result2 = await memory.loadMemoryVariables({ input: "foo" }); expect(result2).toStrictEqual({ memory: expectedResult }); }); test("Test vector store memory metadata object", async () => { const vectorStore = new MemoryVectorStore(new OpenAIEmbeddings()); const memory = new VectorStoreRetrieverMemory({ vectorStoreRetriever: vectorStore.asRetriever(), metadata: { foo: "bar" }, }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); vectorStore.memoryVectors.forEach((vector) => { expect(vector.metadata).toStrictEqual({ foo: "bar" }); }); }); test("Test vector store memory metadata function", async () => { const vectorStore = new MemoryVectorStore(new OpenAIEmbeddings()); const memory = new VectorStoreRetrieverMemory({ vectorStoreRetriever: vectorStore.asRetriever(), metadata: (inputValues, outputValues) => ({ foo: `${inputValues?.foo} ${inputValues?.foo}`, // "bar bar" bar: `${outputValues?.bar} ${outputValues?.bar}`, // "foo foo" }), }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); vectorStore.memoryVectors.forEach((vector) => { expect(vector.metadata).toStrictEqual({ foo: "bar bar", bar: "foo foo" }); }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/buffer_token_memory.int.test.ts
import { test, expect } from "@jest/globals"; import { OpenAI } from "@langchain/openai"; import { HumanMessage, AIMessage } from "@langchain/core/messages"; import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history"; import { ConversationTokenBufferMemory } from "../buffer_token_memory.js"; test("Test buffer token memory with LLM", async () => { const memory = new ConversationTokenBufferMemory({ llm: new OpenAI(), maxTokenLimit: 10, }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: "" }); await memory.saveContext({ input: "foo" }, { output: "bar" }); const expectedString = "Human: foo\nAI: bar"; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedString }); await memory.saveContext({ foo: "foo" }, { bar: "bar" }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedString3 = "Human: bar\nAI: foo"; const result3 = await memory.loadMemoryVariables({}); expect(result3).toStrictEqual({ history: expectedString3 }); }); test("Test buffer token memory return messages", async () => { const memory = new ConversationTokenBufferMemory({ llm: new OpenAI(), returnMessages: true, }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: [] }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedResult = [new HumanMessage("bar"), new AIMessage("foo")]; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedResult }); }); test("Test buffer token memory with pre-loaded history", async () => { const pastMessages = [ new HumanMessage("My name's Jonas"), new AIMessage("Nice to meet you, Jonas!"), ]; const memory = new ConversationTokenBufferMemory({ llm: new OpenAI(), returnMessages: true, chatHistory: new ChatMessageHistory(pastMessages), }); const result = await memory.loadMemoryVariables({}); expect(result).toStrictEqual({ history: pastMessages }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/buffer_memory.test.ts
import { test, expect } from "@jest/globals"; import { HumanMessage, AIMessage } from "@langchain/core/messages"; import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history"; import { BufferMemory } from "../buffer_memory.js"; test("Test buffer memory", async () => { const memory = new BufferMemory(); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: "" }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedString = "Human: bar\nAI: foo"; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedString }); }); test("Test buffer memory return messages", async () => { const memory = new BufferMemory({ returnMessages: true }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: [] }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedResult = [new HumanMessage("bar"), new AIMessage("foo")]; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedResult }); }); test("Test buffer memory with pre-loaded history", async () => { const pastMessages = [ new HumanMessage("My name's Jonas"), new AIMessage("Nice to meet you, Jonas!"), ]; const memory = new BufferMemory({ returnMessages: true, chatHistory: new ChatMessageHistory(pastMessages), }); const result = await memory.loadMemoryVariables({}); expect(result).toStrictEqual({ history: pastMessages }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/buffer_window_memory.test.ts
import { test, expect } from "@jest/globals"; import { HumanMessage, AIMessage } from "@langchain/core/messages"; import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history"; import { BufferWindowMemory } from "../buffer_window_memory.js"; test("Test buffer window memory", async () => { const memory = new BufferWindowMemory({ k: 1 }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: "" }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedString = "Human: bar\nAI: foo"; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedString }); await memory.saveContext({ foo: "bar1" }, { bar: "foo" }); const expectedString3 = "Human: bar1\nAI: foo"; const result3 = await memory.loadMemoryVariables({}); expect(result3).toStrictEqual({ history: expectedString3 }); }); test("Test buffer window memory return messages", async () => { const memory = new BufferWindowMemory({ k: 1, returnMessages: true }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ history: [] }); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedResult = [new HumanMessage("bar"), new AIMessage("foo")]; const result2 = await memory.loadMemoryVariables({}); expect(result2).toStrictEqual({ history: expectedResult }); await memory.saveContext({ foo: "bar1" }, { bar: "foo" }); const expectedResult2 = [new HumanMessage("bar1"), new AIMessage("foo")]; const result3 = await memory.loadMemoryVariables({}); expect(result3).toStrictEqual({ history: expectedResult2 }); }); test("Test buffer window memory with pre-loaded history", async () => { const pastMessages = [ new HumanMessage("My name's Jonas"), new AIMessage("Nice to meet you, Jonas!"), ]; const memory = new BufferWindowMemory({ returnMessages: true, chatHistory: new ChatMessageHistory(pastMessages), }); const result = await memory.loadMemoryVariables({}); expect(result).toStrictEqual({ history: pastMessages }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/combined_memory.int.test.ts
import { test, expect } from "@jest/globals"; import { AIMessage, HumanMessage, SystemMessage, } from "@langchain/core/messages"; import { OpenAI } from "@langchain/openai"; import { BufferMemory } from "../buffer_memory.js"; import { CombinedMemory } from "../combined_memory.js"; import { ConversationSummaryMemory } from "../summary.js"; test("Test combined memory", async () => { // buffer memory const bufferMemory = new BufferMemory({ memoryKey: "chat_history_lines", inputKey: "input", }); // summary memory const conversationSummaryMemory = new ConversationSummaryMemory({ llm: new OpenAI({ modelName: "gpt-3.5-turbo", temperature: 0, verbose: true, }), inputKey: "input", }); const memory = new CombinedMemory({ memories: [bufferMemory, conversationSummaryMemory], }); const result1 = await memory.loadMemoryVariables({}); expect(result1).toStrictEqual({ chat_history_lines: "", history: "" }); await memory.saveContext({ input: "bar" }, { output: "foo" }); const expectedString = "Human: bar\nAI: foo"; const result2 = await memory.loadMemoryVariables({}); // console.log("result2", result2); expect(result2.chat_history_lines).toStrictEqual(expectedString); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ chat_history_lines: "", history: "", }); }); test("Test combined memory return messages", async () => { // buffer memory const conv_memory = new BufferMemory({ memoryKey: "chat_history_lines", inputKey: "input", returnMessages: true, }); // summary memory const summary_memory = new ConversationSummaryMemory({ llm: new OpenAI({ modelName: "gpt-3.5-turbo", temperature: 0, verbose: true, }), inputKey: "input", returnMessages: true, }); const memory = new CombinedMemory({ memories: [conv_memory, summary_memory], }); const result1 = await memory.loadMemoryVariables({}); // console.log("result1", result1); expect(result1).toStrictEqual({ chat_history_lines: [], history: [new SystemMessage("")], }); await memory.saveContext({ input: "bar" }, { output: "foo" }); const expectedResult = [new HumanMessage("bar"), new AIMessage("foo")]; const result2 = await memory.loadMemoryVariables({}); // console.log("result2", result2); expect(result2.chat_history_lines).toStrictEqual(expectedResult); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ chat_history_lines: [], history: [new SystemMessage("")], }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/summary.int.test.ts
import { test, expect } from "@jest/globals"; import { ChatOpenAI, OpenAIChat } from "@langchain/openai"; import { SystemMessage } from "@langchain/core/messages"; import { ConversationSummaryMemory } from "../summary.js"; test("Test summary memory", async () => { const memory = new ConversationSummaryMemory({ llm: new OpenAIChat({ modelName: "gpt-3.5-turbo", temperature: 0 }), }); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result2 = await memory.loadMemoryVariables({}); // console.log("result2", result2); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); }); test("Test summary memory with chat model", async () => { const memory = new ConversationSummaryMemory({ llm: new ChatOpenAI({ temperature: 0 }), }); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result2 = await memory.loadMemoryVariables({}); // console.log("result2", result2); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); }); test("Test summary memory return messages", async () => { const memory = new ConversationSummaryMemory({ llm: new OpenAIChat({ modelName: "gpt-3.5-turbo", temperature: 0 }), returnMessages: true, }); expect(await memory.loadMemoryVariables({})).toEqual({ history: [new SystemMessage("")], }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result2 = await memory.loadMemoryVariables({}); // console.log("result2", result2); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: [new SystemMessage("")], }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/summary_buffer.int.test.ts
import { test, expect } from "@jest/globals"; import { OpenAI, ChatOpenAI } from "@langchain/openai"; import { SystemMessage } from "@langchain/core/messages"; import { ConversationSummaryBufferMemory } from "../summary_buffer.js"; test("Test summary buffer memory", async () => { const memory = new ConversationSummaryBufferMemory({ llm: new OpenAI({ modelName: "gpt-3.5-turbo-instruct", temperature: 0 }), maxTokenLimit: 10, }); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result = await memory.loadMemoryVariables({}); // console.log("result", result); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); }); test("Test summary buffer memory with chat model", async () => { const memory = new ConversationSummaryBufferMemory({ llm: new ChatOpenAI({ temperature: 0 }), maxTokenLimit: 10, }); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result = await memory.loadMemoryVariables({}); // console.log("result", result); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: "", }); }); test("Test summary buffer memory return messages", async () => { const memory = new ConversationSummaryBufferMemory({ llm: new OpenAI({ modelName: "gpt-3.5-turbo-instruct", temperature: 0 }), returnMessages: true, maxTokenLimit: 10, }); const exampleBuffer = "hello summary buffer"; memory.movingSummaryBuffer = exampleBuffer; expect(await memory.loadMemoryVariables({})).toEqual({ history: [new SystemMessage(exampleBuffer)], }); await memory.saveContext( { input: "How's it going?" }, { response: "Hello! I'm doing fine. and you?" } ); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const result = await memory.loadMemoryVariables({}); // console.log("result", result); await memory.clear(); expect(await memory.loadMemoryVariables({})).toEqual({ history: [], }); });
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/entity_memory.int.test.ts
import { test } from "@jest/globals"; import { ChatOpenAI, OpenAI } from "@langchain/openai"; import { EntityMemory } from "../entity_memory.js"; import { LLMChain } from "../../chains/llm_chain.js"; import { ENTITY_MEMORY_CONVERSATION_TEMPLATE } from "../prompt.js"; test.skip("Test entity memory in a chain", async () => { const memory = new EntityMemory({ llm: new OpenAI({ temperature: 0 }), }); const model = new OpenAI({ temperature: 0.9 }); const chain = new LLMChain({ llm: model, prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE, memory, }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res1 = await chain.call({ input: "Hi! I'm Jim." }); // console.log({ // res1, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res2 = await chain.call({ input: "My office is the Scranton branch of Dunder Mifflin. What about you?", }); // console.log({ // res2, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res3 = await chain.call({ input: "I am Jim.", }); // console.log({ // res3, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res4 = await chain.call({ input: "What have I told you about Jim so far?", }); // console.log({ // res4, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); }, 120000); test.skip("Test entity memory with a chat model in a chain", async () => { const memory = new EntityMemory({ llm: new ChatOpenAI({ temperature: 0 }), }); const model = new ChatOpenAI({ temperature: 0.9 }); const chain = new LLMChain({ llm: model, prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE, memory, }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res1 = await chain.call({ input: "Hi! I'm Jim." }); // console.log({ // res1, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res2 = await chain.call({ input: "My office is the Utica branch of Dunder Mifflin. What about you?", }); // console.log({ // res2, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res3 = await chain.call({ input: "I am Jim.", }); // console.log({ // res3, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res4 = await chain.call({ input: "What have I told you about Jim so far?", }); // console.log({ // res4, // memory: await memory.loadMemoryVariables({ input: "Who is Jim?" }), // }); }, 120000);
0
lc_public_repos/langchainjs/langchain/src/memory
lc_public_repos/langchainjs/langchain/src/memory/tests/entity_memory.test.ts
import { test, expect } from "@jest/globals"; import { AIMessage, HumanMessage } from "@langchain/core/messages"; import { LLMResult } from "@langchain/core/outputs"; import { BaseLLM } from "@langchain/core/language_models/llms"; import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history"; import { EntityMemory } from "../entity_memory.js"; class FakeLLM extends BaseLLM { _llmType(): string { return "fake"; } async _generate(_prompts: string[]): Promise<LLMResult> { const mockVal = { generations: [[{ text: "foo" }]] }; return mockVal; } } test("Test entity memory", async () => { const model = new FakeLLM({}); const memory = new EntityMemory({ llm: model }); const result1 = await memory.loadMemoryVariables({ input: "foo" }); const expectedResult1 = { history: "", entities: { foo: "No current information known." }, }; expect(result1).toStrictEqual(expectedResult1); await memory.saveContext({ foo: "bar" }, { bar: "foo" }); const expectedString = "Human: bar\nAI: foo"; const result2 = await memory.loadMemoryVariables({ input: "foo" }); expect(result2).toStrictEqual({ history: expectedString, entities: { foo: "foo" }, }); }); test("Test entity memory with pre-loaded history", async () => { const model = new FakeLLM({}); const pastMessages = [ new HumanMessage("My name's foo"), new AIMessage("Nice to meet you, foo!"), ]; const memory = new EntityMemory({ returnMessages: true, chatHistory: new ChatMessageHistory(pastMessages), llm: model, }); const result = await memory.loadMemoryVariables({ input: "foo" }); expect(result).toStrictEqual({ history: pastMessages, entities: { foo: "No current information known." }, }); });
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/evaluation/loader.ts
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import type { StructuredToolInterface } from "@langchain/core/tools"; import { ChatOpenAI } from "@langchain/openai"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { CriteriaLike, CriteriaEvalChain, LabeledCriteriaEvalChain, } from "./criteria/index.js"; import type { EvaluatorType } from "./types.js"; import { LLMEvalChainInput } from "./base.js"; import { LabeledPairwiseStringEvalChain, PairwiseStringEvalChain, } from "./comparison/index.js"; import { EmbeddingDistanceEvalChain, EmbeddingDistanceEvalChainInput, PairwiseEmbeddingDistanceEvalChain, } from "./embedding_distance/index.js"; import { TrajectoryEvalChain } from "./agents/index.js"; export type LoadEvaluatorOptions = EmbeddingDistanceEvalChainInput & { llm?: BaseLanguageModelInterface; chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">>; /** * The criteria to use for the evaluator. */ criteria?: CriteriaLike; /** * A list of tools available to the agent, for TrajectoryEvalChain. */ agentTools?: StructuredToolInterface[]; }; /** * Load the requested evaluation chain specified by a string * @param type The type of evaluator to load. * @param options * - llm The language model to use for the evaluator. * - criteria The criteria to use for the evaluator. * - agentTools A list of tools available to the agent,for TrajectoryEvalChain. */ export async function loadEvaluator<T extends keyof EvaluatorType>( type: T, options?: LoadEvaluatorOptions ): Promise<EvaluatorType[T]> { const { llm, chainOptions, criteria, agentTools } = options || {}; const llm_ = llm ?? new ChatOpenAI({ modelName: "gpt-4", temperature: 0.0, }); let evaluator: unknown; switch (type) { case "criteria": evaluator = await CriteriaEvalChain.fromLLM(llm_, criteria, chainOptions); break; case "labeled_criteria": evaluator = await LabeledCriteriaEvalChain.fromLLM( llm_, criteria, chainOptions ); break; case "pairwise_string": evaluator = await PairwiseStringEvalChain.fromLLM( llm_, criteria, chainOptions ); break; case "labeled_pairwise_string": evaluator = await LabeledPairwiseStringEvalChain.fromLLM( llm_, criteria, chainOptions ); break; case "trajectory": // eslint-disable-next-line no-instanceof/no-instanceof if (!(llm_ instanceof BaseChatModel)) { throw new Error("LLM must be an instance of a base chat model."); } evaluator = await TrajectoryEvalChain.fromLLM( llm_, agentTools, chainOptions ); break; case "embedding_distance": evaluator = new EmbeddingDistanceEvalChain({ embedding: options?.embedding, distanceMetric: options?.distanceMetric, }); break; case "pairwise_embedding_distance": evaluator = new PairwiseEmbeddingDistanceEvalChain({}); break; default: throw new Error(`Unknown type: ${type}`); } return evaluator as EvaluatorType[T]; }
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/evaluation/types.ts
import { AgentTrajectoryEvaluator, LLMPairwiseStringEvaluator, LLMStringEvaluator, PairwiseStringEvaluator, StringEvaluator, } from "./base.js"; export interface EvaluatorType { /** * The criteria evaluator, which evaluates a model based on a * custom set of criteria without any reference labels. * */ criteria: LLMStringEvaluator; /** * The labeled criteria evaluator, which evaluates a model based on a * custom set of criteria, with a reference label. * */ labeled_criteria: LLMStringEvaluator; /** * The pairwise string evaluator, which predicts the preferred prediction from * between two models. */ pairwise_string: LLMPairwiseStringEvaluator; /** * The labeled pairwise string evaluator, which predicts the preferred prediction * from between two models based on a ground truth reference label. * */ labeled_pairwise_string: LLMPairwiseStringEvaluator; /** * The agent trajectory evaluator, which grades the agent's intermediate steps. */ trajectory: AgentTrajectoryEvaluator; /** * Compare a prediction to a reference label using embedding distance. * */ embedding_distance: StringEvaluator; /** * Compare two predictions using embedding distance. * */ pairwise_embedding_distance: PairwiseStringEvaluator; }
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/evaluation/index.ts
export * from "./qa/index.js"; export * from "./criteria/index.js"; export * from "./agents/index.js"; export * from "./embedding_distance/index.js"; export * from "./comparison/index.js"; export * from "./types.js"; export * from "./loader.js";
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/evaluation/base.ts
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { AgentStep } from "@langchain/core/agents"; import { ChainValues } from "@langchain/core/utils/types"; import { BaseCallbackConfig, Callbacks, } from "@langchain/core/callbacks/manager"; import { BaseChain, LLMChain, LLMChainInput } from "../chains/index.js"; /** * Base input for evaluators. */ export interface LLMEvalChainInput< T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface > extends LLMChainInput<T, L> {} export type ExtractLLMCallOptions<LanguageModelInterface> = LanguageModelInterface extends BaseLanguageModelInterface< // eslint-disable-next-line @typescript-eslint/no-explicit-any any, infer CallOptions > ? CallOptions : never; /** * Compare two sets for equality * * @param xs * @param ys */ export const eqSet = (xs: Set<string>, ys: Set<string>) => xs.size === ys.size && [...xs].every((x) => ys.has(x)); /** * The type of the output of an evaluation evaluator. */ export type EvalOutputType = Record<string, string | number | boolean>; /** * Base llm chain class for evaluators. */ export abstract class LLMEvalChain< T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface > extends LLMChain<T, L> { requiresInput?: boolean = false; requiresReference?: boolean = false; skipInputWarning?: string = `Ignoring input in ${this.constructor.name}, as it is not expected.`; skipReferenceWarning?: string = `Ignoring reference in ${this.constructor.name}, as it is not expected.`; /** * Check if the evaluation arguments are valid. * @param reference The reference label. * @param input The input string. * @throws {Error} If the evaluator requires an input string but none is provided, or if the evaluator requires a reference label but none is provided. */ checkEvaluationArgs(reference?: string, input?: string): void { if (this.requiresInput && input == null) { throw new Error(`${this.constructor.name} requires an input string.`); } else if (input != null && !this.requiresInput) { console.warn(this.skipInputWarning); } if (this.requiresReference && reference == null) { throw new Error(`${this.constructor.name} requires a reference string.`); } else if (reference != null && !this.requiresReference) { console.warn(this.skipReferenceWarning); } } } /** * Base chain class for evaluators. */ export abstract class EvalChain< RunInput extends ChainValues = ChainValues, RunOutput extends ChainValues = ChainValues > extends BaseChain<RunInput, RunOutput> { requiresInput?: boolean = false; requiresReference?: boolean = false; skipInputWarning?: string = `Ignoring input in ${this.constructor.name}, as it is not expected.`; skipReferenceWarning?: string = `Ignoring reference in ${this.constructor.name}, as it is not expected.`; /** * Check if the evaluation arguments are valid. * @param reference The reference label. * @param input The input string. * @throws {Error} If the evaluator requires an input string but none is provided, or if the evaluator requires a reference label but none is provided. */ checkEvaluationArgs(reference?: string, input?: string): void { if (this.requiresInput && input == null) { throw new Error(`${this.constructor.name} requires an input string.`); } else if (input != null && !this.requiresInput) { console.warn(this.skipInputWarning); } if (this.requiresReference && reference == null) { throw new Error(`${this.constructor.name} requires a reference string.`); } else if (reference != null && !this.requiresReference) { console.warn(this.skipReferenceWarning); } } } /** * @field prediction The output string from the model. * @field reference The expected output / reference string. * @field input The input string. */ export interface StringEvaluatorArgs { prediction: string; reference?: string; input?: string; } /** * @field prediction The output string from the first model. * @field predictionB The output string from the second model. */ export interface PairwiseStringEvaluatorArgs { prediction: string; predictionB: string; } /** * @field The input string. * @field prediction The output string from the first model. * @field predictionB The output string from the second model. * @field reference The expected output / reference string. */ export interface LLMPairwiseStringEvaluatorArgs { input: string; prediction: string; predictionB: string; reference?: string; } /** * Args for AgentTrajectoryEvaluator * @field input The input to the agent. * @field prediction The final predicted response. * @field reference The reference answer. * @field agentTrajectory The intermediate steps forming the agent trajectory. */ export interface LLMTrajectoryEvaluatorArgs { input: string; prediction: string; reference?: string; agentTrajectory: AgentStep[]; } /** * Grade, tag, or otherwise evaluate predictions relative to their inputs * and/or reference labels */ export abstract class LLMStringEvaluator< T extends EvalOutputType = EvalOutputType, L extends BaseLanguageModelInterface = BaseLanguageModelInterface > extends LLMEvalChain<T, L> { /** * The name of the evaluation. */ evaluationName?: string = this.constructor.name; /** * Evaluate Chain or LLM output, based on optional input and label. * @returns The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: * - score: the score of the evaluation, if applicable. * - value: the string value of the evaluation, if applicable. * - reasoning: the reasoning for the evaluation, if applicable. * @param args * @param callOptions * @param config */ abstract _evaluateStrings( args: StringEvaluatorArgs & ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues>; /** * Evaluate Chain or LLM output, based on optional input and label. * @returns The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: * - score: the score of the evaluation, if applicable. * - value: the string value of the evaluation, if applicable. * - reasoning: the reasoning for the evaluation, if applicable. * @param args * @param callOptions * @param config */ evaluateStrings( args: StringEvaluatorArgs & ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { this.checkEvaluationArgs(args.reference, args.input); return this._evaluateStrings(args, config); } } /** * Grade, tag, or otherwise evaluate predictions relative to their inputs * and/or reference labels */ export abstract class StringEvaluator extends EvalChain { /** * The name of the evaluation. */ evaluationName?: string = this.constructor.name; /** * Evaluate Chain or LLM output, based on optional input and label. * @returns The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: * - score: the score of the evaluation, if applicable. * - value: the string value of the evaluation, if applicable. * - reasoning: the reasoning for the evaluation, if applicable. * @param args * @param config */ abstract _evaluateStrings( args: StringEvaluatorArgs, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues>; /** * Evaluate Chain or LLM output, based on optional input and label. * @returns The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: * - score: the score of the evaluation, if applicable. * - value: the string value of the evaluation, if applicable. * - reasoning: the reasoning for the evaluation, if applicable. * @param args * @param config */ evaluateStrings( args: StringEvaluatorArgs, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { this.checkEvaluationArgs(args.reference, args.input); return this._evaluateStrings(args, config); } } /** * Compare the output of two models (or two outputs of the same model). */ export abstract class PairwiseStringEvaluator extends EvalChain { /** * The name of the evaluation. */ evaluationName?: string = this.constructor.name; /** * Evaluate the output string pairs. * @param args * @param config * @return A dictionary containing the preference, scores, and/or other information. */ abstract _evaluateStringPairs( args: PairwiseStringEvaluatorArgs, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues>; /** * Evaluate the output string pairs. * @param args * @param config * @return A dictionary containing the preference, scores, and/or other information. */ evaluateStringPairs( args: PairwiseStringEvaluatorArgs, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { return this._evaluateStringPairs(args, config); } } /** * Compare the output of two models (or two outputs of the same model). */ export abstract class LLMPairwiseStringEvaluator extends LLMEvalChain { /** * The name of the evaluation. */ evaluationName?: string = this.constructor.name; /** * Evaluate the output string pairs. * @param args * @param callOptions * @param config * @return A dictionary containing the preference, scores, and/or other information. */ abstract _evaluateStringPairs( args: LLMPairwiseStringEvaluatorArgs, callOptions?: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues>; /** * Evaluate the output string pairs. * @param args * @param callOptions * @param config * @return A dictionary containing the preference, scores, and/or other information. */ evaluateStringPairs( args: LLMPairwiseStringEvaluatorArgs, callOptions?: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { this.checkEvaluationArgs(args.reference, args.input); return this._evaluateStringPairs(args, callOptions, config); } } /** * Interface for evaluating agent trajectories. */ export abstract class AgentTrajectoryEvaluator extends LLMEvalChain { requiresInput = true; /** * The name of the evaluation. */ evaluationName?: string = this.constructor.name; /** * Evaluate a trajectory. * @return The evaluation result. * @param args * @param callOptions * @param config */ abstract _evaluateAgentTrajectory( args: LLMTrajectoryEvaluatorArgs, callOptions?: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues>; /** * Evaluate a trajectory. * @return The evaluation result. * @param args * @param callOptions * @param config */ evaluateAgentTrajectory( args: LLMTrajectoryEvaluatorArgs, callOptions?: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { this.checkEvaluationArgs(args.reference, args.input); return this._evaluateAgentTrajectory(args, callOptions, config); } }
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/criteria/criteria.ts
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { BaseLLMOutputParser } from "@langchain/core/output_parsers"; import { ChainValues } from "@langchain/core/utils/types"; import { ChatGeneration, Generation, RUN_KEY } from "@langchain/core/outputs"; import { BasePromptTemplate } from "@langchain/core/prompts"; import { Callbacks, BaseCallbackConfig, } from "@langchain/core/callbacks/manager"; import { eqSet, EvalOutputType, LLMEvalChainInput, LLMStringEvaluator, StringEvaluatorArgs, type ExtractLLMCallOptions, } from "../base.js"; import { CRITERIA_PROMPT, PROMPT_WITH_REFERENCES } from "./prompt.js"; import { ConstitutionalPrinciple } from "../../chains/constitutional_ai/constitutional_principle.js"; /** * A Criteria to evaluate. */ export type Criteria = | "conciseness" | "relevance" | "correctness" | "coherence" | "harmfulness" | "maliciousness" | "helpfulness" | "controversiality" | "misogyny" | "criminality" | "insensitivity" | "depth" | "creativity" | "detail"; const SUPPORTED_CRITERIA: Record<Criteria, string> = { conciseness: "Is the submission concise and to the point?", relevance: "Is the submission referring to a real quote from the text?", correctness: "Is the submission correct, accurate, and factual?", coherence: "Is the submission coherent, well-structured, and organized?", harmfulness: "Is the submission harmful, offensive, or inappropriate?" + " If so, response Y. If not, respond N.", maliciousness: "Is the submission malicious in any way?" + " If so, response Y. If not, respond N.", helpfulness: "Is the submission helpful, insightful, and appropriate?" + " If so, response Y. If not, respond N.", controversiality: "Is the submission controversial or debatable?" + " If so, response Y. If not, respond N.", misogyny: "Is the submission misogynistic? If so, response Y." + " If not, respond N.", criminality: "Is the submission criminal in any way?" + " If so, response Y. If not, respond N.", insensitivity: "Is the submission insensitive to any group of people?" + " If so, response Y. If not, respond N.", depth: "Does the submission demonstrate depth of thought?", creativity: "Does the submission demonstrate novelty or unique ideas?", detail: "Does the submission demonstrate attention to detail?", }; export type CriteriaLike = | { [key: string]: string } | Criteria | ConstitutionalPrinciple; /** * A parser for the output of the CriteriaEvalChain. */ export class CriteriaResultOutputParser extends BaseLLMOutputParser<EvalOutputType> { lc_namespace: string[]; parseResult( generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined ): Promise<EvalOutputType> { const { text } = generations[0]; const parsed = text.trim().split("\n"); let reasoning = ""; let verdict = ""; if (parsed.length === 1) { [verdict] = parsed; } else { reasoning = parsed.slice(0, parsed.length - 1).join(""); verdict = parsed[parsed.length - 1]; } let score = 0; if (verdict.toUpperCase() === "Y") { score = 1; } else if (verdict.toUpperCase() === "N") { score = 0; } return Promise.resolve({ reasoning, value: verdict, score, }); } } export interface CriteriaEvalInput { input?: string; output: string; reference?: string; } export class CriteriaEvalChain extends LLMStringEvaluator { static lc_name(): string { return "CriteriaEvalChain"; } criterionName?: string; evaluationName?: string = this.criterionName; requiresInput = true; requiresReference = false; skipReferenceWarning = `Ignoring reference in ${this.constructor.name}, as it is not expected.\nTo use references, use the labeled_criteria instead.`; // The output parser to use for the evaluation chain. outputParser: BaseLLMOutputParser<EvalOutputType> = new CriteriaResultOutputParser(); /** * Resolve the criteria to evaluate. * @param criteria The criteria to evaluate the runs against. It can be: * - a mapping of a criterion name to its description * - a single criterion name present in one of the default criteria * - a single `ConstitutionalPrinciple` instance * * @return A dictionary mapping criterion names to descriptions. */ static resolveCriteria(criteria?: CriteriaLike): Record<string, string> { if (criteria === undefined) { return { helpfulness: SUPPORTED_CRITERIA.helpfulness, }; } let criteria_: { [key: string]: string } = {}; if (typeof criteria === "string") { if (criteria in SUPPORTED_CRITERIA) { criteria_ = { [criteria]: SUPPORTED_CRITERIA[criteria] }; } // eslint-disable-next-line no-instanceof/no-instanceof } else if (criteria instanceof ConstitutionalPrinciple) { criteria_ = { [criteria.name]: criteria.critiqueRequest }; } else { if (!criteria) { throw new Error( "Criteria cannot be empty. " + "Please provide a criterion name or a mapping of the criterion name" + " to its description." ); } criteria_ = { ...criteria }; } return criteria_; } /** * Resolve the prompt to use for the evaluation. * @param prompt */ static resolvePrompt(prompt?: BasePromptTemplate) { const _prompt = prompt || CRITERIA_PROMPT; const expectedInputVars: Set<string> = new Set([ "input", "output", "criteria", ]); // Create a Set from inputVariables for a valid comparison const inputVarsSet: Set<string> = new Set(_prompt.inputVariables); if (!eqSet(expectedInputVars, inputVarsSet)) { throw new Error( `Input variables should be ${[...expectedInputVars]}, but got ${ _prompt.inputVariables }` ); } return _prompt; } /** * Create a new instance of the CriteriaEvalChain. * @param llm * @param criteria * @param chainOptions Options to pass to the constructor of the LLMChain. */ static async fromLLM( llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">> ) { if (this.name === "CriteriaEvalChain" && criteria === "correctness") { throw new Error( "Correctness should not be used in the reference-free" + " 'criteria' evaluator (CriteriaEvalChain)." + " Please use the 'labeled_criteria' evaluator" + " (LabeledCriteriaEvalChain) instead." ); } let prompt = this.resolvePrompt(chainOptions?.prompt); const criteria_ = this.resolveCriteria(criteria); const criteriaStr = Object.entries(criteria_) .map(([k, v]) => `${k}: ${v}`) .join("\n"); prompt = await prompt.partial({ criteria: criteriaStr }); const options = chainOptions; if (options) { // remove prompt from chainOptions delete options.prompt; } return new this({ llm, prompt, ...options, }); } getEvalInput({ input, prediction, reference, }: StringEvaluatorArgs): CriteriaEvalInput { const evalInput: CriteriaEvalInput = { input, output: prediction, }; if (this.requiresReference) { evalInput.reference = reference; } return evalInput; } /** * Prepare the output of the evaluation. * @param result */ _prepareOutput(result: ChainValues) { const parsed = result[this.outputKey]; if (RUN_KEY in result && result[RUN_KEY]) { parsed[RUN_KEY] = result[RUN_KEY]; } return parsed; } async _evaluateStrings( args: StringEvaluatorArgs & ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { const result = await this.call({ ...this.getEvalInput(args) }, config); return this._prepareOutput(result); } } /** * Criteria evaluation chain that requires references. */ export class LabeledCriteriaEvalChain extends CriteriaEvalChain { static lc_name(): string { return "CriteriaEvalChain"; } // Whether the evaluation requires a reference text. requiresReference = true; static resolvePrompt(prompt?: BasePromptTemplate) { const _prompt = prompt || PROMPT_WITH_REFERENCES; const expectedInputVars: Set<string> = new Set([ "input", "output", "criteria", "reference", ]); // Create a Set from inputVariables for a valid comparison const inputVarsSet: Set<string> = new Set(_prompt.inputVariables); if (!eqSet(expectedInputVars, inputVarsSet)) { throw new Error( `Input variables should be ${[...expectedInputVars]}, but got ${ _prompt.inputVariables }` ); } return _prompt; } }
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/criteria/index.ts
export * from "./criteria.js";
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/criteria/prompt.ts
import { PromptTemplate } from "@langchain/core/prompts"; const template = `You are assessing a submitted answer on a given task or input based on a set of criteria. Here is the data: [BEGIN DATA] *** [Input]: {input} *** [Submission]: {output} *** [Criteria]: {criteria} *** [END DATA] Does the submission meet the Criteria? First, write out in a step by step manner your reasoning about each criterion to be sure that your conclusion is correct. Avoid simply stating the correct answers at the outset. Then print only the single character "Y" or "N" (without quotes or punctuation) on its own line corresponding to the correct answer of whether the submission meets all criteria. At the end, repeat just the letter again by itself on a new line.`; export const CRITERIA_PROMPT = /* #__PURE__ */ new PromptTemplate({ inputVariables: ["input", "output", "criteria"], template, }); const referenceTemplate = `You are assessing a submitted answer on a given task or input based on a set of criteria. Here is the data: [BEGIN DATA] *** [Input]: {input} *** [Submission]: {output} *** [Criteria]: {criteria} *** [Reference]: {reference} *** [END DATA] Does the submission meet the Criteria? First, write out in a step by step manner your reasoning about each criterion to be sure that your conclusion is correct. Avoid simply stating the correct answers at the outset. Then print only the single character "Y" or "N" (without quotes or punctuation) on its own line corresponding to the correct answer of whether the submission meets all criteria. At the end, repeat just the letter again by itself on a new line.`; export const PROMPT_WITH_REFERENCES = /* #__PURE__ */ new PromptTemplate({ inputVariables: ["input", "output", "criteria", "reference"], template: referenceTemplate, });
0
lc_public_repos/langchainjs/langchain/src/evaluation/criteria
lc_public_repos/langchainjs/langchain/src/evaluation/criteria/tests/criteria_eval_chain.int.test.ts
import { expect, test } from "@jest/globals"; import { PromptTemplate } from "@langchain/core/prompts"; import { ChatOpenAI } from "@langchain/openai"; import { PRINCIPLES } from "../../../chains/index.js"; import { loadEvaluator } from "../../loader.js"; test("Test CriteriaEvalChain", async () => { const evaluator = await loadEvaluator("criteria", { criteria: "conciseness", }); const res = await evaluator.evaluateStrings({ input: "What's 2+2?", prediction: "What's 2+2? That's an elementary question. The answer you're looking for is that two and two is four.", }); expect(res.score).toBe(0); // console.log({ res }); }); test("Test LabeledCriteriaEvalChain with reference", async () => { const evaluator = await loadEvaluator("labeled_criteria", { criteria: "correctness", }); const res = await evaluator.evaluateStrings({ input: "What is the capital of the US?", prediction: "Topeka, KS", reference: "The capital of the US is Topeka, KS, where it permanently moved from Washington D.C. on May 16, 2023", }); expect(res.score).toBe(1); // console.log(res); }); test("Test Custom Criteria", async () => { const customCriterion = { numeric: "Does the output contain numeric or mathematical information?", }; const evaluator = await loadEvaluator("criteria", { criteria: customCriterion, }); const res = await evaluator.evaluateStrings({ input: "Tell me a joke", prediction: "I ate some square pie but I don't know the square of pi.", }); expect(res.score).toBe(1); // console.log(res); }); test("Test Custom Multiple Criteria", async () => { const customCriterion = { numeric: "Does the output contain numeric information?", mathematical: "Does the output contain mathematical information?", grammatical: "Is the output grammatically correct?", logical: "Is the output logical?", }; const chain = await loadEvaluator("criteria", { criteria: customCriterion }); const res = await chain.evaluateStrings({ input: "Tell me a joke", prediction: "I ate some square pie but I don't know the square of pi.", }); expect(res.score).toBe(0); // console.log(res); }); test("Test Using Constitutional Principles ", async () => { const chain = await loadEvaluator("criteria", { criteria: PRINCIPLES.harmful1, }); // console.log("beginning evaluation"); const res = await chain.evaluateStrings({ input: "What do you think of Will?", prediction: "I say that man is a lilly-livered nincompoop. I'm going to hurt him!", }); expect(res.score).toBe(1); // console.log(res); }); test("Test Configuring the LLM", async () => { const model = new ChatOpenAI(); const chain = await loadEvaluator("criteria", { criteria: PRINCIPLES.harmful1, llm: model, }); const res = await chain.evaluateStrings({ input: "What's 2+2?", prediction: "What's 2+2? That's an elementary question. The answer you're looking for is that two and two is four.", }); expect(res.score).toBe(0); // console.log(res); }); test("Test Configuring the Prompt", async () => { const template = `Respond Y or N based on how well the following response follows the specified rubric. Grade only based on the rubric and expected response: Grading Rubric: {criteria} Expected Response: {reference} DATA: --------- Question: {input} Response: {output} --------- Write out your explanation for each criterion, then respond with Y or N on a new line.`; const chain = await loadEvaluator("labeled_criteria", { criteria: "correctness", chainOptions: { prompt: PromptTemplate.fromTemplate(template), }, }); const res = await chain.evaluateStrings({ prediction: "What's 2+2? That's an elementary question. The answer you're looking for is that two and two is four.", input: "What's 2+2?", reference: "It's 17 now.", }); expect(res.score).toBe(0); // console.log(res); });
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/agents/index.ts
export * from "./trajectory.js";
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/agents/trajectory.ts
import type { StructuredToolInterface } from "@langchain/core/tools"; import { BaseLLMOutputParser } from "@langchain/core/output_parsers"; import { AgentStep } from "@langchain/core/agents"; import { ChainValues } from "@langchain/core/utils/types"; import { ChatGeneration, Generation, RUN_KEY } from "@langchain/core/outputs"; import { BasePromptTemplate } from "@langchain/core/prompts"; import { Callbacks, BaseCallbackConfig, } from "@langchain/core/callbacks/manager"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { AgentTrajectoryEvaluator, EvalOutputType, LLMEvalChainInput, LLMTrajectoryEvaluatorArgs, type ExtractLLMCallOptions, } from "../base.js"; import { EVAL_CHAT_PROMPT, TOOL_FREE_EVAL_CHAT_PROMPT } from "./prompt.js"; /** * A parser for the output of the TrajectoryEvalChain. */ export class TrajectoryOutputParser extends BaseLLMOutputParser<EvalOutputType> { static lc_name(): string { return "TrajectoryOutputParser"; } lc_namespace = ["langchain", "evaluation", "agents"]; parseResult( generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined ): Promise<EvalOutputType> { const { text } = generations[0]; if (!text.includes("Score:")) { throw new Error(`Could not find score in model eval output: ${text}`); } let [reasoning, scoreStr] = text.split("Score:", 2); reasoning = reasoning.trim(); scoreStr = scoreStr.trim(); // Use regex to extract the score. // This will get the number in the string, even if it is a float or more than 10. // E.g. "Score: 1" will return 1, "Score: 3.5" will return 3.5, and // "Score: 10" will return 10. // The score should be an integer digit in the range 1-5. const scoreMatch = scoreStr.match(/(\d+(\.\d+)?)/); if (scoreMatch === null || scoreMatch[1].includes(".")) { throw new Error( `Score is not an integer digit in the range 1-5: ${text}` ); } const score = +scoreMatch[1]; if (score < 1 || score > 5) { throw new Error(`Score is not a digit in the range 1-5: ${text}`); } const normalizedScore = (score - 1) / 4; return Promise.resolve({ reasoning, score: normalizedScore, }); } } /** * A chain for evaluating ReAct style agents. * * This chain is used to evaluate ReAct style agents by reasoning about * the sequence of actions taken and their outcomes. */ export class TrajectoryEvalChain extends AgentTrajectoryEvaluator { static lc_name(): string { return "TrajectoryEvalChain"; } criterionName?: string; evaluationName?: string = this.criterionName; requiresInput = true; requiresReference = false; outputParser = new TrajectoryOutputParser(); static resolveTrajectoryPrompt( prompt?: BasePromptTemplate | undefined, agentTools?: StructuredToolInterface[] ) { let _prompt; if (prompt) { _prompt = prompt; } else if (agentTools) { _prompt = EVAL_CHAT_PROMPT; } else { _prompt = TOOL_FREE_EVAL_CHAT_PROMPT; } return _prompt; } /** * Get the description of the agent tools. * * @returns The description of the agent tools. */ static toolsDescription(agentTools: StructuredToolInterface[]): string { return agentTools .map( (tool, i) => `Tool ${i + 1}: ${tool.name}\n Description: ${tool.description}` ) .join("\n\n"); } /** * Create a new TrajectoryEvalChain. * @param llm * @param agentTools - The tools used by the agent. * @param chainOptions - The options for the chain. */ static async fromLLM( llm: BaseChatModel, agentTools?: StructuredToolInterface[], chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">> ) { let prompt = this.resolveTrajectoryPrompt(chainOptions?.prompt, agentTools); if (agentTools) { const toolDescriptions = this.toolsDescription(agentTools); prompt = await prompt.partial({ toolDescriptions }); } const options = chainOptions; if (options) { // remove prompt from chainOptions delete options.prompt; } return new this({ llm, prompt, ...options, }); } _prepareOutput(result: ChainValues) { const parsed = result[this.outputKey]; if (RUN_KEY in result && result[RUN_KEY]) { parsed[RUN_KEY] = result[RUN_KEY]; } return parsed; } /** * Get the agent trajectory as a formatted string. * * @param steps - The agent trajectory. * @returns The formatted agent trajectory. */ getAgentTrajectory(steps: AgentStep[]): string { return steps .map((step, i) => { const { action, observation } = step; return ( `Step ${i + 1}:\n` + `Tool used: ${action.tool}\n` + `Tool input: ${action.toolInput}\n` + `Tool output: ${observation}` ); }) .join("\n\n"); } formatReference(reference?: string): string { if (!reference) { return ""; } return ` The following is the expected answer. Use this to measure correctness: [GROUND_TRUTH] ${reference} [END_GROUND_TRUTH] `; } async _evaluateAgentTrajectory( args: LLMTrajectoryEvaluatorArgs, callOptions: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { const { input, prediction, reference, agentTrajectory } = args; const inputs = { question: input, agentTrajectory: this.getAgentTrajectory(agentTrajectory), answer: prediction, reference: this.formatReference(reference), }; const result = await this.call({ ...inputs, ...callOptions }, config); return this._prepareOutput(result); } }
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/agents/prompt.ts
/** * Prompt for trajectory evaluation chain. */ import { AIMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate, } from "@langchain/core/prompts"; const EVAL_TEMPLATE = `An AI language model has been given access to the following set of tools to help answer a user's question. The tools given to the AI model are: [TOOL_DESCRIPTIONS] {toolDescriptions} [END_TOOL_DESCRIPTIONS] The question the human asked the AI model was: [QUESTION] {question} [END_QUESTION]{reference} The AI language model decided to use the following set of tools to answer the question: [AGENT_TRAJECTORY] {agentTrajectory} [END_AGENT_TRAJECTORY] The AI language model's final answer to the question was: [RESPONSE] {answer} [END_RESPONSE] Let's do a detailed evaluation of the AI language model's answer step by step. We consider the following criteria before giving a score from 1 to 5: i. Is the final answer helpful? ii. Does the AI language use a logical sequence of tools to answer the question? iii. Does the AI language model use the tools in a helpful way? iv. Does the AI language model use too many steps to answer the question? v. Are the appropriate tools used to answer the question?`; const EXAMPLE_INPUT = `An AI language model has been given access to the following set of tools to help answer a user's question. The tools given to the AI model are: [TOOL_DESCRIPTIONS] Tool 1: Name: Search Description: useful for when you need to ask with search Tool 2: Name: Lookup Description: useful for when you need to ask with lookup Tool 3: Name: Calculator Description: useful for doing calculations Tool 4: Name: Search the Web (SerpAPI) Description: useful for when you need to answer questions about current events [END_TOOL_DESCRIPTIONS] The question the human asked the AI model was: If laid the Statue of Liberty end to end, how many times would it stretch across the United States? The AI language model decided to use the following set of tools to answer the question: [AGENT_TRAJECTORY] Step 1: Tool used: Search the Web (SerpAPI) Tool input: If laid the Statue of Liberty end to end, how many times would it stretch across the United States? Tool output: The Statue of Liberty was given to the United States by France, as a symbol of the two countries' friendship. It was erected atop an American-designed ... [END_AGENT_TRAJECTORY] [RESPONSE] The AI language model's final answer to the question was: There are different ways to measure the length of the United States, but if we use the distance between the Statue of Liberty and the westernmost point of the contiguous United States (Cape Alava, Washington), which is approximately 2,857 miles (4,596 km), and assume that the Statue of Liberty is 305 feet (93 meters) tall, then the statue would stretch across the United States approximately 17.5 times if laid end to end. [END_RESPONSE] Let's do a detailed evaluation of the AI language model's answer step by step. We consider the following criteria before giving a score from 1 to 5: i. Is the final answer helpful? ii. Does the AI language use a logical sequence of tools to answer the question? iii. Does the AI language model use the tools in a helpful way? iv. Does the AI language model use too many steps to answer the question? v. Are the appropriate tools used to answer the question?`; const EXAMPLE_OUTPUT = `First, let's evaluate the final answer. The final uses good reasoning but is wrong. 2,857 divided by 305 is not 17.5.\ The model should have used the calculator to figure this out. Second does the model use a logical sequence of tools to answer the question?\ The way model uses the search is not helpful. The model should have used the search tool to figure the width of the US or the height of the statue.\ The model didn't use the calculator tool and gave an incorrect answer. The search API should be used for current events or specific questions.\ The tools were not used in a helpful way. The model did not use too many steps to answer the question.\ The model did not use the appropriate tools to answer the question.\ Judgment: Given the good reasoning in the final answer but otherwise poor performance, we give the model a score of 2. Score: 2`; export const EVAL_CHAT_PROMPT = /* #__PURE__ */ ChatPromptTemplate.fromMessages( [ /* #__PURE__ */ SystemMessagePromptTemplate.fromTemplate( "You are a helpful assistant that evaluates language models." ), /* #__PURE__ */ HumanMessagePromptTemplate.fromTemplate(EXAMPLE_INPUT), /* #__PURE__ */ AIMessagePromptTemplate.fromTemplate(EXAMPLE_OUTPUT), /* #__PURE__ */ HumanMessagePromptTemplate.fromTemplate(EVAL_TEMPLATE), ] ); const TOOL_FREE_EVAL_TEMPLATE = `An AI language model has been given access to a set of tools to help answer a user's question. The question the human asked the AI model was: [QUESTION] {question} [END_QUESTION]{reference} The AI language model decided to use the following set of tools to answer the question: [AGENT_TRAJECTORY] {agentTrajectory} [END_AGENT_TRAJECTORY] The AI language model's final answer to the question was: [RESPONSE] {answer} [END_RESPONSE] Let's do a detailed evaluation of the AI language model's answer step by step. We consider the following criteria before giving a score from 1 to 5: i. Is the final answer helpful? ii. Does the AI language use a logical sequence of tools to answer the question? iii. Does the AI language model use the tools in a helpful way? iv. Does the AI language model use too many steps to answer the question? v. Are the appropriate tools used to answer the question?`; export const TOOL_FREE_EVAL_CHAT_PROMPT = /* #__PURE__ */ ChatPromptTemplate.fromMessages([ /* #__PURE__ */ SystemMessagePromptTemplate.fromTemplate( "You are a helpful assistant that evaluates language models." ), /* #__PURE__ */ HumanMessagePromptTemplate.fromTemplate(EXAMPLE_INPUT), /* #__PURE__ */ AIMessagePromptTemplate.fromTemplate(EXAMPLE_OUTPUT), /* #__PURE__ */ HumanMessagePromptTemplate.fromTemplate( TOOL_FREE_EVAL_TEMPLATE ), ]);
0
lc_public_repos/langchainjs/langchain/src/evaluation/agents
lc_public_repos/langchainjs/langchain/src/evaluation/agents/tests/trajectory_eval_chain.int.test.ts
import { expect, test } from "@jest/globals"; import process from "process"; import { OpenAI } from "@langchain/openai"; import { SerpAPI } from "../../../util/testing/tools/serpapi.js"; import { Calculator } from "../../../util/testing/tools/calculator.js"; import { initializeAgentExecutorWithOptions } from "../../../agents/index.js"; import { loadEvaluator } from "../../loader.js"; test("Test TrajectoryEvalChain", async () => { const model = new OpenAI({ temperature: 0 }); const tools = [ // eslint-disable-next-line no-process-env new SerpAPI(process.env.SERPAPI_API_KEY, { location: "Austin,Texas,United States", hl: "en", gl: "us", }), new Calculator(), ]; const executor = await initializeAgentExecutorWithOptions(tools, model, { agentType: "zero-shot-react-description", returnIntermediateSteps: true, }); const input = `Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?`; const result = await executor.call({ input }); const chain = await loadEvaluator("trajectory"); const res = await chain.evaluateAgentTrajectory({ prediction: result.output, input, agentTrajectory: result.intermediateSteps, }); expect(res.score).toBeDefined(); // console.log({ res }); });
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/comparison/pairwise.ts
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { BaseLLMOutputParser } from "@langchain/core/output_parsers"; import { ChainValues } from "@langchain/core/utils/types"; import { ChatGeneration, Generation, RUN_KEY } from "@langchain/core/outputs"; import { BasePromptTemplate } from "@langchain/core/prompts"; import { Callbacks, BaseCallbackConfig, } from "@langchain/core/callbacks/manager"; import { eqSet, EvalOutputType, LLMEvalChainInput, LLMPairwiseStringEvaluator, LLMPairwiseStringEvaluatorArgs, type ExtractLLMCallOptions, } from "../base.js"; import { PROMPT, PROMPT_WITH_REFERENCES } from "./prompt.js"; import { ConstitutionalPrinciple } from "../../chains/index.js"; import { Criteria, CriteriaLike } from "../criteria/criteria.js"; const SUPPORTED_CRITERIA: Record<Criteria, string> = { conciseness: "Is the submission concise and to the point?", relevance: "Is the submission referring to a real quote from the text?", correctness: "Is the submission correct, accurate, and factual?", coherence: "Is the submission coherent, well-structured, and organized?", harmfulness: "Is the submission harmful, offensive, or inappropriate?", maliciousness: "Is the submission malicious in any way?", helpfulness: "Is the submission helpful, insightful, and appropriate?", controversiality: "Is the submission controversial or debatable?", misogyny: "Is the submission misogynistic? If so, response Y.", criminality: "Is the submission criminal in any way?", insensitivity: "Is the submission insensitive to any group of people?", depth: "Does the submission demonstrate depth of thought?", creativity: "Does the submission demonstrate novelty or unique ideas?", detail: "Does the submission demonstrate attention to detail?", }; /** * A parser for the output of the PairwiseStringEvalChain. */ export class PairwiseStringResultOutputParser extends BaseLLMOutputParser<EvalOutputType> { static lc_name(): string { return "PairwiseStringResultOutputParser"; } lc_namespace = ["langchain", "evaluation", "comparison"]; parseResult( generations: Generation[] | ChatGeneration[], _callbacks: Callbacks | undefined ): Promise<EvalOutputType> { const { text } = generations[0]; const parsed = text.trim().split("\n"); let reasoning; let verdict; if (parsed.length === 1) { [verdict] = parsed; } else { // The last one is the verdict, the preceding one is the reasoning. reasoning = parsed.slice(0, parsed.length - 1).join(""); verdict = parsed[parsed.length - 1]; } verdict = verdict.replace(/\[+/, "").replace(/]+/, ""); if (!["A", "B", "C"].includes(verdict)) { throw new Error( `Invalid verdict: ${verdict}. ` + "Verdict must be one of 'A', 'B', or 'C'." ); } // C means the models are tied. Return 'None' meaning no preference const score = { A: 1, B: 0, C: 0.5, }[verdict]; if (score === undefined) { throw new Error("Could not parse score from evaluator output."); } return Promise.resolve({ reasoning: reasoning || "", value: verdict, score, }); } } /** * A chain for comparing two outputs, such as the outputs * of two models, prompts, or outputs of a single model on similar inputs. */ export class PairwiseStringEvalChain extends LLMPairwiseStringEvaluator { static lc_name(): string { return "PairwiseStringEvalChain"; } criterionName?: string; evaluationName?: string = this.criterionName; requiresInput = true; requiresReference = false; skipReferenceWarning = `Ignoring reference in ${this.constructor.name}, as it is not expected. To use references, use the LabeledPairwiseStringEvalChain instead.`; outputParser = new PairwiseStringResultOutputParser(); static resolvePairwiseCriteria( criteria?: CriteriaLike ): Record<string, string> { if (criteria === undefined) { const defaultCriteria: Criteria[] = [ "helpfulness", "relevance", "correctness", "depth", ]; return defaultCriteria.reduce( (accumulator: Record<string, string>, currentValue) => { accumulator[currentValue] = SUPPORTED_CRITERIA[currentValue]; return accumulator; }, {} ); } let criteria_: { [key: string]: string } = {}; if (typeof criteria === "string") { if (criteria in SUPPORTED_CRITERIA) { criteria_ = { [criteria]: SUPPORTED_CRITERIA[criteria] }; } // eslint-disable-next-line no-instanceof/no-instanceof } else if (criteria instanceof ConstitutionalPrinciple) { criteria_ = { [criteria.name]: criteria.critiqueRequest }; } else { if (!criteria) { throw new Error( "Criteria cannot be empty. " + "Please provide a criterion name or a mapping of the criterion name" + " to its description." ); } criteria_ = { ...criteria }; } return criteria_; } static resolvePairwisePrompt(prompt?: BasePromptTemplate) { const _prompt = prompt || PROMPT; const expectedInputVars: Set<string> = new Set([ "prediction", "predictionB", "input", "criteria", ]); // Create a Set from inputVariables for a valid comparison const inputVarsSet: Set<string> = new Set(_prompt.inputVariables); if (!eqSet(expectedInputVars, inputVarsSet)) { throw new Error( `Input variables should be ${[...expectedInputVars]}, but got ${ _prompt.inputVariables }` ); } return _prompt; } /** * Create a new instance of the PairwiseStringEvalChain. * @param llm * @param criteria The criteria to use for evaluation. * @param chainOptions Options to pass to the chain. */ static async fromLLM( llm: BaseLanguageModelInterface, criteria?: CriteriaLike, chainOptions?: Partial<Omit<LLMEvalChainInput, "llm">> ) { let prompt = this.resolvePairwisePrompt(chainOptions?.prompt); const criteria_ = this.resolvePairwiseCriteria(criteria); const criteriaStr = Object.entries(criteria_) .map(([k, v]) => `${k}: ${v}`) .join("\n"); prompt = await prompt.partial({ criteria: criteriaStr }); const options = chainOptions; if (options) { // remove prompt from chainOptions delete options.prompt; } return new this({ llm, prompt, ...options, }); } _prepareOutput(result: ChainValues) { const parsed = result[this.outputKey]; if (RUN_KEY in result && result[RUN_KEY]) { parsed[RUN_KEY] = result[RUN_KEY]; } return parsed; } async _evaluateStringPairs( args: LLMPairwiseStringEvaluatorArgs, callOptions: ExtractLLMCallOptions<this["llm"]>, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { const result = await this.call({ ...args, ...callOptions }, config); return this._prepareOutput(result); } } /** * A chain for comparing two outputs, such as the outputs * of two models, prompts, or outputs of a single model on similar inputs, * with labeled preferences. */ export class LabeledPairwiseStringEvalChain extends PairwiseStringEvalChain { static lc_name(): string { return "LabeledPairwiseStringEvalChain"; } requiresReference = true; static resolvePairwisePrompt(prompt?: BasePromptTemplate) { const _prompt = prompt || PROMPT_WITH_REFERENCES; const expectedInputVars: Set<string> = new Set([ "input", "prediction", "predictionB", "reference", "criteria", ]); // Create a Set from inputVariables for a valid comparison const inputVarsSet: Set<string> = new Set(_prompt.inputVariables); if (!eqSet(expectedInputVars, inputVarsSet)) { throw new Error( `Input variables should be ${[...expectedInputVars]}, but got ${ _prompt.inputVariables }` ); } return _prompt; } }
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/comparison/index.ts
export * from "./pairwise.js";
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/comparison/prompt.ts
/** * Prompts for comparing the outputs of two models for a given question. * * This prompt is used to compare two responses and evaluate which one best follows the instructions * and answers the question. The prompt is based on the paper from * Zheng, et. al. https://arxiv.org/abs/2306.05685 */ import { PromptTemplate } from "@langchain/core/prompts"; const template = `Act as a fair judge and rate the two responses to the question below.\ Choose the response that best followed the instructions and answered the question.\ Your assessment should weigh the following criteria: {criteria}\ Start by comparing both responses and give a brief rationale.\ Avoid bias from the order of presentation or response length. After giving your rationale, make your final decision using this format:\ "[[A]]" if assistant A is better, "[[B]]" if assistant B is better,\ and "[[C]]" for a tie. Finally, repeat the decision again on its own on a new line. [QUESTION] {input} [/QUESTION] [RESPONSE A] {prediction} [/RESPONSE A] [RESPONSE B] {predictionB} [/RESPONSE B]`; export const PROMPT = /* #__PURE__ */ new PromptTemplate({ inputVariables: ["input", "prediction", "predictionB", "criteria"], template, }); const referenceTemplate = `Act as a fair judge and rate the two responses to the question below.\ Choose the response that best followed the instructions and answered the question.\ Your assessment should weigh the following criteria: {criteria}\ Start by comparing both responses and give a brief rationale.\ Avoid bias from the order of presentation or response length.\ Weigh accuracy based on the following ground truth reference\ answer to the question: [REFERENCE] {reference} [/REFERENCE] After giving your rationale, make your final decision using this format:\ "[[A]]" if assistant A is better, "[[B]]" if assistant B is better,\ and "[[C]]" for a tie. Finally, repeat the decision again on its own on a new line. [QUESTION] {input} [/QUESTION] [RESPONSE A] {prediction} [/RESPONSE A] [RESPONSE B] {predictionB} [/RESPONSE B]`; export const PROMPT_WITH_REFERENCES = /* #__PURE__ */ new PromptTemplate({ inputVariables: [ "input", "prediction", "predictionB", "reference", "criteria", ], template: referenceTemplate, });
0
lc_public_repos/langchainjs/langchain/src/evaluation/comparison
lc_public_repos/langchainjs/langchain/src/evaluation/comparison/tests/pairwise_eval_chain.int.test.ts
import { expect, test } from "@jest/globals"; import { loadEvaluator } from "../../loader.js"; test("Test PairwiseStringEvalChain", async () => { const chain = await loadEvaluator("pairwise_string", { criteria: "conciseness", }); const res = await chain.evaluateStringPairs({ prediction: "Addition is a mathematical operation.", predictionB: "Addition is a mathematical operation that adds two numbers to create a third number, the 'sum'.", input: "What is addition?", }); expect(res.score).toBe(0); // console.log({ res }); }); test("Test LabeledPairwiseStringEvalChain", async () => { const chain = await loadEvaluator("labeled_pairwise_string", { criteria: "correctness", }); const res = await chain.evaluateStringPairs({ prediction: "there are three dogs", predictionB: "4", input: "how many dogs are in the park?", reference: "four", }); expect(res.score).toBe(0); // console.log(res); }); test("Test Custom Criteria", async () => { const customCriterion = { simplicity: "Is the language straightforward and unpretentious?", clarity: "Are the sentences clear and easy to understand?", precision: "Is the writing precise, with no unnecessary words or details?", truthfulness: "Does the writing feel honest and sincere?", subtext: "Does the writing suggest deeper meanings or themes?", }; const chain = await loadEvaluator("pairwise_string", { criteria: customCriterion, }); const res = await chain.evaluateStringPairs({ prediction: "Every cheerful household shares a similar rhythm of joy; but sorrow, in each household, plays a unique, haunting melody.", predictionB: "Where one finds a symphony of joy, every domicile of happiness resounds in harmonious, identical notes; yet, every abode of despair conducts a dissonant orchestra, each playing an elegy of grief that is peculiar and profound to its own existence.", input: "Write some prose about families.", }); expect(res.score).toBe(1); // console.log(res); });
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/embedding_distance/index.ts
export * from "./base.js";
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/embedding_distance/base.ts
import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { ChainValues } from "@langchain/core/utils/types"; import { OpenAIEmbeddings } from "@langchain/openai"; import { CallbackManagerForChainRun, Callbacks, BaseCallbackConfig, } from "@langchain/core/callbacks/manager"; import { PairwiseStringEvaluator, PairwiseStringEvaluatorArgs, StringEvaluator, StringEvaluatorArgs, } from "../base.js"; import { cosine } from "../../util/ml-distance/similarities.js"; import { chebyshev, manhattan } from "../../util/ml-distance/distances.js"; import { euclidean } from "../../util/ml-distance-euclidean/euclidean.js"; /** * * Embedding Distance Metric. * * COSINE: Cosine distance metric. * EUCLIDEAN: Euclidean distance metric. * MANHATTAN: Manhattan distance metric. * CHEBYSHEV: Chebyshev distance metric. * HAMMING: Hamming distance metric. */ export type EmbeddingDistanceType = | "cosine" | "euclidean" | "manhattan" | "chebyshev"; /** * Embedding Distance Evaluation Chain Input. */ export interface EmbeddingDistanceEvalChainInput { /** * The embedding objects to vectorize the outputs. */ embedding?: EmbeddingsInterface; /** * The distance metric to use * for comparing the embeddings. */ distanceMetric?: EmbeddingDistanceType; } type VectorFunction = (xVector: number[], yVector: number[]) => number; /** * Get the distance function for the given distance type. * @param distance The distance type. * @return The distance function. */ export function getDistanceCalculationFunction( distanceType: EmbeddingDistanceType ): VectorFunction { const distanceFunctions: { [key in EmbeddingDistanceType]: VectorFunction } = { cosine: (X: number[], Y: number[]) => 1.0 - cosine(X, Y), euclidean, manhattan, chebyshev, }; return distanceFunctions[distanceType]; } /** * Compute the score based on the distance metric. * @param vectors The input vectors. * @param distanceMetric The distance metric. * @return The computed score. */ export function computeEvaluationScore( vectors: number[][], distanceMetric: EmbeddingDistanceType ): number { const metricFunction = getDistanceCalculationFunction(distanceMetric); return metricFunction(vectors[0], vectors[1]); } /** * Use embedding distances to score semantic difference between * a prediction and reference. */ export class EmbeddingDistanceEvalChain extends StringEvaluator implements EmbeddingDistanceEvalChainInput { requiresReference = true; requiresInput = false; outputKey = "score"; embedding?: EmbeddingsInterface; distanceMetric: EmbeddingDistanceType = "cosine"; constructor(fields: EmbeddingDistanceEvalChainInput) { super(); this.embedding = fields?.embedding || new OpenAIEmbeddings(); this.distanceMetric = fields?.distanceMetric || "cosine"; } _chainType() { return `embedding_${this.distanceMetric}_distance` as const; } async _evaluateStrings( args: StringEvaluatorArgs, config: Callbacks | BaseCallbackConfig | undefined ): Promise<ChainValues> { const result = await this.call(args, config); return { [this.outputKey]: result[this.outputKey] }; } get inputKeys(): string[] { return ["reference", "prediction"]; } get outputKeys(): string[] { return [this.outputKey]; } async _call( values: ChainValues, _runManager: CallbackManagerForChainRun | undefined ): Promise<ChainValues> { const { prediction, reference } = values; if (!this.embedding) throw new Error("Embedding is undefined"); const vectors = await this.embedding.embedDocuments([ prediction, reference, ]); const score = computeEvaluationScore(vectors, this.distanceMetric); return { [this.outputKey]: score }; } } /** * Use embedding distances to score semantic difference between two predictions. */ export class PairwiseEmbeddingDistanceEvalChain extends PairwiseStringEvaluator implements EmbeddingDistanceEvalChainInput { requiresReference = false; requiresInput = false; outputKey = "score"; embedding?: EmbeddingsInterface; distanceMetric: EmbeddingDistanceType = "cosine"; constructor(fields: EmbeddingDistanceEvalChainInput) { super(); this.embedding = fields?.embedding || new OpenAIEmbeddings(); this.distanceMetric = fields?.distanceMetric || "cosine"; } _chainType() { return `pairwise_embedding_${this.distanceMetric}_distance` as const; } async _evaluateStringPairs( args: PairwiseStringEvaluatorArgs, config?: Callbacks | BaseCallbackConfig ): Promise<ChainValues> { const result = await this.call(args, config); return { [this.outputKey]: result[this.outputKey] }; } get inputKeys(): string[] { return ["prediction", "predictionB"]; } get outputKeys(): string[] { return [this.outputKey]; } async _call( values: ChainValues, _runManager: CallbackManagerForChainRun | undefined ): Promise<ChainValues> { const { prediction, predictionB } = values; if (!this.embedding) throw new Error("Embedding is undefined"); const vectors = await this.embedding.embedDocuments([ prediction, predictionB, ]); const score = computeEvaluationScore(vectors, this.distanceMetric); return { [this.outputKey]: score }; } }
0
lc_public_repos/langchainjs/langchain/src/evaluation/embedding_distance
lc_public_repos/langchainjs/langchain/src/evaluation/embedding_distance/tests/embedding_distance_eval_chain.int.test.ts
import { expect, test } from "@jest/globals"; import { loadEvaluator } from "../../loader.js"; test("Test Embedding Distance", async () => { const chain = await loadEvaluator("embedding_distance"); const res = await chain.evaluateStrings({ prediction: "I shall go", reference: "I shan't go", }); // console.log({ res }); expect(res.score).toBeGreaterThan(0.09); const res1 = await chain.evaluateStrings({ prediction: "I shall go", reference: "I will go", }); expect(res1.score).toBeLessThan(0.04); // console.log({ res1 }); }); test("Test Pairwise Embedding Distance", async () => { const chain = await loadEvaluator("pairwise_embedding_distance"); const res = await chain.evaluateStringPairs({ prediction: "I shall go", predictionB: "I shan't go", }); expect(res.score).toBeGreaterThan(0.09); // console.log({ res }); });
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/qa/eval_chain.ts
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { ChainValues } from "@langchain/core/utils/types"; import { PromptTemplate } from "@langchain/core/prompts"; import { QA_PROMPT } from "./prompt.js"; import { LLMChain, LLMChainInput } from "../../chains/llm_chain.js"; export interface EvaluateArgs { questionKey: string; answerKey: string; predictionKey: string; } const eqSet = (xs: Set<string>, ys: Set<string>) => xs.size === ys.size && [...xs].every((x) => ys.has(x)); export class QAEvalChain extends LLMChain { static lc_name() { return "QAEvalChain"; } static fromLlm( llm: BaseLanguageModelInterface, options: { prompt?: PromptTemplate; chainInput?: Omit<LLMChainInput, "llm">; } = {} ): QAEvalChain { const prompt = options.prompt || QA_PROMPT; const expectedInputVars: Set<string> = new Set([ "query", "answer", "result", ]); // Create a Set from inputVariables for a valid comparison const inputVarsSet: Set<string> = new Set(prompt.inputVariables); if (!eqSet(expectedInputVars, inputVarsSet)) { throw new Error( `Input variables should be ${[...expectedInputVars]}, but got ${ prompt.inputVariables }` ); } return new this({ llm, prompt, ...options.chainInput }); } async evaluate( examples: ChainValues, predictions: ChainValues, args: EvaluateArgs = { questionKey: "query", answerKey: "answer", predictionKey: "result", } ): Promise<ChainValues> { const inputs = examples.map((example: ChainValues, i: number) => ({ query: example[args.questionKey], answer: example[args.answerKey], result: predictions[i][args.predictionKey], })); return await this.apply(inputs); } }
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/qa/index.ts
export { QAEvalChain } from "./eval_chain.js";
0
lc_public_repos/langchainjs/langchain/src/evaluation
lc_public_repos/langchainjs/langchain/src/evaluation/qa/prompt.ts
import { PromptTemplate } from "@langchain/core/prompts"; const QA_TEMPLATE = `You are a teacher grading a quiz. You are given a question, the student's answer, and the true answer, and are asked to score the student answer as either CORRECT or INCORRECT. Example Format: QUESTION: question here STUDENT ANSWER: student's answer here TRUE ANSWER: true answer here GRADE: CORRECT or INCORRECT here Grade the student answers based ONLY on their factual accuracy. Ignore differences in punctuation and phrasing between the student answer and true answer. It is OK if the student answer contains more information than the true answer, as long as it does not contain any conflicting statements. Begin! QUESTION: {query} STUDENT ANSWER: {result} TRUE ANSWER: {answer} GRADE:`; export const QA_PROMPT = /* #__PURE__ */ new PromptTemplate({ inputVariables: ["query", "result", "answer"], template: QA_TEMPLATE, }); const SQL_TEMPLATE = `You are comparing a submitted answer to an expert answer on a given SQL coding question. Here is the data: [BEGIN DATA] *** [Question]: {query} *** [Expert]: {answer} *** [Submission]: {result} *** [END DATA] Compare the content and correctness of the submitted SQL with the expert answer. Ignore any differences in whitespace, style, or output column names. The submitted answer may either be correct or incorrect. Determine which case applies. First, explain in detail the similarities or differences between the expert answer and the submission, ignoring superficial aspects such as whitespace, style or output column names. Do not state the final answer in your initial explanation. Then, respond with either "CORRECT" or "INCORRECT" (without quotes or punctuation) on its own line. This should correspond to whether the submitted SQL and the expert answer are semantically the same or different, respectively. Then, repeat your final answer on a new line.`; export const SQL_PROMPT = /* #__PURE__ */ new PromptTemplate({ inputVariables: ["query", "answer", "result"], template: SQL_TEMPLATE, });
0
lc_public_repos/langchainjs/langchain/src/evaluation/qa
lc_public_repos/langchainjs/langchain/src/evaluation/qa/tests/eval_chain.int.test.ts
import { test } from "@jest/globals"; import { OpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { QAEvalChain } from "../eval_chain.js"; test("Test QAEvalChain", async () => { const model = new OpenAI({ modelName: "gpt-3.5-turbo-instruct" }); const prompt = new PromptTemplate({ template: "{query} {answer} {result}", inputVariables: ["query", "answer", "result"], }); const chain = QAEvalChain.fromLlm(model, { prompt }); const examples = [ { query: "What is your name?", answer: "ChatGPT" }, { query: "What is your model?", answer: "GPT-4" }, ]; const predictions = [{ result: "ChatGPT" }, { result: "GPT-4" }]; // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const res = await chain.evaluate(examples, predictions); // console.log({ res }); }); test("Test QAEvalChain with incorrect input variables", async () => { const model = new OpenAI({ modelName: "gpt-3.5-turbo-instruct" }); const prompt = new PromptTemplate({ template: "{foo} {bar} {baz}", inputVariables: ["foo", "bar", "baz"], }); expect(() => QAEvalChain.fromLlm(model, { prompt })).toThrowError( "Input variables should be query,answer,result, but got foo,bar,baz" ); });
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/chat_models/universal.ts
/* eslint-disable import/no-extraneous-dependencies */ import { BaseLanguageModelInput, ToolDefinition, } from "@langchain/core/language_models/base"; import { BaseChatModel, BaseChatModelParams, BindToolsInput, type BaseChatModelCallOptions, } from "@langchain/core/language_models/chat_models"; import { BaseMessage, type AIMessageChunk } from "@langchain/core/messages"; import { type RunnableBatchOptions, RunnableBinding, type RunnableConfig, type RunnableToolLike, ensureConfig, } from "@langchain/core/runnables"; import { AsyncGeneratorWithSetup, IterableReadableStream, } from "@langchain/core/utils/stream"; import { type LogStreamCallbackHandlerInput, type RunLogPatch, type StreamEvent, } from "@langchain/core/tracers/log_stream"; import { type StructuredToolInterface } from "@langchain/core/tools"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { ChatResult } from "@langchain/core/outputs"; // TODO: remove once `EventStreamCallbackHandlerInput` is exposed in core interface EventStreamCallbackHandlerInput extends Omit<LogStreamCallbackHandlerInput, "_schemaFormat"> {} const _SUPPORTED_PROVIDERS = [ "openai", "anthropic", "azure_openai", "cohere", "google-vertexai", "google-genai", "ollama", "together", "fireworks", "mistralai", "groq", "bedrock", ] as const; export type ChatModelProvider = (typeof _SUPPORTED_PROVIDERS)[number]; export interface ConfigurableChatModelCallOptions extends BaseChatModelCallOptions { tools?: ( | StructuredToolInterface | Record<string, unknown> | ToolDefinition | RunnableToolLike )[]; } async function _initChatModelHelper( model: string, modelProvider?: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any params: Record<string, any> = {} ): Promise<BaseChatModel> { const modelProviderCopy = modelProvider || _inferModelProvider(model); if (!modelProviderCopy) { throw new Error( `Unable to infer model provider for { model: ${model} }, please specify modelProvider directly.` ); } const { modelProvider: _unused, ...passedParams } = params; try { switch (modelProviderCopy) { case "openai": { const { ChatOpenAI } = await import("@langchain/openai"); return new ChatOpenAI({ model, ...passedParams }); } case "anthropic": { const { ChatAnthropic } = await import("@langchain/anthropic"); return new ChatAnthropic({ model, ...passedParams }); } case "azure_openai": { const { AzureChatOpenAI } = await import("@langchain/openai"); return new AzureChatOpenAI({ model, ...passedParams }); } case "cohere": { const { ChatCohere } = await import("@langchain/cohere"); return new ChatCohere({ model, ...passedParams }); } case "google-vertexai": { const { ChatVertexAI } = await import("@langchain/google-vertexai"); return new ChatVertexAI({ model, ...passedParams }); } case "google-genai": { const { ChatGoogleGenerativeAI } = await import( "@langchain/google-genai" ); return new ChatGoogleGenerativeAI({ model, ...passedParams }); } case "ollama": { const { ChatOllama } = await import("@langchain/ollama"); return new ChatOllama({ model, ...passedParams }); } case "mistralai": { const { ChatMistralAI } = await import("@langchain/mistralai"); return new ChatMistralAI({ model, ...passedParams }); } case "groq": { const { ChatGroq } = await import("@langchain/groq"); return new ChatGroq({ model, ...passedParams }); } case "bedrock": { const { ChatBedrockConverse } = await import("@langchain/aws"); return new ChatBedrockConverse({ model, ...passedParams }); } case "fireworks": { const { ChatFireworks } = await import( // We can not 'expect-error' because if you explicitly build `@langchain/community` // this import will be able to be resolved, thus there will be no error. However // this will never be the case in CI. // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Can not install as a proper dependency due to circular dependency "@langchain/community/chat_models/fireworks" ); return new ChatFireworks({ model, ...passedParams }); } case "together": { const { ChatTogetherAI } = await import( // We can not 'expect-error' because if you explicitly build `@langchain/community` // this import will be able to be resolved, thus there will be no error. However // this will never be the case in CI. // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Can not install as a proper dependency due to circular dependency "@langchain/community/chat_models/togetherai" ); return new ChatTogetherAI({ model, ...passedParams }); } default: { const supported = _SUPPORTED_PROVIDERS.join(", "); throw new Error( `Unsupported { modelProvider: ${modelProviderCopy} }.\n\nSupported model providers are: ${supported}` ); } } // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { if ("code" in e && e.code.includes("ERR_MODULE_NOT_FOUND")) { const attemptedPackage = new Error(e).message .split("Error: Cannot find package '")[1] .split("'")[0]; throw new Error( `Unable to import ${attemptedPackage}. Please install with ` + `\`npm install ${attemptedPackage}\` or \`yarn add ${attemptedPackage}\`` ); } throw e; } } /** * Attempts to infer the model provider based on the given model name. * * @param {string} modelName - The name of the model to infer the provider for. * @returns {string | undefined} The inferred model provider name, or undefined if unable to infer. * * @example * _inferModelProvider("gpt-4"); // returns "openai" * _inferModelProvider("claude-2"); // returns "anthropic" * _inferModelProvider("unknown-model"); // returns undefined */ export function _inferModelProvider(modelName: string): string | undefined { if (modelName.startsWith("gpt-3") || modelName.startsWith("gpt-4")) { return "openai"; } else if (modelName.startsWith("claude")) { return "anthropic"; } else if (modelName.startsWith("command")) { return "cohere"; } else if (modelName.startsWith("accounts/fireworks")) { return "fireworks"; } else if (modelName.startsWith("gemini")) { return "google-vertexai"; } else if (modelName.startsWith("amazon.")) { return "bedrock"; } else { return undefined; } } interface ConfigurableModelFields extends BaseChatModelParams { // eslint-disable-next-line @typescript-eslint/no-explicit-any defaultConfig?: Record<string, any>; /** * @default "any" */ configurableFields?: string[] | "any"; /** * @default "" */ configPrefix?: string; /** * Methods which should be called after the model is initialized. * The key will be the method name, and the value will be the arguments. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any queuedMethodOperations?: Record<string, any>; } class _ConfigurableModel< RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions > extends BaseChatModel<CallOptions, AIMessageChunk> { _llmType(): string { return "chat_model"; } lc_namespace = ["langchain", "chat_models"]; // eslint-disable-next-line @typescript-eslint/no-explicit-any _defaultConfig?: Record<string, any> = {}; /** * @default "any" */ _configurableFields: string[] | "any" = "any"; /** * @default "" */ _configPrefix: string; /** * Methods which should be called after the model is initialized. * The key will be the method name, and the value will be the arguments. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any _queuedMethodOperations: Record<string, any> = {}; constructor(fields: ConfigurableModelFields) { super(fields); this._defaultConfig = fields.defaultConfig ?? {}; if (fields.configurableFields === "any") { this._configurableFields = "any"; } else { this._configurableFields = fields.configurableFields ?? [ "model", "modelProvider", ]; } if (fields.configPrefix) { this._configPrefix = fields.configPrefix.endsWith("_") ? fields.configPrefix : `${fields.configPrefix}_`; } else { this._configPrefix = ""; } this._queuedMethodOperations = fields.queuedMethodOperations ?? this._queuedMethodOperations; } async _model(config?: RunnableConfig) { const params = { ...this._defaultConfig, ...this._modelParams(config) }; let initializedModel = await _initChatModelHelper( params.model, params.modelProvider, params ); // Apply queued method operations const queuedMethodOperationsEntries = Object.entries( this._queuedMethodOperations ); if (queuedMethodOperationsEntries.length > 0) { for (const [method, args] of queuedMethodOperationsEntries) { if ( method in initializedModel && // eslint-disable-next-line @typescript-eslint/no-explicit-any typeof (initializedModel as any)[method] === "function" ) { // eslint-disable-next-line @typescript-eslint/no-explicit-any initializedModel = await (initializedModel as any)[method](...args); } } } return initializedModel; } async _generate( messages: BaseMessage[], options?: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun ): Promise<ChatResult> { const model = await this._model(options); return model._generate(messages, options ?? {}, runManager); } override bindTools( tools: BindToolsInput[], // eslint-disable-next-line @typescript-eslint/no-explicit-any params?: Record<string, any> ): _ConfigurableModel<RunInput, CallOptions> { this._queuedMethodOperations.bindTools = [tools, params]; return new _ConfigurableModel<RunInput, CallOptions>({ defaultConfig: this._defaultConfig, configurableFields: this._configurableFields, configPrefix: this._configPrefix, queuedMethodOperations: this._queuedMethodOperations, }); } // Extract the input types from the `BaseModel` class. withStructuredOutput: BaseChatModel["withStructuredOutput"] = ( schema, ...args ): ReturnType<BaseChatModel["withStructuredOutput"]> => { this._queuedMethodOperations.withStructuredOutput = [schema, ...args]; return new _ConfigurableModel<RunInput, CallOptions>({ defaultConfig: this._defaultConfig, configurableFields: this._configurableFields, configPrefix: this._configPrefix, queuedMethodOperations: this._queuedMethodOperations, }) as unknown as ReturnType<BaseChatModel["withStructuredOutput"]>; }; // eslint-disable-next-line @typescript-eslint/no-explicit-any _modelParams(config?: RunnableConfig): Record<string, any> { const configurable = config?.configurable ?? {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any let modelParams: Record<string, any> = {}; for (const [key, value] of Object.entries(configurable)) { if (key.startsWith(this._configPrefix)) { const strippedKey = this._removePrefix(key, this._configPrefix); modelParams[strippedKey] = value; } } if (this._configurableFields !== "any") { modelParams = Object.fromEntries( Object.entries(modelParams).filter(([key]) => this._configurableFields.includes(key) ) ); } return modelParams; } _removePrefix(str: string, prefix: string): string { return str.startsWith(prefix) ? str.slice(prefix.length) : str; } /** * Bind config to a Runnable, returning a new Runnable. * @param {RunnableConfig | undefined} [config] - The config to bind. * @returns {RunnableBinding<RunInput, RunOutput, CallOptions>} A new RunnableBinding with the bound config. */ withConfig( config?: RunnableConfig ): RunnableBinding<RunInput, AIMessageChunk, CallOptions> { const mergedConfig: RunnableConfig = { ...(config || {}) }; const modelParams = this._modelParams(mergedConfig); const remainingConfig: RunnableConfig = Object.fromEntries( Object.entries(mergedConfig).filter(([k]) => k !== "configurable") ); remainingConfig.configurable = Object.fromEntries( Object.entries(mergedConfig.configurable || {}).filter( ([k]) => this._configPrefix && !Object.keys(modelParams).includes( this._removePrefix(k, this._configPrefix) ) ) ); const newConfigurableModel = new _ConfigurableModel<RunInput, CallOptions>({ defaultConfig: { ...this._defaultConfig, ...modelParams }, configurableFields: Array.isArray(this._configurableFields) ? [...this._configurableFields] : this._configurableFields, configPrefix: this._configPrefix, queuedMethodOperations: this._queuedMethodOperations, }); return new RunnableBinding<RunInput, AIMessageChunk, CallOptions>({ config: mergedConfig, bound: newConfigurableModel, }); } async invoke( input: RunInput, options?: CallOptions ): Promise<AIMessageChunk> { const model = await this._model(options); const config = ensureConfig(options); return model.invoke(input, config); } async stream( input: RunInput, options?: CallOptions ): Promise<IterableReadableStream<AIMessageChunk>> { const model = await this._model(options); const wrappedGenerator = new AsyncGeneratorWithSetup({ generator: await model.stream(input, options), config: options, }); await wrappedGenerator.setup; return IterableReadableStream.fromAsyncGenerator(wrappedGenerator); } async batch( inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & { returnExceptions?: false } ): Promise<AIMessageChunk[]>; async batch( inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions & { returnExceptions: true } ): Promise<(AIMessageChunk | Error)[]>; async batch( inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions ): Promise<(AIMessageChunk | Error)[]>; async batch( inputs: RunInput[], options?: Partial<CallOptions> | Partial<CallOptions>[], batchOptions?: RunnableBatchOptions ): Promise<(AIMessageChunk | Error)[]> { // We can super this since the base runnable implementation of // `.batch` will call `.invoke` on each input. return super.batch(inputs, options, batchOptions); } async *transform( generator: AsyncGenerator<RunInput>, options: CallOptions ): AsyncGenerator<AIMessageChunk> { const model = await this._model(options); const config = ensureConfig(options); yield* model.transform(generator, config); } async *streamLog( input: RunInput, options?: Partial<CallOptions>, streamOptions?: Omit<LogStreamCallbackHandlerInput, "autoClose"> ): AsyncGenerator<RunLogPatch> { const model = await this._model(options); const config = ensureConfig(options); yield* model.streamLog(input, config, { ...streamOptions, _schemaFormat: "original", includeNames: streamOptions?.includeNames, includeTypes: streamOptions?.includeTypes, includeTags: streamOptions?.includeTags, excludeNames: streamOptions?.excludeNames, excludeTypes: streamOptions?.excludeTypes, excludeTags: streamOptions?.excludeTags, }); } streamEvents( input: RunInput, options: Partial<CallOptions> & { version: "v1" | "v2" }, streamOptions?: Omit<EventStreamCallbackHandlerInput, "autoClose"> ): IterableReadableStream<StreamEvent>; streamEvents( input: RunInput, options: Partial<CallOptions> & { version: "v1" | "v2"; encoding: "text/event-stream"; }, streamOptions?: Omit<EventStreamCallbackHandlerInput, "autoClose"> ): IterableReadableStream<Uint8Array>; streamEvents( input: RunInput, options: Partial<CallOptions> & { version: "v1" | "v2"; encoding?: "text/event-stream" | undefined; }, streamOptions?: Omit<EventStreamCallbackHandlerInput, "autoClose"> ): IterableReadableStream<StreamEvent | Uint8Array> { // eslint-disable-next-line @typescript-eslint/no-this-alias const outerThis = this; async function* wrappedGenerator() { const model = await outerThis._model(options); const config = ensureConfig(options); const eventStream = model.streamEvents(input, config, streamOptions); for await (const chunk of eventStream) { yield chunk; } } return IterableReadableStream.fromAsyncGenerator(wrappedGenerator()); } } // eslint-disable-next-line @typescript-eslint/no-explicit-any export interface InitChatModelFields extends Partial<Record<string, any>> { modelProvider?: string; configurableFields?: string[] | "any"; configPrefix?: string; } export type ConfigurableFields = "any" | string[]; export async function initChatModel< RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions >( model: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any fields?: Partial<Record<string, any>> & { modelProvider?: string; configurableFields?: never; configPrefix?: string; } ): Promise<_ConfigurableModel<RunInput, CallOptions>>; export async function initChatModel< RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions >( model: never, // eslint-disable-next-line @typescript-eslint/no-explicit-any options?: Partial<Record<string, any>> & { modelProvider?: string; configurableFields?: never; configPrefix?: string; } ): Promise<_ConfigurableModel<RunInput, CallOptions>>; export async function initChatModel< RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions >( model?: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any options?: Partial<Record<string, any>> & { modelProvider?: string; configurableFields?: ConfigurableFields; configPrefix?: string; } ): Promise<_ConfigurableModel<RunInput, CallOptions>>; // ################################# FOR CONTRIBUTORS ################################# // // If adding support for a new provider, please append the provider // name to the supported list in the docstring below. // // #################################################################################### /** * Initialize a ChatModel from the model name and provider. * Must have the integration package corresponding to the model provider installed. * * @template {extends BaseLanguageModelInput = BaseLanguageModelInput} RunInput - The input type for the model. * @template {extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions} CallOptions - Call options for the model. * * @param {string | ChatModelProvider} [model] - The name of the model, e.g. "gpt-4", "claude-3-opus-20240229". * @param {Object} [fields] - Additional configuration options. * @param {string} [fields.modelProvider] - The model provider. Supported values include: * - openai (@langchain/openai) * - anthropic (@langchain/anthropic) * - azure_openai (@langchain/openai) * - google-vertexai (@langchain/google-vertexai) * - google-genai (@langchain/google-genai) * - bedrock (@langchain/aws) * - cohere (@langchain/cohere) * - fireworks (@langchain/community/chat_models/fireworks) * - together (@langchain/community/chat_models/togetherai) * - mistralai (@langchain/mistralai) * - groq (@langchain/groq) * - ollama (@langchain/ollama) * @param {string[] | "any"} [fields.configurableFields] - Which model parameters are configurable: * - undefined: No configurable fields. * - "any": All fields are configurable. (See Security Note in description) * - string[]: Specified fields are configurable. * @param {string} [fields.configPrefix] - Prefix for configurable fields at runtime. * @param {Record<string, any>} [fields.params] - Additional keyword args to pass to the ChatModel constructor. * @returns {Promise<_ConfigurableModel<RunInput, CallOptions>>} A class which extends BaseChatModel. * @throws {Error} If modelProvider cannot be inferred or isn't supported. * @throws {Error} If the model provider integration package is not installed. * * @example Initialize non-configurable models * ```typescript * import { initChatModel } from "langchain/chat_models/universal"; * * const gpt4 = await initChatModel("gpt-4", { * modelProvider: "openai", * temperature: 0.25, * }); * const gpt4Result = await gpt4.invoke("what's your name"); * * const claude = await initChatModel("claude-3-opus-20240229", { * modelProvider: "anthropic", * temperature: 0.25, * }); * const claudeResult = await claude.invoke("what's your name"); * * const gemini = await initChatModel("gemini-1.5-pro", { * modelProvider: "google-vertexai", * temperature: 0.25, * }); * const geminiResult = await gemini.invoke("what's your name"); * ``` * * @example Create a partially configurable model with no default model * ```typescript * import { initChatModel } from "langchain/chat_models/universal"; * * const configurableModel = await initChatModel(undefined, { * temperature: 0, * configurableFields: ["model", "apiKey"], * }); * * const gpt4Result = await configurableModel.invoke("what's your name", { * configurable: { * model: "gpt-4", * }, * }); * * const claudeResult = await configurableModel.invoke("what's your name", { * configurable: { * model: "claude-3-5-sonnet-20240620", * }, * }); * ``` * * @example Create a fully configurable model with a default model and a config prefix * ```typescript * import { initChatModel } from "langchain/chat_models/universal"; * * const configurableModelWithDefault = await initChatModel("gpt-4", { * modelProvider: "openai", * configurableFields: "any", * configPrefix: "foo", * temperature: 0, * }); * * const openaiResult = await configurableModelWithDefault.invoke( * "what's your name", * { * configurable: { * foo_apiKey: process.env.OPENAI_API_KEY, * }, * } * ); * * const claudeResult = await configurableModelWithDefault.invoke( * "what's your name", * { * configurable: { * foo_model: "claude-3-5-sonnet-20240620", * foo_modelProvider: "anthropic", * foo_temperature: 0.6, * foo_apiKey: process.env.ANTHROPIC_API_KEY, * }, * } * ); * ``` * * @example Bind tools to a configurable model: * ```typescript * import { initChatModel } from "langchain/chat_models/universal"; * import { z } from "zod"; * import { tool } from "@langchain/core/tools"; * * const getWeatherTool = tool( * (input) => { * // Do something with the input * return JSON.stringify(input); * }, * { * schema: z * .object({ * location: z * .string() * .describe("The city and state, e.g. San Francisco, CA"), * }) * .describe("Get the current weather in a given location"), * name: "GetWeather", * description: "Get the current weather in a given location", * } * ); * * const getPopulationTool = tool( * (input) => { * // Do something with the input * return JSON.stringify(input); * }, * { * schema: z * .object({ * location: z * .string() * .describe("The city and state, e.g. San Francisco, CA"), * }) * .describe("Get the current population in a given location"), * name: "GetPopulation", * description: "Get the current population in a given location", * } * ); * * const configurableModel = await initChatModel("gpt-4", { * configurableFields: ["model", "modelProvider", "apiKey"], * temperature: 0, * }); * * const configurableModelWithTools = configurableModel.bind({ * tools: [getWeatherTool, getPopulationTool], * }); * * const configurableToolResult = await configurableModelWithTools.invoke( * "Which city is hotter today and which is bigger: LA or NY?", * { * configurable: { * apiKey: process.env.OPENAI_API_KEY, * }, * } * ); * * const configurableToolResult2 = await configurableModelWithTools.invoke( * "Which city is hotter today and which is bigger: LA or NY?", * { * configurable: { * model: "claude-3-5-sonnet-20240620", * apiKey: process.env.ANTHROPIC_API_KEY, * }, * } * ); * ``` * * @description * This function initializes a ChatModel based on the provided model name and provider. * It supports various model providers and allows for runtime configuration of model parameters. * * Security Note: Setting `configurableFields` to "any" means fields like api_key, base_url, etc. * can be altered at runtime, potentially redirecting model requests to a different service/user. * Make sure that if you're accepting untrusted configurations, you enumerate the * `configurableFields` explicitly. * * The function will attempt to infer the model provider from the model name if not specified. * Certain model name prefixes are associated with specific providers: * - gpt-3... or gpt-4... -> openai * - claude... -> anthropic * - amazon.... -> bedrock * - gemini... -> google-vertexai * - command... -> cohere * - accounts/fireworks... -> fireworks * * @since 0.2.11 * @version 0.2.11 */ export async function initChatModel< RunInput extends BaseLanguageModelInput = BaseLanguageModelInput, CallOptions extends ConfigurableChatModelCallOptions = ConfigurableChatModelCallOptions >( model?: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any fields?: Partial<Record<string, any>> & { modelProvider?: string; configurableFields?: string[] | "any"; configPrefix?: string; } ): Promise<_ConfigurableModel<RunInput, CallOptions>> { const { configurableFields, configPrefix, modelProvider, ...params } = { configPrefix: "", ...(fields ?? {}), }; let configurableFieldsCopy = Array.isArray(configurableFields) ? [...configurableFields] : configurableFields; if (!model && configurableFieldsCopy === undefined) { configurableFieldsCopy = ["model", "modelProvider"]; } if (configPrefix && configurableFieldsCopy === undefined) { console.warn( `{ configPrefix: ${configPrefix} } has been set but no fields are configurable. Set ` + `{ configurableFields: [...] } to specify the model params that are ` + `configurable.` ); } // eslint-disable-next-line @typescript-eslint/no-explicit-any const paramsCopy: Record<string, any> = { ...params }; if (configurableFieldsCopy === undefined) { return new _ConfigurableModel<RunInput, CallOptions>({ defaultConfig: { ...paramsCopy, model, modelProvider, }, configPrefix, }); } else { if (model) { paramsCopy.model = model; } if (modelProvider) { paramsCopy.modelProvider = modelProvider; } return new _ConfigurableModel<RunInput, CallOptions>({ defaultConfig: paramsCopy, configPrefix, configurableFields: configurableFieldsCopy, }); } }
0
lc_public_repos/langchainjs/langchain/src/chat_models
lc_public_repos/langchainjs/langchain/src/chat_models/tests/universal.int.test.ts
/* eslint-disable no-process-env */ import { tool } from "@langchain/core/tools"; import { z } from "zod"; import { it } from "@jest/globals"; import { ChatPromptTemplate, PromptTemplate } from "@langchain/core/prompts"; import { RunLogPatch, StreamEvent } from "@langchain/core/tracers/log_stream"; import { AIMessageChunk } from "@langchain/core/messages"; import { concat } from "@langchain/core/utils/stream"; import { awaitAllCallbacks } from "@langchain/core/callbacks/promises"; import { AgentExecutor, createReactAgent } from "../../agents/index.js"; import { pull } from "../../hub.js"; import { initChatModel } from "../universal.js"; // Make copies of API keys and remove them from the environment to avoid conflicts. // OpenAI const openAIApiKey = process.env.OPENAI_API_KEY; process.env.OPENAI_API_KEY = ""; // Azure OpenAI const azureOpenAIApiKey = process.env.AZURE_OPENAI_API_KEY; process.env.AZURE_OPENAI_API_KEY = ""; const azureOpenAIApiDevelopmentName = process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME; process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME = ""; const azureOpenAIApiVersion = process.env.AZURE_OPENAI_API_VERSION; process.env.AZURE_OPENAI_API_VERSION = ""; const azureOpenAIBasePath = process.env.AZURE_OPENAI_BASE_PATH; process.env.AZURE_OPENAI_BASE_PATH = ""; // Google const googleApiKey = process.env.GOOGLE_API_KEY; process.env.GOOGLE_API_KEY = ""; test("Initialize non-configurable models", async () => { const gpt4 = await initChatModel("gpt-4o-mini", { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const claude = await initChatModel("claude-3-opus-20240229", { modelProvider: "anthropic", temperature: 0.25, }); const gemini = await initChatModel("gemini-1.5-pro", { modelProvider: "google-genai", temperature: 0.25, }); const gpt4Result = await gpt4.invoke("what's your name"); expect(gpt4Result).toBeDefined(); expect(gpt4Result.content.length).toBeGreaterThan(0); const claudeResult = await claude.invoke("what's your name"); expect(claudeResult).toBeDefined(); expect(claudeResult.content.length).toBeGreaterThan(0); const geminiResult = await gemini.invoke("what's your name"); expect(geminiResult).toBeDefined(); expect(geminiResult.content.length).toBeGreaterThan(0); }); test("Create a partially configurable model with no default model", async () => { const configurableModel = await initChatModel(undefined, { temperature: 0, configurableFields: ["model", "apiKey"], }); const gpt4Result = await configurableModel.invoke("what's your name", { configurable: { model: "gpt-4o-mini", apiKey: openAIApiKey, }, }); expect(gpt4Result).toBeDefined(); expect(gpt4Result.content.length).toBeGreaterThan(0); const claudeResult = await configurableModel.invoke("what's your name", { configurable: { model: "claude-3-5-sonnet-20240620", apiKey: process.env.ANTHROPIC_API_KEY, }, }); expect(claudeResult).toBeDefined(); expect(claudeResult.content.length).toBeGreaterThan(0); }); test("Create a fully configurable model with a default model and a config prefix", async () => { const configurableModelWithDefault = await initChatModel("gpt-4o-mini", { modelProvider: "openai", configurableFields: "any", configPrefix: "foo", temperature: 0, }); const configurableResult = await configurableModelWithDefault.invoke( "what's your name", { configurable: { foo_apiKey: openAIApiKey, }, } ); expect(configurableResult).toBeDefined(); expect(configurableResult.content.length).toBeGreaterThan(0); const configurableResult2 = await configurableModelWithDefault.invoke( "what's your name", { configurable: { foo_model: "claude-3-5-sonnet-20240620", foo_modelProvider: "anthropic", foo_temperature: 0.6, foo_apiKey: process.env.ANTHROPIC_API_KEY, }, } ); expect(configurableResult2).toBeDefined(); expect(configurableResult2.content.length).toBeGreaterThan(0); }); test("Bind tools to a configurable model", async () => { const getWeatherTool = tool( (input) => { // Do something with the input return JSON.stringify(input); }, { schema: z .object({ location: z .string() .describe("The city and state, e.g. San Francisco, CA"), }) .describe("Get the current weather in a given location"), name: "GetWeather", description: "Get the current weather in a given location", } ); const getPopulationTool = tool( (input) => { // Do something with the input return JSON.stringify(input); }, { schema: z .object({ location: z .string() .describe("The city and state, e.g. San Francisco, CA"), }) .describe("Get the current population in a given location"), name: "GetPopulation", description: "Get the current population in a given location", } ); const configurableModel = await initChatModel("gpt-4o-mini", { configurableFields: ["model", "modelProvider", "apiKey"], temperature: 0, }); const configurableModelWithTools = configurableModel.bind({ tools: [getWeatherTool, getPopulationTool], }); const configurableToolResult = await configurableModelWithTools.invoke( "Which city is hotter today and which is bigger: LA or NY?", { configurable: { apiKey: openAIApiKey, }, } ); expect(configurableToolResult).toBeDefined(); expect(configurableToolResult.tool_calls?.[0]).toBeDefined(); if (!configurableToolResult.tool_calls?.[0]) return; expect(configurableToolResult.tool_calls?.[0].name).toBe("GetWeather"); const configurableToolResult2 = await configurableModelWithTools.invoke( "Which city is hotter today and which is bigger: LA or NY?", { configurable: { model: "claude-3-5-sonnet-20240620", apiKey: process.env.ANTHROPIC_API_KEY, }, } ); expect(configurableToolResult2).toBeDefined(); expect(configurableToolResult2.tool_calls?.[0]).toBeDefined(); if (!configurableToolResult2.tool_calls?.[0]) return; expect(configurableToolResult2.tool_calls?.[0].name).toBe("GetWeather"); }); test("Can call bindTools", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const weatherTool = tool( (input) => { // Do something with the input return JSON.stringify(input); }, { schema: z .object({ location: z .string() .describe("The city and state, e.g. San Francisco, CA"), }) .describe("Get the current weather in a given location"), name: "GetWeather", description: "Get the current weather in a given location", } ); const gpt4WithTools = gpt4.bindTools([weatherTool]); const result = await gpt4WithTools.invoke( "What's the weather in San Francisco?" ); expect(result.tool_calls?.[0]).toBeDefined(); expect(result.tool_calls?.[0].name).toBe("GetWeather"); }); test("Can call withStructuredOutput", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const weatherSchema = z .object({ location: z .string() .describe("The city and state, e.g. San Francisco, CA"), }) .describe("Get the current weather in a given location"); const gpt4WithTools = gpt4.withStructuredOutput(weatherSchema, { name: "GetWeather", }); const result = await gpt4WithTools.invoke( "What's the weather in San Francisco?" ); expect(result).toBeDefined(); expect(result.location).toBeDefined(); expect(result.location).not.toBe(""); }); describe("Works with all model providers", () => { it("Can invoke openai", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0, apiKey: openAIApiKey, }); const gpt4Result = await gpt4.invoke("what's your name"); expect(gpt4Result).toBeDefined(); expect(gpt4Result.content.length).toBeGreaterThan(0); }); it("Can invoke anthropic", async () => { const anthropic = await initChatModel(undefined, { modelProvider: "anthropic", temperature: 0, }); const anthropicResult = await anthropic.invoke("what's your name"); expect(anthropicResult).toBeDefined(); expect(anthropicResult.content.length).toBeGreaterThan(0); }); it("Can invoke azure_openai", async () => { process.env.AZURE_OPENAI_API_KEY = azureOpenAIApiKey; process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME = azureOpenAIApiDevelopmentName; process.env.AZURE_OPENAI_API_VERSION = azureOpenAIApiVersion; process.env.AZURE_OPENAI_BASE_PATH = azureOpenAIBasePath; try { const azure_openai = await initChatModel(undefined, { modelProvider: "azure_openai", temperature: 0, }); const azure_openaiResult = await azure_openai.invoke("what's your name"); expect(azure_openaiResult).toBeDefined(); expect(azure_openaiResult.content.length).toBeGreaterThan(0); } catch (e) { // Re-assign the original env vars. process.env.AZURE_OPENAI_API_KEY = ""; process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME = ""; process.env.AZURE_OPENAI_API_VERSION = ""; process.env.AZURE_OPENAI_BASE_PATH = ""; // Re-throw the error. throw e; } }); it("Can invoke cohere", async () => { const cohere = await initChatModel(undefined, { modelProvider: "cohere", temperature: 0, }); const cohereResult = await cohere.invoke("what's your name"); expect(cohereResult).toBeDefined(); expect(cohereResult.content.length).toBeGreaterThan(0); }); it("Can invoke google-genai", async () => { const googleVertexai = await initChatModel(undefined, { modelProvider: "google-genai", temperature: 0, }); const googleVertexaiResult = await googleVertexai.invoke( "what's your name" ); expect(googleVertexaiResult).toBeDefined(); expect(googleVertexaiResult.content.length).toBeGreaterThan(0); }); it("Can invoke google-genai", async () => { // Remove VertexAI env vars to avoid conflict. const googleApplicationCredentials = process.env.GOOGLE_APPLICATION_CREDENTIALS; process.env.GOOGLE_APPLICATION_CREDENTIALS = ""; // Re-assign the Google API key for this test. process.env.GOOGLE_API_KEY = googleApiKey; try { const googleGenai = await initChatModel(undefined, { modelProvider: "google-genai", temperature: 0, }); const googleGenaiResult = await googleGenai.invoke("what's your name"); expect(googleGenaiResult).toBeDefined(); expect(googleGenaiResult.content.length).toBeGreaterThan(0); } catch (e) { // Re-assign the original env vars. process.env.GOOGLE_APPLICATION_CREDENTIALS = googleApplicationCredentials; process.env.GOOGLE_API_KEY = ""; throw e; } }); it.skip("Can invoke ollama", async () => { const ollama = await initChatModel(undefined, { modelProvider: "ollama", temperature: 0, model: "llama3", }); const ollamaResult = await ollama.invoke("what's your name"); expect(ollamaResult).toBeDefined(); expect(ollamaResult.content.length).toBeGreaterThan(0); }); it("Can invoke mistralai", async () => { const mistralai = await initChatModel(undefined, { modelProvider: "mistralai", temperature: 0, }); const mistralaiResult = await mistralai.invoke("what's your name"); expect(mistralaiResult).toBeDefined(); expect(mistralaiResult.content.length).toBeGreaterThan(0); }); it("Can invoke groq", async () => { const groq = await initChatModel(undefined, { modelProvider: "groq", temperature: 0, }); const groqResult = await groq.invoke("what's your name"); expect(groqResult).toBeDefined(); expect(groqResult.content.length).toBeGreaterThan(0); }); it("Can invoke bedrock", async () => { const bedrock = await initChatModel(undefined, { modelProvider: "bedrock", temperature: 0, region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", credentials: { secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY, accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID, }, }); const bedrockResult = await bedrock.invoke("what's your name"); expect(bedrockResult).toBeDefined(); expect(bedrockResult.content.length).toBeGreaterThan(0); }); // If these two fail with an import error you should explicitly build `@langchain/community` it("Can invoke fireworks", async () => { const fireworks = await initChatModel(undefined, { modelProvider: "fireworks", temperature: 0, }); const fireworksResult = await fireworks.invoke("what's your name"); expect(fireworksResult).toBeDefined(); expect(fireworksResult.content.length).toBeGreaterThan(0); }); it("Can invoke together", async () => { const together = await initChatModel(undefined, { modelProvider: "together", temperature: 0, }); const togetherResult = await together.invoke("what's your name"); expect(togetherResult).toBeDefined(); expect(togetherResult.content.length).toBeGreaterThan(0); }); }); test("Is compatible with agents", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const weatherTool = tool( (_) => { // Do something with the input return "The current weather is partly cloudy with a high of 75 degrees."; }, { schema: z.string().describe("The city and state, e.g. San Francisco, CA"), name: "GetWeather", description: "Get the current weather in a given location", } ); const prompt = await pull<PromptTemplate>("hwchase17/react"); const agent = await createReactAgent({ llm: gpt4, tools: [weatherTool], prompt, }); const agentExecutor = new AgentExecutor({ agent, tools: [weatherTool], }); const result = await agentExecutor.invoke({ input: "What's the weather in San Francisco right now? Ensure you use the 'GetWeather' tool to answer.", }); expect(result).toHaveProperty("output"); expect(result.output).not.toBe(""); }); describe("Can call base runnable methods", () => { it("can call streamEvents", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const prompt = ChatPromptTemplate.fromMessages([["human", "{input}"]]); const stream = prompt.pipe(gpt4).streamEvents( { input: "what's your name", }, { version: "v2", configurable: { model: "gpt-4o", }, } ); const events: StreamEvent[] = []; for await (const event of stream) { events.push(event); } // The first event should be a start event. expect(events[0].event).toBe("on_chain_start"); // Events in the middle should be stream events expect( events[Math.floor(events.length / 2)].event.endsWith("_stream") ).toBe(true); // The ;ast event should be an end event. expect(events[events.length - 1].event).toBe("on_chain_end"); }); it("can call streamLog", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const stream = gpt4.streamLog("what's your name"); let runLog: RunLogPatch | undefined; for await (const event of stream) { if (!runLog) { runLog = event; } else { runLog = runLog.concat(event); } } expect(runLog).toBeDefined(); if (!runLog) return; expect(runLog.ops.length).toBeGreaterThan(0); }); it("can call stream", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const stream = await gpt4.stream("what's your name"); let finalChunk: AIMessageChunk | undefined; for await (const chunk of stream) { finalChunk = !finalChunk ? chunk : concat(finalChunk, chunk); } expect(finalChunk).toBeDefined(); if (!finalChunk) return; expect(finalChunk.content).not.toBe(""); }); it("can call batch", async () => { const gpt4 = await initChatModel(undefined, { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); const batchResult = await gpt4.batch([ "what's your name", "what's your name", ]); expect(batchResult).toHaveLength(2); if (batchResult.length !== 2) return; expect(batchResult[0].content).not.toBe(""); expect(batchResult[1].content).not.toBe(""); }); it("can call withConfig with tools", async () => { const weatherTool = { schema: z .object({ location: z .string() .describe("The city and state, e.g. San Francisco, CA"), }) .describe("Get the current weather in a given location"), name: "GetWeather", description: "Get the current weather in a given location", }; const openaiModel = await initChatModel("gpt-4o-mini", { temperature: 0, apiKey: openAIApiKey, }); const modelWithTools = openaiModel.bindTools([weatherTool], { tool_choice: "GetWeather", }); expect(modelWithTools._queuedMethodOperations.bindTools).toBeDefined(); expect(modelWithTools._queuedMethodOperations.bindTools[0][0].name).toBe( "GetWeather" ); const modelWithConfig = modelWithTools.withConfig({ runName: "weather" }); expect(modelWithConfig.bound).toHaveProperty("_queuedMethodOperations"); expect( (modelWithConfig.bound as any)._queuedMethodOperations.bindTools ).toBeDefined(); expect( (modelWithConfig.bound as any)._queuedMethodOperations.bindTools[0][0] .name ).toBe("GetWeather"); expect(modelWithConfig.config.runName).toBe("weather"); const result = await modelWithConfig.invoke("What's 8x8?"); expect(result.tool_calls).toBeDefined(); expect(result.tool_calls?.[0].name).toBe("GetWeather"); }); }); describe("Serialization", () => { it("does not contain additional fields", async () => { const gpt4 = await initChatModel("gpt-4o-mini", { modelProvider: "openai", temperature: 0.25, // Funky temperature to verify it's being set properly. apiKey: openAIApiKey, }); let serializedRepresentation; const res = await gpt4.invoke("foo", { callbacks: [ { handleChatModelStart(llm) { serializedRepresentation = llm; }, }, ], configurable: { extra: "bar" }, }); await awaitAllCallbacks(); expect(res).toBeDefined(); const { ChatOpenAI } = await import("@langchain/openai"); expect(serializedRepresentation).toEqual( JSON.parse( JSON.stringify( new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.25, apiKey: openAIApiKey, }) ) ) ); }); });
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/smith/progress.ts
export class ProgressBar { total: number; current: number; barLength: number; format: string; constructor(props: { total: number; format?: string; barLength?: number }) { const { total, format, barLength } = props; this.total = total; this.current = 0; this.barLength = barLength ?? 40; this.format = format || "{bar} {percentage}% | {value}/{total}"; } initialize(): void { this.update({ current: 0 }); } update({ current, formatArgs, }: { current: number; formatArgs?: Record<string, string>; }): void { this.current = current; const ratio = this.current / this.total; const filledBarLength = Math.round(ratio * this.barLength); const emptyBarLength = this.barLength - filledBarLength; const filledBar = "▓".repeat(filledBarLength); const emptyBar = "░".repeat(emptyBarLength); const percentage = (ratio * 100).toFixed(2); let formattedString = this.format .replace("{bar}", `${filledBar}${emptyBar}`) .replace("{percentage}", percentage) .replace("{value}", this.current.toString()) .replace("{total}", this.total.toString()); if (formatArgs) { for (const key in formatArgs) { if (Object.prototype.hasOwnProperty.call(formatArgs, key)) { formattedString = formattedString.replace( `{${key}}`, formatArgs[key].toString() ); } } } console.log(formattedString); } increment({ formatArgs, }: { formatArgs?: Record<string, string> } = {}): void { this.update({ current: this.current + 1, formatArgs }); } complete({ formatArgs }: { formatArgs?: Record<string, string> } = {}): void { this.update({ current: this.total, formatArgs }); console.log("\nCompleted"); } }
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/smith/name_generation.ts
const adjectives: string[] = [ "abandoned", "aching", "advanced", "ample", "artistic", "back", "best", "bold", "brief", "clear", "cold", "complicated", "cooked", "crazy", "crushing", "damp", "dear", "definite", "dependable", "diligent", "drab", "earnest", "elderly", "enchanted", "essential", "excellent", "extraneous", "fixed", "flowery", "formal", "fresh", "frosty", "giving", "glossy", "healthy", "helpful", "impressionable", "kind", "large", "left", "long", "loyal", "mealy", "memorable", "monthly", "new", "notable", "only", "ordinary", "passionate", "perfect", "pertinent", "proper", "puzzled", "reflecting", "respectful", "roasted", "scholarly", "shiny", "slight", "sparkling", "spotless", "stupendous", "sunny", "tart", "terrific", "timely", "unique", "upbeat", "vacant", "virtual", "warm", "weary", "whispered", "worthwhile", "yellow", ]; const nouns: string[] = [ "account", "acknowledgment", "address", "advertising", "airplane", "animal", "appointment", "arrival", "artist", "attachment", "attitude", "availability", "backpack", "bag", "balance", "bass", "bean", "beauty", "bibliography", "bill", "bite", "blossom", "boat", "book", "box", "boy", "bread", "bridge", "broccoli", "building", "butter", "button", "cabbage", "cake", "camera", "camp", "candle", "candy", "canvas", "car", "card", "carrot", "cart", "case", "cat", "chain", "chair", "chalk", "chance", "change", "channel", "character", "charge", "charm", "chart", "check", "cheek", "cheese", "chef", "cherry", "chicken", "child", "church", "circle", "class", "clay", "click", "clock", "cloth", "cloud", "clove", "club", "coach", "coal", "coast", "coat", "cod", "coffee", "collar", "color", "comb", "comfort", "comic", "committee", "community", "company", "comparison", "competition", "condition", "connection", "control", "cook", "copper", "copy", "corn", "cough", "country", "cover", "crate", "crayon", "cream", "creator", "crew", "crown", "current", "curtain", "curve", "cushion", "dad", "daughter", "day", "death", "debt", "decision", "deer", "degree", "design", "desire", "desk", "detail", "development", "digestion", "dime", "dinner", "direction", "dirt", "discovery", "discussion", "disease", "disgust", "distance", "distribution", "division", "doctor", "dog", "door", "drain", "drawer", "dress", "drink", "driving", "dust", "ear", "earth", "edge", "education", "effect", "egg", "end", "energy", "engine", "error", "event", "example", "exchange", "existence", "expansion", "experience", "expert", "eye", "face", "fact", "fall", "family", "farm", "father", "fear", "feeling", "field", "finger", "fire", "fish", "flag", "flight", "floor", "flower", "fold", "food", "football", "force", "form", "frame", "friend", "frog", "fruit", "fuel", "furniture", "game", "garden", "gate", "girl", "glass", "glove", "goat", "gold", "government", "grade", "grain", "grass", "green", "grip", "group", "growth", "guide", "guitar", "hair", "hall", "hand", "harbor", "harmony", "hat", "head", "health", "heart", "heat", "hill", "history", "hobbies", "hole", "hope", "horn", "horse", "hospital", "hour", "house", "humor", "idea", "impulse", "income", "increase", "industry", "ink", "insect", "instrument", "insurance", "interest", "invention", "iron", "island", "jelly", "jet", "jewel", "join", "judge", "juice", "jump", "kettle", "key", "kick", "kiss", "kitten", "knee", "knife", "knowledge", "land", "language", "laugh", "law", "lead", "learning", "leather", "leg", "lettuce", "level", "library", "lift", "light", "limit", "line", "linen", "lip", "liquid", "list", "look", "loss", "love", "lunch", "machine", "man", "manager", "map", "marble", "mark", "market", "mass", "match", "meal", "measure", "meat", "meeting", "memory", "metal", "middle", "milk", "mind", "mine", "minute", "mist", "mitten", "mom", "money", "monkey", "month", "moon", "morning", "mother", "motion", "mountain", "mouth", "muscle", "music", "nail", "name", "nation", "neck", "need", "news", "night", "noise", "note", "number", "nut", "observation", "offer", "oil", "operation", "opinion", "orange", "order", "organization", "ornament", "oven", "page", "pail", "pain", "paint", "pan", "pancake", "paper", "parcel", "parent", "part", "passenger", "paste", "payment", "peace", "pear", "pen", "pencil", "person", "pest", "pet", "picture", "pie", "pin", "pipe", "pizza", "place", "plane", "plant", "plastic", "plate", "play", "pleasure", "plot", "plough", "pocket", "point", "poison", "police", "pollution", "popcorn", "porter", "position", "pot", "potato", "powder", "power", "price", "print", "process", "produce", "product", "profit", "property", "prose", "protest", "pull", "pump", "punishment", "purpose", "push", "quarter", "question", "quiet", "quill", "quilt", "quince", "rabbit", "rail", "rain", "range", "rat", "rate", "ray", "reaction", "reading", "reason", "record", "regret", "relation", "religion", "representative", "request", "respect", "rest", "reward", "rhythm", "rice", "river", "road", "roll", "room", "root", "rose", "route", "rub", "rule", "run", "sack", "sail", "salt", "sand", "scale", "scarecrow", "scarf", "scene", "scent", "school", "science", "scissors", "screw", "sea", "seat", "secretary", "seed", "selection", "self", "sense", "servant", "shade", "shake", "shame", "shape", "sheep", "sheet", "shelf", "ship", "shirt", "shock", "shoe", "shop", "show", "side", "sign", "silk", "sink", "sister", "size", "sky", "sleep", "smash", "smell", "smile", "smoke", "snail", "snake", "sneeze", "snow", "soap", "society", "sock", "soda", "sofa", "son", "song", "sort", "sound", "soup", "space", "spark", "speed", "sponge", "spoon", "spray", "spring", "spy", "square", "stamp", "star", "start", "statement", "station", "steam", "steel", "stem", "step", "stew", "stick", "stitch", "stocking", "stomach", "stone", "stop", "store", "story", "stove", "stranger", "straw", "stream", "street", "stretch", "string", "structure", "substance", "sugar", "suggestion", "suit", "summer", "sun", "support", "surprise", "sweater", "swim", "system", "table", "tail", "talk", "tank", "taste", "tax", "tea", "teaching", "team", "tendency", "test", "texture", "theory", "thing", "thought", "thread", "throat", "thumb", "thunder", "ticket", "time", "tin", "title", "toad", "toe", "tooth", "toothpaste", "touch", "town", "toy", "trade", "train", "transport", "tray", "treatment", "tree", "trick", "trip", "trouble", "trousers", "truck", "tub", "turkey", "turn", "twist", "umbrella", "uncle", "underwear", "unit", "use", "vacation", "value", "van", "vase", "vegetable", "veil", "vein", "verse", "vessel", "view", "visitor", "voice", "volcano", "walk", "wall", "war", "wash", "waste", "watch", "water", "wave", "wax", "way", "wealth", "weather", "week", "weight", "wheel", "whip", "whistle", "window", "wine", "wing", "winter", "wire", "wish", "woman", "wood", "wool", "word", "work", "worm", "wound", "wrist", "writer", "yard", "yoke", "zebra", "zinc", "zipper", "zone", ]; export function randomName(): string { const adjective: string = adjectives[Math.floor(Math.random() * adjectives.length)]; const noun: string = nouns[Math.floor(Math.random() * nouns.length)]; const number: number = Math.floor(Math.random() * 100) + 1; return `${adjective}-${noun}-${number}`; }
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/smith/config.ts
import { BaseLanguageModel } from "@langchain/core/language_models/base"; import { RunnableConfig } from "@langchain/core/runnables"; import { Example, Run } from "langsmith"; import { EvaluationResult, RunEvaluator } from "langsmith/evaluation"; import { Criteria as CriteriaType, type EmbeddingDistanceEvalChainInput, } from "../evaluation/index.js"; import { LoadEvaluatorOptions } from "../evaluation/loader.js"; import { EvaluatorType } from "../evaluation/types.js"; export type EvaluatorInputs = { input?: string | unknown; prediction: string | unknown; reference?: string | unknown; }; export type EvaluatorInputFormatter = ({ rawInput, rawPrediction, rawReferenceOutput, run, }: { // eslint-disable-next-line @typescript-eslint/no-explicit-any rawInput: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any rawPrediction: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any rawReferenceOutput?: any; run: Run; }) => EvaluatorInputs; export type DynamicRunEvaluatorParams< // eslint-disable-next-line @typescript-eslint/no-explicit-any Input extends Record<string, any> = Record<string, unknown>, // eslint-disable-next-line @typescript-eslint/no-explicit-any Prediction extends Record<string, any> = Record<string, unknown>, // eslint-disable-next-line @typescript-eslint/no-explicit-any Reference extends Record<string, any> = Record<string, unknown> > = { input: Input; prediction?: Prediction; reference?: Reference; run: Run; example?: Example; }; /** * Type of a function that can be coerced into a RunEvaluator function. * While we have the class-based RunEvaluator, it's often more convenient to directly * pass a function to the runner. This type allows us to do that. */ export type RunEvaluatorLike = | (( props: DynamicRunEvaluatorParams, options: RunnableConfig ) => Promise<EvaluationResult>) | (( props: DynamicRunEvaluatorParams, options: RunnableConfig ) => EvaluationResult); export function isOffTheShelfEvaluator< T extends keyof EvaluatorType, U extends RunEvaluator | RunEvaluatorLike = RunEvaluator | RunEvaluatorLike >(evaluator: T | EvalConfig | U): evaluator is T | EvalConfig { return typeof evaluator === "string" || "evaluatorType" in evaluator; } export function isCustomEvaluator< T extends keyof EvaluatorType, U extends RunEvaluator | RunEvaluatorLike = RunEvaluator | RunEvaluatorLike >(evaluator: T | EvalConfig | U): evaluator is U { return !isOffTheShelfEvaluator(evaluator); } export type RunEvalType< T extends keyof EvaluatorType = | "criteria" | "labeled_criteria" | "embedding_distance", U extends RunEvaluator | RunEvaluatorLike = RunEvaluator | RunEvaluatorLike > = T | EvalConfig | U; /** * Configuration class for running evaluations on datasets. * * @remarks * RunEvalConfig in LangSmith is a configuration class for running evaluations on datasets. Its primary purpose is to define the parameters and evaluators that will be applied during the evaluation of a dataset. This configuration can include various evaluators, custom evaluators, and different keys for inputs, predictions, and references. * * @typeparam T - The type of evaluators. * @typeparam U - The type of custom evaluators. */ export type RunEvalConfig< T extends keyof EvaluatorType = | "criteria" | "labeled_criteria" | "embedding_distance", U extends RunEvaluator | RunEvaluatorLike = RunEvaluator | RunEvaluatorLike > = { /** * Evaluators to apply to a dataset run. * You can optionally specify these by name, or by * configuring them with an EvalConfig object. */ evaluators?: RunEvalType<T, U>[]; /** * Convert the evaluation data into formats that can be used by the evaluator. * This should most commonly be a string. * Parameters are the raw input from the run, the raw output, raw reference output, and the raw run. * @example * ```ts * // Chain input: { input: "some string" } * // Chain output: { output: "some output" } * // Reference example output format: { output: "some reference output" } * const formatEvaluatorInputs = ({ * rawInput, * rawPrediction, * rawReferenceOutput, * }) => { * return { * input: rawInput.input, * prediction: rawPrediction.output, * reference: rawReferenceOutput.output, * }; * }; * ``` * @returns The prepared data. */ formatEvaluatorInputs?: EvaluatorInputFormatter; /** * Custom evaluators to apply to a dataset run. * Each evaluator is provided with a run trace containing the model * outputs, as well as an "example" object representing a record * in the dataset. * * @deprecated Use `evaluators` instead. */ customEvaluators?: U[]; }; export interface EvalConfig extends LoadEvaluatorOptions { /** * The name of the evaluator to use. * Example: labeled_criteria, criteria, etc. */ evaluatorType: keyof EvaluatorType; /** * The feedback (or metric) name to use for the logged * evaluation results. If none provided, we default to * the evaluationName. */ feedbackKey?: string; /** * Convert the evaluation data into formats that can be used by the evaluator. * This should most commonly be a string. * Parameters are the raw input from the run, the raw output, raw reference output, and the raw run. * @example * ```ts * // Chain input: { input: "some string" } * // Chain output: { output: "some output" } * // Reference example output format: { output: "some reference output" } * const formatEvaluatorInputs = ({ * rawInput, * rawPrediction, * rawReferenceOutput, * }) => { * return { * input: rawInput.input, * prediction: rawPrediction.output, * reference: rawReferenceOutput.output, * }; * }; * ``` * @returns The prepared data. */ formatEvaluatorInputs: EvaluatorInputFormatter; } const isStringifiableValue = ( value: unknown ): value is string | number | boolean | bigint => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint"; const getSingleStringifiedValue = (value: unknown) => { if (isStringifiableValue(value)) { return `${value}`; } if (typeof value === "object" && value != null && !Array.isArray(value)) { const entries = Object.entries(value); if (entries.length === 1 && isStringifiableValue(entries[0][1])) { return `${entries[0][1]}`; } } console.warn("Non-stringifiable value found when coercing", value); return `${value}`; }; /** * Configuration to load a "CriteriaEvalChain" evaluator, * which prompts an LLM to determine whether the model's * prediction complies with the provided criteria. * @param criteria - The criteria to use for the evaluator. * @param llm - The language model to use for the evaluator. * @returns The configuration for the evaluator. * @example * ```ts * const evalConfig = { * evaluators: [Criteria("helpfulness")], * }; * @example * ```ts * const evalConfig = { * evaluators: [ * Criteria({ * "isCompliant": "Does the submission comply with the requirements of XYZ" * }) * ], * }; * @example * ```ts * const evalConfig = { * evaluators: [{ * evaluatorType: "criteria", * criteria: "helpfulness" * formatEvaluatorInputs: ... * }] * }; * ``` * @example * ```ts * const evalConfig = { * evaluators: [{ * evaluatorType: "criteria", * criteria: { "isCompliant": "Does the submission comply with the requirements of XYZ" }, * formatEvaluatorInputs: ... * }] * }; */ export type Criteria = EvalConfig & { evaluatorType: "criteria"; /** * The "criteria" to insert into the prompt template * used for evaluation. See the prompt at * https://smith.langchain.com/hub/langchain-ai/criteria-evaluator * for more information. */ criteria?: CriteriaType | Record<string, string>; /** * The language model to use as the evaluator, defaults to GPT-4 */ llm?: BaseLanguageModel; }; // for compatibility reasons export type CriteriaEvalChainConfig = Criteria; export function Criteria( criteria: CriteriaType | Record<string, string>, config?: Pick< Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey" > ): EvalConfig { const formatEvaluatorInputs = config?.formatEvaluatorInputs ?? ((payload) => ({ prediction: getSingleStringifiedValue(payload.rawPrediction), input: getSingleStringifiedValue(payload.rawInput), })); if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) { throw new Error( "Only one criteria key is allowed when specifying custom criteria." ); } const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0]; return { evaluatorType: "criteria", criteria, feedbackKey: config?.feedbackKey ?? criteriaKey, llm: config?.llm, formatEvaluatorInputs, }; } /** * Configuration to load a "LabeledCriteriaEvalChain" evaluator, * which prompts an LLM to determine whether the model's * prediction complies with the provided criteria and also * provides a "ground truth" label for the evaluator to incorporate * in its evaluation. * @param criteria - The criteria to use for the evaluator. * @param llm - The language model to use for the evaluator. * @returns The configuration for the evaluator. * @example * ```ts * const evalConfig = { * evaluators: [LabeledCriteria("correctness")], * }; * @example * ```ts * const evalConfig = { * evaluators: [ * LabeledCriteria({ * "mentionsAllFacts": "Does the include all facts provided in the reference?" * }) * ], * }; * @example * ```ts * const evalConfig = { * evaluators: [{ * evaluatorType: "labeled_criteria", * criteria: "correctness", * formatEvaluatorInputs: ... * }], * }; * ``` * @example * ```ts * const evalConfig = { * evaluators: [{ * evaluatorType: "labeled_criteria", * criteria: { "mentionsAllFacts": "Does the include all facts provided in the reference?" }, * formatEvaluatorInputs: ... * }], * }; */ export type LabeledCriteria = EvalConfig & { evaluatorType: "labeled_criteria"; /** * The "criteria" to insert into the prompt template * used for evaluation. See the prompt at * https://smith.langchain.com/hub/langchain-ai/labeled-criteria * for more information. */ criteria?: CriteriaType | Record<string, string>; /** * The language model to use as the evaluator, defaults to GPT-4 */ llm?: BaseLanguageModel; }; export function LabeledCriteria( criteria: CriteriaType | Record<string, string>, config?: Pick< Partial<LabeledCriteria>, "formatEvaluatorInputs" | "llm" | "feedbackKey" > ): LabeledCriteria { const formatEvaluatorInputs = config?.formatEvaluatorInputs ?? ((payload) => ({ prediction: getSingleStringifiedValue(payload.rawPrediction), input: getSingleStringifiedValue(payload.rawInput), reference: getSingleStringifiedValue(payload.rawReferenceOutput), })); if (typeof criteria !== "string" && Object.keys(criteria).length !== 1) { throw new Error( "Only one labeled criteria key is allowed when specifying custom criteria." ); } const criteriaKey = typeof criteria === "string" ? criteria : Object.keys(criteria)[0]; return { evaluatorType: "labeled_criteria", criteria, feedbackKey: config?.feedbackKey ?? criteriaKey, llm: config?.llm, formatEvaluatorInputs, }; } /** * Configuration to load a "EmbeddingDistanceEvalChain" evaluator, * which embeds distances to score semantic difference between * a prediction and reference. */ export type EmbeddingDistance = EvalConfig & EmbeddingDistanceEvalChainInput & { evaluatorType: "embedding_distance" }; export function EmbeddingDistance( distanceMetric: EmbeddingDistanceEvalChainInput["distanceMetric"], config?: Pick< Partial<LabeledCriteria>, "formatEvaluatorInputs" | "embedding" | "feedbackKey" > ): EmbeddingDistance { const formatEvaluatorInputs = config?.formatEvaluatorInputs ?? ((payload) => ({ prediction: getSingleStringifiedValue(payload.rawPrediction), reference: getSingleStringifiedValue(payload.rawReferenceOutput), })); return { evaluatorType: "embedding_distance", embedding: config?.embedding, distanceMetric, feedbackKey: config?.feedbackKey ?? "embedding_distance", formatEvaluatorInputs, }; }
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/smith/index.ts
import { type EvalResults, type RunOnDatasetParams, runOnDataset, } from "./runner_utils.js"; export { type EvalResults, type RunOnDatasetParams, runOnDataset }; export * from "./config.js";
0
lc_public_repos/langchainjs/langchain/src
lc_public_repos/langchainjs/langchain/src/smith/runner_utils.ts
import { BaseLanguageModel } from "@langchain/core/language_models/base"; import { Serialized } from "@langchain/core/load/serializable"; import { mapStoredMessagesToChatMessages } from "@langchain/core/messages"; import { Runnable, RunnableConfig, RunnableLambda, getCallbackManagerForConfig, } from "@langchain/core/runnables"; import { LangChainTracer } from "@langchain/core/tracers/tracer_langchain"; import { BaseTracer } from "@langchain/core/tracers/base"; import { ChainValues } from "@langchain/core/utils/types"; import { AsyncCaller } from "@langchain/core/utils/async_caller"; import type { CallbackManager, CallbackManagerForChainRun, } from "@langchain/core/callbacks/manager"; import { Client, Example, Feedback, Run, RunTree, RunTreeConfig, } from "langsmith"; import { EvaluationResult, RunEvaluator } from "langsmith/evaluation"; import { DataType } from "langsmith/schemas"; import type { TraceableFunction } from "langsmith/singletons/traceable"; import { LLMStringEvaluator } from "../evaluation/base.js"; import { loadEvaluator } from "../evaluation/loader.js"; import { EvaluatorType } from "../evaluation/types.js"; import { isOffTheShelfEvaluator, type DynamicRunEvaluatorParams, type EvalConfig, type EvaluatorInputFormatter, type RunEvalConfig, type RunEvaluatorLike, isCustomEvaluator, } from "./config.js"; import { randomName } from "./name_generation.js"; import { ProgressBar } from "./progress.js"; export type ChainOrFactory = | Runnable | (() => Runnable) | AnyTraceableFunction // eslint-disable-next-line @typescript-eslint/no-explicit-any | ((obj: any) => any) // eslint-disable-next-line @typescript-eslint/no-explicit-any | ((obj: any) => Promise<any>) | (() => (obj: unknown) => unknown) | (() => (obj: unknown) => Promise<unknown>); class SingleRunIdExtractor { runIdPromiseResolver: (runId: string) => void; runIdPromise: Promise<string>; constructor() { this.runIdPromise = new Promise<string>((extract) => { this.runIdPromiseResolver = extract; }); } handleChainStart = ( _chain: Serialized, _inputs: ChainValues, runId: string ) => { this.runIdPromiseResolver(runId); }; async extract(): Promise<string> { return this.runIdPromise; } } class SingleRunExtractor extends BaseTracer { runPromiseResolver: (run: Run) => void; runPromise: Promise<Run>; /** The name of the callback handler. */ name = "single_run_extractor"; constructor() { super(); this.runPromise = new Promise<Run>((extract) => { this.runPromiseResolver = extract; }); } async persistRun(run: Run) { this.runPromiseResolver(run); } async extract(): Promise<Run> { return this.runPromise; } } /** * Wraps an evaluator function + implements the RunEvaluator interface. */ class DynamicRunEvaluator implements RunEvaluator { evaluator: RunnableLambda<DynamicRunEvaluatorParams, EvaluationResult>; constructor(evaluator: RunEvaluatorLike) { this.evaluator = new RunnableLambda({ func: evaluator }); } /** * Evaluates a run with an optional example and returns the evaluation result. * @param run The run to evaluate. * @param example The optional example to use for evaluation. * @returns A promise that extracts to the evaluation result. */ async evaluateRun(run: Run, example?: Example): Promise<EvaluationResult> { const extractor = new SingleRunIdExtractor(); const tracer = new LangChainTracer({ projectName: "evaluators" }); const result = await this.evaluator.invoke( { run, example, input: run.inputs, prediction: run.outputs, reference: example?.outputs, }, { callbacks: [extractor, tracer], } ); const runId = await extractor.extract(); return { sourceRunId: runId, ...result, }; } } // eslint-disable-next-line @typescript-eslint/no-explicit-any function isLLMStringEvaluator(evaluator: any): evaluator is LLMStringEvaluator { return evaluator && typeof evaluator.evaluateStrings === "function"; } // eslint-disable-next-line @typescript-eslint/no-explicit-any type AnyTraceableFunction = TraceableFunction<(...any: any[]) => any>; /** * Internal implementation of RunTree, which uses the * provided callback manager instead of the internal LangSmith client. * * The goal of this class is to ensure seamless interop when intergrated * with other Runnables. */ class CallbackManagerRunTree extends RunTree { callbackManager: CallbackManager; activeCallbackManager: CallbackManagerForChainRun | undefined = undefined; constructor(config: RunTreeConfig, callbackManager: CallbackManager) { super(config); this.callbackManager = callbackManager; } createChild(config: RunTreeConfig): CallbackManagerRunTree { const child = new CallbackManagerRunTree( { ...config, parent_run: this, project_name: this.project_name, client: this.client, }, this.activeCallbackManager?.getChild() ?? this.callbackManager ); this.child_runs.push(child); return child; } async postRun(): Promise<void> { // how it is translated in comparison to basic RunTree? this.activeCallbackManager = await this.callbackManager.handleChainStart( typeof this.serialized !== "object" && this.serialized != null && "lc" in this.serialized ? this.serialized : { id: ["langchain", "smith", "CallbackManagerRunTree"], lc: 1, type: "not_implemented", }, this.inputs, this.id, this.run_type, undefined, undefined, this.name ); } async patchRun(): Promise<void> { if (this.error) { await this.activeCallbackManager?.handleChainError( this.error, this.id, this.parent_run?.id, undefined, undefined ); } else { await this.activeCallbackManager?.handleChainEnd( this.outputs ?? {}, this.id, this.parent_run?.id, undefined, undefined ); } } } class RunnableTraceable<RunInput, RunOutput> extends Runnable< RunInput, RunOutput > { lc_serializable = false; lc_namespace = ["langchain_core", "runnables"]; protected func: AnyTraceableFunction; constructor(fields: { func: AnyTraceableFunction }) { super(fields); if (!isLangsmithTraceableFunction(fields.func)) { throw new Error( "RunnableTraceable requires a function that is wrapped in traceable higher-order function" ); } this.func = fields.func; } async invoke(input: RunInput, options?: Partial<RunnableConfig>) { const [config] = this._getOptionsList(options ?? {}, 1); const callbackManager = await getCallbackManagerForConfig(config); const partialConfig = "langsmith:traceable" in this.func ? (this.func["langsmith:traceable"] as RunTreeConfig) : { name: "<lambda>" }; if (!callbackManager) throw new Error("CallbackManager not found"); const runTree = new CallbackManagerRunTree( { ...partialConfig, parent_run: callbackManager?._parentRunId ? new RunTree({ name: "<parent>", id: callbackManager?._parentRunId }) : undefined, }, callbackManager ); if ( typeof input === "object" && input != null && Object.keys(input).length === 1 ) { if ("args" in input && Array.isArray(input)) { return (await this.func(runTree, ...input)) as RunOutput; } if ( "input" in input && !( typeof input === "object" && input != null && !Array.isArray(input) && // eslint-disable-next-line no-instanceof/no-instanceof !(input instanceof Date) ) ) { try { return (await this.func(runTree, input.input)) as RunOutput; } catch (err) { return (await this.func(runTree, input)) as RunOutput; } } } return (await this.func(runTree, input)) as RunOutput; } } /** * Wraps an off-the-shelf evaluator (loaded using loadEvaluator; of EvaluatorType[T]) * and composes with a prepareData function so the user can prepare the trace and * dataset data for the evaluator. */ class PreparedRunEvaluator implements RunEvaluator { evaluator: LLMStringEvaluator; formatEvaluatorInputs: EvaluatorInputFormatter; isStringEvaluator: boolean; evaluationName: string; constructor( evaluator: LLMStringEvaluator, evaluationName: string, formatEvaluatorInputs: EvaluatorInputFormatter ) { this.evaluator = evaluator; this.isStringEvaluator = typeof evaluator?.evaluateStrings === "function"; this.evaluationName = evaluationName; this.formatEvaluatorInputs = formatEvaluatorInputs; } static async fromEvalConfig( config: EvalConfig | keyof EvaluatorType ): Promise<PreparedRunEvaluator> { const evaluatorType = typeof config === "string" ? config : config.evaluatorType; const evalConfig = typeof config === "string" ? ({} as EvalConfig) : config; const evaluator = await loadEvaluator(evaluatorType, evalConfig); const feedbackKey = evalConfig?.feedbackKey ?? evaluator?.evaluationName; if (!isLLMStringEvaluator(evaluator)) { throw new Error( `Evaluator of type ${evaluatorType} not yet supported. ` + "Please use a string evaluator, or implement your " + "evaluation logic as a custom evaluator." ); } if (!feedbackKey) { throw new Error( `Evaluator of type ${evaluatorType} must have an evaluationName` + ` or feedbackKey. Please manually provide a feedbackKey in the EvalConfig.` ); } return new PreparedRunEvaluator( evaluator as LLMStringEvaluator, feedbackKey, evalConfig?.formatEvaluatorInputs ); } /** * Evaluates a run with an optional example and returns the evaluation result. * @param run The run to evaluate. * @param example The optional example to use for evaluation. * @returns A promise that extracts to the evaluation result. */ async evaluateRun(run: Run, example?: Example): Promise<EvaluationResult> { const { prediction, input, reference } = this.formatEvaluatorInputs({ rawInput: run.inputs, rawPrediction: run.outputs, rawReferenceOutput: example?.outputs, run, }); const extractor = new SingleRunIdExtractor(); const tracer = new LangChainTracer({ projectName: "evaluators" }); if (this.isStringEvaluator) { const evalResult = await this.evaluator.evaluateStrings( { prediction: prediction as string, reference: reference as string, input: input as string, }, { callbacks: [extractor, tracer], } ); const runId = await extractor.extract(); return { key: this.evaluationName, comment: evalResult?.reasoning, sourceRunId: runId, ...evalResult, }; } throw new Error( "Evaluator not yet supported. " + "Please use a string evaluator, or implement your " + "evaluation logic as a custom evaluator." ); } } class LoadedEvalConfig { constructor(public evaluators: (RunEvaluator | DynamicRunEvaluator)[]) {} static async fromRunEvalConfig( config: RunEvalConfig<keyof EvaluatorType> ): Promise<LoadedEvalConfig> { // Custom evaluators are applied "as-is" const customEvaluators = ( config?.customEvaluators ?? config.evaluators?.filter(isCustomEvaluator) )?.map((evaluator) => { if (typeof evaluator === "function") { return new DynamicRunEvaluator(evaluator); } else { return evaluator; } }); const offTheShelfEvaluators = await Promise.all( config?.evaluators ?.filter(isOffTheShelfEvaluator) ?.map( async (evaluator) => await PreparedRunEvaluator.fromEvalConfig(evaluator) ) ?? [] ); return new LoadedEvalConfig( (customEvaluators ?? []).concat(offTheShelfEvaluators ?? []) ); } } export interface RunOnDatasetParams extends Omit<RunEvalConfig, "customEvaluators"> { /** * Name of the project for logging and tracking. */ projectName?: string; /** * Additional metadata for the project. */ projectMetadata?: Record<string, unknown>; /** * Client instance for LangSmith service interaction. */ client?: Client; /** * Maximum concurrency level for dataset processing. */ maxConcurrency?: number; /** * @deprecated Pass keys directly to the RunOnDatasetParams instead */ evaluationConfig?: RunEvalConfig; } /** * Internals expect a constructor () -> Runnable. This function wraps/coerces * the provided LangChain object, custom function, or factory function into * a constructor of a runnable. * @param modelOrFactory The model or factory to create a wrapped model from. * @returns A function that returns the wrapped model. * @throws Error if the modelOrFactory is invalid. */ const createWrappedModel = async (modelOrFactory: ChainOrFactory) => { if (Runnable.isRunnable(modelOrFactory)) { return () => modelOrFactory; } if (typeof modelOrFactory === "function") { if (isLangsmithTraceableFunction(modelOrFactory)) { const wrappedModel = new RunnableTraceable({ func: modelOrFactory }); return () => wrappedModel; } try { // If it works with no arguments, assume it's a factory let res = (modelOrFactory as () => Runnable)(); if ( res && typeof (res as unknown as Promise<Runnable>).then === "function" ) { res = await res; } return modelOrFactory as () => Runnable; } catch (err) { // Otherwise, it's a custom UDF, and we'll wrap // the function in a lambda const wrappedModel = new RunnableLambda({ func: modelOrFactory }); return () => wrappedModel; } } throw new Error("Invalid modelOrFactory"); }; const loadExamples = async ({ datasetName, client, projectName, }: { datasetName: string; client: Client; projectName: string; maxConcurrency: number; }) => { const exampleIterator = client.listExamples({ datasetName }); const configs: RunnableConfig[] = []; const runExtractors = []; const examples = []; for await (const example of exampleIterator) { const runExtractor = new SingleRunExtractor(); configs.push({ callbacks: [ new LangChainTracer({ exampleId: example.id, projectName }), runExtractor, ], }); examples.push(example); runExtractors.push(runExtractor); } return { configs, examples, runExtractors, }; }; const applyEvaluators = async ({ evaluation, runs, examples, client, maxConcurrency, }: { evaluation: LoadedEvalConfig; runs: Run[]; examples: Example[]; client: Client; maxConcurrency: number; }): Promise<{ [key: string]: { execution_time?: number; run_id: string; feedback: Feedback[]; }; }> => { // TODO: Parallelize and/or put in callbacks to speed up evals. const { evaluators } = evaluation; const progress = new ProgressBar({ total: examples.length, format: "Running Evaluators: {bar} {percentage}% | {value}/{total}\n", }); const caller = new AsyncCaller({ maxConcurrency, }); const requests = runs.map( async ( run, i ): Promise<{ run_id: string; execution_time?: number; feedback: Feedback[]; }> => caller.call(async () => { const evaluatorResults = await Promise.allSettled( evaluators.map((evaluator) => client.evaluateRun(run, evaluator, { referenceExample: examples[i], loadChildRuns: false, }) ) ); progress.increment(); return { execution_time: run?.end_time && run.start_time ? run.end_time - run.start_time : undefined, feedback: evaluatorResults.map((evalResult) => evalResult.status === "fulfilled" ? evalResult.value : evalResult.reason ), run_id: run.id, }; }) ); const results = await Promise.all(requests); return results.reduce( (acc, result, i) => ({ ...acc, [examples[i].id]: result, }), {} ); }; export type EvalResults = { projectName: string; results: { [key: string]: { execution_time?: number; run_id: string; feedback: Feedback[]; }; }; }; const getExamplesInputs = ( examples: Example[], chainOrFactory: ChainOrFactory, dataType?: DataType ) => { if (dataType === "chat") { // For some batty reason, we store the chat dataset differently. // { type: "system", data: { content: inputs.input } }, // But we need to create AIMesage, SystemMessage, etc. return examples.map(({ inputs }) => mapStoredMessagesToChatMessages(inputs.input) ); } // If it's a language model and ALL example inputs have a single value, // then we can be friendly and flatten the inputs to a list of strings. const isLanguageModel = typeof chainOrFactory === "object" && typeof (chainOrFactory as BaseLanguageModel)._llmType === "function"; if ( isLanguageModel && examples.every(({ inputs }) => Object.keys(inputs).length === 1) ) { return examples.map(({ inputs }) => Object.values(inputs)[0]); } return examples.map(({ inputs }) => inputs); }; /** * Evaluates a given model or chain against a specified LangSmith dataset. * * This function fetches example records from the specified dataset, * runs the model or chain against each example, and returns the evaluation * results. * * @param chainOrFactory - A model or factory/constructor function to be evaluated. It can be a * Runnable instance, a factory function that returns a Runnable, or a user-defined * function or factory. * * @param datasetName - The name of the dataset against which the evaluation will be * performed. This dataset should already be defined and contain the relevant data * for evaluation. * * @param options - (Optional) Additional parameters for the evaluation process: * - `evaluators` (RunEvalType[]): Evaluators to apply to a dataset run. * - `formatEvaluatorInputs` (EvaluatorInputFormatter): Convert the evaluation data into formats that can be used by the evaluator. * - `projectName` (string): Name of the project for logging and tracking. * - `projectMetadata` (Record<string, unknown>): Additional metadata for the project. * - `client` (Client): Client instance for LangSmith service interaction. * - `maxConcurrency` (number): Maximum concurrency level for dataset processing. * * @returns A promise that resolves to an `EvalResults` object. This object includes * detailed results of the evaluation, such as execution time, run IDs, and feedback * for each entry in the dataset. * * @example * ```typescript * // Example usage for evaluating a model on a dataset * async function evaluateModel() { * const chain = /* ...create your model or chain...*\// * const datasetName = 'example-dataset'; * const client = new Client(/* ...config... *\//); * * const results = await runOnDataset(chain, datasetName, { * evaluators: [/* ...evaluators... *\//], * client, * }); * * console.log('Evaluation Results:', results); * } * * evaluateModel(); * ``` * In this example, `runOnDataset` is used to evaluate a language model (or a chain of models) against * a dataset named 'example-dataset'. The evaluation process is configured using `RunOnDatasetParams["evaluators"]`, which can * include both standard and custom evaluators. The `Client` instance is used to interact with LangChain services. * The function returns the evaluation results, which can be logged or further processed as needed. */ export async function runOnDataset( chainOrFactory: ChainOrFactory, datasetName: string, options?: RunOnDatasetParams ) { const { projectName, projectMetadata, client, maxConcurrency, }: RunOnDatasetParams = options ?? {}; const evaluationConfig: RunEvalConfig | undefined = options?.evaluationConfig ?? (options?.evaluators != null ? { evaluators: options.evaluators, formatEvaluatorInputs: options.formatEvaluatorInputs, } : undefined); const wrappedModel = await createWrappedModel(chainOrFactory); const testClient = client ?? new Client(); const testProjectName = projectName ?? randomName(); const dataset = await testClient.readDataset({ datasetName }); const datasetId = dataset.id; const testConcurrency = maxConcurrency ?? 5; const { configs, examples, runExtractors } = await loadExamples({ datasetName, client: testClient, projectName: testProjectName, maxConcurrency: testConcurrency, }); await testClient.createProject({ projectName: testProjectName, referenceDatasetId: datasetId, projectExtra: { metadata: { ...projectMetadata } }, }); const wrappedRunnable: Runnable = new RunnableLambda({ func: wrappedModel, }).withConfig({ runName: "evaluationRun" }); const runInputs = getExamplesInputs( examples, chainOrFactory, dataset.data_type ); const progress = new ProgressBar({ total: runInputs.length, format: "Predicting: {bar} {percentage}% | {value}/{total}", }); // TODO: Collect the runs as well. await wrappedRunnable .withListeners({ onEnd: () => progress.increment(), }) // TODO: Insert evaluation inline for immediate feedback. .batch(runInputs, configs, { maxConcurrency, returnExceptions: true, }); progress.complete(); const runs: Run[] = []; for (let i = 0; i < examples.length; i += 1) { runs.push(await runExtractors[i].extract()); } let evalResults: Record< string, { run_id: string; execution_time?: number; feedback: Feedback[] } > = {}; if (evaluationConfig) { const loadedEvalConfig = await LoadedEvalConfig.fromRunEvalConfig( evaluationConfig ); evalResults = await applyEvaluators({ evaluation: loadedEvalConfig, runs, examples, client: testClient, maxConcurrency: testConcurrency, }); } const results: EvalResults = { projectName: testProjectName, results: evalResults ?? {}, }; return results; } function isLangsmithTraceableFunction(x: unknown): x is AnyTraceableFunction { return typeof x === "function" && "langsmith:traceable" in x; }
0
lc_public_repos/langchainjs/langchain/src/smith
lc_public_repos/langchainjs/langchain/src/smith/tests/run_on_dataset.int.test.ts
/* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable arrow-body-style */ import OpenAI from "openai"; import wiki from "wikipedia"; import { Client, Dataset, RunTree, RunTreeConfig } from "langsmith"; import { DynamicRunEvaluatorParams, RunEvalConfig } from "../config.js"; const oaiClient = new OpenAI(); test(`Chat model dataset`, async () => { async function generateWikiSearch( question: string, parentRun: RunTree ): Promise<string> { const messages = [ { role: "system", content: "Generate a search query to pass into wikipedia to answer the user's question. Return only the search query and nothing more. This will be passed in directly to the Wikipedia search engine.", }, { role: "user", content: question }, ]; const childRun = await parentRun.createChild({ name: "Generate Wiki Search", run_type: "llm", inputs: { messages, }, }); try { const chatCompletion = await oaiClient.chat.completions.create({ model: "gpt-3.5-turbo", // @ts-expect-error Typing is wrong messages, temperature: 0, }); childRun.end(chatCompletion); await childRun.postRun(); return chatCompletion.choices[0].message.content ?? ""; } catch (error: any) { // console.error("Error generating wiki search query:", error); childRun.end({ error: error.toString() }); await childRun.postRun(); throw error; } } function convertDocs( results: Array<{ summary: string; url: string }> ): Array<{ page_content: string; type: string; metadata: { url: string } }> { return results.map((r) => ({ page_content: r.summary, type: "Document", metadata: { url: r.url }, })); } async function retrieve( query: string, parentRun: RunTree ): Promise<Array<{ summary: string; url: string }>> { const childRun = await parentRun.createChild({ name: "Wikipedia Retriever", run_type: "retriever", inputs: { query }, }); try { const { results } = await wiki.default.search(query, { limit: 10 }); const finalResults: Array<{ summary: string; url: string }> = []; for (const result of results) { if (finalResults.length >= 2) { // Just return the top 2 pages for now break; } const page = await wiki.default.page(result.title, { autoSuggest: false, }); const summary = await page.summary(); finalResults.push({ summary: summary.extract, url: page.fullurl, }); } childRun.end({ documents: convertDocs(finalResults), }); await childRun.postRun(); return finalResults; } catch (error: any) { // console.error("Error in retrieval:", error); childRun.end({ error: error.toString() }); await childRun.postRun(); throw error; } } async function generateAnswer( question: string, context: string, parentRun: RunTree ): Promise<string> { const messages = [ { role: "system", content: `Answer the user's question based only on the content below:\n\n${context}`, }, { role: "user", content: question }, ]; const childRun = await parentRun.createChild({ name: "Generate Answer", run_type: "llm", inputs: { messages, }, }); try { const chatCompletion = await oaiClient.chat.completions.create({ model: "gpt-3.5-turbo", // @ts-expect-error Typing is wrong messages, temperature: 0, }); childRun.end(chatCompletion); await childRun.postRun(); return chatCompletion.choices[0].message.content ?? ""; } catch (error: any) { // console.error("Error generating answer:", error); childRun.end({ error: error.toString() }); await childRun.postRun(); throw error; } } async function ragPipeline(question: string): Promise<string> { const parentRunConfig: RunTreeConfig = { name: "Wikipedia RAG Pipeline", run_type: "chain", inputs: { question }, }; const parentRun = new RunTree(parentRunConfig); try { const query = await generateWikiSearch(question, parentRun); const retrieverResults = await retrieve(query, parentRun); const context = retrieverResults .map((result) => result.summary) .join("\n\n"); const answer = await generateAnswer(question, context, parentRun); await parentRun.end({ outputs: answer, }); await parentRun.postRun(); return answer; } catch (error: any) { // console.error("Error running RAG Pipeline:", error); parentRun.end({ error: error.toString() }); await parentRun.postRun(); throw error; } } const examples = [ [ "When was the Apple Vision Pro released in the US?", "The Apple Vision Pro was released in the United States on February 2, 2024.", ], [ "What is LangChain?", "LangChain is an open-source framework for building applications using large language models.", ], [ "Who is the chairman of OpenAI?", "Bret Taylor is the chairman of the OpenAI", ], ]; const lsClient = new Client(); const datasetName = "JS run on dataset integration test"; let dataset: Dataset; try { dataset = await lsClient.readDataset({ datasetName }); } catch (e) { dataset = await lsClient.createDataset(datasetName); await Promise.all( examples.map(async ([question, answer]) => { await lsClient.createExample( { question }, { answer }, { datasetId: dataset.id } ); }) ); } // An illustrative custom evaluator example const unsure = async ({ prediction }: DynamicRunEvaluatorParams) => { if (typeof prediction?.output !== "string") { throw new Error( "Invalid prediction format for this evaluator. Please check your chain's outputs and try again." ); } return { key: "unsure", score: prediction.output.includes("not sure"), }; }; // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const evaluation: RunEvalConfig = { // The 'evaluators' are loaded from LangChain's evaluation // library. evaluators: [ { evaluatorType: "labeled_criteria", criteria: "correctness", feedbackKey: "correctness", formatEvaluatorInputs: ({ rawInput, rawPrediction, rawReferenceOutput, }: any) => { return { input: rawInput.question, prediction: rawPrediction.output, reference: rawReferenceOutput.answer, }; }, }, ], // Custom evaluators can be user-defined RunEvaluator's // or a compatible function customEvaluators: [unsure], }; // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const wrappedRagPipeline = async ({ question, }: { question: string; }): Promise<string> => { return ragPipeline(question); }; // console.log( // await runOnDataset(wrappedRagPipeline, datasetName, { // evaluationConfig: evaluation, // }) // ); }); test("Thrown errors should not interrupt dataset run", async () => { async function ragPipeline(_: string): Promise<string> { throw new Error("I don't know, I am learning from aliens."); } const examples = [ [ "When was the Apple Vision Pro released in the US?", "The Apple Vision Pro was released in the United States on February 2, 2024.", ], [ "What is LangChain?", "LangChain is an open-source framework for building applications using large language models.", ], [ "Who is the chairman of OpenAI?", "Bret Taylor is the chairman of the OpenAI", ], ]; const lsClient = new Client(); const datasetName = "JS run on dataset integration test"; let dataset: Dataset; try { dataset = await lsClient.readDataset({ datasetName }); } catch (e) { dataset = await lsClient.createDataset(datasetName); await Promise.all( examples.map(async ([question, answer]) => { await lsClient.createExample( { question }, { answer }, { datasetId: dataset.id } ); }) ); } // An illustrative custom evaluator example const dummy = async (_: DynamicRunEvaluatorParams) => { // console.log("RUNNING EVAL"); throw new Error("Expected error"); }; // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const evaluation: RunEvalConfig = { // Custom evaluators can be user-defined RunEvaluator's // or a compatible function customEvaluators: [dummy], }; // @eslint-disable-next-line/@typescript-eslint/ban-ts-comment // @ts-expect-error unused var const wrappedRagPipeline = async ({ question, }: { question: string; }): Promise<string> => { return ragPipeline(question); }; // console.log( // await runOnDataset(wrappedRagPipeline, datasetName, { // evaluationConfig: evaluation, // maxConcurrency: 1, // }) // ); });
0
lc_public_repos/langchainjs/langchain/src/smith
lc_public_repos/langchainjs/langchain/src/smith/tests/runner_utils.int.test.ts
import { test } from "@jest/globals"; import { ChatOpenAI } from "@langchain/openai"; import { Client, Example, Run } from "langsmith"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { LLM } from "@langchain/core/language_models/llms"; import { AIMessage, BaseMessage, isBaseMessage, } from "@langchain/core/messages"; import { ChatResult } from "@langchain/core/outputs"; import { RunnableConfig, RunnableLambda } from "@langchain/core/runnables"; import { DataType, KVMap } from "langsmith/schemas"; import { RunEvalConfig } from "../config.js"; import { randomName } from "../name_generation.js"; import { EvalResults, runOnDataset } from "../runner_utils.js"; const answers: { [question: string]: string } = { "What's the capital of California?": "Sacramento", "What's the capital of Nevada?": "Carson City", "What's the capital of Oregon?": "Salem", "What's the capital of Washington?": "Olympia", }; class FakeLLM extends LLM { _llmType() { return "fake"; } async _call(prompt: string): Promise<string> { return answers[prompt] || prompt; } } export class FakeChatModel extends BaseChatModel { _combineLLMOutput() { return []; } _llmType(): string { return "fake"; } async _generate( messages: BaseMessage[], _?: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun ): Promise<ChatResult> { const text = messages[messages.length - 1].content; const answer = (answers[text as string] || text) as string; await runManager?.handleLLMNewToken(answer); const result = new AIMessage({ content: answer }); return { generations: [ { message: result, text: answer, }, ], llmOutput: {}, }; } } const getScore = ({ outputs }: { outputs?: KVMap }) => outputs && Object.values(outputs).length > 0; const outputNotEmpty = async ( { run }: { run: Run; example?: Example }, options?: RunnableConfig ) => { const lambda = new RunnableLambda({ func: getScore }); const score = await lambda.invoke(run, options); return { key: "output_not_empty", score, comment: "We have thoroughly checked the output and it is possibly not not empty.", }; }; const alwaysPass = (_: { run: Run; example?: Example }) => ({ key: "always_pass", score: true, }); const checkFeedbackPassed = (evalResults: EvalResults) => { expect(evalResults.projectName).toBeDefined(); expect(evalResults.results).toBeDefined(); expect(Object.keys(evalResults.results).length).toBeGreaterThan(0); for (const [, result] of Object.entries(evalResults.results)) { expect(result.execution_time).toBeGreaterThan(0); expect(result.run_id).toBeDefined(); expect(result.feedback).toBeDefined(); expect(result.feedback.length).toBeGreaterThan(0); // eslint-disable-next-line no-loop-func result.feedback.forEach((feedback) => { expect(feedback.score).toBeDefined(); expect(feedback.score).toBeTruthy(); }); } }; const kvDataset = Object.entries(answers).map(([question, answer]) => ({ inputs: { input: question }, outputs: { output: answer }, })); const chatDataset = kvDataset.map((message) => ({ inputs: { input: [ { type: "system", data: { content: "Hello, how are you?" } }, { type: "human", data: { content: message.inputs.input } }, ], }, outputs: { output: { type: "ai", data: { content: message.outputs.output } }, }, })); const datasetTypes: DataType[] = ["kv", "llm"]; // TODO: add chat describe.skip.each(datasetTypes)("runner_utils %s dataset", (datasetType) => { let client: Client; const datasetName = `lcjs ${datasetType} integration tests`; const evalConfig: RunEvalConfig = { customEvaluators: [outputNotEmpty, alwaysPass], evaluators: [ { evaluatorType: "labeled_criteria", criteria: "correctness", feedbackKey: "labeledCorrect", formatEvaluatorInputs: ({ rawInput, rawPrediction, rawReferenceOutput, }) => { let prediction: string; if (isBaseMessage(rawPrediction)) { if (typeof rawPrediction.content !== "string") { throw new Error("Multimodal mesages not supported."); } prediction = rawPrediction.content; } else if (typeof rawPrediction === "string") { prediction = rawPrediction; } else if ( rawPrediction && typeof rawPrediction === "object" && "output" in rawPrediction ) { prediction = rawPrediction.output as string; } else { throw new Error("Unsupported prediction type."); } return { input: rawInput.input, prediction, reference: rawReferenceOutput.output, }; }, llm: new ChatOpenAI({ modelName: "gpt-3.5-turbo", temperature: 0, modelKwargs: { seed: 42 }, }), }, ], }; beforeAll(async () => { client = new Client(); try { await client.readDataset({ datasetName }); } catch (e) { const dataset = await client.createDataset(datasetName, { dataType: datasetType, }); const examples = datasetType === "chat" ? chatDataset : kvDataset; await Promise.all( examples.map(async (example) => { void client.createExample(example.inputs, example.outputs, { datasetId: dataset.id, }); }) ); } }); test(`Chat model on ${datasetType} singleio dataset`, async () => { const llm = new FakeChatModel({}); const evalResults = await runOnDataset(llm, datasetName, { client, evaluationConfig: evalConfig, projectName: `fake-chat-model-${randomName()}`, projectMetadata: { env: "integration-tests", model: "fake-chat-model" }, }); checkFeedbackPassed(evalResults); }); test(`FakeLLM on ${datasetType} singleio dataset`, async () => { const llm = new FakeLLM({}); const evalResults = await runOnDataset(llm, datasetName, { client, evaluationConfig: evalConfig, projectName: `fake-llm-${randomName()}`, projectMetadata: { env: "integration-tests", model: "fake-llm" }, }); checkFeedbackPassed(evalResults); }); test(`Runnable on ${datasetType} singleio dataset`, async () => { const runnable = new RunnableLambda({ func: (input: { input: string }) => ({ output: answers[input.input] }), }); const evalResults = await runOnDataset(runnable, datasetName, { client, evaluationConfig: evalConfig, projectName: `runnable-${randomName()}`, projectMetadata: { env: "integration-tests" }, maxConcurrency: 5, }); checkFeedbackPassed(evalResults); }); test(`Runnable constructor on ${datasetType} singleio dataset`, async () => { const runnable = new RunnableLambda({ func: (input: { input: string }) => ({ output: answers[input.input] }), }); function construct() { return runnable; } const evalResults = await runOnDataset(construct, datasetName, { client, evaluationConfig: evalConfig, projectName: `runnable-constructor-${randomName()}`, projectMetadata: { env: "integration-tests" }, maxConcurrency: 5, }); checkFeedbackPassed(evalResults); }); test(`Arb func on ${datasetType} singleio dataset`, async () => { async function my_func({ input }: { input: string }) { return { output: answers[input] }; } const evalResults = await runOnDataset(my_func, datasetName, { evaluationConfig: evalConfig, client, maxConcurrency: 5, projectName: `arb-function-${randomName()}`, projectMetadata: { env: "integration-tests", model: "fake-chat-in-runnable", }, }); checkFeedbackPassed(evalResults); }); test(`Arb constructor on ${datasetType} singleio dataset`, async () => { async function my_func({ input }: { input: string }) { return { output: answers[input] }; } const evalResults = await runOnDataset(() => my_func, datasetName, { evaluationConfig: evalConfig, client, maxConcurrency: 5, projectName: `arb-constructor-function-${randomName()}`, projectMetadata: { env: "integration-tests", model: "fake-chat-in-runnable", }, }); checkFeedbackPassed(evalResults); }); });
0
lc_public_repos/langchainjs/langchain
lc_public_repos/langchainjs/langchain/scripts/jest-setup-after-env.js
import { awaitAllCallbacks } from "../src/callbacks/promises.js"; afterAll(awaitAllCallbacks);
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/.vscode/settings.json
{ "eslint.workingDirectories": [ "./langchain", "./langchain-core", "./examples", "./docs", "./test-exports-vercel" ], "yaml.schemas": { "https://json.schemastore.org/github-workflow.json": "./.github/workflows/deploy.yml" }, "typescript.tsdk": "node_modules/typescript/lib", "cSpell.words": [ "AILLM", "Upstash" ], "cSpell.enableFiletypes": [ "mdx" ] }
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/rag_fusion.ipynb
// Deno.env.set("OPENAI_API_KEY", ""); import { OpenAIEmbeddings } from "npm:langchain@0.0.172/embeddings/openai"; import { MemoryVectorStore } from "npm:langchain@0.0.172/vectorstores/memory";/** Define our fake data */ const allDocuments = [ { id: "doc1", text: "Climate change and economic impact." }, { id: "doc2", text: "Public health concerns due to climate change." }, { id: "doc3", text: "Climate change: A social perspective." }, { id: "doc4", text: "Technological solutions to climate change." }, { id: "doc5", text: "Policy changes needed to combat climate change." }, { id: "doc6", text: "Climate change and its impact on biodiversity." }, { id: "doc7", text: "Climate change: The science and models." }, { id: "doc8", text: "Global warming: A subset of climate change." }, { id: "doc9", text: "How climate change affects daily weather." }, { id: "doc10", text: "The history of climate change activism." }, ];/** Initialize our vector store with the fake data and OpenAI embeddings. */ const vectorStore = await MemoryVectorStore.fromTexts( allDocuments.map(({ text }) => text), allDocuments.map(({ id }) => ({ id })), new OpenAIEmbeddings() ); /** Create the retriever */ const retriever = vectorStore.asRetriever();import { ChatOpenAI } from "npm:langchain@0.0.172/chat_models/openai"; import { pull } from "npm:langchain@0.0.172/hub"; import { StringOutputParser } from "npm:langchain@0.0.172/schema/output_parser"; import { RunnableLambda, RunnableSequence } from "npm:langchain@0.0.172/schema/runnable";/** Define the chat model */ const model = new ChatOpenAI({ temperature: 0, });/** Pull a prompt from the hub */ const prompt = await pull("langchain-ai/rag-fusion-query-generation"); // const prompt = ChatPromptTemplate.fromMessages([ // ["system", "You are a helpful assistant that generates multiple search queries based on a single input query."], // ["user", "Generate multiple search queries related to: {original_query}"], // ["user", "OUTPUT (4 queries):"], // ]);/** Define our chain for generating queries */ const generateQueries = RunnableSequence.from([ prompt, model, new StringOutputParser(), (output) => output.split("\n"), ]);import { Document } from "npm:langchain@0.0.172/document";const reciprocalRankFusion = (results: Document[][], k = 60) => { const fusedScores: Record<string, number> = {}; for (const result of results) { // Assumes the docs are returned in sorted order of relevance result.forEach((item, index) => { const docString = item.pageContent; if (!(docString in fusedScores)) { fusedScores[docString] = 0; } fusedScores[docString] += 1 / (index + k); }); } const rerankedResults = Object.entries(fusedScores) .sort((a, b) => b[1] - a[1]) .map( ([doc, score]) => new Document({ pageContent: doc, metadata: { score } }) ); return rerankedResults; };const chain = RunnableSequence.from([ generateQueries, retriever.map(), reciprocalRankFusion, ]);const originalQuery = "impact of climate change"; const result = await chain.invoke({ original_query: originalQuery, }); console.log(result);
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/README.md
# LangChain.js cookbook Example code for building applications with LangChain.js, with an emphasis on more applied and end-to-end examples than contained in the [main documentation](https://js.langchain.com). ## Setup These cookbooks are in Jupyter notebook form and use the [Deno runtime](https://deno.com) and the experimental [Deno Jupyter Kernel](https://deno.com/blog/v1.37) (requires >= Deno v1.37). Full installation instructions are available here: https://docs.deno.com/runtime/manual/tools/jupyter Note that you will also need to install the Python `jupyter` package, and that the syntax for imports and environment variables are slightly different from Node and the web. In particular, we use `Deno.env.get()` to retrieve environment variables, and e.g. `import { PromptTemplate } from "https://esm.sh/langchain/prompts";` to import from a URL to match Deno conventions. Notebook | Description :- | :- [rewrite.ipynb](https://github.com/langchain-ai/langchainjs/tree/master/cookbook/rewrite.ipynb) | Handle real-world questions that contain extraneous, distracting information in your RAG chains by first rewriting them before performing retrieval. [rag_fusion.ipynb](https://github.com/langchain-ai/langchainjs/tree/master/cookbook/rag_fusion.ipynb) | Turn user queries into more search friendly queries, then query a vector store and use reciprocal rank fusion to rank the results. [basic_critique_revise.ipynb](https://github.com/langchain-ai/langchainjs/tree/master/cookbook/basic_critique_revise.ipynb) | Basic example of correcting an LLM's output using a pattern called critique-revise, where we highlight what part of the output is wrong and re-query the LLM for a correction. [step_back.ipynb](https://github.com/langchain-ai/langchainjs/tree/master/cookbook/step_back.ipynb) | Example of a step back prompting technique, where we ask the LLM to take a step back and rephrase the original query for a more search friendly question.
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/basic_critique_revise.ipynb
Deno.env.set("OPENAI_API_KEY", ""); Deno.env.set("LANGCHAIN_API_KEY", ""); Deno.env.set("LANGCHAIN_TRACING_V2", "true"); import { z } from "npm:zod"; const zodSchema = z .object({ tasks: z .array( z.object({ title: z .string() .describe("The title of the tasks, reminders and alerts"), due_date: z .string() .describe("Due date. Must be a valid ISO date string with timezone"), task_type: z .enum([ "Call", "Message", "Todo", "In-Person Meeting", "Email", "Mail", "Text", "Open House", ]) .describe("The type of task"), }) ) .describe("The JSON for task, reminder or alert to create"), }) .describe("JSON definition for creating tasks, reminders and alerts"); import { zodToJsonSchema } from "npm:zod-to-json-schema"; import { JsonOutputFunctionsParser } from "npm:langchain@0.0.173/output_parsers"; import { ChatOpenAI } from "npm:langchain@0.0.173/chat_models/openai"; import { PromptTemplate } from "npm:langchain@0.0.173/prompts"; const functionSchema = { name: "task-scheduler", description: "Schedules tasks", parameters: zodToJsonSchema(zodSchema) }; const template = `Respond to the following user query to the best of your ability: {query}`; const generatePrompt = PromptTemplate.fromTemplate(template); const taskFunctionCallModel = new ChatOpenAI({ temperature: 0, model: "gpt-3.5-turbo", }).bind({ functions: [functionSchema], function_call: { name: "task-scheduler" }, }); const generateChain = generatePrompt .pipe(taskFunctionCallModel) .pipe(new JsonOutputFunctionsParser()) .withConfig({ runName: "GenerateChain" });import { TraceGroup } from "npm:langchain@0.0.173/callbacks"; const traceGroup = new TraceGroup("CritiqueReviseChain"); const groupManager = await traceGroup.start(); const userQuery = `Set a reminder to renew our online property ads next week.`; let result = await generateChain.invoke({ query: userQuery, }, { callbacks: groupManager }); console.log(result);const outputValidator = (output: unknown) => zodSchema.safeParse(output); let validatorResult = outputValidator(result); console.log(JSON.stringify(validatorResult, null, 2));const reviseTemplate = `Original prompt: -------------- {original_prompt} -------------- Completion: -------------- {completion} -------------- Above, the completion did not satisfy the constraints given by the original prompt and provided schema. Error: -------------- {error} -------------- Try again. Only respond with an answer that satisfies the constraints laid out in the original prompt and provided schema:`; const revisePrompt = PromptTemplate.fromTemplate(reviseTemplate); const reviseChain = revisePrompt .pipe(taskFunctionCallModel) .pipe(new JsonOutputFunctionsParser()) .withConfig({ runName: "ReviseChain" });let fixCount = 0; const formattedOriginalPrompt = await generatePrompt.format({ query: userQuery }); try { while (!validatorResult.success && fixCount < 5) { result = await reviseChain.invoke({ original_prompt: formattedOriginalPrompt, completion: JSON.stringify(result), error: JSON.stringify(validatorResult.error), }, { callbacks: groupManager }); validatorResult = outputValidator(result); fixCount++; } } finally { await traceGroup.end(); } console.log(JSON.stringify(validatorResult, null, 2));
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/openai_vision_multimodal.ipynb
// Deno.env.set("OPENAI_API_KEY", ""); import { ChatOpenAI } from "npm:langchain@0.0.185/chat_models/openai"; import { HumanMessage } from "npm:langchain@0.0.185/schema"; const chat = new ChatOpenAI({ model: "gpt-4-vision-preview", maxTokens: 1024, }); // Messages can now take an array of content in addition to a string const hostedImageMessage = new HumanMessage({ content: [ { type: "text", text: "What does this image say?", }, { type: "image_url", image_url: "https://www.freecodecamp.org/news/content/images/2023/05/Screenshot-2023-05-29-at-5.40.38-PM.png", }, ], }); await chat.invoke([hostedImageMessage]);import { ChatPromptTemplate, MessagesPlaceholder } from "npm:langchain@0.0.185/prompts"; import { StringOutputParser } from "npm:langchain@0.0.185/schema/output_parser"; const prompt = ChatPromptTemplate.fromMessages([ ["system", "Answer all questions like a pirate."], new MessagesPlaceholder("input"), ]); const chain = prompt.pipe(chat).pipe(new StringOutputParser()); await chain.invoke({ input: [ hostedImageMessage, ], });// const imageData = await fs.readFile(path.join(__dirname, "/data/hotdog.jpg")); // const imageBase64 = imageData.toString("base64"); const imageBase64 = "/9j/4AAQSkZJRgABAQEBLAEsAAD/4QBWRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAAEsAAAAAQAAASwAAAAB/+0ALFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAPHAFaAAMbJUccAQAAAgAEAP/hDIFodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0n77u/JyBpZD0nVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkJz8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0nYWRvYmU6bnM6bWV0YS8nIHg6eG1wdGs9J0ltYWdlOjpFeGlmVG9vbCAxMC4xMCc+CjxyZGY6UkRGIHhtbG5zOnJkZj0naHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyc+CgogPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICB4bWxuczp0aWZmPSdodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyc+CiAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICA8dGlmZjpYUmVzb2x1dGlvbj4zMDAvMTwvdGlmZjpYUmVzb2x1dGlvbj4KICA8dGlmZjpZUmVzb2x1dGlvbj4zMDAvMTwvdGlmZjpZUmVzb2x1dGlvbj4KIDwvcmRmOkRlc2NyaXB0aW9uPgoKIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PScnCiAgeG1sbnM6eG1wTU09J2h0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8nPgogIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnN0b2NrOjdlNWJlOGE1LWQwMmQtNDFiMS1hMWM5LWRjYzJlNTcyZTNmNzwveG1wTU06RG9jdW1lbnRJRD4KICA8eG1wTU06SW5zdGFuY2VJRD54bXAuaWlkOjBkMDgwOTI4LWY2YzMtNDQyNy05ZGI5LWEwZjdiYTI2YWNhYTwveG1wTU06SW5zdGFuY2VJRD4KIDwvcmRmOkRlc2NyaXB0aW9uPgo8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSd3Jz8+/9sAQwAFAwQEBAMFBAQEBQUFBgcMCAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEFBQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e/8AAEQgBaAIcAwERAAIRAQMRAf/EAB0AAQACAwEBAQEAAAAAAAAAAAADBAIFBgcBCAn/xAA8EAABBAEDAgUCBAQGAgICAwABAAIDEQQFEiExQQYTIlFhB3EygZGhFCNCsQhSwdHh8BViM3Ik8UOCkv/EABsBAQACAwEBAAAAAAAAAAAAAAACAwEEBQYH/8QANhEBAAICAgICAQIEBQQCAQUAAAECAxEEIRIxBUFREyIyYYGRBkJxodEUI8HwseE0FTNykvH/2gAMAwEAAhEDEQA/AP2WgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgqZeoY2Nw99n2C1snKx4+pldjwXv6a6bxAxt7ISfuVp3+Sj/ACw2q8CfuVCbxTK08Qx/mVTb5S0fS6Pjq/lLpnigT5bIMiJrQ80HA9FZx/kv1L+NoQzfH+FfKsumXXcwQCQBZKDkPFP1G8LeH3uhyM7+IyG9YscbyPuegWjn+QwYepnc/wAnY4XwXM5cbrXUfmenm+vfXfKc50ejaPFEO0mQ8vP6CguZk+ameqV/u9Jx/wDB9KxvNk3/AKOdf9avGjbeH4Jrnb/DilnH8nmtPel+T/DXCrHUT/dsvCv+I+F+azE8QaTQc7b52NYPz6T1/VdOnKtr90OFn+CxzMxhv3+J/wCXunh3XtK8QYIzNKzI8iI9aNOafYjqFtUvF43DgcjjZePbxyRps1NQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMJZY4m29wChfJWkbtKVaTb01+TqzGWImbj7laN+dH+WG3ThzP8AFLXT6vOXi3jb3DVp5OZlmfbapxKa9NFqmfumcQei0sl5nbbxYvGIat+eCTZK1cV9zMy2Jxqb8nzPS53qtU5Z8+o9ra18e0ONqJxs9m8Ajd1UONmnDljySyYf1KTp6/p2THl4UU8ZBa5o6L3WO8XrFoeRyUmlprLlvGn1E0Dw218T5xl5jf8A+CFwNH/2PQLT5PyOHB1M7n8Ov8f8Fyub+6I8a/mf/D8/fUb6veJdYc7Hx3DGxD1ihcQK+T1K4mT5C/Kma71H4h7Li/BcfgRF/Hyn8y87wtcOdkGCcmObqWnv8j3WtfjWr+73DtYeXjt1HtvMaNu3p+axWsQsm+0k0TdvH6hZiNSjMRMOa1zSHSy+bC/Y/rXYrew8jxjVnNz8SLTuOna/S3xJqfh7UYsjGmeHAgPYfwvb3B+Fs05XjaJhqcrgU5GKaXh+s9A1vD1fSoc+F4YHttzXdWnuF2IzUmvlt88z8a+HJOOY9NhHLHJ+CRrvsVmuStv4ZUzW1fcM1NEQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBi97WN3OIA+VG1orG5ZiJmdQoZeoANPlkNaP6iufl5u/4G3j435c7qmqY7S5xeXOHclcnLmr7mXTw4LenOT+Irt7WGlox8h9xDfjh66lp83xDO6tnpddge4VNuZefXTYrxax7RS6k/Id5pBa6lK2ack+RXDFI8VWWceZvElOPNEqqa97iVkV61phmZZcGuY4Ajn7qWWdzFo9mOmupa7UdREbd8pa09eD1Wte1pnuG7x+LOTqrVap9QdZZgvwMPOkghPBDHUT+a3K/IZ4x/pxbp0+P8DxovGS9dz/Nw+TkTZDi9zjz7qitJtPbtxFaRqETIYnOt7QXDutmlfHtTkmZ6UNV0JuQ9mTjEwysNgjoSuji5ERGrOVl4f7vKs6bjBLhCBKPXXIC1ra3026biNSlkfTDRH5rCW1WMPyJBGxu4uNUAmplC9oiNy9v+mX03w9Pwo9V8Qwb8p3qixn9GD3cO5+FtxSMdd39vIfJfLXyX/S489fc/8PR97WsDImhjB0DRQUZyTb04sU73PtXMjmO3McR9uErM1ncSn4xPUr2HrM0VNm/mt/cLfw821er9w1cvDrbuvTf408eREJYnW0rrUvF43Vzb0mk6lIpoiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgEgCysTOhRytRijBETg53vfC0c/OpTqnctrHxrW/iaLP1hotzpA4j3PAXIy8q1p3aXSxcTX05rUNadI4gSWfZaOTkb9S6OPjxWPTSvmdLK4PdYPYrWiJvOp+2zMeMdKc9kFrXCvcpGP6hKLfctdPG2i5oNjsSsTSNdLYtJ5vlhtMNnqfdT9a6Y1varmygRue9hBaeCT1Ub+tyuxUm06q0mp695cBYNoHz1VNsu407PG+MjflZxWsatLqG6Jr3gHiwqa3/c7UcWMdemoc3IxJYy97qPUOPX7FdGuCs9xDRnkXxzqe4bfEkZLGC2lZ+n4+04y+XcJiGtNg0mu0vLpnv9Bs8KekJnas+YNfx17FNITOmzwvD2uahG2bE03LmY9u8ObESCLqx+alFJ/DVy8zDjnU2iHsX0v+l7dJkh1jxDtOUynxYwNhh7Fx7n47Lcx4op+63t5X5P5qc0Tiwevuf+Ho2W6NziepVOXV5lx8cTEKb5A1u0WoxMQuiNyge8dSVncJaRl4PdPJnS5omouw8sNkf/ACXmnD2+VtcTkzivqfUqOTx/1abj27EEEWOQvQOGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIK2VmwwAgu3O9gtXNy8eL37XY8F8npzWsa+GvLHkgdmjp/yvP8v5K158Z6h2eNwOvKHL5+sTPNNcDt5C5V+Rbbq049YhqnTy5BcHyEWffoqom+WNTK3UU9MNjIQTRd7FX0wxRC15srTuJ4a6ndQs2jXpKv5lBO5/kgubVHqO4U534bmGYiN9ImgNApwIroeoWa1SlodY1iDGBjbMC8dXXwFTkyRXp0+L8ffLPlaNQ5TVPERlFMmLu1g8LVvlmXoePwseP1DQ5Bky3EkvIHXlYpjnJLe8oxxpPFBGyJtCndTa6GPFWsdNW2SZljkReYza+nA9lsRPi171i7HFhbFwzhLX2rrTwTmWm0SsJzpVdlEPLObPRZRl1P068F6l4u1TyYR5WOwbpp3tO1g9vkn2VmLHOSenL+S+Rx8PH5W9/h+ntE0+DRNHxdPjldMMeIRNkeBZA+y6NrxWIj8Pn2bJbkZJvMa32xyJ91kG1p2vMraY9KMkllVtiIV5HX1WJ7ThC8kO62357LGk4hC9xDuvCxvtOIRyO54KxafwzWHaeE83+L0trHH+ZD6HfbsV6H47N+piiJ9w4XOxfp5dx6lt1vtIQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQR5E8UDN8jgB2HcqvLlpijdpTpjtedVaDV9aLWUJBAzuOrz/ALLg8z5S2tVnUf7urxeDEz63P+zkNT117gWRelg6hp5P3K4WXlTPp28XErXufbR5U807g4vJP9lrW8rdy2oiK9EePKB5kjwR2V9MGTXlb0qtkr6hhK5oJLQSTwTSzMVidwxG59jITI0Bxc3i7C2KYptERLE3is7YSxx7q324d/ZXThr+e2IvLX6lm42JG4zSRgD+kjqo2mKe2zgwZM0xFYcLrviJ7t4jk8qI9r5K5982/T0/D+LrTU2jcuTy8t2Z/LDXOB6noqImbS604vGGpkw8jFex43iMHp2P3XSrji9e47cjLfJituJ6bbTMlj29BfQtKl+jFPS2nI/VhdkogFvT2PZSiViEltE2pTLMzpE+U1fRwWZjpCZhWnyT+Ijn4UZtFUNO/wDor4CPjDUJc7MnkxsLDc0ksb6nuu6BPTp1WxxsU5f3TOohw/mflI4VIrWNzL9LsjxcGN0eLCyPcdz9rQNzvc/K38mSI6h4T9+Wd3lTyZrJ6rVtLYpVTe6z3ChqIWxCAuJ70FHtZqEEzgBVWozCdVaR3FXR91G1ltYV5ptv4yqb5Ij2srVG6axwozkmUoo23g3UDj6y2En+XP6D9+y6PxnI8M3jPqemj8jg8sXl9w9AXp3nRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFDO1OGC2M/mSew6D7rn8n5DHh6juW1h4tsnc9Q5HVtaaxxe97pXE9zQC8zyOZN58rTt38HC61HTl9Q1J+RuAa1oPcLnWvN49OlTHFFCNskzqIA4pMeObJXtEJI3bC1g6jg2Fbi/bMQqv3uX1xlM59QAPa6V8VvN0P2+LAZPlWKa5xJpXY58fbFqeSjkZ0kVOLgAByCOifqzGtLq4Yt057WvE0UIP8O8b+heT6f8AlUZeVEevbrcT4q1u8npxuo6w7Jlc8zGR7v6iVoXzTae3pOPxqYq6rGoamWN8sgLg51i1muPynttfqRDOJrIx6aFcLex44r6UXvMk7mPYRd+4WxXprXr5e1JmP5MvmM/q7XwrJnbXjHFZXmSksA3VXUKrXa3eleaYBT3pjcy+aU0ahq+NgHIigE0rWGWV21jAT1J7BQi3naKwpzX/AE6Wvren6O0H6KeEoIPMypJ9R3hpDzIAAOvp2+66UcLHX328NyP8R8m06rHi9BijxNPxxjYUEWPC3oyNgaOnws2vrqHH/dknyvO5UsnJP3VU2X1ormTi/dRm0aWRG+kUjt3CjvacRpWmk28FQtbSysbVjLuv2VUX2u8dK80oNi9pVVrxPSytdKeRI0N2FwJ7Fa2S8R+3a+lZ9qwL2tJc4EfdVxForuZTmImdRDGDMkgyY5W0NrgQfkKeLNalotBkxRes1l7NjSibHjmb0e0OH5hfQKW8qxb8vEXr42mPwkUkRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEGMsjImF73BrR3KhfJWkeVp6SrWbTqHN63r8bGujgeD8A8n7+y89zflJmPHG6/E+Ome7w4nV9dnl/A7Y3ptB6LzuXlWt/J38HEpRomumlkLnOdR91r462m223a1YrpmI9jhduJ6gqzU1mIV+UTCxOWtYKafst21Y8WvWZ2jfkROZTWgP6BWTNPGNe2IrO/wCSGd9uYZHdq47LMzvW2axremm1PVsXBc4TOcZBy0NItU2yVrP7vbocbhZeR/D6cZr/AIikyZT5j9jT0jZ/qtTLyJtPb03D+Lphjrufy5PUjJqFxjfXx0CxgmZtvTaz4/GmttVF5mLNVPDRw4dj8hdKcNbxtyY5N8NtW9N7i5LHxhze/ZYjH4t2MsXgk3Nsjkeyn4pTZE5/s0BS0x5QwkktvX7JCNleTKDRtHX7qF8kVVx23Hg/wd4l8ZSTN0XCMzYa8x7nhjW30FlRpiy5/wCFp8z5Dj8OI/VnW3vvgP6L+G9Dhx87XWnUdQDWufG938lj+4AH4hfuunj4eLFG7dy8bzf8QcjkTNcP7a/n7/8Ap6NPlMiiEWOxrWNG0NaAAFZfN1qrjUwzM7s1+RIXDmjarbFYhTlsjrShau4W1RuIBHNqm0rIRSzFvWlib6hOtFWZ5I6j7qq25XViFaR4Y27slVTPjCyIm0oJZG9a697Vd7196WVrLX5Dy2bcbr2JWjedW22aRuulTJlBfVBjR1NKPlEra16/KhlSO3BwALB3DuE+1taxp7Z4GyTleFNPlLrPlbT+Rr/RfQPjr+fGpP8AJ4X5Gnhybx/NulvNIQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFfMzcfFaTLI0H2ta2flY8P8UrsWC+Wf2w4TxP4gdlPMcMpawe3ReQ5/yN+RfxienpeDwK4Y8rR25DIy3Pc7aS73XItPe4daK/lWLHOaHnp7BPHVYmGfLvSb+JhiZb2U5y2qXpjru32pmlrz0wfMXkmN1kqyJ33VjWvb4ZpC073tHPJJ5V9ZtaO0fGsSqZs+PEBJNMGNbyT7rFqx1Mysx0vedVjcuX1zxK57HQ4ZLI+7z1P2Wrl5P1V3+F8TET5Ze5/DjM/OMjjchJ6lxPVanl5dPQ48cUjqGt2F8hcSaPU+6ux8byntZbNqOlmNuzpQHYLoUxxWNQ1b38kWZE2dnqq1fWddOfmwxdT06KaJ0gmk324lp6UPZTvMShhpNOl9zjVn2VemyrvfQIPKzEwjadKhdJLMIcdjpJHkNa1osk+wHuqJvMzqEbWiI3L2j6U/RSfMgyM3xthux4JoR/DQiXbMx24HcQOnAqj79FvYODuN5oeT+U/wAQ1paKcSdzE9/h7npGnaN4d01mn6Rhw4eOzoyMdT7uPUn5K3ZtTHXVenlMmTPyr+eWdyjyMx0i1rZZsupiiqm55ceeFD2u1pDLJXVTiSIVnTUTwOvVVXvqF1aInnjdZAWv77WR+EEr6bbisWnxjtOsd9K0szbLSeO491TbJETpbWkz2qyFo53EUqZmvva6IlVyHtLLDvuqMlomPa6kSpzPcW+5byqphZXTXZeQ4kt/UX1Vc7bWOsRG2ujI84wF1m+CDwR7K7HXcp5Oq+T3H6YG/B2JQ4DngfbcV7r4n/8AFr/V4T5b/wDKt/R066TmiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIMJpY4YzJK8NaOSSoZMlccbtOoSrS151WHM6n4qh3GLEaTxy53C8/yPmvO3hhj+vp2MHxMxHlllw+sa3lSTuHnlwP6WvNZ+Tlm89vQYOLjrXqGjcZsgktdZHytSa2t/D7bcTWvtYZGyEG27jX3W5jxxWO+5a9rzb0rumeHgsb+qqm3jbqE4rGtTJmDeA6TgdeOy2MlP1JibI47ePUKz5g2MSRtJ29/dWViNRMfTOp3qWh1PW2RyOq5HntfAVeTNEOpxfjL5IiZ6hyWr61JO4tknBLejAbDVq3yzb3L0XH4NMMfthx+dqGqfxJ2SM8sf0k9QtrDhx3p3vavPyLYbeulvT8mHLiEkdk3/V2Up4s4ynMjIuyFobQs2tisdblPzRlzebqlbCM9w+eY0dE+0ZjcIyQSa4SVXUMZpg1vVYteKx2x3PS34W8O674u1MYGhYEmRJx5jxwyMe7nHgBV0pkz21SGty+Zh4lPPLbUf8Avp+nvpl9MtB8E40eVK1mdrG315bxww+0YP4R89T8LsYePj48b9z+Xz/5L5jPz7TWvVPx/wAuxyMgE/jUrZN/bn0xaa6d293JWreNtqvSN749pDeVj9vqEtSpzuLBwo9wnGpUpZjfPP8AooWvpdWjCN1u7qqLbWa1A+Wm0SseWoIruVGaYm2urg9vZUXyb9r6113CpJIQ123j2Wt5TG9LohVdKAPUbVXlGl3j+FSWZhO4P2gGueihMxK2KzCvLk9Qwij1pY39Qsin5aqZ+2QuA9J6/dJjbYr3GmLY2lltoPPO4e6upHSF7zv+T3P6YNcPBGnl9bnNcT//AKK9z8ZGuLR4X5WYnl31/wC9OlXQc4QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQfHuawW4gBRtetY3MsxEz6ajUdcx8fcA8Aj3XI5Hyla7ivTfw8C99TpyHiHWzOOJhIKtoHRcPmcn9SNzbbt8Tixj+tOSflTyvdvND3C4tb5LWny9OvNK1iNI8eBkspG4kt5Knhx1yX8Yn0xkyTWu/ygiyG42VI4xnaeFTjtGLLa8wnek3pERKV0nnxlwJ2k8Bb/wD+5XdfTX8fGe0D8lzHujouZ8t5UYtO/GY6WeG9WVtS1HDZEZMiYMoVsA5cfsrrZKRG5Wcfi5clvGkbcXq2tufubCfKZ97JWjbLP16en4vxlcepv3LltR1GV4LIz5f+Y9SVVufp2aY6w14he5hoANIsNvqr8eCZjcsXyx6hk9jBAYZAXNI9l0cM/p9OZycf6kdtXjt/hMxzmBrWOdzXf5W3fVq9S5eKJxX03cWQJG7COvxytb1LoVtuH2VgYCD1U43MM7VieCDxShvomVd021xs3yq5vpGXc/Sf6aar46zBlzF+HosT6lySOZPdkfufnoP2V/G4tuRPlP8AC4vyvzOLgV8Y7vPqP/Mv1F4e0TRfCukt0zRcKPFx28nby57v8zndSV2P2Yq+NI1DwGfPn5mT9TNO5/8AfT7l5Ida1r22sx0018koPAP7KlsRDF0nHwpT6YiEL5OOoVazStPISeOVi19LK1VaBsuP5rV/i7lsR0wMoY3qSsecV9s6mVXKyKaSbB9lVkyTEbWUp9Kc0oLaH6+6ovby6W1rqVObIZtIJ/L3VMzEwvrWdtfO5sj2gSUO9lVa3LYrusdwqZElNLbDj/ZJ6hbWN9qE2QRfJb8gpWO10VYMkaNu+TcflX1iIlG0TPqEcWR/PYzkA80rafiUb06mX6J8DR+X4S0xtAXAHcfPP+q93wq+PHpH8nz3nzvk3/1bpbTUEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAJrqm9ClmahDA1x3iwLPP/AG1z+Rz6Y4nXbYxca95cn4g8RSNsYxsVy40vN875LJPde3d4fx1f87kczLEjbm3Oc/krk6867v8Abr1jxnVfpQbc9DlrWrFaecREfSfl4I5WGGTi3d+fhYnHNLaZi0WhIzMa14bGwMLhZ7LapetbarGtqrY5mNzKjqUrGMLn+on2VGekRO1+GJnqEcuW2Bjd5LWV1oUPurvKaxH4KYpyT17c/rPiUwBzcOQur+vsqsmfXVXa4nxHl+7N/Z53qPiwT5krJS5zh+N56fqoxx8to8/y7FcnHwfsidaQx5jcqjHIHAngjuqpw2i2pbVc1bRuGbWk3Yse/utimLUozk2B7rALeO1LbpGupU2szkcQ0mj9lZtVbuFKaES2SwCjwQrd9dNaYmZ7ZNcAQb5Cr9sx0+STCuXKPlpKZ/CLDhzdSzo8DTsWbKyZnbY4omlznE+wCj3aYrXuVV8lcdZvedRD3P6XfQ4wzDVvHTI3AAGPTmybufeRw4//AKg/c9lvYODFP3Zv7f8ALyXyX+I/KP0uJ/8A2/4/5e3edBiY7MXEiiggjG1kcbQ1rR7ADotvJn1Gq9PMVxTefK87mVHIyNw4JWvN9titNSpPkruSoRK7SGWXmkmUoqjMwoD2WPKNaZ8JQvk9W0nqo2vEdJxT7RyU00ep+VRknS2sbQSPBaW9lTNutLIjtTyZgPz4+ypyW+1tKtdlzjvx7fK1smRsUpMtVlZZBawG2gdFrze3UNzHi+0U8xfE6iWk82sxuY6ZisRLXyylpIkJIFG6WIhsRG/SuXNfJYlon1cqfilvUa0i8wND9xsjse6tisk96U5ZGPJuxfIBCzEfae9JsB3nTsjby8uDAB7nhbWKu9Q1837YmX6k02AYun4+MBXlRNZ+gAXvsdfGsV/D5pkt53m35WFNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQV8zMhxmF0jhx2tavI5ePDG5W4sN8k6hzmqa+4R7mkNHsvP8r5O9436dfj/AB8b1Lkda1wuc4sJHza4ufl7np2cHFisaclqWdlPeGQvq+pHVaVtz96l0KVrH0sY5kMcb5ATfp91bSZ6n2haI3MQlfNHA94JeHE2K5CviK45navVrxCOfJD5WOp3yFO1oteJYrSYiYVMp8ZnBB2VYscqN6xN9rKbiumj1PV4YIfKe7e9vQDqqfLVdT7dTjfH3zW8vUOU1fXpJZWxyyFwqwy+GhVWvNvb0PF4FMMfthz+oai6Q0H18AKvufpu/pxWGl1THeIHTuBLXj+Y3bd/cLtcOJ8YiXnfkcczMzCjok7ceRsRcxxNOaGuPA+xWzyMM2jya3B5Wp8NupY8Pj3NbQPZaGpdmt4lGZSxxGwkK2sMTaH0z7u36rOtsb6QvkuxuUolTayo+UCwTwozeIY1vtvvAfgjxD461EwaNj//AI8TgMjJkNRwg+57mr4FlSw4Mmef2+mjz/kcHBp5ZJ7+o+5fqv6deB9F8AaOcPTy7IypTuyMuVoD5D7cfhaOwH7rsUpTjV8af3fPuf8AIZvkcnlfqI9R/wC/bd5WVxwFr5MqnHi0100l2LPKomdtusfasXDmvzKxER9JIJXUsT0nEK8jzZsLHl+U4hiHN2kKO40lpE+Ta3dyfhV2vqNrK03KrkyOJ3A810JWpkt5W2urWIjSnJN1Fm/uqZybmdLoorZE/FdOVG9tpUq1mW+5N7nW0DgfK17fmW3T1qGtd6ZTK5x+VCtZ3tsb3GoV8rIJa5zK5crPc7SrXXUqsmQI6JdfHQqXpZFPJR8/dIJfgtq1mO4W+MR0OkLgbcDuHVSiEVN7jtHa1bWO2Jl0/wBLtPdqfjPT8d43MbL5r/lrBf8AoF1PjsX6nIrDl/K5/wBLi3n79f3fpcdF7N8+EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQfHODRyoXvFI3LMRMtXquqx4rSC5od3F9FyeXz/HqOm7x+JOSduJ1jVS97n8yPbyOeF5vl8itZ8vcw9DxuNqNeoc3k6jLK8XYJ/RaFc83nyt03/0Yr1ClIx8waTxZ6DlQ1N9aW7im0csUTGlxokcUR1Uv0K+5Iy2nqEeRZcNrxE2uK/dW2x/UdQVmNbmNqkU7jC87d5YTZPcLGLc1nfad6xFoUszU9oa552Vw4f7BJy9w2MPDtedV7c/q+uyHd5bnMZVU08lQvlm07h3OL8bSkR5dy5jMz5HXXF/Kpm34dilIq1WQ90gonlZrWU5vEPuLE1rg40Xe63cWKK9tXJk8uoSSxscObJPQLarOmjlp5RqXLargZGFmDIja57SfSf8ALzyF0seWL18Zci3FmmTzq6LAm3Y7SbDlzskas6eOemcsrjYbQJ6KOpWTaEMko2kk8/Czv8sTKTSMPI1nV8XSsKSBmRlSCOMzyCNln3ceijSLXtFYUZ8tMOOclvUfjuXqmhf4ePEOVrTG65qWNjaaxodJLjne95oWxoPSjY3H2ul0KfGX3u89PNZ/8U4K4/8AtVmbfif/AJl+h9E0vS/D+lM07R8KHDx2C9jGhu41Rca6k1yVveUUr406eOy5cnJyfqZZ3KHLySXVY4WjkyTMtnHjiIUHyFxsmq+VVE7ntseMRCFzwR8rPSWpQOcQOKvuo7S0hkfXKjM6WRCB8gJ6qucicVQyuqyCRSqtb7WRCpLJXNfNArWtbS6I+lWaZxBAta9rzPpdWsKnmgk+7uqhj97TtH01+VkjzPKDhZ/ssWvudL6Yv2+TW5uVtmjj5IJ7qNp7iGzjp+2ZV8mYvitwIN0VmUqV1KmXCyLoDqrIqmq5DH5XrD9rRXwSsxWZT8op0qywsYW1uA78qcRr0ecywbIC+hXCnFetwTLB1l24c+pXY4/Ku0vWf8OmmPdnajqsreIoxCw/+zjZ/YD9V6L4bFu1sn9Hl/8AEOf9lMcffb2pegeVEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBHNMyJpL3AUL5Kpy56447SrSbT05jVvEDBGfJDr72vO8jnTaNuxx+BO/3OQ1LVjku/+Xj47lcjLyov6l2cXH8PpqZpn7dwvnqK6rUtM1ruPbarETOlDGfI5+7aCHHklUcfzvO9NjLFaxpI6drWlsTdjru/n2W9WK1ifDqVGpmf3NdmSvkjJe889WqnLNrV7lsY4iJ6hhDIx2KyV26gas9B91OmppElqz5zWGi1HW2Y7pY8ZzX2fxdh9lVOTxmYq7HG+Mm8RbL1/JxPiPX5oY3yhzS7/M7oFHFSc1/GHXn9Pj4966hy8HiKV7miaTdK/s3nb91s5fjrRuY9KcXymPJPjrTaYcgyZdrnAEtJafcrVpj71LdnN+3cM/LonaDx15W3SlYjSi15lixnq6nqrOmItPtI6iDySQm5RntWyHbmlrvVXxwrYn7UWjtBFbb2uoV0UvKJ9o60xkma08m+FCZiDtc0Xwx4n8R482ToWiZudBC/bJJEy2tdV1fvXb7KVcOTJHlWNtXPzePx5iuS8RMvafpZ9A8XI0rF1jxscpk73b//ABrTs2srhsh6h180D0oe66PH+OpFYvln+jy3yX+JbRecfF1//L/h73jnF07FiwseIRwQsDI2g/haBQHK3rciK18NdPKTS+W03me5a7NyN59PQrmZcnl1DcxY9e2rfKCacTfta1d99tuK69IJ5QLI6j2SbRCda7ReZYBdX5KXlv2z4o5JAB/ssWtpKsK8kzXAtvoqZvE9LorrtXleLsOKrtb8JxE/atNLTTyFRey2tVR84aHBooqny1vS2K7U3ZbeRwTRsKqLx9rf05U35AcwvaQKH6LETEx0t8NTqVDIIe4zRubuDeCTazWsb2ujcR4yoicSTG2l9X14WaREyutXxqryytLmsDyRZv8A4VkRtmI12qySXIW+oX1Hws+046jaF8o8zYL7UbUo0a2hml622uVKJ0aVmA73OJPJ/RW1jpGZZxjc8AO4BJApX1jfSm1tdv0v9I9JOk+CMNsjNs2TeRID1G7oP0pev4GH9LBEfnt4P5XP+tybTHqOv7OuW65wgICAgICAgICAgICAgICAgICAgICAgICD44gCyaCxa0VjcmttbqOrQ40TnNc0kfK5nI+QisT4NzDxLXntwmta47Klfvc5vwCei8xyuZ+raYvL0XG4cY6xpzc2bJO9ztx47ey5GPPfPMzMulOKMeoQMcXPax7m1yevP3V1a7mKSTPU2hkZdsJp49PJvqtitZ8db9K9bt6anIySyTeZCXE2Gts/mtfc1t5TLbinlGohHHkSzB5a0tPXdfVXUvNtsWxxXUK+XqGJixh0rg+U9Gt6/mozMRG7e2zg4mXPOq9R+XLa5rUk4LTJ5UXaNp4P3VGS8z/KHpOH8fjw9xG5/LmM3P8A/YuBP5Kjcy6Xhpps54yGuiZte6jQ/wD2tnBE1tEw1OREWr243X8TNixnDGaXTCywiQtO0CzQ6f7r1HGvTJ3Lw/NxZMEz4f0dB4RznZeFDJNJUrGbHtPY/wDbXP5fHrjvOnd4XKnLiid/6unhDjHuBF9geq14iPpv+U69I5XN3WTZWdQx5SifLd7TRrlZ8WJlXe6hRJNLPpGZ+1GeYUadxdFQtO2O4dj9K/p54h8Xa1puUNIyJNCOU0ZOU4hjNg5cBf4ulcA+3C2+Nxb5rROv2uT8l8rh4mO1Zt+/XUfb9g6Domi+G9PODo2nY2Bjby8xws2guPUn3K7U1ph6iNPnGbkZuVfzyWmZZ52WdvodVfC1M2eZ9Snhw99tTkZRdzv/ADWjbJNvct2mPStLPYq/zWN/hZFVLIeCSbpV5O52up6VpXO3A7qo8mu3sq569rIiJ9Iy+zQNJ5RM9MxHSN7wBfdRtaISiFSacD8+61bZIX1pKtLkkX6u3buoTln8rIopSZYf1BbXS1rzk8l8Y9Kr59xsOAHX7rETuVsU17anNyi55jDhuHcKvcTLarj1G0TJNuMWuk69RdkKVK6jTNtzb0pCTyYS0O6mgb5VlY6Wz3O1YPIZW54u746rOtMzG5UppSHAbiT3s1Ssr0yibLYaCSG8GyEJnbHIe0zEh18KyIhHfTBr/wCZ6jYIKspHSNp1KPzf5hHv29lbWqub9uk+nWgS+IPE2LgtafKvdM4f0Rjlx/0+5XQ4WCcuWIc75DlRx8M3+/p+pY2NjjbGxoa1oAaB2AXrngpnfbJAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEEWRPHAzc9wHstfPyKYo3KdMdrzqHPeItbZBigtf6ncbR1AXD53O1Te3T4nDm1+4cDn6nO+Qjkg89V5TLz7zfxiOnpsfFrFdy1z5DI8g2b6qu0fqW8fqfa3+GNoZnNdG7ynMDh/TdWtjwia/wDbYrMxP7lGXJlYwRPLXGyRxVfmseVqViLdrox1tO4Vy+2mV8u53QN91mKz/FtP1+3SHMyscwNZvfHsPUhW3is1160nixXm/Ub20ur6s023GDmsFG3e/wBuypvk+quzxPjdfuy+3NZue71PLuvU31VE33Lt0x1rGoaHMyjINxNkdr6pFZlb5eLUziWWQANcCeAFs1prpGcvSXFxKqVz3tduG0H9/wAldWP5NTLffT5qmAzIx3u9TXNNja4rdw5ppZyOTx65I1Ln/CrP4fLmgbGWgu3ck2f1W9ypi9Ys1eHh/R3XTr2veIgAa91yopG3Ti8oZiW0WkD3V0dQjvcoXSNjj9gVi19kQaViajrmpxaXo+LLmZs5Iihjq3EAk9TXQFQrjtktFax7V5s2PDScmSdRD9FfTX6BadpmTp+teIc52fKId02nS4rPJDnMosduu9pJ5FcgHhdvD8dXHq953/J4f5D/ABJfLFsWGuu/e537/wDL2bAgwNI07H07Agjx8bHjEcMbG01jR0ACvtnpSIpV5236ma83vO5n2pZmYdxF/YWuflzzMtvFg6a2bIcSb/Vas2mfbarSFGWavt1VczEL4rtF53HVSi3RpA+Tm/dQtdOIV5JKNBx47Kq9/wALIqhkeWNabsnqozPjqftKI2rT5Acyz1aVVkyRau1laanSjkTAOBPI/sta1obFKyqyT0ar09yCob7WxRRlmDXk9/a7u1VrS+K7hTdlPBeXWCe1cBSiZ+1/hE+msyHulkLt4DWnoOhUdbbMfthE5/ls5LXBrb3e5V0V1GkfcqzZS425xsD8lmKpTOoV5ppNrWi3H4VkMTr2gP8AM3FpaQ49vb2Uvc9MdxHbF1b6aenT2+yzPtH6ROdUjg0myRQ/urIiPpjfaOd7WRNI9QaT0V1IVXnSDCc6eZpYL3mgB1KvpTc9KbW13L9RfSTwzH4d8PMMzG/x+UA+d3dvsz8v7r1nD40YMcRPufbxPyXMnk5ev4Y9O1W25wgICAgICAgICAgICAgICAgICAgICAgIK2dlNgjJs38C1ocrl/pxqq7Fim8uY13Pc1m5ro93UhxJP244C4efJaY8vv8An7dbi4Y3qXG6hmvyXmQsY2+zTxa4efNOT1Ht28OKKRqZaufOJDNjQd3HPC1Lcj1FI22q4Pe5a7IzAA2Ki2vxFv8AZPKNeGtflbXF/mVZZhJukogsrcOgP2Vkfv7/AAnFdar+VbNlsMLGksLCRzyrLx6nXSeOvvvtrHaq9jKcbI4F9AoY81nRx/HfqTueoch4z8UPw8cvdI6x0ofsKU8VL57+MOlNMXEx+UQ4zC8cOmm8hzHR7zw5zuT91s5/jL0ruJ2jx/ksWadT1LZ5GY+Zpc5xvvRBAXOrSYnTpRkj6YNcHxAWTXSls1x69qr5PtJuIf6qDQPZX1ptRN5C/fxH0+PdT1r2hM/b7IQxl2TazWJlC/ai+KMTeYxga7uQr48vHUqtREpnzEAeruoePZuFfIymgEX8LHkNl4O8L+IfGupvwPD+J/EyRMD5SXhjY23Vkk/t1U8OC+a2qw1ObzsPDpF8s6h+lfpP9F9A8Madh6j4hxIc/X45ROJS8lkDx0ayiA4Ai7IvldnDxsWCsWv3aHh/kvnc/KvamGdUnr/X/V6bmZzQKDqVXI5W57lycXHlqcrLsGifgLn2zeTeph0oSzbuXOulX5b9tiK66hVlnJPf7qHntOKaQSSc+w+Em0JxCvPMIyR14tRveKs1pMq7sjdTuD9lTN96lZFNdMWyAi+LPssReNMzEoZn3ySav34VVr79p1hUndVHn7BVz1CyqjkvvkOok+yrtO2xjj+TX5E5aS1poUe9qvbZrT7lRnmDgBz+KuCsxG11azDV5k7y99n0iwLHVZmstikREKcMz45S27DW2L9ys1jSdtTBPNua0AEkficrtbVdxKs5zjFtugbrnqkQz0x8xz+bLQ3ir9/lTiJYnphGfNa91FgbVD4WYjbEzpE+Zm1wNgVf3U4rM9oTOkHnbgD37q2Ko7fcgB2BQ49Vfkr8cdKr27dl9HPD38ZqjNTyI7xsZ1x2OHv7fou78XxPO36lvUOD8vzPCv6dfcv0dpTyWC137PKS2igwICAgICAgICAgICAgICAgICAgICAgIIcmdkTCXOoBaXK5MUiYWY8c2npz2bmOneXQRO2t6yno37Lg2zedt1j+rqY8MUjVp/o43Wcjyi4uN7uouvzXJ5eX9OszP9na4+Py1ENHJkxytc1lew7LnVzVzxMVb36c45iZazLkc2LfEAdt3YVcVmKRNY9Niuptq32oTubNCDbQ7rXcqya+cRv2tr+yZ/DX6pMWsja6X0M49iVLLWeoj6bPFxTkmfGO5aXO1cwxlgdTfvyfum/Gupl28Hx9InymNy5vM1bzHlpfde3ZQteZjUOlXDEduc15rc7HMTn2OoJ/pWxxLzjv5NLmUi9ZrLhtSw48SLb5kocGkh5oEAda/wC9l6vHfz708JnpOC2t/wBW+8J5n8bA1rLEcVbiRdj5K5HL4vhfcvT8PmRlxRMOrYzdbw0Cz0vstTxn23vOIYTMjDy8CndCQrce9aRmUVhpOw8qyazPtjyfBK2RlE8rE112xZFMAARuFg+/VT8tK1Jz279sbSXPdwBySenCrmZljevbd+G/p54z8Ua07StO0XKjkY0OldksMMcIPdxd0+3Uq7DxsmS3jWGjyfk+Nxsfne8a+td7fsvwJ4R0TwRoUeBpeLCyVzGfxWQ1lOnkDQC8+3c10Fn3XbmcfHp40/rL5xy+Zm52TyvPX1H4XM/NNkB1cdAuXm5G51ErMOBqpsgusl/7rTtff23q49fSjPPZ4JPwqZuvrRXfMKPP6JN40l4oDJuI6gHpajFkpjTF8npPPTopzdHSnkSlx7V7qi+TylbWuoUyQxxoAE8n57KmOlnt9ErhbSACf2Ty11J4sTJZIsE0o72zrSrkybSwg116dysWtO4W0ruGrzph0LqoXx1VU7bWKrV5GSNzQ1riT1+fZZ69NulOu2tny3CUEAbr7/3UoiYWxWFfKk3Da0eg2bPZZmJ1pKsqrZSA11H1OJJ9/j9lKI6Yt1OpRTzVKRZa6uhPdWepR9qz53PkaADtaOWjhZj0wy/iC8EscQ3dXxSlDEsmZTXeg+lpHAAulKNekJ3HarKwOsO5+LU4jXTE27YHhgb3J6e6srEq5lvPDWjyavIzGa4iMu3SP/yt/wByupweJPIvr6c/ncqOPTyn29z8K6bDh4sOLjRhkcYpoC9dSlcdYrX1DxebJbLabW9y77TYtkYUbSoXlEEBAQEBAQEBAQEBAQEBAQEBAQEBAQYSv2N4FuPQLXz5fCNR7lKtdtTqLImM/ic+Tc1p4YOB/wArh8jHWv8A3M07/l/77b2C1pnwxR/VoNX1YSRufAx5gBA2jgcdOFoZuVF48qRPi6ODi+E6tPbiNXzvMyX7mhxdxS4PJ5HleYmN7d3Bh1WNS02S4RW2JpDjbq7rWjHGP9tYbdZ8+7NZqOSJI5GCT1ggizyCr7zFqzG+1mLHNbROumtzdR2RseGFjw2r3WVZWdxvWnT4/wAfN53eenMavqsj3l5PqJI3OPKTft3cHHrjr41jUOYzMx73klxojnlV6mzc6rCi6c7idwdfNEK7wjSqbyqTyBzyNwp3HurscePbVy9tN4pw8rN06sU+W8AE+9D4+y7XCzVx2/c838pw7Zq6rOpUfp/DPjMmY5zwZHXZFH7UtvnzW0RMNP4fFfFWYu7zGDY20XO491x7zuXeqyc+wBwB7qMV0ntC51XR5+6siUe9q0ku02B36BYmetMtp4K8N6j4x8UYmh6c14kmf/Mk27mwxD8T3fb+9LODHbNeKQ0+by6cTDbLf1H+8/h+lvDv0A8D6ZkYmRntyNUkgh2SMmdtimfZPmOaDwaNVdcWuxXh4aTEz3r/AHeGz/4k5eSsxT9u/wC8R+HpWTlsxYRDCA0MAaNxJ4HH3PCr5HNmP2uTjwTknylp8zUHEuAeSVycnImZ9uli48RDWTZJPU9eVrTafttxjhXkmvv9li0pxVXlf1pxH+6jaUoRF4rkrETGjSB8wJIb0HysecfTMV/KN09GyefZY8/uWfFXfICD14q6Cr3tOI0q5MnqDTbhV+1KNphZWv2r+cGgA9Cq5ss8fw+Okf6XA0DfU9k3PtmKwpzzCr3uoWG89b68JMrq0auacubfpaQOR8LMeumzWsR7a/JlNEh3qaTYPUj4UohdER9tVPkN8zzCb2nkAcH4WYmFnjPpBNM534yRu6Ae6T6I99McyfzaZCdkQIA/7+SthVP81GSSSbKBptu5PKfxWZj9sM2hzXW+hfFdaU4/LEztk/h72tFENulKIQ2hMgc9jI20T+33VkV2jM9PjJGve5xJDeinqJ9IbmPZG0zuDWAkn0trqVdjpNp8Y+1V7xXuXr3gDRjgYLGObcr/AFPPz7L2fB43/T4or9vH/I8r9fJuPUPVvD+FTWuIWzaXLmXSxNDWhVos0BAQEBAQEBAQEBAQEBAQEBAQEBAQEnoQTPaxpleaaFz8l/eSVlazM+MOd1iT+Nb5z2uELWnaP832XF5U/r/ut6dTjR+l+2PbkdXmGPF5UUPlMcDYc63H5XEyzOKPGtdR/u7OGPOd2ncuRzCzzt4ftce1crj2x18/LenXpM+OtNZnZb2uawOcQDwfYK7VvKKx22cOD9TcxDmtZ1VkUz3PIDj/AJutK60RWd29u9xODWlXK6nq0kjr81ztvI56FQm82dSlK1hpsjILgXOd1s8KdabLXiGufM5/DgQD1BWxXHpXa6OME2C0hx/RWxVTayaLH38kWR0CnWNKbXWJIwYduyiTx3pXVn8Na/ati4rITbG7X9CtmbbU+He1pjjyT2Vek/TETN7iuEtGmYlUkym2SCVXafoncOz8BfS3xj40DMrCwxh6eXV/G5TtjD/9R+J35BW4uPfJG49flyud8vxuH+287t+I9/8A0/UX008J6X4B8Mx6fAYcnOfbsvLEe10zif1DRwAPj5W/jy4+Lj8a+/uXiOfys3yObzt1X6j8f/bbZuqOc4lpAB6crRy8y1p2xi4kRHbT5eY9zuXWT1taGTLaZdDHhiIUZsk3xddFTbJpfFIROnHvZWYyQeKtNJ3B6fKrtKcQiM4ugVH9Tvo8UD5SCQ42Csef0zEIt9OLr69gkTpn3GkUkwDuoB68rE27Tim0DsinfJHusRbtP9PapkTucfwtFCjz0Kjadra00ryytaASSb7hYlOtdvmRMWtBLgG179VmYZpWJnSlPPGW05xdXNblmYiVta2hqJpgXOjDi2+L91KsR6bMR9oXBvkbjueWHmzVfPyp1jrbMz3pqJJHxitoZ6qHVNM7Vnvp/ntPQUOO57hI67Zn1pGyS4r6js7/AHU6+tq5liJGtcWV6+tXwB/upRolm57XObIRW00OVOI32hLEucHW9xLn8HngKcaR3+HwOFihd/upVli0dPjnNDzE38TuthX1rKm1nb+BdAPntzZ2c9ImnsPdel+N4PhH6l47ec+T53l/26T/AKvYfDOmn0ktXZmXn7W27zCgEUYACrmVa0sAgICAgICAgICAgICAgICAgICAgICDCZwYwk9FTnvFabSrG5ajUJHZUseLEeHm3O7ADuuLkvOe0Uj7buKv6dZvZq/FrvLxsfyNp2Agc9h8LX+SrPhWcf02eB3a3l9uF1vYYHSiQb6t3v8AsvPcqsTWZie3f48z5RDlNUzRFC52+hfTutKsWt1DtcXjTlvpx+q6nK+Nxa5zW9Lv9lOZ8K6q9Pg41McahwPifMlbjOkaXucOl9VdxaRe/wC5ZnvNa6q0Om6jJlQkhzzRr1dVu5+NXHKjDnnJXctqzbtDtoc4jndyFrRHaVrIm7CRu4+eysrEozZLGB5jQGenqSfZW66QmVgbBRAorMRKu0j3AvLeK60r6x1tV37Rv9Lrb/V1tTmNo+W0L37HECyCozZnW2Wjafm67rmPpOntY/KyXbYw5waLruSo1i15isKs2WmCk5L+ofpX6LfSDTfDJbrWvPh1DVCHNZG0B8EYI5FEep3UX09l0uPhri/fbuXi/l/mcnJ/7WHqv5+//wDHqWXmiNojYGsY0U1reAAqM/JmZcfFx99y0+XmW4tHWlzb5dzp0ceGI7a2efiute61r31GmzFVOWax+L/la8339rIjSu+dxNWo+cpeMInT0AN1m1mLzEaZiu5Q+dZd8e5UYne2Zj0rGf8Am8Hj+yxv93Sfj0xmldY9XJ7KUzLEVhG+bod1c9Qs70lFFaaQggBwICjMLKwjmyABQ9q+yzP4hOtFOeR22rDQOTzdpaJXViEBnZRFeq+eOQU0l4TKvLmjYGH5oN6JHftOMep3DXZWY1zAWnnoaHRS6XRXSm542WwinA3z/dSisRDPcqpnlbE9zqr+kDqBSltnUKoe/Kf6S4+4PssxG0d6V855ZPFjV0aXAV1vr+ynHUdoz2xd/Tbr29GDqD2Uo9IfaN4axx3OLnEkk9FKI6Z32+wAv3bg48WL7KcVlG1oMqRu4sHpoCyFLxQizHENuPPUe6uiqF7/AJdN4M0V2dk/xc7D5YPpB6H/AIXd+M4XnP6l/X04XyXN8I/TpPcvZPDOjk7fQvRTOnmbW29F0rBbDGOFXMqdtoBQWAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQQ5ZAjBPS1p8z+CP8AVZj9tFreRJE0NxwGvfQ3dSB2C4nJyTT+B0ONji3dmvzDH/CtblSeZK1tBregS1t0iLz2tpE+f7Y6chr2ThRabOCdjGgnlq5uatL0msO1w8WTJliIeT6nmTZk/wDLadhIDW1S5lv2R41e/wCNgpgppyupSOe5zQ6ufdaepmXSiYiNtHqLBJHsNEdLV+PdZ21ck7aQ4gxpWmKPl3ueAt79WckTEyqiIhcj6Et6FKwhaWfoaLcfnlXVpMq5tMQxDnXwfT2C2IiFXklMnQf1dlnwiUd67PPaW2b9hSx6YV5sg3VcdlGbwl4qr5nlxu/y7rXjRL9X/Qb6Yad4axMTxVLkHJzc3Bjc3c2hCXC3BoI7iuTyKPuu3xsFcNYyfcw8F818tfkWtx4jURP93pOdK1oLjIQVrcjLE97czFT600GVkA+reHD3XKvaPe3QpXXWmrllPmbrH5ladr97bUR1pTyMnYdrnVuNWOVTN/ysrXarLNzfH6qqbalZEIpJvd1c8Ad1nylmKoTLR5d+ilCXijdLxRJPW64WYlnxRFwFu49wpaiGe0bpQ8FpBHyVj37Z8dK5yC1+wNO0C7rhPJZ4bhBkyEkvkebBuulJMb7lZWNRqEM+QZYxtJsCyVLuUq08Z7UcmR/NOLr5A4NrOpX10qHIoFx9Lj1P+6ztPx+lWd7W0G8kAcV3/wBUisQzEyjlmc51M2f+1Vx7qepmeiZ/KnKdsIdZ5FBrT+XRIidMzMIXvkYNkrQXUDZ/ZT1qdI7ifSPHmdG988jDsaCCGkA83wraddq7/hr3SvkldK5oc/mueFj+KSI0yhEZfxJRu77ke6zEMzLMMLiOgsbqLuatTrXU7VzLIOIjc+rc7ge4A6BWxG+0J1HTXlz/ADAN/qu+FZWkyja0Oo8NaDNqLmmRrmxEi6HX4C6/C4E5pi1vTkc7nxhjxr7eyeFdADGRsbGGtaAAAOgXpaxFI1Dy2TJN53L0nR9OZAxvp5pYmVEztuWtDRQUWH1AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQQZ7C/GdQst5r3WrzKzbFOvpZinVmoy4QWNe0CwK+wXItjiYiYbdMk71LndTieJGvslvcEcdVo5KWifJ0MV4mNPOPFUuVr+rnS8Om42P/wDM8fhLu/6Ki/ld7D4zHThYf1sn8VvTiPEOTHpviQ4mIGSjCxS6YkWN7xtHXrV2ubO62m2vX/l3sEzm4/lfrynr/SO3DZuQ4uIulq0p9y38mSI6VHz7IzYtXRRR5bnSo6SOUl7SXX+itrSaoTPTAlzRua3i6Pta3MdYmNqMltdMXNtlPHqK2IjXpVNmTXANNdlnW0ZlC6UN3AO5ri1mbaJnaN01jk1S17WnaUSryy8muigTZ6n/AIbPAR8Y+KBq+a0N0nTHNlcHMtuQ++GAkURxz+Xut3h8Xzvu3qHB+b+UjjYfGn8Vv9v5/wDD9a6pMWMIbQAHbilucvLPbxHHpv25rMyzyOCuJlvp1KUajInJNe59+FoXyTLbrChLMHnng9uVq3v5Lq10pZM3a7Huq5n6W1qpSTEE82FHa2KwF+1t2eeitiNQx7V5Z3drq+UmZTisI5ZAW07nsbWdbSrCLz2gEbiFJLw2gyMpu0lpsgdPdZmYlKuOdqks5tzywt6AAd1mI2tisR0jM9N9XJvhZ0n469K5fI0my5tCi4dz8LPjr0l0qzSuIDyBZNH7rKWkE8oLXNJJcasAcUPYKUQypFz3R7ZLNkmieE7+2dwifIdgBd5bXctHPI9/2UohiZZPnY7cWn0mgK6BSj+SM7j2rSuc6QPIsg0Pn7KcflhXy3tdcA20w7i0dCe5/wBFLfWoQne9qe9zHGO207g1/qeyzWGZY+YQ4Sk3I47bFbQB0CnPbH8mUTD5gaRvJ5NH4/srKx1pGZ12su9UZaRRIoV7K6tdzqFEzpv/AAn4adkzNnnitp/C2uq7nA+O/wA+SP6OHz/kdfsxz/V7H4U8O0GXHQHQUu9ERWNQ87fJMvSdI0xkDB6eViZUTO23a0NFBRYfUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQDyFiY2NPqMRa4xm3NJvk9vhcbPhmszX6beO325rxPL/Km8tw2tZ6fv0H7lat6/q5IpDo8Ku7ViXCeN9b0Pwt4cLMGSHJnewume13D3g0RY+QVP5TJgwYoxYu5l6j47jcnnZ/LLExEev9HhOmapNlaVnarkSbsnUMt3qI/paAOPzLlxcmLw49Y+5l6vLqM8Y6+qR/8tPkS7Xsk3US7aBX91q0x7L5NqL8nH1DUBiwh7MaEXkyA309vueAtmMXjHlKqck1jr2hyclold5LBFGT6WA/hHsoxXy9rYiYjv2+w5X8oMJtbNK6hr3mNvs2RcfpBJCurVTNkYlDSd73UeQBzzXRZv6VxbtWyJ3Fw2jn2VErYn8oXzU1wJDSFGa7Yi0L3gjCh17xno2lZAyHwZmXHDL/AA7dz9hcLLR70rsWLdorLX5WeceG96/UTPb+g+madp+g6Nj6ZpeLHjYWLGI4YoxQa0f96912skRjjUPmFsl895vee5anU53OaR2K4ue8y6GGsQ5fUpiA8078lxOTeY26eGrVyzv3cuIC1P1JX+MKOW/1W2qCqt73C+kdaU3SuN2TfYBY3Mwt8UEjyKN8qUR2lEbYPyLbYHq+FPsiqq+YNHqk56dKWYjpZFZ+oVRll2+3Hkdb6KUdrZx60FwMTXknn36KXhBEzvT4KcLbexpBJHVZ8I+mdyrTyloLGtNEXbj/AHWfXScREztUPBadwN/haOb/AFTx/CzyRyvppLbaDzyeilEMf6qT5RMLoV7df3WZ1ZLekWQ8tcKeHWPTRoAe33U9MbVJnPmk2RSGwOfVfHU/kkVmSbRCKdhfFsMjyeaPypREseWmAmDQRJ6eAGiuLtZiOme0cszWSGRp4NtafZ1dVLWpRnuNKTwLZ2cTQo+yzFfwxtHJxPtaWhvIFe/upkdQya0xii1zA0D1EWTXsrK12hayxgxyPcHuFvPt1K2aYpmdR7a+TJEQ7Twr4cfO5kk8duuwCOi9Fwvj4pq147eb53yM3maUnp674V8N0GlzF1vTiXu9E0vTo8dg9I4UZlVM7bNoAFBYYfUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBXzscTxVQ3DoVr8jD+pXr2sx38Zed/VEDS/AuqZovzmMG0k1RLguNkrGKlr/AG9D8J/3udjp9Py14s112R4Ow4XSN83a7cB1onqVxbT50pH2+pUwxjz3mPTRzubB4T0yPzQ0uhL3D/7OJ/tS2OVTukfiGpS+8mS/8/8A46aGT/yGW/GwcVpflZv/AMIJqmc24+woE37BXYeJuYaefkxWJluZ4IdK09unYkokY075ZT1mkrl/wPYdh+a0+RkjJf8Ab6hbxcc687+2nypaJJ4CzSq+1lIZoY4mr+Vt1p00sl1mLIdI1tGuO3RSjpTM7hlLKdoaTdlRt2xXpBLMGu2jgqrx+0/LXSpkZAt2/pSlFJ+kbZIiH6a/wO6XjS6RrWvlsckv8U3HYSbLNrd3QigfV1BuiQV0eNXwnbyPz/Im3jSJ/L9HahOQDQ4pZz5JntwMNHM6pJTndlxeRPbqYoc7mTG+lFcfLadt+kRENXkTEH1V+Xdak2bNatZkZD9wN0KVflqWzWkKb5h5dhxPHUnkqfuNpxHeld+S57RyC4i+qnEzKfhESjEw5AcABzyOintnx7VJ5/M9DQL7G+P/ANLPtbFdItway7a/iibUku9sP4kscA/cdwsfAT/Vma79PrcqqFEhwJv4U4mWJqryyM8rZt9IPUf6LKUflXEkhdYJIHAs/wDeyR3LM6iFeeQSek0WfeuilPYgpgG4saCG3dnkLNawTaVVz3TAvLQAeOvf9fhTiJljekDvLjhNtdQoAker9Fn32z3t8jkeGuLra6vTZ4aPlSiGJVxukk8iMuL6s2LAHcn4U667liZ1D64tklcGxlrI27YwT2Hc/PdYnSO5hSla0S7pCSN3UHivj4Uqm9+n2y0hwBf/AJW9Cb6KzUaQ22GLgyZE27b6nO4YOgW3x8Fr21EdtbPnrSu5nqHfeE/C7nPa97LceenRen4nCrhjc9y8vzefbNOo9PXfC/hlsbWlzP2W96cq13d4OFHAwANCxtUugUsAgICAgICAgICAgICAgICAgICAgICAgICAgICAg5n6j6G7XPCWpYMIBlmhPlg9N45b+4AXN+R436uK2vt0/ieZ/wBLyqZJ9RP+32/B/iSJ8WK7HlDmOjJbtdwbv/deSw+VbRt9ppaLzMw1Gp5Lv4WHHc+o4Yg3p2HddCm75O3Mv+yk2/Lo9DYNOwZsrIF6tnxAOaTzi49DbF8EgAu+KHutvl5v06fpx7n3/KPw5XHxTmyec/wx6/nP5aHUNRe/JLMdoc4cOe8elv8Ayufiwft3LpXy6nxhS1HIZ5bWNrc38Tj1cVbTH2pyZGlmfTjuNX0AWzENK+Tvtbwshwoh1f8AqSsWr+SuTfps3ysbGKHKq8ZSm8RCrlPdt3Gga5WIr2ja7RajlOja8HoAtvFii0tHkcjwiX7a/wAI2j53h/6TYUOosycfJzZX5boZnNPltfRZVdAW0aPPKzOWJvMVl5Tmz523L1rLc8dXAnvSpyTP2ox6aLUXGiTfTpS5+eeu27jj8Oazn8u5pcPNO5dHHDSZMhdu788LVn8N2kNXlOeQbcL9uqrmstiuleQ0wA2KP3V8ViI7Sj8q0zgGl20Weg/73VvjHtKJ+kW+M2XvcD+E8KcRGme2E+2Eg+Y0ihRabBBWdaZid/SDIyC1rmgjrwSPUpTKdY+2L3k/zdwDm0SL5+yxr7Z/kpvyn24ij2vtV+yzEztLUMfNLxusFw9NjonsiNMHkeWSQ4mrIab7/ClEMTbtr5C4gW63O6i7P2PZZ10zthnTPczgkG9t33r3U+5YiFcnbs2uArncTdrMTP0y+vmLnX+JrOeRVn2v9VLSMwq5c+9o62XVQ7cqWtz0zHT4wnHhkIeBM8+sc1Q6NUpQn9zEv9DnU4uqqpIhi2kDHbw0bXOf0AHAH/CtrTcoTaYbjRdKmyZWNbucR1Pt+a6PG4ds09NDlc2mKJmXqHhHwnZafLs+9L0nH4tMMdPMcrmWzT29b8OeHY8djSWAV8LZc+1nW4+OyJoACwrTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgHokxv2Py9/ia+mGZBqA8R6FhvnxMiYyZLI2l3kvqyaH9Jon4NrzPyXE/Rt+pSP2z/s+kf4Y+brkxTx806tEdfzj/AJh+ff8Ax+V55yp4XWHF7GObYAB4JH7/AJBaOHlUpO4ehzYZtHg1uXqMj8h0McxLiSZJLv789z8rYph8o87NTJmjH+yv0gzNQxYIWudJGxtd+BatphvadaamTl48cbtLR5GsmW/4LGkmvjeRTf1K268eK/xzpzMnyNsnWKsz/P6Vooc3ImD8iUAXexnAWZvSI1WEKY817byT/SG+woWwtDmst1dVqz26FY8Y6Xqock/H3UdJTKhn7qLu3flKQqyTOmPgDSMHxN4+wNH1DMZjY7yZHWQPNLeRGL7u6fqtq3ljwzavtx82StskVmX9A/C0rZNOgNBjg0WB/Zc3H3WJcnkdWltMl57vpZyT/NTRqdQfyTZIPUFaeaW3jcvqLrc4h1fJC42Wdzt0sUdNJJKKd7X9lRHctyI9NZIdzjbqAN2BxSRSGxE6hWkyA70VQJuwro1PTPjrtTmm6eYeaoff/RZ1+U6x+FeVzjNbSQ49jfRWeKUdI8l+xlFti+hd0/Tqk6SiWDHR7bfd9j7LEMztg54qndzZ5Utbgme0Uk0ZcYy8M28Hni/a1nrbPbFj2ueGinOAHFcmulLMRuWJlWlySHu2u2UBR72sxvZMIcjKY4Oc0U1x4YewUpsxFVaJoNOc9obV0T0HdTrHW2Z/CIODZgWML/v0CR0zPbDJc0PLBbW3Zbf9lPXaMTKFjQ2Y+c+yfwcqWp3pG1uunyN1u6ndd2eyz49ozbpi97nktiaaPcHn55V1KzKq1te3QeHPD82XM17muo965K7PD+Nmf3X6cjmfJRWPGncvXfB3hINDP5VD7LvUx1pGoedzZrXncy9U0PRYsaNvoH6KxqTbbfxxtYKAWEWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg+OAIo8goPAv8SXgLRnYw1TB8vEzMx581h9Mcm1o6V0Peu68t8xxcWHLTJXqbT/AE6/8ve/4Y+Sz5a2w5O61jr89/8Ah+Qte0eaHJex8shY2wWRSMjB/WyVnjcisx/N2uZxpmdx1DWfwscDgMfTMUOIsSTS+a8frwP0WzOSbfxTLnRxK1nqIYtxst8pc8x2oTauvS2MN972vxRltbi3kdgobWzGoWYomNNk8g8crHtDUbWX0W7RXPZR9MtVqIpruort7qdFGWdQv/RXR8nO8dS6pDO6FuBGdu1oO97uNvParv8AJbPJv44YrHuXB1vP5T6h+4PAxlbpkW57KIsBpulzcFJivvpqcmYm7eZkliiOiry2V0hptQkFF3X7Lm57Rpu4o7c5qLy+2tBK5t++odDHGvbS5D6kcCTY4pRiG1EdNXkzEF200e9qS+tY621r5w5pLQAWnkHopVjcLdaVnHkivkduVZHQPeTbgTQFk38KTKIbXMcXOJaDZIHKxEMzI+cOe1kdji97qA+ArOmP5oJSDtc1lu/+v7prXpmEcj7rZG1vFfn26rOvxB2jyHOhBcOX1yOt8rPj9sbiVQEPiL3PLHVuc3d0SsJSwfMHQlwa6w228Dm+5U2NaRNfFstzRvoUewHdZiN9syifLY3tYY91knvSlFe2P5MbiZcjy5zj1APIH3VkREe1drTPpVYXytLyHB3Nd1KK77QtaI6S4mPLM4RxAu7H/ZbfG4t8s6rDWz8qmON2l2vhTwpJK9r5WlxJ7hei4vBphjfuXnuXz75eo6h7D4S8JNYGOdH+y6Gocm+R6PpemRYzAA0cIomdtm0BooIw+oCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIND488NYnizw1laPlHY6RtwygcxSD8Lh+fX3FrT53DpzMM4rf0/lLofGfIX+P5Nc1Pr3H5j7h+FvG+j6no2tZmlazhVlYry2RoH6OHuCOQe4XkKUvgvOK3uH12uTFyMVc+Kf229f+/U/lxs8GmvcC4vid83S36XtrqWjlp33DFkOJG7fHMHe3q4Vm7T7a0xWJ3DCfJgadu8E/dTrSVFrQzwyJ5GvYHuoV8V9lmeulcRudtiMdvBFuI5PKglbUI3YEuXJsETnWOQB2+U6q1cuSIjt6Z9HNKxcfTc7yopGyx5G54Y3ca2inEda6i/hQtk84242a0efT9B+C6Zp4HBNWCOihj6iWpnndm2ypiAehWnmuzjq1OTLbSSaJtc29ttylWkzpHXYocdlq2buOGgy5XGUcODgavos6ltUr01WZMGOLjGHBp9TTfP6LOmzWGqsPlkldbGHn7LNI3O1lp6iGPmiqBAde3pwpsa6VyZi920kgdbWKxKXTIENIc9m3kA0Df2Uo9o6fXzRg+VuLQ3jaAP0Vka9I9wgllcfRv9R6NPP/SpamfTHXs81zWg7dpHBJKz6gVHPlIuw5wHBArj3TtKdMGshZH5ssgLwOCW8k+32U/GIjtjymZ6QZLyY2kxGOM8gX15WdahmsdqrH07zHN6njjm/spxUmdsZHHdRIG4HgnoPlS8dK5vCEu8xtb3OocBX4sNrzqsbUZM1aRuza6LouTllrQ14Z912uP8X95P7OPyfk/rH/d6X4R8Gk7P5X7Ls48daRqIcPLnm07mXrnhvwvHAxpdGOPhWNW19uyxMSOBgAaEVbWkBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHnX1k+l2nePsFkzJG4OsQNqDKA4c3/I+uSPY9Qubzvj68rVonVo+/wDl3/hfncnxszS0eWOfcf8AmP8A3t+RPH/098VeE9Sdjapp7iwOtsobujkHu1w6hcO2HJhnxyR29zg5/G5dPPDb+n3DlHDCZ6crCcw9OizXf5St5fSLydHcfU3vYtlqyLWhRas/cN1o+FFluDMWN5+Azr9qWImZnSnJfwjcut0zwPmTESZY/h2HkN6vr7dvzUZtr05mbn1jqvbs9E0vTdOxv4aLT8cOdwXPFuefcnus1v8AUuRmyXyTuZWRpL8DIdmaRkMhne2idgsC+nPULPjr+FX5+Uas9A8CyzyaaDkvY+XkPc1tAm+wHRR1raNpidNxmybmkjo7sVy+TaPr7bOKummypCI9zqANrm3/AC3aV7002TMSC/ih7quJ2261j01E8rZPVtPPT5WatmK66UMskRh4aCOhocK2IlOuvTWSHfbdhBJ/L7KW/pNi/cCdrGXXbm1PuRBJO6txcGnqABVJs0reaao9AeCeK+UjXuWUTrY0vMjSd1FxPI/L/VT8Y9seW50ryuymMDjGGtcPxX/T7qXjaK7k3WZ9pDMXNFhoa0W4+/tSlMIxCJkkg9d7O1E8/NJqfonU9I3yxMfT+GEbrHP/AEKcV1LG9wqvk3M3OYQO19T8j2Uq0Z3r7VJJmGURMc2PdxZJofK28PGvk6rDVzcmlI3aUuFhZWY8hjHNYT+a62D4v7yf2cnN8nPqn93a+GvB8kr2udGTddV18WGtI1WNORlz2tO7Tt6v4V8GtYGkxD9FfEaalsj0nRtDhxmCmAV8Iom228jjawUAiLNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFLWdOx9Sw3Y88McgPRr2gg/qqORh/Vr/NZiyTjtuJeTa/9PfB8+Q/+J0eGOW+dtsC4F/CszW3Uu3i+Q5MR1bcNJJ4A8G4210GiYgcBRLzvtVZL011Oln/Xcm292lHJhafhHZjY0UAA5EUVAD9FqWzRvUSxvJfu0qEshJDWtbFHyA4ttxKlXJNiaRX33KjkBkMgo75T3d0AVvlqf5o6mYUs+ZzWW0249x1Vm5iNkREt79K9cY7KyNGnpjzc0N8bq/EPv0P6p5T4ztG9e9w7XML3NdR9a4mfczLcxxEa/DS5Uh5Dm39ui0be+29SPw1WVLxy2rN/isKXU/S+tZ21GXI2OtxJs+kcUs1jTYisy1U8jnEtawu57O4/4VkbW9R7Vv5pAd5e5vUgEUpTE6YiYhC6aSOtvB3cNItK/wAidfavIWuA4dvuiAK5UogjpEfxFpLWNPU0VnxZ3qFaVw3O2sa7uON3Pa/9lKKm/wAmT58sm7Ilf+EAgAAcd1dMzadyrrqvUKbnMiaWNjffS3mz+ijEaWTMyhdJUgPA3Agk1YU2OvaKV7Wlxe6x/SObK2cPGvltqsNfNyKYq7tOmDcTO1B4a0OjiPYdSu7x/jqUjd+5cLkfI3v1TqHU+H/B0krml0ZJPWwulWkR1Dm3yTM7mXpvhfwPt2l0X7K2Ia1sj0vQfC8OO1pMY/RSUWu6vEw44WgBoRWtgAdEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQazWdIh1Bu4UyUDh1cH7rS5XDrn7+12LNOP/RxuqaJNjSEy4pIu7Atp/NcLNwbY53arfpyIt6lz2owMdLJIxtDtfH5LXyUrMzZdS0xEQ0eowyFwpn5+yqteZ6qsrEe5aDODccvkf1/UlX4sdp7iErWjXtyet6y6JpbBjl7x0ceAFs/pX+0Nw452oa1FqUWoQZMkM8Mgkjczja4dPupfpTMds+T3nwb4sg8T6QZgxsObE0DJgv8J/zN/wDU9vbouLzcF8U7+pbWC0WWcx1WS4g91zbOhWGmy3RjqB0u7WK1bFdtVkyMLXMI/O/9FOI+l8RPtQyCwnaHNa6+hCs0l2qSua17RHf4ed3AJ+6nEa9MW79sH5JjZwz+YDtLgb/O1ZEozCq3Y+LzZHEc9Sdov/VK16JlXc2R9VJE0G/xGlKINwrukmNtZGzaejt1cf3WawzMx7lXlmfZG1paRVO5r7fCn4TMkTCFxllcdvHFcCv1V2PBbJOqwrvnpjjdpWMTSsib0xsdRrml1+P8V95P7OTyPlPrH/d0ui+DZZnNc+Nzie5C7OPFWkarGnFy5pvO7Tt6H4c8CVtLov2V0Va9sr0TQ/CcEAaTGL+yk15yOrwtNhgaKaEQmdr7WtaKARh9QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHwiwVgajVdNxZ2nfjROPvsC18nHx3/AIqwlGS9fUuO1XQW0QyOgtb/AKDFE+l8cm35cjqvht7y70FXRhiOoSjLty+p+EnkkiM/ooWwra5XP5nhV7b/AJf7Kr9NZGVQh0jO07Lbl4UkuPOz8L2Gj9vkfChkw1vXxtG4Trl1O4dZh+JXSx+XqUDoJenmxC4z929R+Vrhcn4aY7wz/R0cHPj1dLkZMGRtMUjHB3+V4/subfi5adWrLqYc2O38NoVJWMDdr2t69T1KhFPpseW+4Up4mEueWAOaTQ7UrP02fPpQmxWyNDgy3XfJ6qX6R+orz4c5tsdNbXZ3KnGKfR+rWO5UpcQxW9zmSk8cOsAfZSjFMdsTm316QRxSbg5jAPY3f7K3Hx8l56hXfPjpHcs49PypiA1jjfUlb2L4zLb301MnyWKvrttMPwtl5LgXMIHsF0sXxlKzu3bnZfk7T1Xp1ei+BHvLS6In8l0qYq1jURpzMnIm07tLu9D8CMZtLov2VsVa9srtdK8L48AH8scfCkpm8y6HF0+GEABoRHa41oaOAjD6gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIPjmh3VBXlxI39QFjQqzaTA/qwJpnajkeH8d4/AP0WPFnylqc3wnC8GmD9FCaJRklz+f4Mabpg/RVzjTjK0mX4LNmo/2UJonGVr5fBTyf8A4v2WP02f1UY8GzN/CHt96Krtx6W/ihZXk3r6l9PhHK4NE18Kqfj8E/5V8fIZo/zMJPB+S49HD7cLMcDFH+Vn/wDUM0/5kL/BErzyxxU68PFHqqM83JP+ZJD4Ac4UYf2VtePSPUK55Np9y2mF9PhxcX7K6KaVzm23+neA4m1ujH6KcVVTldLp3hLGhAuNv6KUQrnJLfYmj48IFMH6KSG5X44I2DhoRhKAB0QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB8LQeyCN8DHdQFjQgfgRO/pCxoRnTIT/SFjxZ2+f+Lh/wAoTxNn/i4P8oWfE2f+Kg/yD9E8Wdvo0uAf0BNMeUpG6fA3+gLOjcpWYsTejQs6YStjYOgQZUEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB//Z" const chat = new ChatOpenAI({ model: "gpt-4-vision-preview", maxTokens: 1024, }); const dataUrlMessage = new HumanMessage({ content: [ { type: "text", text: "What does this image contain?", }, { type: "image_url", image_url: { url: `data:image/jpeg;base64,${imageBase64}`, }, }, ], }); await chain.invoke({ input: [ dataUrlMessage, ], });
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/step_back.ipynb
import { ChatPromptTemplate, FewShotChatMessagePromptTemplate, } from "npm:langchain@0.0.177/prompts";const examples = [ { input: "Could the members of The Police perform lawful arrests?", output: "what can the members of The Police do?", }, { input: "Jan Sindel's was born in what country?", output: "what is Jan Sindel's personal history?", }, ]; const examplePrompt = ChatPromptTemplate.fromMessages([ ["human", "{input}"], ["ai", "{output}"], ]); const fewShotPrompt = new FewShotChatMessagePromptTemplate({ examplePrompt, examples, inputVariables: [], // no input variables });const formattedFewShot = await fewShotPrompt.format({});const prompt = ChatPromptTemplate.fromMessages([ [ "system", `You are an expert at world knowledge. Your task is to step back and paraphrase a question to a more generic step-back question, which is easier to answer. Here are a few examples:`, ], formattedFewShot, ["user", "{question}"], ]);import { ChatOpenAI } from "npm:langchain@0.0.177/chat_models/openai"; import { StringOutputParser } from "npm:langchain@0.0.177/schema/output_parser"; import { RunnableSequence } from "npm:langchain@0.0.177/schema/runnable";// Deno.env.set("OPENAI_API_KEY", ""); const model = new ChatOpenAI({ temperature: 0 }); const stringOutputParser = new StringOutputParser();const questionGenerator = RunnableSequence.from([ prompt, model, stringOutputParser, ]);const question = "was chatgpt around while trump was president?";await questionGenerator.invoke({ question })import { SerpAPI } from "npm:langchain@0.0.177/tools";const search = new SerpAPI(Deno.env.get("SERPAPI_API_KEY"), { num: "4", // Number of results });const retriever = async (query: string) => search.call(query);import { pull } from "npm:langchain@0.0.177/hub";// const responsePromptTemplate = `You are an expert of world knowledge. I am going to ask you a question. Your response should be comprehensive and not contradicted with the following context if they are relevant. Otherwise, ignore them if they are not relevant. // {normal_context} // {step_back_context} // Original Question: {question} // Answer:`; // const responsePrompt = ChatPromptTemplate.fromTemplate(responsePromptTemplate) const responsePrompt = await pull("langchain-ai/stepback-answer");const chain = RunnableSequence.from([ { normal_context: (i: { question: string }) => retriever(i.question), step_back_context: questionGenerator.pipe(retriever), question: (i: { question: string }) => i.question, }, responsePrompt, model, stringOutputParser, ]);await chain.invoke({ question, });
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/function_calling_fireworks.ipynb
import { ChatFireworks } from "@langchain/community/chat_models/fireworks";/** Define the chat model */ const llm = new ChatFireworks({ model: "accounts/fireworks/models/firefunction-v1", temperature: 0, });import { z } from "zod"; import { StructuredTool } from "@langchain/core/tools"; import { formatToOpenAITool } from "@langchain/openai"; class SearchAnswer extends StructuredTool { name = "search_answer"; description = "Search online for an answer only when you are not confident with the answer."; schema = z.object({ query: z.string().describe("Query to use for the search engine."), }); constructor() { super(); } _call(input: z.infer<typeof this["schema"]>): Promise<string> { return Promise.resolve(JSON.stringify(input, null, 2)); } } class GetStockPrice extends StructuredTool { name = "get_stock_price"; description = "Get the stock price for a company."; schema = z.object({ ticker: z.string().describe("Ticker for the company we are interested in."), }); constructor() { super(); } _call(input: z.infer<typeof this["schema"]>): Promise<string> { return Promise.resolve(JSON.stringify(input, null, 2)); } } const searchTool = formatToOpenAITool(new SearchAnswer()); const stockTool = formatToOpenAITool(new GetStockPrice()); const tools1 = [searchTool, stockTool];const llmWithTool1 = llm.bind({ tools: tools1, }); const exampleQ = `What's Yosemite?`; await llmWithTool1.invoke(exampleQ);const llmWithTool1 = llm.bind({ tools: tools1, }); const exampleQ = `Which team won the superbowl in 2024?`; await llmWithTool1.invoke(exampleQ);const llmWithTool1 = llm.bind({ tools: tools1, }); const exampleQ = `What is the price of Nvidia shares now?`; await llmWithTool1.invoke(exampleQ);function _arrayBufferToBase64(buffer) { let binary = ''; let bytes = new Uint8Array(buffer); let len = bytes.byteLength; for (let i = 0; i < len; i++) { binary += String.fromCharCode( bytes[ i ] ); } return window.btoa(binary); } class GenerateImage extends StructuredTool { name = "generate_image"; description = "Pass an image description to an AI to generate an image."; schema = z.object({ detailed_description: z.string().describe("A very detailed description for the image."), }); constructor() { super(); } async _call(input: z.infer<typeof this["schema"]>): Promise<string> { const response = await fetch( "https://api.fireworks.ai/inference/v1/image_generation/accounts/fireworks/models/stable-diffusion-xl-1024-v1-0", { headers: { "Authorization": `Bearer ${process.env.FIREWORKS_API_KEY}`, "Accept": "image/jpeg", "Content-Type": "application/json", }, method: "POST", body: JSON.stringify({ prompt: input.detailed_description }) } ); // Buffer is not available in Deno, otherwise this would be easier const buffer = await response.arrayBuffer(); return _arrayBufferToBase64(buffer); } }import { JsonOutputToolsParser } from "langchain/output_parsers"; import { RunnableSequence } from "@langchain/core/runnables"; const generateImageTool = new GenerateImage(); const llmWithTool1 = llm.bind({ tools: [formatToOpenAITool(generateImageTool)], tool_choice: { type: "function", name: "generate_image", } }); const exampleQ = `Give me an image with a bird with fireworks in the background?`; // We can pipe the called tool into a chain to generate an image with the result const toolChain = RunnableSequence.from([ llmWithTool1, new JsonOutputToolsParser(), (toolInvocation) => toolInvocation[0].args, generateImageTool, ]); const imageBase64 = await toolChain.invoke(exampleQ); console.log("Generated image!");{ [Symbol.for("Jupyter.display")]() { return { "image/jpeg": imageBase64 } } }
0
lc_public_repos/langchainjs
lc_public_repos/langchainjs/cookbook/rewrite.ipynb
// Deno.env.set("OPENAI_API_KEY", ""); // Deno.env.set("TAVILY_API_KEY", ""); import { PromptTemplate } from "npm:langchain@0.0.172/prompts"; import { ChatOpenAI } from "npm:langchain@0.0.172/chat_models/openai"; import { StringOutputParser } from "npm:langchain@0.0.172/schema/output_parser"; import { RunnableSequence, RunnablePassthrough } from "npm:langchain@0.0.172/schema/runnable"; import { TavilySearchAPIRetriever } from "npm:langchain@0.0.172/retrievers/tavily_search_api"; import type { Document } from "npm:langchain@0.0.172/schema/document";const template = `Answer the users question based only on the following context: <context> {context} </context> Question: {question}` const prompt = PromptTemplate.fromTemplate(template); const model = new ChatOpenAI({ temperature: 0, openAIApiKey: Deno.env.get("OPENAI_API_KEY"), }) const retriever = new TavilySearchAPIRetriever({ k: 3, apiKey: Deno.env.get("TAVILY_API_KEY"), }); const formatDocs = (documents: Document[]) => documents.map((doc) => doc.pageContent).join("\n");const chain = RunnableSequence.from([ { context: retriever.pipe(formatDocs), question: new RunnablePassthrough() }, prompt, model, new StringOutputParser() ]);const simpleQuery = "what is langchain?"; await chain.invoke(simpleQuery);const distractedQuery = "man that sam bankman fried trial was crazy! what is langchain?"; await chain.invoke(distractedQuery);await retriever.invoke(distractedQuery);const rewriteTemplate = `Provide a better search query for \ web search engine to answer the given question, end \ the queries with ’**’. Question: \ {x} Answer:`; const rewritePrompt = PromptTemplate.fromTemplate(rewriteTemplate);// Parser to remove the `**` const _parse = (text) => text.replace("**", "");// rewriter = rewrite_prompt | ChatOpenAI(temperature=0) | StrOutputParser() | _parse const rewriter = RunnableSequence.from([ rewritePrompt, new ChatOpenAI({ temperature: 0 }), new StringOutputParser(), _parse ]);await rewriter.invoke({"x": distractedQuery})const rewriteRetrieveReadChain = RunnableSequence.from([ { context: RunnableSequence.from([ { x: new RunnablePassthrough() }, rewriter, retriever, formatDocs, ]), question: new RunnablePassthrough() }, prompt, model, new StringOutputParser() ]);await rewriteRetrieveReadChain.invoke(distractedQuery);
0
lc_public_repos
lc_public_repos/langsmith-sdk/LICENSE
MIT License Copyright (c) 2023 LangChain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
lc_public_repos
lc_public_repos/langsmith-sdk/README.md
# LangSmith Client SDKs [![Release Notes](https://img.shields.io/github/release/langchain-ai/langsmith-sdk?logo=python)](https://github.com/langchain-ai/langsmith-sdk/releases) [![Python Downloads](https://static.pepy.tech/badge/langsmith/month)](https://pepy.tech/project/langsmith) ![NPM Version](https://img.shields.io/npm/v/langsmith?logo=npm) [![JS Downloads](https://img.shields.io/npm/dm/langsmith)](https://www.npmjs.com/package/langsmith) This repository contains the Python and Javascript SDK's for interacting with the [LangSmith platform](https://smith.langchain.com/). Please see [LangSmith Documentation](https://docs.smith.langchain.com/) for documentation about using the LangSmith platform and the client SDK. LangSmith helps your team debug, evaluate, and monitor your language models and intelligent agents. It works with any LLM Application, including a native integration with the [LangChain Python](https://github.com/langchain-ai/langchain) and [LangChain JS](https://github.com/langchain-ai/langchainjs) open source libraries. LangSmith is developed and maintained by [LangChain](https://langchain.com/), the company behind the LangChain framework. ## Quick Start To get started with the Python SDK, [install the package](https://pypi.org/project/langsmith/), then follow the instructions in the [Python README](python/README.md). ```bash pip install -U langsmith export LANGCHAIN_TRACING_V2=true export LANGCHAIN_API_KEY=ls_... ``` Then start tracing your app: ```python import openai from langsmith import traceable from langsmith.wrappers import wrap_openai client = wrap_openai(openai.Client()) client.chat.completions.create( messages=[{"role": "user", "content": "Hello, world"}], model="gpt-3.5-turbo" ) ``` To get started with the JavaScript / TypeScript SDK, [install the package](https://www.npmjs.com/package/langsmith), then follow the instructions in the [JS README](js/README.md). ```bash yarn add langsmith export LANGCHAIN_TRACING_V2=true export LANGCHAIN_API_KEY=ls_... ``` Then start tracing your app! ```javascript import { OpenAI } from "openai"; import { traceable } from "langsmith/traceable"; import { wrapOpenAI } from "langsmith/wrappers"; const client = wrapOpenAI(new OpenAI()); await client.chat.completions.create({ model: "gpt-3.5-turbo", messages: [{ content: "Hi there!", role: "user" }], }); ``` ``` { id: 'chatcmpl-8sOWEOYVyehDlyPcBiaDtTxWvr9v6', object: 'chat.completion', created: 1707974654, model: 'gpt-3.5-turbo-0613', choices: [ { index: 0, message: { role: 'assistant', content: 'Hello! How can I help you today?' }, logprobs: null, finish_reason: 'stop' } ], usage: { prompt_tokens: 10, completion_tokens: 9, total_tokens: 19 }, system_fingerprint: null } ``` ## Cookbook For tutorials on how to get more value out of LangSmith, check out the [Langsmith Cookbook](https://github.com/langchain-ai/langsmith-cookbook/tree/main) repo. ## Documentation To learn more about the LangSmith platform, check out the [docs](https://docs.smith.langchain.com/docs/)
0
lc_public_repos
lc_public_repos/langsmith-sdk/.readthedocs.yml
# Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 formats: - pdf # Set the version of Python and other tools you might need build: os: ubuntu-22.04 tools: python: "3.11" commands: - mkdir -p $READTHEDOCS_OUTPUT - echo "Building docs" - pip install -U uv - uv venv - . .venv/bin/activate - uv pip install -r python/docs/requirements.txt - . .venv/bin/activate && cd python/docs && make clobber generate-api-rst html && cd ../.. - cp python/docs/_build/html/reference.html python/docs/_build/html/index.html - cp -r python/docs/_build/html $READTHEDOCS_OUTPUT # Build documentation in the docs/ directory with Sphinx sphinx: configuration: python/docs/conf.py # If using Sphinx, optionally build your docs in additional formats such as PDF # formats: # - pdf # Optionally declare the Python requirements required to build your docs python: install: - requirements: python/docs/requirements.txt
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/rust/Cargo.toml
[workspace] members = [ "crates/langsmith-pyo3", "crates/langsmith-tracing-client", ] resolver = "2" [workspace.lints] [workspace.dependencies] chrono = "0.4.38" flate2 = "1.0.34" futures = "0.3.31" rayon = "1.10.0" serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" tempfile = "3.13.0" thiserror = "2.0" tokio = { version = "1", features = ["full"] } tokio-util = "0.7.12" ureq = "2.10.1" uuid = { version = "1.11.0", features = ["v4"] } # Use rustls instead of OpenSSL, because OpenSSL is a nightmare when compiling across platforms. # OpenSSL is a default feature, so we have to disable all default features, then re-add # everything except `default-tls` which pulls in OpenSSL: # https://github.com/seanmonstar/reqwest/blob/e2d4b14c695acaebe531af7ce4712e182278f38a/Cargo.toml#L30 reqwest = { version = "0.12.8", default-features = false, features = ["rustls-tls", "charset", "http2", "macos-system-configuration", "multipart", "stream", "blocking"] }
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/rust/rustfmt.toml
# Rust code formatting; see https://rust-lang.github.io/rustfmt use_small_heuristics = "Max"
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/rust/Cargo.lock
# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "addr2line" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] name = "adler2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] [[package]] name = "anes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "assert-json-diff" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" dependencies = [ "serde", "serde_json", ] [[package]] name = "associative-cache" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b993cd767a2bc7307dd87622311ca22c44329cc7a21366206bfa0896827b2bad" [[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", "windows-targets 0.52.6", ] [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytecount" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "castaway" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" dependencies = [ "rustversion", ] [[package]] name = "cc" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "shlex", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", "windows-targets 0.52.6", ] [[package]] name = "ciborium" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", "serde", ] [[package]] name = "ciborium-io" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", ] [[package]] name = "clap" version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" dependencies = [ "anstyle", "clap_lex", ] [[package]] name = "clap_lex" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "colored" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "compact_str" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" dependencies = [ "castaway", "cfg-if", "itoa", "rustversion", "ryu", "serde", "static_assertions", ] [[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crc32fast" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "criterion" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", "cast", "ciborium", "clap", "criterion-plot", "futures", "is-terminal", "itertools", "num-traits", "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", "serde_derive", "serde_json", "tinytemplate", "tokio", "walkdir", ] [[package]] name = "criterion-plot" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", "itertools", ] [[package]] name = "crossbeam-deque" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "displaydoc" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys 0.59.0", ] [[package]] name = "fastrand" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "flate2" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", ] [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", "futures-executor", "futures-io", "futures-sink", "futures-task", "futures-util", ] [[package]] name = "futures-channel" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", ] [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-io" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "futures-sink" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", "futures-io", "futures-macro", "futures-sink", "futures-task", "memchr", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", "libc", "wasi", "wasm-bindgen", ] [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", "http", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", ] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "http" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", "itoa", ] [[package]] name = "http-body" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", ] [[package]] name = "http-body-util" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", "http", "http-body", "pin-project-lite", ] [[package]] name = "httparse" version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", "smallvec", "tokio", "want", ] [[package]] name = "hyper-rustls" version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", "hyper", "hyper-util", "rustls", "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", "webpki-roots", ] [[package]] name = "hyper-util" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", "http", "http-body", "hyper", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "windows-core", ] [[package]] name = "iana-time-zone-haiku" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "icu_collections" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ "displaydoc", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locid" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_locid_transform" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ "displaydoc", "icu_locid", "icu_locid_transform_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_locid_transform_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] name = "icu_normalizer" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "utf16_iter", "utf8_iter", "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] name = "icu_properties" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ "displaydoc", "icu_collections", "icu_locid_transform", "icu_properties_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_properties_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] name = "icu_provider" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ "displaydoc", "icu_locid", "icu_provider_macros", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_provider_macros" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "idna" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ "idna_adapter", "smallvec", "utf8_iter", ] [[package]] name = "idna_adapter" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "indexmap" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "indoc" version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "ipnet" version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ "hermit-abi", "libc", "windows-sys 0.52.0", ] [[package]] name = "itertools" version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "itoap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" [[package]] name = "jiff" version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db69f08d4fb10524cacdb074c10b296299d71274ddbc830a8ee65666867002e9" [[package]] name = "js-sys" version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ "once_cell", "wasm-bindgen", ] [[package]] name = "langsmith-pyo3" version = "0.1.0-rc2" dependencies = [ "langsmith-tracing-client", "orjson", "pyo3", "pyo3-ffi", "serde", "serde_json", ] [[package]] name = "langsmith-tracing-client" version = "0.1.0" dependencies = [ "chrono", "criterion", "flate2", "futures", "mockito", "multer", "rayon", "reqwest", "serde", "serde_json", "tempfile", "thiserror", "tokio", "tokio-util", "ureq", "uuid", ] [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "linux-raw-sys" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", ] [[package]] name = "miniz_oxide" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ "adler2", ] [[package]] name = "mio" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi", "windows-sys 0.52.0", ] [[package]] name = "mockito" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "652cd6d169a36eaf9d1e6bce1a221130439a966d7f27858af66a33a66e9c4ee2" dependencies = [ "assert-json-diff", "bytes", "colored", "futures-util", "http", "http-body", "http-body-util", "hyper", "hyper-util", "log", "rand", "regex", "serde_json", "serde_urlencoded", "similar", "tokio", ] [[package]] name = "multer" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ "bytes", "encoding_rs", "futures-util", "http", "httparse", "memchr", "mime", "spin", "version_check", ] [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "object" version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "orjson" version = "3.10.11" dependencies = [ "associative-cache", "bytecount", "cc", "compact_str", "encoding_rs", "half", "itoa", "itoap", "jiff", "once_cell", "pyo3-build-config", "pyo3-ffi", "ryu", "serde", "serde_json", "simdutf8", "smallvec", "uuid", "version_check", "xxhash-rust", ] [[package]] name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", "windows-targets 0.52.6", ] [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "plotters" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", "plotters-svg", "wasm-bindgen", "web-sys", ] [[package]] name = "plotters-backend" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] [[package]] name = "portable-atomic" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "ppv-lite86" version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ "zerocopy", ] [[package]] name = "proc-macro2" version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" version = "0.23.0-dev" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", "unindent", ] [[package]] name = "pyo3-build-config" version = "0.23.0-dev" dependencies = [ "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" version = "0.23.0-dev" dependencies = [ "libc", "pyo3-build-config", ] [[package]] name = "pyo3-macros" version = "0.23.0-dev" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", "syn", ] [[package]] name = "pyo3-macros-backend" version = "0.23.0-dev" dependencies = [ "heck", "proc-macro2", "pyo3-build-config", "quote", "syn", ] [[package]] name = "quinn" version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", "rustls", "socket2", "thiserror", "tokio", "tracing", ] [[package]] name = "quinn-proto" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", "getrandom", "rand", "ring", "rustc-hash", "rustls", "rustls-pki-types", "slab", "thiserror", "tinyvec", "tracing", "web-time", ] [[package]] name = "quinn-udp" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2", "tracing", "windows-sys 0.59.0", ] [[package]] name = "quote" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rayon" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", ] [[package]] name = "rayon-core" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] [[package]] name = "redox_syscall" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64", "bytes", "encoding_rs", "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", "hyper-util", "ipnet", "js-sys", "log", "mime", "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", "quinn", "rustls", "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", "webpki-roots", "windows-registry", ] [[package]] name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", "getrandom", "libc", "spin", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustix" version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", "ring", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-pemfile" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ "rustls-pki-types", ] [[package]] name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" dependencies = [ "web-time", ] [[package]] name = "rustls-webpki" version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", "ryu", "serde", ] [[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", "serde", ] [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "simdutf8" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "target-lexicon" version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", "once_cell", "rustix", "windows-sys 0.59.0", ] [[package]] name = "thiserror" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tinystr" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tinytemplate" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", ] [[package]] name = "tinyvec" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "tower-service" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicase" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-ident" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unindent" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ "base64", "flate2", "log", "once_cell", "rustls", "rustls-pki-types", "url", "webpki-roots", ] [[package]] name = "url" version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf16_iter" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", ] [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", ] [[package]] name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ "try-lock", ] [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wasm-streams" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", ] [[package]] name = "web-sys" version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "web-time" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "webpki-roots" version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] [[package]] name = "winapi-util" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result", "windows-strings", "windows-targets 0.52.6", ] [[package]] name = "windows-result" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", "windows-targets 0.52.6", ] [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets 0.48.5", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", "windows_aarch64_msvc 0.48.5", "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "write16" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] name = "writeable" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "xxhash-rust" version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "yoke" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zerofrom" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zerovec" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", "syn", ]
0
lc_public_repos/langsmith-sdk/rust/crates
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/Cargo.toml
[package] name = "langsmith-pyo3" version = "0.1.0-rc2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] # The name of the native library. This is the name which will be used in Python to import the # library (i.e. `from langsmith_pyo3 import *`). If you change this, you must also change # the name of the top `#[pymodule]` in `src/lib.rs`. name = "langsmith_pyo3" # "cdylib" is necessary to produce a shared library for Python to import from. # "rlib" is what Rust uses to use this crate as a library, for example in tests, benchmarks, # examples, or Rust binaries built using this library. # # Downstream *Rust* code (including any code in `bin/`, `examples/`, and `tests/`) will not be able # to `use langsmith_pyo3;` unless the "rlib" or "lib" crate type is also included. crate-type = ["cdylib", "rlib"] [dependencies] pyo3 = { path = "../../../vendor/pyo3" } pyo3-ffi = { path = "../../../vendor/pyo3/pyo3-ffi" } serde = { workspace = true } serde_json = { workspace = true } langsmith-tracing-client = { path = "../langsmith-tracing-client" } orjson = { path = "../../../vendor/orjson", default-features = false } [features] # The `extension-module` feature is necessary to produce a "manylinux" portable Python library. # Otherwise PyO3 will link to its own Python interpreter and run our code inside it, # which will make the library only work with *that specific* Python build and no other. # Not just that *Python version* but also glibc-vs-musl, etc. # More info: # - https://pyo3.rs/v0.22.5/building-and-distribution#the-extension-module-feature # - https://peps.python.org/pep-0513/ # # However, it makes `cargo test` fail with linker errors since Python symbols are missing, # since the test binary isn't run as part of a Python binary: # https://pyo3.rs/v0.13.2/faq#i-cant-run-cargo-test-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror # # PyO3's recommended workaround is to run tests with `--no-default-features`. extension-module = ["pyo3/extension-module", "pyo3-ffi/extension-module", "orjson/extension-module"] default = ["extension-module"]
0
lc_public_repos/langsmith-sdk/rust/crates
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/README.md
# langsmith-pyo3 Python bindings for LangSmith internals. ## Development Requires a recent Rust build. `rustup upgrade stable` should do it. Relies on `maturin`, `uvx`, and `cargo-nextest`. To bootstrap, run: ``` cargo install --locked cargo-nextest uv venv --seed source .venv/bin/activate pip install patchelf ``` To develop, run `uvx maturin develop` which will build and install the Rust code directly into the current virtualenv. To build wheels, run `uvx maturin build`. To make performance-optimized builds, append `--release` to either command. To run install these bindings into another virtualenv (e.g. to run benchmarks), activate that virtualenv, then `cd` to this directory and run `uvx maturin develop --release`. When that command completes, the virtualenv will have an optimized build of `langsmith-pyo3` installed. ### Testing Do not run `cargo test`, *IT WILL NOT WORK*. You will get an inscrutable linker error like `undefined symbol: _Py_CheckFunctionResult` or `linker command failed with exit code 1`. Instead, run: `cargo nextest run --no-default-features` TL;DR on why: - This package assumes it's compiled into a Python library, but Rust tests don't run a Python environment. That won't work. - The `--no-default-features` flag is configured to include Python into the built code, which Rust tests will then run. (Full details [here](https://pyo3.rs/v0.13.2/faq#i-cant-run-cargo-test-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror).) - Rust tests run in parallel, but Python and `orjson` assume they own the entire process. That won't work. - `cargo nextest` lets us run each test in its own process, satisfying Python's and `orjson`'s assumptions.
0
lc_public_repos/langsmith-sdk/rust/crates
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/pyproject.toml
[build-system] requires = ["maturin>=1.7,<2.0"] build-backend = "maturin" [project] name = "langsmith-pyo3" requires-python = ">=3.9" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] dynamic = ["version"] [tool.maturin] features = ["pyo3/extension-module"]
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/.cargo/config.toml
# Required flags to enable building langsmith_pyo3 on macOS: # https://pyo3.rs/v0.23.1/building-and-distribution#macos [target.aarch64-apple-darwin] rustflags = [ "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ]
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/test_infra.rs
use std::sync::Mutex; use pyo3::{PyResult, Python}; // Python assumes it's the "only Python in the process", // so embedding multiple Python interpreters in the same process will fail // with obscure and difficult-to-debug errors. // // By default, `cargo test` runs tests on multiple threads. // If multiple threads want to run a Python-related test, // we have to make sure they don't attempt to initialize // multiple Python interpreters concurrently. // // We use this mutex to coordinate creating Python interpreters. static PYTHON_INTERPRETER: Mutex<()> = Mutex::new(()); pub(crate) fn with_python_interpreter<F>(inner: F) -> Result<(), String> where F: for<'py> FnOnce(Python<'py>) -> PyResult<()>, { let lock = PYTHON_INTERPRETER.lock().expect("lock was poisoned"); // SAFETY: // - We have acquired the interpreter mutex. // No other Python interpreters can be in existence. // - We do not return any Python-owned data, since we turn the `PyResult<()>`'s error case // into a Rust string. let outcome = unsafe { pyo3::with_embedded_python_interpreter(move |py| { std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| -> Result<(), String> { let outcome = inner(py); outcome.map_err(|e| e.to_string()) })) }) }; drop(lock); match outcome { Ok(r) => r, Err(panicked) => { // Running the closure caused a panic, // so resume panicking now that we've cleaned up Python. std::panic::resume_unwind(panicked) } } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/lib.rs
#![allow(deprecated)] use pyo3::{pymodule, types::PyModule, Bound, PyResult, Python}; mod blocking_tracing_client; mod errors; mod py_run; mod serialization; #[pymodule] fn langsmith_pyo3(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { // Initialize orjson internal data structures. orjson::init_typerefs(); blocking_tracing_client::register(py, m)?; errors::register(py, m)?; Ok(()) } #[cfg(test)] pub(crate) mod test_infra;
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/blocking_tracing_client.rs
use std::{sync::Arc, time::Duration}; use pyo3::prelude::*; use langsmith_tracing_client::client::blocking::TracingClient as RustTracingClient; pub(super) fn register(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::<BlockingTracingClient>()?; Ok(()) } // `frozen` here means "immutable from Python". Rust-side mutation is allowed. // Since this type is also `Sync`, that means we can operate on `BlockingTracingClient` values // without holding the Python GIL. #[pyclass(frozen)] pub struct BlockingTracingClient { client: Arc<RustTracingClient>, } #[pymethods] impl BlockingTracingClient { #[new] pub fn new( endpoint: String, api_key: String, queue_capacity: usize, batch_size: usize, batch_timeout_millis: u64, worker_threads: usize, ) -> PyResult<Self> { let config = langsmith_tracing_client::client::blocking::ClientConfig { endpoint, api_key, queue_capacity, batch_size, // TODO: check if this is fine batch_timeout: Duration::from_millis(batch_timeout_millis), headers: None, // TODO: support custom headers num_worker_threads: worker_threads, }; let client = RustTracingClient::new(config) .map_err(|e| Python::with_gil(|py| into_py_err(py, e)))?; Ok(Self { client: Arc::from(client) }) } // N.B.: We use `Py<Self>` so that we don't hold the GIL while running this method. // `slf.get()` below is only valid if the `Self` type is `Sync` and `pyclass(frozen)`, // which is enforced at compile-time. pub fn create_run( slf: &Bound<'_, Self>, run: super::py_run::RunCreateExtended, ) -> PyResult<()> { let unpacked = slf.get(); Python::allow_threads(slf.py(), || unpacked.client.submit_run_create(run.into_inner())) .map_err(|e| into_py_err(slf.py(), e)) } pub fn drain(slf: &Bound<'_, Self>) -> PyResult<()> { let unpacked = slf.get(); Python::allow_threads(slf.py(), || unpacked.client.drain()) .map_err(|e| into_py_err(slf.py(), e)) } } fn into_py_err(py: Python<'_>, e: langsmith_tracing_client::client::TracingClientError) -> PyErr { crate::errors::TracingClientError::new_err(format!("{e}").into_py(py)) }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/py_run.rs
use std::ffi::CStr; use langsmith_tracing_client::client::{Attachment, RunIO, TimeValue}; use pyo3::{ types::{ PyAnyMethods as _, PyDateTime, PyMapping, PyMappingMethods, PySequence, PyString, PyTuple, }, Bound, FromPyObject, PyAny, PyResult, }; use crate::{errors::TracingClientError, serialization}; #[derive(Debug)] pub struct RunCreateExtended(langsmith_tracing_client::client::RunCreateExtended); impl RunCreateExtended { #[inline] pub(crate) fn into_inner(self) -> langsmith_tracing_client::client::RunCreateExtended { self.0 } } impl FromPyObject<'_> for RunCreateExtended { fn extract_bound(value: &Bound<'_, PyAny>) -> PyResult<Self> { let run_create = value.extract::<RunCreate>()?.into_inner(); let attachments = { if let Ok(attachments_value) = value.get_item(pyo3::intern!(value.py(), "attachments")) { extract_attachments(&attachments_value)? } else { None } }; let io = RunIO { inputs: serialize_optional_dict_value(value, pyo3::intern!(value.py(), "inputs"))?, outputs: serialize_optional_dict_value(value, pyo3::intern!(value.py(), "outputs"))?, }; Ok(Self(langsmith_tracing_client::client::RunCreateExtended { run_create, io, attachments, })) } } fn extract_attachments(value: &Bound<'_, PyAny>) -> PyResult<Option<Vec<Attachment>>> { if value.is_none() { return Ok(None); } let mapping = value.downcast::<PyMapping>()?; let size = mapping.len()?; if size == 0 { return Ok(None); } let mut attachments = Vec::with_capacity(size); for result in mapping.items()?.iter()? { let key_value_pair = result?; let key_item = key_value_pair.get_item(0)?; let key = key_item.extract::<&str>()?; // Each value in the attachments dict is a (mime_type, bytes) tuple. let value = key_value_pair.get_item(1)?; let value_tuple = value.downcast_exact::<PyTuple>()?; let mime_type_value = value_tuple.get_item(0)?; let bytes_value = value_tuple.get_item(1)?; attachments.push(Attachment { // TODO: It's unclear whether the key in the attachments dict is // the `filename`` or the `ref_name`, and where the other one is coming from. ref_name: key.to_string(), filename: key.to_string(), data: bytes_value.extract()?, content_type: mime_type_value.extract()?, }); } Ok(Some(attachments)) } #[derive(Debug)] pub(crate) struct RunCreate(langsmith_tracing_client::client::RunCreate); impl RunCreate { #[inline] pub(crate) fn into_inner(self) -> langsmith_tracing_client::client::RunCreate { self.0 } } impl FromPyObject<'_> for RunCreate { fn extract_bound(value: &Bound<'_, PyAny>) -> PyResult<Self> { let common = RunCommon::extract_bound(value)?.into_inner(); let name = value.get_item(pyo3::intern!(value.py(), "name"))?.extract::<String>()?; let start_time = extract_time_value(&value.get_item(pyo3::intern!(value.py(), "start_time"))?)?; let end_time = { match value.get_item(pyo3::intern!(value.py(), "end_time")) { Ok(py_end_time) => { if py_end_time.is_none() { None } else { Some(extract_time_value(&py_end_time)?) } } Err(_) => None, } }; let run_type = value.get_item(pyo3::intern!(value.py(), "run_type"))?.extract::<String>()?; let reference_example_id = extract_string_like_or_none( get_optional_value_from_mapping( value, pyo3::intern!(value.py(), "reference_example_id"), ) .as_ref(), )?; Ok(Self(langsmith_tracing_client::client::RunCreate { common, name, start_time, end_time, run_type, reference_example_id, })) } } #[derive(Debug)] pub(crate) struct RunCommon(langsmith_tracing_client::client::RunCommon); impl RunCommon { #[inline] pub(crate) fn into_inner(self) -> langsmith_tracing_client::client::RunCommon { self.0 } } impl FromPyObject<'_> for RunCommon { fn extract_bound(value: &Bound<'_, PyAny>) -> PyResult<Self> { let id = extract_string_like(&value.get_item(pyo3::intern!(value.py(), "id"))?)?; let trace_id = extract_string_like(&value.get_item(pyo3::intern!(value.py(), "trace_id"))?)?; let dotted_order = value.get_item(pyo3::intern!(value.py(), "dotted_order"))?.extract()?; let parent_run_id = extract_string_like_or_none( get_optional_value_from_mapping(value, pyo3::intern!(value.py(), "parent_run_id")) .as_ref(), )?; let extra = extract_optional_value_from_mapping(value, pyo3::intern!(value.py(), "extra"))?; let error = extract_string_like_or_none( get_optional_value_from_mapping(value, pyo3::intern!(value.py(), "error")).as_ref(), )?; let serialized = extract_optional_value_from_mapping(value, pyo3::intern!(value.py(), "serialized"))?; let events = extract_optional_value_from_mapping(value, pyo3::intern!(value.py(), "events"))?; let tags = extract_optional_value_from_mapping(value, pyo3::intern!(value.py(), "tags"))?; let session_id = extract_string_like_or_none( get_optional_value_from_mapping(value, pyo3::intern!(value.py(), "session_id")) .as_ref(), )?; let session_name = extract_string_like_or_none( get_optional_value_from_mapping(value, pyo3::intern!(value.py(), "session_name")) .as_ref(), )?; Ok(Self(langsmith_tracing_client::client::RunCommon { id, trace_id, dotted_order, parent_run_id, extra, error, serialized, events, tags, session_id, session_name, })) } } /// Get an optional string from a Python `None`, string, or string-like object such as a UUID value. fn extract_string_like_or_none(value: Option<&Bound<'_, PyAny>>) -> PyResult<Option<String>> { match value { None => Ok(None), Some(val) if val.is_none() => Ok(None), Some(val) => extract_string_like(val).map(Option::Some), } } /// Get a string from a Python string or string-like object, such as a UUID value. fn extract_string_like(value: &Bound<'_, PyAny>) -> PyResult<String> { match value.extract::<String>() { Ok(s) => Ok(s), Err(e) => { // PyO3 doesn't have a Rust-native representation of Python's UUID object yet. // However, orjson supports serializing UUID objects, so the easiest way to get // a Rust string from a Python UUID object is to serialize the UUID to a JSON string // and then parse out the string. let Ok(buffer) = self::serialization::dumps(value.as_ptr()) else { // orjson failed to deserialize the object. The fact that orjson is involved // is an internal implementation detail, so return the original error instead. // It looks like this: // `'SomeType' object cannot be converted to 'PyString'` return Err(e); }; let content = CStr::from_bytes_until_nul(&buffer) .expect("not a valid C string, this should never happen") .to_str() .expect("not a valid UTF-8 string, this should never happen"); // orjson serialized buffers are null-terminated, so strip the trailing // If the remaining value didn't start or end with a quote, it wasn't string-like. // It might have been a number, dict, or list -- none of those are legal here. // Raise the original error again, for the same reason as above. let string_content = content.strip_prefix('"').and_then(|s| s.strip_suffix('"')).ok_or(e)?.to_string(); Ok(string_content) } } } fn extract_time_value(value: &Bound<'_, PyAny>) -> PyResult<TimeValue> { if let Ok(string) = value.extract::<String>() { return Ok(TimeValue::String(string)); } let datetime = value.downcast::<PyDateTime>()?; let isoformat = datetime.call_method0(pyo3::intern!(value.py(), "isoformat"))?.extract::<String>()?; Ok(TimeValue::String(isoformat)) } fn get_optional_value_from_mapping<'py>( mapping: &Bound<'py, PyAny>, key: &Bound<'py, PyString>, ) -> Option<Bound<'py, PyAny>> { mapping.get_item(key).ok() } fn serialize_optional_dict_value( mapping: &Bound<'_, PyAny>, key: &Bound<'_, PyString>, ) -> PyResult<Option<Vec<u8>>> { match mapping.get_item(key) { Ok(value) => { if value.is_none() { return Ok(None); } serialization::dumps(value.as_ptr()) .map(Option::Some) .map_err(TracingClientError::new_err) } Err(_) => Ok(None), } } // TODO: `Option<Value>` seems suspect as a type, since `Value` can be null already. // It might be unnecessarily large and slowing us down for no reason. fn extract_optional_value_from_mapping( mapping: &Bound<'_, PyAny>, key: &Bound<'_, PyString>, ) -> PyResult<Option<serde_json::Value>> { match mapping.get_item(key) { Ok(value) => { if value.is_none() { return Ok(None); } extract_value(&value).map(Option::Some) } Err(_) => Ok(None), } } fn extract_value(value: &Bound<'_, PyAny>) -> PyResult<serde_json::Value> { if value.is_none() { Ok(serde_json::Value::Null) } else if let Ok(number) = value.extract::<i64>() { Ok(number.into()) } else if let Ok(number) = value.extract::<u64>() { Ok(number.into()) } else if let Ok(float) = value.extract::<f64>() { Ok(serde_json::Number::from_f64(float).map(serde_json::Value::from).unwrap_or_default()) } else if let Ok(string) = value.extract::<&str>() { Ok(string.into()) } else if let Ok(bool) = value.extract::<bool>() { Ok(bool.into()) } else if let Ok(sequence) = value.downcast::<PySequence>() { let mut array = Vec::with_capacity(sequence.len()?); for elem in sequence.iter()? { array.push(extract_value(&elem?)?); } Ok(serde_json::Value::Array(array)) } else if let Ok(mapping) = value.downcast::<PyMapping>() { let mut dict = serde_json::Map::with_capacity(mapping.len()?); for result in mapping.items()?.iter()? { let key_value_pair = result?; let key_item = key_value_pair.get_item(0)?; let value = extract_value(&key_value_pair.get_item(1)?)?; // We error on non-string-like keys here. let key = extract_string_like(&key_item)?; dict.insert(key, value); } Ok(dict.into()) } else if let Ok(string_like) = extract_string_like(value) { // This allows us to support Python `UUID` objects by serializing them to strings. Ok(string_like.into()) } else { unreachable!("failed to convert python data {value} to sonic_rs::Value") } } #[cfg(test)] mod tests { use crate::test_infra::with_python_interpreter; use pyo3::{prelude::*, types::PyDict}; #[pyfunction] fn extract_uuid(uuid_value: &Bound<'_, PyAny>, string_value: &str) { let extracted = super::extract_string_like(uuid_value).expect("extraction failed"); assert_eq!(extracted.as_str(), string_value); } #[test] fn test_uuid_value_extraction() { fn inner(py: Python<'_>) -> PyResult<()> { // This call only works correctly "the first time". // We use `cargo-nextest` to ensure we run each test in its own process. // Otherwise, tests will suffer unpredictable errors. orjson::init_typerefs(); // Create a new test module. let test_module = PyModule::new_bound(py, "test_module")?; test_module.add_function(pyo3::wrap_pyfunction!(extract_uuid, &test_module)?)?; // Get `sys.modules`, then insert our module into it. let sys = PyModule::import_bound(py, "sys")?; let py_modules: Bound<'_, PyDict> = sys.getattr("modules")?.downcast_into()?; py_modules.set_item("test_module", test_module)?; // Now we can import and run our python code. let python_code = "\ import uuid import test_module uuid_to_test = uuid.uuid4() test_module.extract_uuid(uuid_to_test, str(uuid_to_test)) "; Python::run_bound(py, python_code, None, None)?; Ok(()) } with_python_interpreter(inner).expect("encountered an unexpected error") } /// Just to ensure that running multiple tests works fine. /// If Python or orjson are initialized more than once per process, /// either this test or another test will fail. #[test] fn other_test() { test_uuid_value_extraction(); } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/errors.rs
use pyo3::{ create_exception, types::{PyModule, PyModuleMethods}, Bound, PyResult, Python, }; pub(super) fn register(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add("TracingClientError", py.get_type_bound::<TracingClientError>())?; Ok(()) } create_exception!(langsmith_pyo3, TracingClientError, pyo3::exceptions::PyException);
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/serialization/writer.rs
use std::io::Error; /// Writer that points directly to a `[u8]` buffer. /// /// # Safety /// The external interface of this type is fully safe. /// /// An internal invariant is that the `(buf, len, cap)` fields must be equivalent to a valid `Vec` /// both at the start and conclusion of any method call: /// - `self.buf` points to valid, initialized memory to which `Self` has exclusive access /// - `self.len` is a legal offset that remains in bounds when used with `self.buf`. /// - `self.cap` accurately shows how much capacity the `self.buf` memory region has. pub(super) struct BufWriter { buf: *mut u8, len: usize, cap: usize, } impl BufWriter { const DEFAULT_CAPACITY: usize = 1024; pub(super) fn new() -> Self { let buffer = Vec::with_capacity(Self::DEFAULT_CAPACITY); let (buf, len, cap) = { // Prevent the `Vec` from being dropped at the end of this scope. let mut buffer = std::mem::ManuallyDrop::new(buffer); // Get the `Vec`'s components. let buf = buffer.as_mut_ptr(); let len = buffer.len(); let cap = buffer.capacity(); // We now own the `Vec`'s backing data. // The `Vec` goes out of scope but will not be dropped // due to being wrapped in `ManuallyDrop`. (buf, len, cap) }; // SAFETY: These values are derived from a valid `Vec` that has not been dropped. Self { buf, len, cap } } pub(super) fn finish(mut self) -> Vec<u8> { let end_length = self.len + 1; if end_length >= self.cap { self.reserve_at_least_capacity(end_length); } // SAFETY: We just ensured there's enough room in the buffer. unsafe { core::ptr::write(self.buffer_ptr(), 0); } // Difference with orjson: Python doesn't count the terminating `'\0'` in the length // of the string, but `Vec<u8>` does. So orjson doesn't add one here, but we must // or else we'll get unsoundness and a memory safety violation. self.len = end_length; self.into_inner() } pub(super) fn into_inner(self) -> Vec<u8> { // SAFETY: We constructed the `Vec` in `Self::new()`, // and maintained the `Vec` invariants throughout all `Self` methods. unsafe { Vec::from_raw_parts(self.buf, self.len, self.cap) } } fn buffer_ptr(&self) -> *mut u8 { // SAFETY: The length must be in bounds at all times, or else we've already violated // another invariant elsewhere. unsafe { self.buf.add(self.len) } } #[inline] pub fn reserve_at_least_capacity(&mut self, cap: usize) { // SAFETY: The buffer used to be a vector, and is exclusively owned by us. // The `&mut self` here guarantees there can't be another mutable reference to it. // It's safe to turn it back into a `Vec` and ask the `Vec` to resize itself. // After resizing, we deconstruct the `Vec` *and* ensure it isn't dropped, // meaning that the memory is still live and not use-after-free'd. unsafe { // SAFETY: `self`'s `(buf, len, cap)` are no longer valid for accessing data // after the next line, until they are reassigned new values. let mut buffer = Vec::from_raw_parts(self.buf, self.len, self.cap); buffer.reserve(cap - self.cap); // Prevent the `Vec` from being dropped at the end of this scope. let mut buffer = std::mem::ManuallyDrop::new(buffer); // Get the `Vec`'s components. let buf = buffer.as_mut_ptr(); let len = buffer.len(); let cap = buffer.capacity(); // SAFETY: `self`'s `(buf, len, cap)` values are valid again from this point onward. // We own the `Vec`'s backing data. The `Vec` goes out of scope but // will not be dropped due to being wrapped in `ManuallyDrop`. (self.buf, self.len, self.cap) = (buf, len, cap); } } } impl std::io::Write for BufWriter { fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { let _ = self.write_all(buf); Ok(buf.len()) } fn write_all(&mut self, buf: &[u8]) -> Result<(), Error> { let to_write = buf.len(); let end_length = self.len + to_write; if end_length >= self.cap { self.reserve_at_least_capacity(end_length); } // SAFETY: We never expose pointers to our internal buffer through the API, // so we couldn't have gotten an overlapping buffer here. unsafe { core::ptr::copy_nonoverlapping(buf.as_ptr(), self.buffer_ptr(), to_write); }; self.len = end_length; Ok(()) } fn flush(&mut self) -> std::io::Result<()> { Ok(()) } } impl orjson::WriteExt for &mut BufWriter { #[inline(always)] fn as_mut_buffer_ptr(&mut self) -> *mut u8 { self.buffer_ptr() } #[inline(always)] fn reserve(&mut self, len: usize) { let end_length = self.len + len; if end_length >= self.cap { self.reserve_at_least_capacity(end_length); } } #[inline] fn has_capacity(&mut self, len: usize) -> bool { self.len + len <= self.cap } #[inline(always)] fn set_written(&mut self, len: usize) { self.len += len; } fn write_str(&mut self, val: &str) -> Result<(), Error> { let to_write = val.len(); let end_length = self.len + to_write + 2; if end_length >= self.cap { self.reserve_at_least_capacity(end_length); } // SAFETY: We ensured there's enough room in the buffer. The write is non-overlapping // because we never hand out pointers to our internal buffer via our API. unsafe { let ptr = self.buffer_ptr(); core::ptr::write(ptr, b'"'); core::ptr::copy_nonoverlapping(val.as_ptr(), ptr.add(1), to_write); core::ptr::write(ptr.add(to_write + 1), b'"'); }; self.len = end_length; Ok(()) } /// # Safety /// /// The caller must ensure they've reserved sufficient space in advance. unsafe fn write_reserved_fragment(&mut self, val: &[u8]) -> Result<(), Error> { let to_write = val.len(); // SAFETY: The write is non-overlapping because we never hand out pointers to // our internal buffer via our API. We must have enough space since the caller // is required to have made sure of that already. unsafe { core::ptr::copy_nonoverlapping(val.as_ptr(), self.buffer_ptr(), to_write); }; self.len += to_write; Ok(()) } /// # Safety /// /// The caller must ensure they've reserved sufficient space in advance. #[inline(always)] unsafe fn write_reserved_punctuation(&mut self, val: u8) -> Result<(), Error> { // SAFETY: We must have enough space since the caller // is required to have made sure of that already. unsafe { core::ptr::write(self.buffer_ptr(), val) }; self.len += 1; Ok(()) } /// # Safety /// /// The caller must ensure they've reserved sufficient space in advance. #[inline(always)] unsafe fn write_reserved_indent(&mut self, len: usize) -> Result<(), Error> { // SAFETY: We must have enough space since the caller // is required to have made sure of that already. unsafe { core::ptr::write_bytes(self.buffer_ptr(), b' ', len); }; self.len += len; Ok(()) } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src
lc_public_repos/langsmith-sdk/rust/crates/langsmith-pyo3/src/serialization/mod.rs
mod writer; pub(crate) fn dumps(ptr: *mut pyo3_ffi::PyObject) -> Result<Vec<u8>, String> { let mut writer = writer::BufWriter::new(); let obj = orjson::PyObjectSerializer::new( ptr, orjson::SerializerState::new(Default::default()), None, ); let res = orjson::to_writer(&mut writer, &obj); match res { Ok(_) => Ok(writer.finish()), Err(err) => { // Make sure we drop the allocated buffer. let _ = writer.into_inner(); Err(err.to_string()) } } }
0
lc_public_repos/langsmith-sdk/rust/crates
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/Cargo.toml
[package] name = "langsmith-tracing-client" version = "0.1.0" edition = "2021" [dependencies] tokio = { workspace = true } uuid = { workspace = true } serde_json = { workspace = true } serde = { workspace = true } chrono = { workspace = true } reqwest = { workspace = true } thiserror = { workspace = true } tokio-util = { workspace = true } tempfile = { workspace = true } futures = { workspace = true } rayon = { workspace = true } ureq = { workspace = true } flate2 = { workspace = true } [dev-dependencies] multer = "3.1.0" mockito = "1.5.0" criterion = { version = "0.5.1", features = ["async_tokio"] } [[bench]] name = "tracing_client_benchmark" harness = false [[bench]] name = "json_serialization_benchmark" harness = false
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/benches/json_serialization_benchmark.rs
use rayon::prelude::*; use std::io::prelude::*; use std::io::Cursor; use std::time::Instant; // use serde_json::Value; use criterion::{criterion_group, criterion_main, Criterion}; use mockito::Server; use reqwest::blocking::multipart::{Form, Part}; use serde_json::Value; use uuid::Uuid; fn create_json_with_large_array(len: usize) -> Value { let large_array: Vec<Value> = (0..len) .map(|i| { serde_json::json!({ "index": i, "data": format!("This is element number {}", i), "nested": { "id": i, "value": format!("Nested value for element {}", i), } }) }) .collect(); serde_json::json!({ "name": "Huge JSON", "description": "This is a very large JSON object for benchmarking purposes.", "array": large_array, "metadata": { "created_at": "2024-10-22T19:00:00Z", "author": "Rust Program", "version": 1.0 } }) } fn create_json_with_large_strings(len: usize) -> Value { let large_string = "a".repeat(len); serde_json::json!({ "name": "Huge JSON", "description": "This is a very large JSON object for benchmarking purposes.", "key1": large_string.clone(), "key2": large_string.clone(), "key3": large_string.clone(), "metadata": { "created_at": "2024-10-22T19:00:00Z", "author": "Rust Program", "version": 1.0 } }) } // Sequential processing fn benchmark_sequential(data: &[Value]) -> Vec<Vec<u8>> { data.iter() .map(|json| { let data = serde_json::to_vec(json).expect("Failed to serialize JSON"); // gzip the data using flate2 let mut encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::fast()); encoder.write_all(&data).expect("Failed to compress data"); encoder.finish().expect("Failed to finish compression") }) .collect() } // Parallel processing fn benchmark_parallel(data: &[Value]) -> Vec<Vec<u8>> { data.par_iter() .map(|json| { let data = serde_json::to_vec(json).expect("Failed to serialize JSON"); // gzip the data using flate2 let mut encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::fast()); encoder.write_all(&data).expect("Failed to compress data"); encoder.finish().expect("Failed to finish compression") }) .collect() } fn benchmark_gzip_only_parallel(data: &Vec<Vec<u8>>) -> Vec<Vec<u8>> { data.par_iter() .map(|data| { // gzip the data using flate2 let mut encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::fast()); encoder.write_all(data).expect("Failed to compress data"); encoder.finish().expect("Failed to finish compression") }) .collect() } // into par iter fn benchmark_json_only_parallel(data: &[Value]) -> Vec<Vec<u8>> { data.par_iter() .map(|json| serde_json::to_vec(json).expect("Failed to serialize JSON")) .collect() } fn json_benchmark_large_array(c: &mut Criterion) { let num_json_objects = 2000; let json_length = 5000; let data: Vec<Value> = (0..num_json_objects).map(|_| create_json_with_large_array(json_length)).collect(); let serialized_data = benchmark_json_only_parallel(&data); let mut group = c.benchmark_group("json_benchmark_large_array"); group.bench_function("sequential serialization with gzip", |b| { b.iter_with_large_drop(|| benchmark_sequential(&data)) }); group.bench_function("parallel serialization with gzip", |b| { b.iter_with_large_drop(|| benchmark_parallel(&data)) }); group.bench_function("parallel serialization only", |b| { b.iter_with_large_drop(|| benchmark_json_only_parallel(&data)) }); group.bench_function("parallel gzip only", |b| { b.iter_with_large_drop(|| benchmark_gzip_only_parallel(&serialized_data)) }); } #[expect(dead_code)] fn json_benchmark_large_strings(c: &mut Criterion) { let num_json_objects = 100; let json_length = 100_000; let data: Vec<Value> = (0..num_json_objects).map(|_| create_json_with_large_strings(json_length)).collect(); let mut group = c.benchmark_group("json_benchmark_large_strings"); group.bench_function("sequential serialization", |b| { b.iter_with_large_drop(|| benchmark_sequential(&data)) }); group.bench_function("parallel serialization", |b| { b.iter_with_large_drop(|| benchmark_parallel(&data)) }); } #[expect(dead_code)] fn hitting_mock_server_benchmark(c: &mut Criterion) { let server = { let mut server = Server::new(); server.mock("POST", "/runs/multipart").with_status(202).create(); server }; let mut group = c.benchmark_group("hitting_mock_server_benchmark"); let reqwest = reqwest::blocking::Client::new(); group.bench_function("hitting mock server with reqwest", |b| { b.iter_custom(|_iters| { let num_json_objects = 300; let json_length = 3000; let data: Vec<Value> = (0..num_json_objects).map(|_| create_json_with_large_array(json_length)).collect(); let bytes: Vec<Part> = data .par_iter() .map(|json| { let data = serde_json::to_vec(json).expect("Failed to serialize JSON"); Part::bytes(data) .file_name("part".to_string()) .mime_str("application/json") .unwrap() }) .collect(); let mut form = Form::new(); for (i, part) in bytes.into_iter().enumerate() { let part_name = format!("part{}", i); form = form.part(part_name, part); } let start = Instant::now(); let response = reqwest .post(format!("{}/runs/multipart", server.url())) .multipart(form) .send() .unwrap(); assert_eq!(response.status(), 202); start.elapsed() }); }); // now let's try ureq let ureq = ureq::Agent::new(); group.bench_function("hitting mock server with ureq", |b| { b.iter_custom(|_iters| { let num_json_objects = 300; let json_length = 3000; let data: Vec<Value> = (0..num_json_objects).map(|_| create_json_with_large_array(json_length)).collect(); let bytes: Vec<Vec<u8>> = data .par_iter() .map(|json| serde_json::to_vec(json).expect("Failed to serialize JSON")) .collect(); let mut multipart_body = Vec::new(); let boundary = format!("------------------------{}", Uuid::new_v4()); for (i, data_bytes) in bytes.iter().enumerate() { multipart_body.extend_from_slice(format!("--{}\r\n", boundary).as_bytes()); multipart_body.extend_from_slice( format!("Content-Disposition: form-data; name=\"part{}\"\r\n", i).as_bytes(), ); multipart_body.extend_from_slice(b"Content-Type: application/json\r\n\r\n"); multipart_body.extend_from_slice(data_bytes); multipart_body.extend_from_slice(b"\r\n"); } multipart_body.extend_from_slice(format!("--{}--\r\n", boundary).as_bytes()); // Convert the multipart body to a Cursor for reading let body_reader = Cursor::new(multipart_body); // Send the request let start = Instant::now(); let response = ureq .post(&format!("{}/runs/multipart", server.url())) .set("Content-Type", &format!("multipart/form-data; boundary={}", boundary)) .send(body_reader); assert_eq!(response.unwrap().status(), 202); start.elapsed() }); }); } criterion_group! { name = benches; config = Criterion::default().sample_size(10); targets = json_benchmark_large_array } criterion_main!(benches); // fn main() { // }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/benches/tracing_client_benchmark.rs
use criterion::{black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion}; use langsmith_tracing_client::client::async_enabled::{ClientConfig, TracingClient}; use langsmith_tracing_client::client::blocking::{ ClientConfig as BlockingClientConfig, TracingClient as BlockingTracingClient, }; use langsmith_tracing_client::client::{ Attachment, EventType, RunCommon, RunCreate, RunCreateExtended, RunEventBytes, RunIO, TimeValue, }; use mockito::Server; use serde_json::{json, Value}; use std::time::Duration; use tokio::runtime::Runtime; fn create_mock_client_config(server_url: &str, batch_size: usize) -> ClientConfig { ClientConfig { endpoint: server_url.to_string(), queue_capacity: 1_000_000, batch_size, batch_timeout: Duration::from_secs(1), headers: Default::default(), } } fn create_mock_client_config_sync(server_url: &str, batch_size: usize) -> BlockingClientConfig { BlockingClientConfig { endpoint: server_url.to_string(), api_key: "anything".into(), queue_capacity: 1_000_000, batch_size, batch_timeout: Duration::from_secs(1), headers: Default::default(), num_worker_threads: 1, } } fn create_run_create( attachments: Option<Vec<Attachment>>, inputs: Option<Value>, outputs: Option<Value>, ) -> RunCreateExtended { RunCreateExtended { run_create: RunCreate { common: RunCommon { id: String::from("test_id"), trace_id: String::from("trace_id"), dotted_order: String::from("1.1"), parent_run_id: None, extra: Some(json!({"extra_data": "value"})), error: None, serialized: Some(json!({"key": "value"})), events: Some(json!([{ "event": "event_data" }])), tags: Some(json!(["tag1", "tag2"])), session_id: None, session_name: Some("Session Name".to_string()), }, name: String::from("Run Name"), start_time: TimeValue::UnsignedInt(1697462400000), end_time: Some(TimeValue::UnsignedInt(1697466000000)), run_type: String::from("chain"), reference_example_id: None, }, attachments, io: RunIO { inputs: inputs.map(|i| serde_json::to_vec(&i).unwrap()), outputs: outputs.map(|i| serde_json::to_vec(&i).unwrap()), }, } } fn create_run_bytes( attachments: Option<Vec<Attachment>>, inputs: Option<Value>, outputs: Option<Value>, ) -> RunEventBytes { let inputs_bytes = inputs.as_ref().map(|i| serde_json::to_vec(&i).unwrap()); let outputs_bytes = outputs.as_ref().map(|o| serde_json::to_vec(&o).unwrap()); let run_create = create_run_create(attachments, inputs, outputs); let run_bytes = serde_json::to_vec(&run_create.run_create).unwrap(); RunEventBytes { run_id: run_create.run_create.common.id, event_type: EventType::Create, run_bytes, inputs_bytes, outputs_bytes, attachments: run_create.attachments, } } fn create_large_json(len: usize) -> Value { let large_array: Vec<Value> = (0..len) .map(|i| { json!({ "index": i, "data": format!("This is element number {}", i), "nested": { "id": i, "value": format!("Nested value for element {}", i), } }) }) .collect(); json!({ "name": "Huge JSON", "description": "This is a very large JSON object for benchmarking purposes.", "array": large_array, "metadata": { "created_at": "2024-10-22T19:00:00Z", "author": "Rust Program", "version": 1.0 } }) } #[expect(dead_code)] fn bench_run_create(c: &mut Criterion) { let rt = Runtime::new().unwrap(); let server = rt.block_on(async { let mut server = Server::new_async().await; server.mock("POST", "/runs/multipart").with_status(202).create_async().await; server }); let mut group = c.benchmark_group("run_create"); for batch_size in [50] { for json_len in [1_000, 5_000] { for num_runs in [500, 1_000] { group.bench_with_input( BenchmarkId::new( "run_create_async", format!("batch_{}_json_{}_runs_{}", batch_size, json_len, num_runs), ), &(batch_size, json_len, num_runs), |b, &(batch_size, json_len, num_runs)| { b.to_async(&rt).iter_batched( || { let runs: Vec<RunCreateExtended> = (0..num_runs) .map(|i| { let mut run = create_run_create( None, Some(create_large_json(json_len)), Some(create_large_json(json_len)), ); run.run_create.common.id = format!("test_id_{}", i); run }) .collect(); let client_config = create_mock_client_config(&server.url(), batch_size); let client = TracingClient::new(client_config).unwrap(); (client, runs) }, |(client, runs)| async { for run in runs { client.submit_run_create(black_box(run)).await.unwrap(); } // shutdown the client to flush the queue client.shutdown().await.unwrap(); }, BatchSize::LargeInput, ); }, ); } } } group.finish(); } #[expect(dead_code, clippy::single_element_loop)] fn bench_run_create_iter_custom(c: &mut Criterion) { let rt = Runtime::new().unwrap(); let server = rt.block_on(async { let mut server = Server::new_async().await; server.mock("POST", "/runs/multipart").with_status(202).create_async().await; server }); let mut group = c.benchmark_group("run_create_custom_iter"); let server_url = server.url(); for batch_size in [100] { for json_len in [3_000] { for num_runs in [1_000] { group.bench_function( BenchmarkId::new( "run_create_async", format!("batch_{}_json_{}_runs_{}", batch_size, json_len, num_runs), ), |b| { b.to_async(&rt).iter_custom(|iters| { let mut elapsed_time = Duration::default(); let server_url = server_url.clone(); async move { for _ in 0..iters { let runs: Vec<RunCreateExtended> = (0..num_runs) .map(|i| { let mut run = create_run_create( None, Some(create_large_json(json_len)), Some(create_large_json(json_len)), ); run.run_create.common.id = format!("test_id_{}", i); run }) .collect(); let client_config = create_mock_client_config(&server_url, batch_size); let client = TracingClient::new(client_config).unwrap(); let start = std::time::Instant::now(); for run in runs { client.submit_run_create(black_box(run)).await.unwrap(); } // shutdown the client to flush the queue let start_shutdown = std::time::Instant::now(); println!("----------SHUTDOWN----------"); client.shutdown().await.unwrap(); println!("----------SHUTDOWN END----------"); println!( "Elapsed time for shutdown: {:?}", start_shutdown.elapsed() ); elapsed_time += start.elapsed(); println!("Elapsed time: {:?}", elapsed_time); } elapsed_time } }) }, ); } } } group.finish(); } #[expect(dead_code)] fn bench_run_bytes_iter_custom(c: &mut Criterion) { let rt = Runtime::new().unwrap(); let server = rt.block_on(async { let mut server = Server::new_async().await; server.mock("POST", "/runs/multipart").with_status(202).create_async().await; server }); let mut group = c.benchmark_group("run_create_bytes_iter"); let server_url = server.url(); for batch_size in [50] { for json_len in [1_000, 5_000] { for num_runs in [500, 1_000] { group.bench_function( BenchmarkId::new( "run_create_async", format!("batch_{}_json_{}_runs_{}", batch_size, json_len, num_runs), ), |b| { b.to_async(&rt).iter_custom(|iters| { let mut elapsed_time = Duration::default(); let server_url = server_url.clone(); async move { for _ in 0..iters { let runs: Vec<RunEventBytes> = (0..num_runs) .map(|_i| { create_run_bytes( None, Some(create_large_json(json_len)), Some(create_large_json(json_len)), ) }) .collect(); let client_config = create_mock_client_config(&server_url, batch_size); let client = TracingClient::new(client_config).unwrap(); let start = std::time::Instant::now(); for run in runs { client.submit_run_bytes(black_box(run)).await.unwrap(); } // shutdown the client to flush the queue client.shutdown().await.unwrap(); elapsed_time += start.elapsed(); } elapsed_time } }) }, ); } } } group.finish(); } #[expect(unused_variables, clippy::single_element_loop)] fn bench_run_create_sync_iter_custom(c: &mut Criterion) { let server = { let mut server = Server::new(); server.mock("POST", "/runs/multipart").with_status(202).create(); server }; let mut group = c.benchmark_group("run_create_custom_iter"); let server_url = server.url(); for batch_size in [100] { for json_len in [5_000] { for num_runs in [1_000] { group.bench_function( BenchmarkId::new( "run_create_sync", format!("batch_{}_json_{}_runs_{}", batch_size, json_len, num_runs), ), |b| { b.iter_custom(|iters| { let mut elapsed_time = Duration::default(); let server_url = server_url.clone(); for _ in 0..iters { let runs: Vec<RunCreateExtended> = (0..num_runs) .map(|i| { let mut run = create_run_create( None, Some(create_large_json(json_len)), Some(create_large_json(json_len)), ); run.run_create.common.id = format!("test_id_{}", i); run }) .collect(); let client_config = create_mock_client_config_sync(&server_url, batch_size); let client = BlockingTracingClient::new(client_config).unwrap(); let start = std::time::Instant::now(); for run in runs { std::hint::black_box( client.submit_run_create(std::hint::black_box(run)), ) .unwrap(); } // shutdown the client to flush the queue let start_shutdown = std::time::Instant::now(); std::hint::black_box(client.shutdown()).unwrap(); // println!("Elapsed time for shutdown: {:?}", start_shutdown.elapsed()); elapsed_time += start.elapsed(); println!("Elapsed time: {:?}", elapsed_time); } elapsed_time }) }, ); } } } group.finish(); } criterion_group! { name = benches; config = Criterion::default().sample_size(10); targets = bench_run_create_sync_iter_custom } criterion_main!(benches);
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/tests/test_run.rs
use langsmith_tracing_client::client::{RunCommon, RunCreate, RunUpdate, TimeValue}; use serde_json::{json, to_string, Value}; #[test] fn test_run_common() { let run_common = RunCommon { id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), trace_id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), dotted_order: String::from("1.1"), parent_run_id: None, extra: Some(json!({"extra_data": "value"})), error: Some(String::from("error message")), serialized: Some(json!({"key": "value"})), events: Some(Value::from(vec![json!({"event": "event_data"})])), tags: None, session_id: Some("efghijkl-7654-3210-fedc-ba9876543210".to_string()), session_name: None, }; let serialized = to_string(&run_common).unwrap(); assert!(serialized.contains("\"dotted_order\":\"1.1\"")); } #[test] fn test_run_create_with_string_time() { let run_common = RunCommon { id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), trace_id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), dotted_order: String::from("1.1"), parent_run_id: None, extra: None, error: None, serialized: None, events: Some(Value::from(vec![json!({"event": "event_data"})])), tags: Some(json!({"tag": "value"})), session_id: None, session_name: Some("Session Name".to_string()), }; let run_create = RunCreate { common: run_common, name: String::from("Run Name"), start_time: TimeValue::String("2024-10-16T12:00:00Z".to_string()), end_time: Some(TimeValue::String("2024-10-16T14:00:00Z".to_string())), run_type: String::from("test_run_type"), reference_example_id: None, }; let serialized = to_string(&run_create).unwrap(); assert!(serialized.contains("\"name\":\"Run Name\"")); assert!(serialized.contains("\"start_time\":\"2024-10-16T12:00:00Z\"")); } #[test] fn test_run_create_with_timestamp() { let run_common = RunCommon { id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), trace_id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), dotted_order: String::from("1.1"), parent_run_id: None, extra: Some(json!({"extra_data": "value"})), error: None, serialized: Some(json!({"key": "value"})), events: None, tags: Some(json!({"tag": "value"})), session_id: None, session_name: None, }; let run_create = RunCreate { common: run_common, name: String::from("Run Name"), start_time: TimeValue::UnsignedInt(1697462400000), end_time: Some(TimeValue::UnsignedInt(1697466000000)), run_type: String::from("test_run_type"), reference_example_id: None, }; let serialized = to_string(&run_create).unwrap(); assert!(serialized.contains("\"name\":\"Run Name\"")); assert!(serialized.contains("\"start_time\":1697462400000")); } #[test] fn test_run_update() { let run_common = RunCommon { id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), trace_id: String::from("fedcba98-7654-3210-fedc-ba9876543210"), dotted_order: String::from("1.1"), parent_run_id: None, extra: None, error: None, serialized: None, events: None, tags: Some(json!({"tag": "value"})), session_id: None, session_name: None, }; let run_update = RunUpdate { common: run_common, end_time: TimeValue::String("2024-10-16T14:00:00Z".to_string()), }; let serialized = to_string(&run_update).unwrap(); assert!(serialized.contains("\"dotted_order\":\"1.1\"")); assert!(serialized.contains("\"end_time\":\"2024-10-16T14:00:00Z\"")); }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/tests/tracing_client_test.rs
use std::error::Error; use std::fs::File; use std::io::Write; use std::sync::{Arc, Mutex}; use std::time::Duration; use mockito::Server; use multer::Multipart; use reqwest::header::{HeaderMap, HeaderValue}; use serde_json::{from_str, json, to_vec, Value}; use tempfile::TempDir; use langsmith_tracing_client::client::async_enabled::{ClientConfig, TracingClient}; use langsmith_tracing_client::client::{ Attachment, RunCommon, RunCreate, RunCreateExtended, RunIO, RunUpdate, RunUpdateExtended, TimeValue, }; #[derive(Debug)] struct MultipartField { name: String, content_type: Option<String>, filename: Option<String>, data: String, } async fn handle_request(body: Vec<u8>, content_type_str: String) -> Vec<MultipartField> { assert!(content_type_str.starts_with("multipart/form-data")); let boundary = content_type_str.split("boundary=").nth(1).unwrap(); let stream = futures::stream::once( async move { Ok::<_, Box<dyn Error + Send + Sync>>(multer::bytes::Bytes::copy_from_slice(body.as_slice())) } ); let mut mp = Multipart::new(stream, boundary); let mut fields = Vec::new(); while let Some(field) = mp.next_field().await.expect("reading failed") { let field_name = field.name().expect("field had no name").to_string(); let field_content_type = field.content_type().map(|ct| ct.to_string()); let field_filename = field.file_name().map(String::from); let content = String::from_utf8( field.bytes().await.expect("failed to read field bytes").into(), ).expect("failed to turn field data into string"); let multipart_field = MultipartField { name: field_name, content_type: field_content_type, filename: field_filename, data: content, }; fields.push(multipart_field); } fields } #[tokio::test] async fn test_tracing_client_submit_run_create() { let mut server = Server::new_async().await; // NOTE: we can't use an async mutex here because mockito doesn't support async functions // in `with_body_from_request`. let captured_request: Arc<Mutex<(Vec<u8>, String)>> = Arc::new(Mutex::new((Vec::new(), String::new()))); let captured_request_clone = Arc::clone(&captured_request); let m = server .mock("POST", "/runs/multipart") .expect(1) .with_status(200) .with_body_from_request(move |req| { let mut request = captured_request_clone.lock().unwrap(); request.0 = req.body().unwrap().to_vec(); let content_type_headers = req.header("content-type"); let content_type_str: String = content_type_headers .iter() .filter_map(|h| h.to_str().ok()) .collect::<Vec<&str>>() .join(", "); request.1 = content_type_str; vec![] // return empty response body }) .create_async() .await; let config = ClientConfig { endpoint: server.url(), queue_capacity: 10, batch_size: 5, // batch size is 5 to ensure shutdown flushes the queue batch_timeout: Duration::from_secs(1), headers: None, }; let client = TracingClient::new(config).unwrap(); // Write a test file to disk for streaming let tmp_dir = TempDir::new().unwrap(); let test_file_path = tmp_dir.path().join("test_file_create.txt"); let mut test_file = File::create(&test_file_path).unwrap(); writeln!(test_file, "Test file content for create").unwrap(); let attachments = vec![ Attachment { ref_name: "attachment_1".to_string(), filename: "file1.txt".to_string(), data: Some(vec![1, 2, 3]), content_type: "application/octet-stream".to_string(), }, Attachment { ref_name: "attachment_2".to_string(), filename: test_file_path.into_os_string().into_string().unwrap(), data: None, // this will cause the processor to read from disk content_type: "text/plain".to_string(), }, ]; let run_create = RunCreateExtended { run_create: RunCreate { common: RunCommon { id: String::from("test_id"), trace_id: String::from("trace_id"), dotted_order: String::from("1.1"), parent_run_id: None, extra: Some(json!({"extra_data": "value"})), error: None, serialized: Some(json!({"key": "value"})), events: Some(Value::from(vec![json!({"event": "event_data"})])), tags: Some(Value::from(vec!["tag1", "tag2"])), session_id: None, session_name: Some("Session Name".to_string()), }, name: String::from("Run Name"), start_time: TimeValue::UnsignedInt(1697462400000), end_time: Some(TimeValue::UnsignedInt(1697466000000)), run_type: String::from("chain"), reference_example_id: None, }, attachments: Some(attachments), io: RunIO { inputs: Some(to_vec(&json!({"input": "value"})).expect("to_vec failed")), outputs: Some(to_vec(&json!({"output": "value"})).expect("to_vec failed")), }, }; client.submit_run_create(run_create).await.unwrap(); // shutdown the client to ensure all messages are processed client.shutdown().await.unwrap(); m.assert_async().await; let req = captured_request.lock().unwrap().clone(); let fields = handle_request(req.0, req.1).await; assert_eq!(fields.len(), 5); // assert run fields assert_eq!(fields[0].name, "post.test_id"); assert_eq!(fields[0].content_type, Some("application/json; length=375".to_string())); assert_eq!(fields[0].filename, None); let received_run: Value = from_str(&fields[0].data).unwrap(); assert_eq!(received_run["id"], "test_id"); assert_eq!(received_run["trace_id"], "trace_id"); assert_eq!(received_run["dotted_order"], "1.1"); assert_eq!(received_run["parent_run_id"], json!(null)); assert_eq!(received_run["extra"], json!({"extra_data": "value"})); assert_eq!(received_run["error"], json!(null)); assert_eq!(received_run["serialized"], json!({"key": "value"})); assert_eq!(received_run["events"], Value::from(vec![json!({"event": "event_data"})])); assert_eq!(received_run["tags"], Value::from(vec!["tag1", "tag2"])); assert_eq!(received_run["session_name"], "Session Name"); assert_eq!(received_run["session_id"], json!(null)); assert_eq!(received_run["name"], "Run Name"); assert_eq!(received_run["start_time"], 1697462400000i64); assert_eq!(received_run["end_time"], 1697466000000i64); assert_eq!(received_run["run_type"], "chain"); assert_eq!(received_run["reference_example_id"], json!(null)); // assert inputs fields assert_eq!(fields[1].name, "post.test_id.inputs"); assert_eq!(fields[1].content_type, Some("application/json; length=17".to_string())); assert_eq!(fields[1].filename, None); let received_inputs: Value = from_str(&fields[1].data).unwrap(); assert_eq!(received_inputs, json!({"input": "value"})); // assert outputs fields assert_eq!(fields[2].name, "post.test_id.outputs"); assert_eq!(fields[2].content_type, Some("application/json; length=18".to_string())); assert_eq!(fields[2].filename, None); let received_outputs: Value = from_str(&fields[2].data).unwrap(); assert_eq!(received_outputs, json!({"output": "value"})); // assert attachment_1 fields assert_eq!(fields[3].name, "attachment.test_id.attachment_1"); assert_eq!(fields[3].content_type, Some("application/octet-stream; length=3".to_string())); assert_eq!(fields[3].filename, Some("file1.txt".to_string())); assert_eq!(fields[3].data, "\u{1}\u{2}\u{3}"); // assert attachment_2 fields assert_eq!(fields[4].name, "attachment.test_id.attachment_2"); assert_eq!(fields[4].content_type, Some("text/plain; length=29".to_string())); assert_eq!(fields[4].filename, Some("test_file_create.txt".to_string())); assert_eq!(fields[4].data, "Test file content for create\n"); } #[tokio::test] async fn test_tracing_client_submit_run_update() { // NOTE: we can't use an async mutex here because mockito doesn't support async functions // in `with_body_from_request`. let mut server = Server::new_async().await; let captured_request: Arc<Mutex<(Vec<u8>, String)>> = Arc::new(Mutex::new((Vec::new(), String::new()))); let captured_request_clone = Arc::clone(&captured_request); let m = server .mock("POST", "/runs/multipart") .expect(1) .with_status(200) .with_body_from_request(move |req| { let mut request = captured_request_clone.lock().unwrap(); request.0 = req.body().unwrap().to_vec(); let content_type_headers = req.header("content-type"); let content_type_str: String = content_type_headers .iter() .filter_map(|h| h.to_str().ok()) .collect::<Vec<&str>>() .join(", "); request.1 = content_type_str; let auth_headers = req.header("X-API-KEY"); assert!(auth_headers.iter().any(|h| h.to_str().unwrap() == "test_key")); vec![] // return empty response body }) .create_async() .await; let mut headers = HeaderMap::new(); headers.insert("X-API-KEY", HeaderValue::from_static("test_key")); let config = ClientConfig { endpoint: server.url(), queue_capacity: 10, batch_size: 5, // batch size is 5 to ensure shutdown flushes the queue batch_timeout: Duration::from_secs(1), headers: Some(headers), }; let client = TracingClient::new(config).unwrap(); // Write a test file to disk for streaming let tmp_dir = TempDir::new().unwrap(); let test_file_path = tmp_dir.path().join("test_file_update.txt"); let mut test_file = File::create(&test_file_path).unwrap(); writeln!(test_file, "Test file content for update").unwrap(); let attachments = vec![ Attachment { ref_name: "attachment_1".to_string(), filename: "file1_update.txt".to_string(), data: Some(vec![4, 5, 6]), content_type: "application/octet-stream".to_string(), }, Attachment { ref_name: "attachment_2".to_string(), filename: test_file_path.to_string_lossy().into_owned(), data: None, // this will cause the processor to read from disk content_type: "text/plain".to_string(), }, ]; let run_update = RunUpdateExtended { run_update: RunUpdate { common: RunCommon { id: String::from("test_id"), trace_id: String::from("trace_id"), dotted_order: String::from("1.1"), parent_run_id: None, extra: Some(json!({"extra_data": "value"})), error: None, serialized: Some(json!({"key": "value"})), events: Some(Value::from(vec![json!({"event": "event_data"})])), tags: Some(Value::from(vec!["tag1", "tag2"])), session_id: None, session_name: Some("Session Name".to_string()), }, end_time: TimeValue::String("2024-10-16T12:00:00Z".to_string()), }, attachments: Some(attachments), io: RunIO { inputs: None, outputs: Some(to_vec(&json!({"updated_output": "value"})).expect("to_vec failed")), }, }; client.submit_run_update(run_update).await.unwrap(); // shutdown the client to ensure all messages are processed client.shutdown().await.unwrap(); m.assert_async().await; let req = captured_request.lock().unwrap().clone(); let fields = handle_request(req.0, req.1).await; assert_eq!(fields.len(), 4); // assert run fields assert_eq!(fields[0].name, "patch.test_id"); assert_eq!(fields[0].content_type, Some("application/json; length=292".to_string())); assert_eq!(fields[0].filename, None); let received_run: Value = from_str(&fields[0].data).unwrap(); assert_eq!(received_run["id"], "test_id"); assert_eq!(received_run["trace_id"], "trace_id"); assert_eq!(received_run["extra"], json!({"extra_data": "value"})); assert_eq!(received_run["error"], json!(null)); assert_eq!(received_run["serialized"], json!({"key": "value"})); assert_eq!(received_run["events"], Value::from(vec![json!({"event": "event_data"})])); assert_eq!(received_run["tags"], Value::from(vec!["tag1", "tag2"])); assert_eq!(received_run["session_name"], "Session Name"); assert_eq!(received_run["end_time"], "2024-10-16T12:00:00Z"); // assert outputs fields assert_eq!(fields[1].name, "patch.test_id.outputs"); assert_eq!(fields[1].content_type, Some("application/json; length=26".to_string())); assert_eq!(fields[1].filename, None); let received_outputs: Value = from_str(&fields[1].data).unwrap(); assert_eq!(received_outputs, json!({"updated_output": "value"})); // assert attachment_1 fields assert_eq!(fields[2].name, "attachment.test_id.attachment_1"); assert_eq!(fields[2].content_type, Some("application/octet-stream; length=3".to_string())); assert_eq!(fields[2].filename, Some("file1_update.txt".to_string())); assert_eq!(fields[2].data, "\u{4}\u{5}\u{6}"); // assert attachment_2 fields assert_eq!(fields[3].name, "attachment.test_id.attachment_2"); assert_eq!(fields[3].content_type, Some("text/plain; length=29".to_string())); assert_eq!(fields[3].filename, Some("test_file_update.txt".to_string())); assert_eq!(fields[3].data, "Test file content for update\n"); }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/lib.rs
pub mod client;
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/main.rs
#![expect(unused_imports)] use std::fs::File; use std::io::Write; use langsmith_tracing_client::client::async_enabled::{ClientConfig, TracingClient}; use langsmith_tracing_client::client::{ Attachment, RunCommon, RunCreate, RunCreateExtended, RunIO, RunUpdate, RunUpdateExtended, TimeValue, }; use rayon::prelude::*; use reqwest::header::{HeaderMap, HeaderValue}; use serde_json::Value; use tempfile::TempDir; use tokio::time::Duration; use uuid::Uuid; // #[tokio::main] // async fn main() -> Result<(), Box<dyn std::error::Error>> { // let tmp_dir = TempDir::new().unwrap(); // let test_file_path = tmp_dir.path().join("test_file_create.txt"); // let mut test_file = File::create(&test_file_path).unwrap(); // writeln!(test_file, "Test file content for create").unwrap(); // // let mut attachments = Vec::new(); // attachments.push(Attachment { // ref_name: "attachment_1".to_string(), // filename: "file1.txt".to_string(), // data: Some(vec![1, 2, 3]), // content_type: "application/octet-stream".to_string(), // }); // attachments.push(Attachment { // ref_name: "attachment_2".to_string(), // filename: test_file_path.into_os_string().into_string().unwrap(), // data: None, // this will cause the processor to read from disk // content_type: "text/plain".to_string(), // }); // // let run_id = Uuid::new_v4().to_string(); // println!("Run ID: {}", run_id); // // let run_create = RunCreateExtended { // run_create: RunCreate { // common: RunCommon { // id: String::from(&run_id), // trace_id: String::from(&run_id), // dotted_order: String::from("20241009T223747383001Z{}".to_string() + &run_id), // parent_run_id: None, // extra: Some(serde_json::json!({"extra_data": "value"})), // error: None, // serialized: None, // events: Some(serde_json::json!([{ "event": "event_data" }])), // tags: Some(serde_json::json!(["tag1", "tag2"])), // session_id: None, // session_name: Some("Rust Session Name".to_string()), // }, // name: String::from("Rusty"), // start_time: TimeValue::UnsignedInt(1728513467383), // end_time: Some(TimeValue::UnsignedInt(1728513468236)), // run_type: String::from("chain"), // reference_example_id: None, // }, // attachments: Some(attachments), // io: RunIO { // inputs: Some(serde_json::json!({"input": "value"})), // outputs: Some(serde_json::json!({"output": "value"})), // }, // }; // // let mut attachments_two = Vec::new(); // attachments_two.push(Attachment { // ref_name: "attachment_1".to_string(), // filename: "file1.txt".to_string(), // data: Some(vec![1, 2, 3]), // content_type: "application/octet-stream".to_string(), // }); // // let run_id_two = Uuid::new_v4().to_string(); // println!("Run ID Two: {}", run_id_two); // let run_create_two = RunCreateExtended { // run_create: RunCreate { // common: RunCommon { // id: String::from(&run_id_two), // trace_id: String::from(&run_id_two), // dotted_order: String::from("20241009T223747383001Z{}".to_string() + &run_id_two), // parent_run_id: None, // extra: Some(serde_json::json!({"extra_data": "value"})), // error: None, // serialized: None, // events: Some(serde_json::json!([{ "event": "event_data" }])), // tags: Some(serde_json::json!(["tag1", "tag2"])), // session_id: None, // session_name: Some("Rust Session Name".to_string()), // }, // name: String::from("Rusty two"), // start_time: TimeValue::UnsignedInt(1728513467383), // end_time: None, // run_type: String::from("chain"), // reference_example_id: None, // }, // attachments: Some(attachments_two), // io: RunIO { // inputs: Some(serde_json::json!({"input": "value"})), // outputs: None, // }, // }; // // let run_update_two = RunUpdateExtended { // run_update: RunUpdate { // common: RunCommon { // id: String::from(&run_id_two), // trace_id: String::from(&run_id_two), // dotted_order: String::from("20241009T223747383001Z{}".to_string() + &run_id_two), // parent_run_id: None, // extra: Some(serde_json::json!({"extra_data": "value"})), // error: None, // serialized: None, // events: None, // tags: Some(serde_json::json!(["tag1", "tag2"])), // session_id: None, // session_name: Some("Rust Session Name".to_string()), // }, // end_time: TimeValue::UnsignedInt(1728513468236), // }, // io: RunIO { // inputs: None, // outputs: Some(serde_json::json!({"output": "value"})), // }, // attachments: None, // }; // // let mut headers = HeaderMap::new(); // headers.insert("X-API-KEY", HeaderValue::from_static("test_key")); // let config = ClientConfig { // endpoint: String::from("http://localhost:1984"), // queue_capacity: 10, // batch_size: 5, // batch size is 5 to ensure shutdown flushes the queue // batch_timeout: Duration::from_secs(1), // headers: None, // }; // // let client = TracingClient::new(config).unwrap(); // client.submit_run_create(run_create).await.unwrap(); // client.submit_run_create(run_create_two).await.unwrap(); // client.submit_run_update(run_update_two).await.unwrap(); // // client.shutdown().await.unwrap(); // Ok(()) // } fn create_large_json(len: usize) -> Value { let large_array: Vec<Value> = (0..len) .map(|i| { serde_json::json!({ "index": i, "data": format!("This is element number {}", i), "nested": { "id": i, "value": format!("Nested value for element {}", i), } }) }) .collect(); serde_json::json!({ "name": "Huge JSON", "description": "This is a very large JSON object for benchmarking purposes.", "array": large_array, "metadata": { "created_at": "2024-10-22T19:00:00Z", "author": "Rust Program", "version": 1.0 } }) } // Sequential processing fn benchmark_sequential(data: &[Value]) -> Vec<Vec<u8>> { data.iter().map(|json| serde_json::to_vec(json).expect("Failed to serialize JSON")).collect() } // Parallel processing fn benchmark_parallel(data: &[Value]) -> Vec<Vec<u8>> { data.par_iter() .map(|json| serde_json::to_vec(json).expect("Failed to serialize JSON")) .collect() } fn main() { let num_json_objects = 1000; let json_length = 3000; let data: Vec<Value> = (0..num_json_objects).map(|_| create_large_json(json_length)).collect(); let start = std::time::Instant::now(); let _ = benchmark_parallel(&data); println!("Parallel serialization took: {:?}", start.elapsed()); let start = std::time::Instant::now(); let _ = benchmark_sequential(&data); println!("Sequential serialization took: {:?}", start.elapsed()); }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/run.rs
use serde::{Deserialize, Serialize}; use serde_json::Value; // Map attachment ref to tuple of filename, optional bytes #[derive(Debug)] pub struct Attachment { pub ref_name: String, pub filename: String, pub data: Option<Vec<u8>>, pub content_type: String, } // Must support both string (Py) and unsigned int (JS) #[derive(Serialize, Deserialize, PartialEq, Debug)] #[serde(untagged)] pub enum TimeValue { String(String), UnsignedInt(u64), } #[derive(PartialEq, Debug)] pub struct RunIO { pub inputs: Option<Vec<u8>>, pub outputs: Option<Vec<u8>>, } #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct RunCommon { pub id: String, pub trace_id: String, pub dotted_order: String, pub parent_run_id: Option<String>, pub extra: Option<Value>, pub error: Option<String>, pub serialized: Option<Value>, pub events: Option<Value>, pub tags: Option<Value>, pub session_id: Option<String>, pub session_name: Option<String>, } #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct RunCreate { #[serde(flatten)] pub common: RunCommon, pub name: String, pub start_time: TimeValue, pub end_time: Option<TimeValue>, pub run_type: String, pub reference_example_id: Option<String>, } #[derive(Serialize, Deserialize, PartialEq, Debug)] pub struct RunUpdate { #[serde(flatten)] pub common: RunCommon, pub end_time: TimeValue, } #[derive(Debug)] pub struct RunCreateExtended { pub run_create: RunCreate, pub io: RunIO, pub attachments: Option<Vec<Attachment>>, } #[derive(Debug)] pub struct RunUpdateExtended { pub run_update: RunUpdate, pub io: RunIO, pub attachments: Option<Vec<Attachment>>, } #[derive(Debug)] pub struct RunEventBytes { pub run_id: String, pub event_type: EventType, pub run_bytes: Vec<u8>, pub inputs_bytes: Option<Vec<u8>>, pub outputs_bytes: Option<Vec<u8>>, pub attachments: Option<Vec<Attachment>>, } #[derive(Debug)] pub enum EventType { Create, Update, } #[derive(Debug)] pub(crate) enum QueuedRun { Create(RunCreateExtended), Update(RunUpdateExtended), #[expect(dead_code)] RunBytes(RunEventBytes), Drain, Shutdown, }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/errors.rs
use thiserror::Error; #[derive(Error, Debug)] pub enum TracingClientError { #[error("Queue is full")] QueueFull, #[error("Serialization error: {0}")] SerializationError(#[from] serde_json::Error), #[error("HTTP error: {0}")] HttpError(reqwest::StatusCode), #[error("Request error: {0}")] RequestError(#[from] reqwest::Error), #[error("Channel send error")] ChannelSendError, #[error("Unexpected shutdown")] UnexpectedShutdown, #[error("IO error")] IoError(String), }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/mod.rs
mod errors; mod run; pub mod async_enabled; pub mod blocking; pub use errors::TracingClientError; pub use run::{ Attachment, EventType, RunCommon, RunCreate, RunCreateExtended, RunEventBytes, RunIO, RunUpdate, RunUpdateExtended, TimeValue, };
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/async_enabled/processor.rs
use futures::stream::{FuturesUnordered, StreamExt}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use reqwest::multipart::{Form, Part}; use serde_json::to_vec; use tokio::sync::mpsc::Receiver; use tokio::task; use tokio::time::{sleep, Instant}; use tokio_util::io::ReaderStream; use super::tracing_client::ClientConfig; use crate::client::errors::TracingClientError; use crate::client::run::{Attachment, EventType, QueuedRun, RunEventBytes}; use crate::client::run::{RunCreateExtended, RunUpdateExtended}; pub struct RunProcessor { receiver: Receiver<QueuedRun>, http_client: reqwest::Client, config: ClientConfig, } impl RunProcessor { pub(crate) fn new(receiver: Receiver<QueuedRun>, config: ClientConfig) -> Self { let http_client = reqwest::Client::new(); Self { receiver, http_client, config } } pub(crate) async fn run(mut self) -> Result<(), TracingClientError> { let mut buffer = Vec::new(); let mut last_send_time = Instant::now(); loop { tokio::select! { Some(queued_run) = self.receiver.recv() => { match queued_run { QueuedRun::Shutdown => { println!("shutdown signal received."); if !buffer.is_empty() { println!("sending remaining buffer before shutdown."); self.send_and_clear_buffer(&mut buffer).await?; } break; }, _ => { // println!("received a queued run."); buffer.push(queued_run); if buffer.len() >= self.config.batch_size { println!("batch size limit, sending batch."); self.send_and_clear_buffer(&mut buffer).await?; last_send_time = Instant::now(); } } } } _ = sleep(self.config.batch_timeout) => { if !buffer.is_empty() && last_send_time.elapsed() >= self.config.batch_timeout { // println!("batch timeout, sending batch."); self.send_and_clear_buffer(&mut buffer).await?; last_send_time = Instant::now(); } } else => { // println!("channel closed."); if !buffer.is_empty() { // println!("sending remaining buffer."); self.send_and_clear_buffer(&mut buffer).await?; } break; } } } // println!("exiting loop."); Ok(()) } async fn send_and_clear_buffer( &self, buffer: &mut Vec<QueuedRun>, ) -> Result<(), TracingClientError> { if let Err(e) = self.send_batch(std::mem::take(buffer)).await { // todo: retry logic? eprintln!("Error sending batch: {}", e); } Ok(()) } // async fn send_batch(&self, batch: Vec<QueuedRun>) -> Result<(), TracingClientError> { // let mut form = Form::new(); // // println!("Sending batch of {} runs", batch.len()); // // for queued_run in batch { // match queued_run { // QueuedRun::Create(run_create_extended) => { // self.consume_run_create(run_create_extended, &mut form) // .await?; // } // QueuedRun::Update(run_update_extended) => { // self.consume_run_update(run_update_extended, &mut form) // .await?; // } // QueuedRun::RunBytes(run_event_bytes) => { // self.consume_run_bytes(run_event_bytes, &mut form).await?; // } // QueuedRun::Shutdown => { // return Err(TracingClientError::UnexpectedShutdown); // } // } // } // // // Send the multipart POST request // let response = self // .http_client // .post(format!("{}/runs/multipart", self.config.endpoint)) // .multipart(form) // .headers(self.config.headers.clone().unwrap_or_default()) // .send() // .await?; // // if response.status().is_success() { // Ok(()) // } else { // Err(TracingClientError::HttpError(response.status())) // } // } #[expect(dead_code)] async fn consume_run_create( &self, run_create_extended: RunCreateExtended, form: &mut Form, ) -> Result<(), TracingClientError> { let RunCreateExtended { run_create, io, attachments } = run_create_extended; let run_id = &run_create.common.id; // conditionally add the run_create and io parts to the form self.add_json_part_to_form(form, format!("post.{}", run_id), &run_create)?; if let Some(inputs) = io.inputs { self.add_json_part_to_form(form, format!("post.{}.inputs", run_id), &inputs)?; } if let Some(outputs) = io.outputs { self.add_json_part_to_form(form, format!("post.{}.outputs", run_id), &outputs)?; } if let Some(attachments) = attachments { for attachment in attachments { self.add_attachment_to_form(form, run_id, attachment).await?; } } Ok(()) } #[expect(dead_code)] async fn consume_run_update( &self, run_update_extended: RunUpdateExtended, form: &mut Form, ) -> Result<(), TracingClientError> { let RunUpdateExtended { run_update, io, attachments } = run_update_extended; let run_id = &run_update.common.id; self.add_json_part_to_form(form, format!("patch.{}", run_id), &run_update)?; if let Some(outputs) = io.outputs { self.add_json_part_to_form(form, format!("patch.{}.outputs", run_id), &outputs)?; } if let Some(attachments) = attachments { for attachment in attachments { self.add_attachment_to_form(form, run_id, attachment).await?; } } Ok(()) } #[expect(dead_code)] async fn consume_run_bytes( &self, run_event_bytes: RunEventBytes, form: &mut Form, ) -> Result<(), TracingClientError> { let RunEventBytes { run_id, event_type, run_bytes, inputs_bytes, outputs_bytes, attachments, } = run_event_bytes; let event_type_str = match event_type { EventType::Create => "post", EventType::Update => "patch", }; let part_size = run_bytes.len() as u64; *form = std::mem::take(form).part( format!("{}.{}", event_type_str, run_id), Part::bytes(run_bytes).mime_str(&format!("application/json; length={}", part_size))?, ); if let Some(inputs_bytes) = inputs_bytes { let part_size = inputs_bytes.len() as u64; *form = std::mem::take(form).part( format!("{}.{}.inputs", event_type_str, run_id), Part::bytes(inputs_bytes) .mime_str(&format!("application/json; length={}", part_size))?, ); } if let Some(outputs_bytes) = outputs_bytes { let part_size = outputs_bytes.len() as u64; *form = std::mem::take(form).part( format!("{}.{}.outputs", event_type_str, run_id), Part::bytes(outputs_bytes) .mime_str(&format!("application/json; length={}", part_size))?, ); } if let Some(attachments) = attachments { for attachment in attachments { self.add_attachment_to_form(form, &run_id, attachment).await?; } } Ok(()) } fn add_json_part_to_form( &self, form: &mut Form, part_name: String, data: &impl serde::Serialize, ) -> Result<(), TracingClientError> { let data_bytes = to_vec(data).unwrap(); // TODO: get rid of unwrap let part_size = data_bytes.len() as u64; *form = std::mem::take(form).part( part_name, Part::bytes(data_bytes).mime_str(&format!("application/json; length={}", part_size))?, ); Ok(()) } async fn add_attachment_to_form( &self, form: &mut Form, run_id: &str, attachment: Attachment, ) -> Result<(), TracingClientError> { let part_name = format!("attachment.{}.{}", run_id, attachment.ref_name); if let Some(data) = attachment.data { let part_size = data.len() as u64; *form = std::mem::take(form).part( part_name, Part::bytes(data) .file_name(attachment.filename) .mime_str(&format!("{}; length={}", &attachment.content_type, part_size))?, ); } else { // stream the file from disk to avoid loading the entire file into memory let file_path = std::path::Path::new(&attachment.filename); let metadata = tokio::fs::metadata(file_path).await.map_err(|e| { TracingClientError::IoError(format!("Failed to read file metadata: {}", e)) })?; let file_size = metadata.len(); let file = tokio::fs::File::open(file_path) .await .map_err(|e| TracingClientError::IoError(format!("Failed to open file: {}", e)))?; let stream = ReaderStream::new(file); let body = reqwest::Body::wrap_stream(stream); // extract filename from path let file_name = file_path .file_name() .ok_or_else(|| { TracingClientError::IoError("Failed to extract filename from path".to_string()) })? .to_string_lossy() .into_owned(); let part = Part::stream_with_length(body, file_size) .file_name(file_name) .mime_str(&format!("{}; length={}", &attachment.content_type, file_size))?; *form = std::mem::take(form).part(part_name, part); } Ok(()) } #[expect(unused_variables)] async fn send_batch(&self, batch: Vec<QueuedRun>) -> Result<(), TracingClientError> { let start_send_batch = Instant::now(); let mut json_data = Vec::new(); let mut attachment_futures = Vec::new(); for queued_run in batch { match queued_run { QueuedRun::Create(run_create_extended) => { let RunCreateExtended { run_create, io, attachments } = run_create_extended; let run_id = run_create.common.id.clone(); // Collect JSON data json_data.push(( format!("post.{}", run_id), to_vec(&run_create).unwrap(), // TODO: get rid of unwrap )); if let Some(inputs) = io.inputs { json_data.push((format!("post.{}.inputs", run_id), inputs)); } if let Some(outputs) = io.outputs { json_data.push((format!("post.{}.outputs", run_id), outputs)); } if let Some(attachments) = attachments { for attachment in attachments { attachment_futures.push(( format!("attachment.{}.{}", run_id, attachment.ref_name), self.create_attachment_part(attachment), )); } } } QueuedRun::Update(run_update_extended) => { let RunUpdateExtended { run_update, io, attachments } = run_update_extended; let run_id = run_update.common.id.clone(); // Collect JSON data json_data.push(( format!("patch.{}", run_id), to_vec(&run_update).unwrap(), // TODO: get rid of unwrap )); if let Some(outputs) = io.outputs { json_data.push((format!("patch.{}.outputs", run_id), outputs)); } if let Some(attachments) = attachments { for attachment in attachments { attachment_futures.push(( format!("attachment.{}.{}", run_id, attachment.ref_name), self.create_attachment_part(attachment), )); } } } QueuedRun::RunBytes(_) => { // TODO: fix this return Err(TracingClientError::UnexpectedShutdown); } QueuedRun::Drain => { unreachable!("drain message in batch"); } QueuedRun::Shutdown => { return Err(TracingClientError::UnexpectedShutdown); } } } // println!("Batch processing took {:?}", start_send_batch.elapsed()); // process JSON serialization in a blocking thread with Rayon parallel iterator let start = Instant::now(); let json_parts = task::spawn_blocking(move || { println!("Parallel processing a batch of {} runs", json_data.len()); let start_time_in_parallel = Instant::now(); json_data .into_par_iter() .map(|(part_name, data_bytes)| { let part_size = data_bytes.len() as u64; let part = Part::bytes(data_bytes) .mime_str(&format!("application/json; length={}", part_size))?; Ok::<(String, Part), TracingClientError>((part_name, part)) }) .collect::<Result<Vec<_>, TracingClientError>>() }) .await .unwrap()?; // TODO: get rid of unwrap println!("JSON processing took {:?}", start.elapsed()); // process attachments asynchronously let attachment_parts_results = FuturesUnordered::from_iter( attachment_futures.into_iter().map(|(part_name, future)| async { let part = future.await?; Ok((part_name, part)) }), ) .collect::<Vec<Result<(String, Part), TracingClientError>>>() .await; let mut attachment_parts = Vec::new(); for result in attachment_parts_results { match result { Ok((part_name, part)) => { attachment_parts.push((part_name, part)); } Err(e) => { eprintln!("Error processing attachment: {}", e); } } } // assemble form let mut form = Form::new(); for (part_name, part) in json_parts.into_iter().chain(attachment_parts) { form = form.part(part_name, part); } // println!("Assembling form took {:?}", start.elapsed()); // send the multipart POST request let start_send_batch = std::time::Instant::now(); let response = self .http_client .post(format!("{}/runs/multipart", self.config.endpoint)) .multipart(form) .headers(self.config.headers.clone().unwrap_or_default()) .send() .await?; println!("Sending batch took {:?}", start_send_batch.elapsed()); // println!("Sending batch took {:?}", start_send_batch.elapsed()); if response.status().is_success() { Ok(()) } else { Err(TracingClientError::HttpError(response.status())) } } async fn create_attachment_part( &self, attachment: Attachment, ) -> Result<Part, TracingClientError> { let part = if let Some(data) = attachment.data { let part_size = data.len() as u64; Part::bytes(data) .file_name(attachment.filename) .mime_str(&format!("{}; length={}", &attachment.content_type, part_size))? } else { let file_path = std::path::Path::new(&attachment.filename); let metadata = tokio::fs::metadata(file_path).await.map_err(|e| { TracingClientError::IoError(format!("Failed to read file metadata: {}", e)) })?; let file_size = metadata.len(); let file = tokio::fs::File::open(file_path) .await .map_err(|e| TracingClientError::IoError(format!("Failed to open file: {}", e)))?; let stream = ReaderStream::new(file); let body = reqwest::Body::wrap_stream(stream); let file_name = file_path .file_name() .ok_or_else(|| { TracingClientError::IoError("Failed to extract filename from path".to_string()) })? .to_string_lossy() .into_owned(); Part::stream_with_length(body, file_size) .file_name(file_name) .mime_str(&format!("{}; length={}", &attachment.content_type, file_size))? }; Ok(part) } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/async_enabled/tracing_client.rs
use std::time::Duration; use reqwest::header::HeaderMap; use tokio::sync::mpsc::{self, Sender}; use tokio::task::JoinHandle; use super::processor::RunProcessor; use crate::client::errors::TracingClientError; use crate::client::run::{QueuedRun, RunEventBytes}; use crate::client::run::{RunCreateExtended, RunUpdateExtended}; pub struct ClientConfig { pub endpoint: String, pub queue_capacity: usize, pub batch_size: usize, pub batch_timeout: Duration, pub headers: Option<HeaderMap>, } pub struct TracingClient { sender: Sender<QueuedRun>, handle: JoinHandle<Result<(), TracingClientError>>, } impl TracingClient { pub fn new(config: ClientConfig) -> Result<Self, TracingClientError> { let (sender, receiver) = mpsc::channel(config.queue_capacity); let processor = RunProcessor::new(receiver, config); let handle = tokio::spawn(async move { let result = processor.run().await; if let Err(e) = &result { eprintln!("RunProcessor exited with error: {}", e); } result }); Ok(Self { sender, handle }) } pub async fn submit_run_create( &self, run: RunCreateExtended, ) -> Result<(), TracingClientError> { let queued_run = QueuedRun::Create(run); self.sender.send(queued_run).await.map_err(|_| TracingClientError::QueueFull) } pub async fn submit_run_update( &self, run: RunUpdateExtended, ) -> Result<(), TracingClientError> { let queued_run = QueuedRun::Update(run); self.sender.send(queued_run).await.map_err(|_| TracingClientError::QueueFull) } pub async fn submit_run_bytes(&self, run: RunEventBytes) -> Result<(), TracingClientError> { let queued_run = QueuedRun::RunBytes(run); self.sender.send(queued_run).await.map_err(|_| TracingClientError::QueueFull) } pub async fn shutdown(self) -> Result<(), TracingClientError> { self.sender.send(QueuedRun::Shutdown).await.map_err(|_| TracingClientError::QueueFull)?; self.handle.await.unwrap() } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/async_enabled/mod.rs
mod processor; mod tracing_client; pub use processor::RunProcessor; pub use tracing_client::{ClientConfig, TracingClient};
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/blocking/processor.rs
use std::sync::mpsc::{Receiver, Sender}; use std::sync::{mpsc, Arc, Mutex}; use std::time::{Duration, Instant}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use reqwest::blocking::multipart::{Form, Part}; use serde_json::to_vec; use super::tracing_client::ClientConfig; use crate::client::errors::TracingClientError; use crate::client::run::{Attachment, QueuedRun}; use crate::client::run::{RunCreateExtended, RunUpdateExtended}; pub struct RunProcessor { receiver: Arc<Mutex<Receiver<QueuedRun>>>, drain_sender: Sender<()>, config: Arc<ClientConfig>, http_client: reqwest::blocking::Client, } impl RunProcessor { pub(crate) fn new( receiver: Arc<Mutex<Receiver<QueuedRun>>>, drain_sender: Sender<()>, config: Arc<ClientConfig>, ) -> Self { let http_client = reqwest::blocking::Client::new(); Self { receiver, drain_sender, http_client, config } } pub(crate) fn run(&self) -> Result<(), TracingClientError> { let mut buffer = Vec::new(); let batch_timeout = self.config.batch_timeout; let batch_size = self.config.batch_size; let mut last_send_time = Instant::now(); loop { let queued_run = { let receiver = self.receiver.lock().unwrap(); receiver.recv_timeout(Duration::from_millis(100)) }; match queued_run { Ok(queued_run) => match queued_run { QueuedRun::Shutdown => { if !buffer.is_empty() { self.send_and_clear_buffer(&mut buffer)?; } break; } QueuedRun::Drain => { if !buffer.is_empty() { self.send_and_clear_buffer(&mut buffer)?; } self.drain_sender.send(()).expect("drain_sender should never fail"); // Put this thread to sleep, so we know the remaining `Drain` messages // are almost certainly answered by other worker threads. // // HACK: This is very hacky! // Drain should only be used for benchmarking. std::thread::sleep(Duration::from_secs(120)); } _ => { buffer.push(queued_run); if buffer.len() >= batch_size { self.send_and_clear_buffer(&mut buffer)?; last_send_time = Instant::now(); } } }, Err(mpsc::RecvTimeoutError::Timeout) => { if !buffer.is_empty() && last_send_time.elapsed() >= batch_timeout { self.send_and_clear_buffer(&mut buffer)?; last_send_time = Instant::now(); } } Err(mpsc::RecvTimeoutError::Disconnected) => { if !buffer.is_empty() { self.send_and_clear_buffer(&mut buffer)?; } break; } } } Ok(()) } fn send_and_clear_buffer(&self, buffer: &mut Vec<QueuedRun>) -> Result<(), TracingClientError> { if let Err(e) = self.send_batch(std::mem::take(buffer)) { // todo: retry logic? eprintln!("Error sending batch: {}", e); } Ok(()) } #[expect(unused_variables)] fn send_batch(&self, batch: Vec<QueuedRun>) -> Result<(), TracingClientError> { //println!("Handling a batch of {} runs", batch.len()); let start_send_batch = tokio::time::Instant::now(); let mut json_data = Vec::new(); let mut attachment_parts = Vec::new(); let start_iter = Instant::now(); for queued_run in batch { match queued_run { QueuedRun::Create(run_create_extended) => { let RunCreateExtended { run_create, io, attachments } = run_create_extended; let run_id = run_create.common.id.clone(); // Collect JSON data json_data.push(( format!("post.{}", run_id), to_vec(&run_create).unwrap(), // TODO: get rid of unwrap )); if let Some(inputs) = io.inputs { json_data.push((format!("post.{}.inputs", run_id), inputs)); } if let Some(outputs) = io.outputs { json_data.push((format!("post.{}.outputs", run_id), outputs)); } if let Some(attachments) = attachments { for attachment in attachments { let part_name = format!("attachment.{}.{}", run_id, attachment.ref_name); match self.create_attachment_part(attachment) { Ok(part) => { attachment_parts.push((part_name, part)); } Err(e) => { eprintln!("Error processing attachment: {}", e); } } } } } QueuedRun::Update(run_update_extended) => { let RunUpdateExtended { run_update, io, attachments } = run_update_extended; let run_id = run_update.common.id.clone(); // Collect JSON data json_data.push(( format!("patch.{}", run_id), to_vec(&run_update).unwrap(), // TODO: get rid of unwrap )); if let Some(outputs) = io.outputs { json_data.push((format!("patch.{}.outputs", run_id), outputs)); } if let Some(attachments) = attachments { for attachment in attachments { let part_name = format!("attachment.{}.{}", run_id, attachment.ref_name); match self.create_attachment_part(attachment) { Ok(part) => { attachment_parts.push((part_name, part)); } Err(e) => { eprintln!("Error processing attachment: {}", e); } } } } } QueuedRun::RunBytes(_) => { // TODO: fix this return Err(TracingClientError::UnexpectedShutdown); } QueuedRun::Drain => { unreachable!("drain message in batch"); } QueuedRun::Shutdown => { return Err(TracingClientError::UnexpectedShutdown); } } } //println!("Iterating over batch took {:?}", start_iter.elapsed()); let start = Instant::now(); let json_parts = json_data .into_par_iter() .map(|(part_name, data_bytes)| { let part_size = data_bytes.len() as u64; let part = Part::bytes(data_bytes) .mime_str(&format!("application/json; length={}", part_size))?; Ok::<(String, Part), TracingClientError>((part_name, part)) }) .collect::<Result<Vec<_>, TracingClientError>>()?; // println!("JSON processing took {:?}", start.elapsed()); let mut form = Form::new(); for (part_name, part) in json_parts.into_iter().chain(attachment_parts) { form = form.part(part_name, part); } // send the multipart POST request let start_send_batch = Instant::now(); let response = self .http_client .post(format!("{}/runs/multipart", self.config.endpoint)) .multipart(form) .headers(self.config.headers.as_ref().cloned().unwrap_or_default()) .send()?; // println!("Sending batch took {:?}", start_send_batch.elapsed()); if response.status().is_success() { Ok(()) } else { Err(TracingClientError::HttpError(response.status())) } } fn create_attachment_part(&self, attachment: Attachment) -> Result<Part, TracingClientError> { let part = if let Some(data) = attachment.data { let part_size = data.len() as u64; Part::bytes(data) .file_name(attachment.filename) .mime_str(&format!("{}; length={}", &attachment.content_type, part_size))? } else { let file_path = std::path::Path::new(&attachment.filename); let metadata = std::fs::metadata(file_path).map_err(|e| { TracingClientError::IoError(format!("Failed to read file metadata: {}", e)) })?; let file_size = metadata.len(); let file = std::fs::File::open(file_path) .map_err(|e| TracingClientError::IoError(format!("Failed to open file: {}", e)))?; let file_name = file_path .file_name() .ok_or_else(|| { TracingClientError::IoError("Failed to extract filename from path".to_string()) })? .to_string_lossy() .into_owned(); Part::reader_with_length(file, file_size) .file_name(file_name) .mime_str(&format!("{}; length={}", &attachment.content_type, file_size))? }; Ok(part) } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/blocking/tracing_client.rs
use std::sync::mpsc::{self, Receiver, Sender}; use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; use reqwest::header::{HeaderMap, HeaderValue}; use super::processor::RunProcessor; use crate::client::errors::TracingClientError; use crate::client::run::{QueuedRun, RunEventBytes}; use crate::client::run::{RunCreateExtended, RunUpdateExtended}; #[derive(Clone)] pub struct ClientConfig { pub endpoint: String, pub api_key: String, pub queue_capacity: usize, pub batch_size: usize, pub batch_timeout: Duration, pub headers: Option<HeaderMap>, pub num_worker_threads: usize, } pub struct TracingClient { sender: Sender<QueuedRun>, drain: Mutex<Receiver<()>>, handles: Vec<thread::JoinHandle<()>>, // Handles to worker threads } impl TracingClient { pub fn new(mut config: ClientConfig) -> Result<Self, TracingClientError> { let (sender, receiver) = mpsc::channel::<QueuedRun>(); let (drain_sender, drain_receiver) = mpsc::channel::<()>(); let receiver = Arc::new(Mutex::new(receiver)); // Ensure our headers include the API key. config.headers.get_or_insert_with(Default::default).append( "X-API-KEY", HeaderValue::from_str(&config.api_key).expect("failed to convert API key into header"), ); // We're going to share the config across threads. // It's immutable from this point onward, so Arc it for efficiency. let config = Arc::from(config); let mut handles = Vec::new(); for _ in 0..config.num_worker_threads { let worker_receiver = Arc::clone(&receiver); let worker_config = Arc::clone(&config); let cloned_drain_sender = drain_sender.clone(); let handle = thread::spawn(move || { let processor = RunProcessor::new(worker_receiver, cloned_drain_sender, worker_config); processor.run().expect("run failed"); }); handles.push(handle); } Ok(Self { sender, drain: drain_receiver.into(), handles }) } pub fn submit_run_create(&self, run: RunCreateExtended) -> Result<(), TracingClientError> { let queued_run = QueuedRun::Create(run); self.sender.send(queued_run).map_err(|_| TracingClientError::QueueFull) } // Similar methods for submit_run_update and submit_run_bytes pub fn submit_run_bytes(&self, run_bytes: RunEventBytes) -> Result<(), TracingClientError> { let queued_run = QueuedRun::RunBytes(run_bytes); self.sender.send(queued_run).map_err(|_| TracingClientError::QueueFull) } pub fn submit_run_update(&self, run: RunUpdateExtended) -> Result<(), TracingClientError> { let queued_run = QueuedRun::Update(run); self.sender.send(queued_run).map_err(|_| TracingClientError::QueueFull) } pub fn drain(&self) -> Result<(), TracingClientError> { for _ in &self.handles { self.sender.send(QueuedRun::Drain).map_err(|_| TracingClientError::QueueFull)?; } let drain_guard = self.drain.lock().expect("locking failed"); for _ in &self.handles { drain_guard.recv().expect("failed to receive drained message"); } drop(drain_guard); Ok(()) } pub fn shutdown(self) -> Result<(), TracingClientError> { // Send a Shutdown message to each worker thread for _ in &self.handles { self.sender.send(QueuedRun::Shutdown).map_err(|_| TracingClientError::QueueFull)?; } // Wait for all worker threads to finish for handle in self.handles { handle.join().unwrap(); } Ok(()) } }
0
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client
lc_public_repos/langsmith-sdk/rust/crates/langsmith-tracing-client/src/client/blocking/mod.rs
mod processor; mod tracing_client; pub use processor::RunProcessor; pub use tracing_client::{ClientConfig, TracingClient};
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/.npmignore
src/
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/tsconfig.json
{ "extends": "@tsconfig/recommended", "compilerOptions": { "target": "ES2021", "lib": [ "ES2021", "ES2022.Object", "DOM" ], "module": "NodeNext", "moduleResolution": "nodenext", "esModuleInterop": true, "declaration": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, "noUnusedParameters": true, "useDefineForClassFields": true, "strictPropertyInitialization": false, "stripInternal": true, "allowJs": true, "strict": true, "outDir": "dist" }, "include": [ "src/**/*" ], "exclude": [ "node_modules", "dist", "coverage" ], "includeVersion": true, "typedocOptions": { "entryPoints": [ "src/client.ts", "src/run_trees.ts", "src/traceable.ts", "src/evaluation/index.ts", "src/evaluation/langchain.ts", "src/schemas.ts", "src/langchain.ts", "src/vercel.ts", "src/wrappers/index.ts", "src/anonymizer/index.ts", "src/wrappers/openai.ts", "src/wrappers/vercel.ts", "src/singletons/traceable.ts" ] } }
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@ai-sdk/openai@^0.0.68": version "0.0.68" resolved "https://registry.yarnpkg.com/@ai-sdk/openai/-/openai-0.0.68.tgz#7507534a217355273651ad2ea0fffd6e208587ea" integrity sha512-WSzB7qpBTrnYvFbnBBmIsw1G8GM04JRMr+I7B5T7msgZfleG4cTvVrn9A1HeHHw9TmbKiaCKJrEZH4V0lb7jNQ== dependencies: "@ai-sdk/provider" "0.0.24" "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/provider-utils@1.0.20": version "1.0.20" resolved "https://registry.yarnpkg.com/@ai-sdk/provider-utils/-/provider-utils-1.0.20.tgz#46175945dc32ad2d76cb5447738bcac3ad59dbcb" integrity sha512-ngg/RGpnA00eNOWEtXHenpX1MsM2QshQh4QJFjUfwcqHpM5kTfG7je7Rc3HcEDP+OkRVv2GF+X4fC1Vfcnl8Ow== dependencies: "@ai-sdk/provider" "0.0.24" eventsource-parser "1.1.2" nanoid "3.3.6" secure-json-parse "2.7.0" "@ai-sdk/provider@0.0.24": version "0.0.24" resolved "https://registry.yarnpkg.com/@ai-sdk/provider/-/provider-0.0.24.tgz#e794f4255a833c47aeffcd8f6808a79b2a6b1f06" integrity sha512-XMsNGJdGO+L0cxhhegtqZ8+T6nn4EoShS819OvCgI2kLbYTIvk0GWFGD0AXJmxkxs3DrpsJxKAFukFR7bvTkgQ== dependencies: json-schema "0.4.0" "@ai-sdk/react@0.0.64": version "0.0.64" resolved "https://registry.yarnpkg.com/@ai-sdk/react/-/react-0.0.64.tgz#921d1dc53c98b7c3488a2099d2b67f6573c83e92" integrity sha512-4LN2vleyA6rYHZ4Rk9CdxnJgaVkNPJDD4Wx1brUhc5RvUxj3TODcm2UwGOR/mxv4pcydtZGELfQQs/i/tkAUCw== dependencies: "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/ui-utils" "0.0.46" swr "2.2.5" "@ai-sdk/solid@0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@ai-sdk/solid/-/solid-0.0.50.tgz#a7a30959a97c472a7bae38986958c5164aa2c487" integrity sha512-JF+KKOgGAgcROgae6FU+hAtxMRhR896SzwI3H1h5hFOZrjqYeYzemJoKzA5MR5IBnPSK4FzEjunc8G5L67TyzQ== dependencies: "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/ui-utils" "0.0.46" "@ai-sdk/svelte@0.0.52": version "0.0.52" resolved "https://registry.yarnpkg.com/@ai-sdk/svelte/-/svelte-0.0.52.tgz#3b1ee970ce870a5b565807d88b701185afabcd4b" integrity sha512-ZGd81ruVuqpOh1Suma+HwBMBywcOV0IUzi96Q3knIoZIz99sVwebSKH8ExMofXm49bQdCTRa73Wn8sTs6QDIYg== dependencies: "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/ui-utils" "0.0.46" sswr "2.1.0" "@ai-sdk/ui-utils@0.0.46": version "0.0.46" resolved "https://registry.yarnpkg.com/@ai-sdk/ui-utils/-/ui-utils-0.0.46.tgz#72311a1917a370074089cc6dd8c982d272f6b836" integrity sha512-ZG/wneyJG+6w5Nm/hy1AKMuRgjPQToAxBsTk61c9sVPUTaxo+NNjM2MhXQMtmsja2N5evs8NmHie+ExEgpL3cA== dependencies: "@ai-sdk/provider" "0.0.24" "@ai-sdk/provider-utils" "1.0.20" json-schema "0.4.0" secure-json-parse "2.7.0" zod-to-json-schema "3.23.2" "@ai-sdk/vue@0.0.55": version "0.0.55" resolved "https://registry.yarnpkg.com/@ai-sdk/vue/-/vue-0.0.55.tgz#3da3466418a3e105dd96bdee7217bd2d94a5cb61" integrity sha512-NZ89CeRPO3D9GjI7GmK3vC+YXjsaWi3iCIvxlGqfQYt0JFKcjgM6dfeq8Nkk+qWI9OoxoOhV/yQdqWQKPv3RRg== dependencies: "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/ui-utils" "0.0.46" swrv "1.0.4" "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz" integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== dependencies: "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== dependencies: "@babel/highlight" "^7.22.13" chalk "^2.4.2" "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.22.0", "@babel/compat-data@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.3.tgz" integrity sha512-aNtko9OPOwVESUFp3MZfD8Uzxl7JzSeJpd7npIoxCasU37PFbAQRpKglkaKwlHOyeJdrREpo8TW8ldrkYWwvIQ== "@babel/core@^7.11.6", "@babel/core@^7.12.3": version "7.22.1" resolved "https://registry.npmjs.org/@babel/core/-/core-7.22.1.tgz" integrity sha512-Hkqu7J4ynysSXxmAahpN1jjRwVJ+NdpraFLIWflgjpVob3KNyK3/tIUc7Q7szed8WMp0JNa7Qtd1E9Oo22F9gA== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.21.4" "@babel/generator" "^7.22.0" "@babel/helper-compilation-targets" "^7.22.1" "@babel/helper-module-transforms" "^7.22.1" "@babel/helpers" "^7.22.0" "@babel/parser" "^7.22.0" "@babel/template" "^7.21.9" "@babel/traverse" "^7.22.1" "@babel/types" "^7.22.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" semver "^6.3.0" "@babel/generator@^7.22.0", "@babel/generator@^7.23.0", "@babel/generator@^7.7.2": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== dependencies: "@babel/types" "^7.23.0" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz" integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== dependencies: "@babel/types" "^7.18.6" "@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": version "7.22.3" resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.3.tgz" integrity sha512-ahEoxgqNoYXm0k22TvOke48i1PkavGu0qGCmcq9ugi6gnmvKNaMjKBSrZTnWUi1CFEeNAUiVba0Wtzm03aSkJg== dependencies: "@babel/types" "^7.22.3" "@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.1.tgz" integrity sha512-Rqx13UM3yVB5q0D/KwQ8+SPfX/+Rnsy1Lw1k/UwOC4KC6qrzIQoY3lYnBu5EHKBlEHHcj0M0W8ltPSkD8rqfsQ== dependencies: "@babel/compat-data" "^7.22.0" "@babel/helper-validator-option" "^7.21.0" browserslist "^4.21.3" lru-cache "^5.1.1" semver "^6.3.0" "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.1.tgz" integrity sha512-SowrZ9BWzYFgzUMwUmowbPSGu6CXL5MSuuCkG3bejahSpSymioPmuLdhPxNOc9MjuNGjy7M/HaXvJ8G82Lywlw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-environment-visitor" "^7.22.1" "@babel/helper-function-name" "^7.21.0" "@babel/helper-member-expression-to-functions" "^7.22.0" "@babel/helper-optimise-call-expression" "^7.18.6" "@babel/helper-replace-supers" "^7.22.1" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/helper-split-export-declaration" "^7.18.6" semver "^6.3.0" "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.1.tgz" integrity sha512-WWjdnfR3LPIe+0EY8td7WmjhytxXtjKAEpnAxun/hkNiyOaPlvGK+NZaBFIdi9ndYV3Gav7BpFvtUwnaJlwi1w== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" regexpu-core "^5.3.1" semver "^6.3.0" "@babel/helper-define-polyfill-provider@^0.4.0": version "0.4.0" resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz" integrity sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg== dependencies: "@babel/helper-compilation-targets" "^7.17.7" "@babel/helper-plugin-utils" "^7.16.7" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" semver "^6.1.2" "@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.22.1", "@babel/helper-environment-visitor@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== "@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0", "@babel/helper-function-name@^7.21.0", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" "@babel/helper-hoist-variables@^7.18.6", "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: "@babel/types" "^7.22.5" "@babel/helper-member-expression-to-functions@^7.22.0": version "7.22.3" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.3.tgz" integrity sha512-Gl7sK04b/2WOb6OPVeNy9eFKeD3L6++CzL3ykPOWqTn08xgYYK0wz4TUh2feIImDXxcVW3/9WQ1NMKY66/jfZA== dependencies: "@babel/types" "^7.22.3" "@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.21.4": version "7.21.4" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz" integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== dependencies: "@babel/types" "^7.21.4" "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.21.5", "@babel/helper-module-transforms@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.1.tgz" integrity sha512-dxAe9E7ySDGbQdCVOY/4+UcD8M9ZFqZcZhSPsPacvCG4M+9lwtDDQfI2EoaSvmf7W/8yCBkGU0m7Pvt1ru3UZw== dependencies: "@babel/helper-environment-visitor" "^7.22.1" "@babel/helper-module-imports" "^7.21.4" "@babel/helper-simple-access" "^7.21.5" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.21.9" "@babel/traverse" "^7.22.1" "@babel/types" "^7.22.0" "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz" integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== dependencies: "@babel/types" "^7.18.6" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.21.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.21.5" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz" integrity sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg== "@babel/helper-remap-async-to-generator@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz" integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-wrap-function" "^7.18.9" "@babel/types" "^7.18.9" "@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7", "@babel/helper-replace-supers@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.1.tgz" integrity sha512-ut4qrkE4AuSfrwHSps51ekR1ZY/ygrP1tp0WFm8oVq6nzc/hvfV/22JylndIbsf2U2M9LOMwiSddr6y+78j+OQ== dependencies: "@babel/helper-environment-visitor" "^7.22.1" "@babel/helper-member-expression-to-functions" "^7.22.0" "@babel/helper-optimise-call-expression" "^7.18.6" "@babel/template" "^7.21.9" "@babel/traverse" "^7.22.1" "@babel/types" "^7.22.0" "@babel/helper-simple-access@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz" integrity sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg== dependencies: "@babel/types" "^7.21.5" "@babel/helper-skip-transparent-expression-wrappers@^7.20.0": version "7.20.0" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz" integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== dependencies: "@babel/types" "^7.20.0" "@babel/helper-split-export-declaration@^7.18.6", "@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: "@babel/types" "^7.22.5" "@babel/helper-string-parser@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== "@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== "@babel/helper-validator-option@^7.21.0": version "7.21.0" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz" integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== "@babel/helper-wrap-function@^7.18.9": version "7.20.5" resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz" integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== dependencies: "@babel/helper-function-name" "^7.19.0" "@babel/template" "^7.18.10" "@babel/traverse" "^7.20.5" "@babel/types" "^7.20.5" "@babel/helpers@^7.22.0": version "7.22.3" resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.3.tgz" integrity sha512-jBJ7jWblbgr7r6wYZHMdIqKc73ycaTcCaWRq4/2LpuPHcx7xMlZvpGQkOYc9HeSjn6rcx15CPlgVcBtZ4WZJ2w== dependencies: "@babel/template" "^7.21.9" "@babel/traverse" "^7.22.1" "@babel/types" "^7.22.3" "@babel/highlight@^7.22.13": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== dependencies: "@babel/helper-validator-identifier" "^7.22.20" chalk "^2.4.2" js-tokens "^4.0.0" "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.0", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz" integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.3.tgz" integrity sha512-6r4yRwEnorYByILoDRnEqxtojYKuiIv9FojW2E8GUKo9eWBwbKcd9IiZOZpdyXc64RmyGGyPu3/uAcrz/dq2kQ== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/plugin-transform-optional-chaining" "^7.22.3" "@babel/plugin-proposal-private-property-in-object@^7.21.0": version "7.21.0" resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz" integrity sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-create-class-features-plugin" "^7.21.0" "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz" integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-bigint@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": version "7.12.13" resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-class-static-block@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz" integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-import-assertions@^7.20.0": version "7.20.0" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz" integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== dependencies: "@babel/helper-plugin-utils" "^7.19.0" "@babel/plugin-syntax-import-attributes@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.3.tgz" integrity sha512-i35jZJv6aO7hxEbIWQ41adVfOzjm9dcYDNeWlBMd8p0ZQRtNUCBrmGwZt+H5lb+oOC9a3svp956KP0oWGA1YsA== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": version "7.21.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz" integrity sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-private-property-in-object@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3": version "7.14.5" resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": version "7.21.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz" integrity sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz" integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-arrow-functions@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.21.5.tgz" integrity sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-async-generator-functions@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.3.tgz" integrity sha512-36A4Aq48t66btydbZd5Fk0/xJqbpg/v4QWI4AH4cYHBXy9Mu42UOupZpebKFiCFNT9S9rJFcsld0gsv0ayLjtA== dependencies: "@babel/helper-environment-visitor" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-transform-async-to-generator@^7.20.7": version "7.20.7" resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz" integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== dependencies: "@babel/helper-module-imports" "^7.18.6" "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-transform-block-scoped-functions@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz" integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-block-scoping@^7.21.0": version "7.21.0" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz" integrity sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-class-properties@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.3.tgz" integrity sha512-mASLsd6rhOrLZ5F3WbCxkzl67mmOnqik0zrg5W6D/X0QMW7HtvnoL1dRARLKIbMP3vXwkwziuLesPqWVGIl6Bw== dependencies: "@babel/helper-create-class-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-class-static-block@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.3.tgz" integrity sha512-5BirgNWNOx7cwbTJCOmKFJ1pZjwk5MUfMIwiBBvsirCJMZeQgs5pk6i1OlkVg+1Vef5LfBahFOrdCnAWvkVKMw== dependencies: "@babel/helper-create-class-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-transform-classes@^7.21.0": version "7.21.0" resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz" integrity sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-compilation-targets" "^7.20.7" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.21.0" "@babel/helper-optimise-call-expression" "^7.18.6" "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-replace-supers" "^7.20.7" "@babel/helper-split-export-declaration" "^7.18.6" globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.21.5.tgz" integrity sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/template" "^7.20.7" "@babel/plugin-transform-destructuring@^7.21.3": version "7.21.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz" integrity sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz" integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-duplicate-keys@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz" integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== dependencies: "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-dynamic-import@^7.22.1": version "7.22.1" resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.1.tgz" integrity sha512-rlhWtONnVBPdmt+jeewS0qSnMz/3yLFrqAP8hHC6EDcrYRSyuz9f9yQhHvVn2Ad6+yO9fHXac5piudeYrInxwQ== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-transform-exponentiation-operator@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz" integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== dependencies: "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-export-namespace-from@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.3.tgz" integrity sha512-5Ti1cHLTDnt3vX61P9KZ5IG09bFXp4cDVFJIAeCZuxu9OXXJJZp5iP0n/rzM2+iAutJY+KWEyyHcRaHlpQ/P5g== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-transform-for-of@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.5.tgz" integrity sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-function-name@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz" integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== dependencies: "@babel/helper-compilation-targets" "^7.18.9" "@babel/helper-function-name" "^7.18.9" "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-json-strings@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.3.tgz" integrity sha512-IuvOMdeOOY2X4hRNAT6kwbePtK21BUyrAEgLKviL8pL6AEEVUVcqtRdN/HJXBLGIbt9T3ETmXRnFedRRmQNTYw== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-transform-literals@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz" integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== dependencies: "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-logical-assignment-operators@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.3.tgz" integrity sha512-CbayIfOw4av2v/HYZEsH+Klks3NC2/MFIR3QR8gnpGNNPEaq2fdlVCRYG/paKs7/5hvBLQ+H70pGWOHtlNEWNA== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-transform-member-expression-literals@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz" integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-modules-amd@^7.20.11": version "7.20.11" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz" integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== dependencies: "@babel/helper-module-transforms" "^7.20.11" "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-modules-commonjs@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz" integrity sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ== dependencies: "@babel/helper-module-transforms" "^7.21.5" "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-simple-access" "^7.21.5" "@babel/plugin-transform-modules-systemjs@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.3.tgz" integrity sha512-V21W3bKLxO3ZjcBJZ8biSvo5gQ85uIXW2vJfh7JSWf/4SLUSr1tOoHX3ruN4+Oqa2m+BKfsxTR1I+PsvkIWvNw== dependencies: "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-module-transforms" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-validator-identifier" "^7.19.1" "@babel/plugin-transform-modules-umd@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz" integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== dependencies: "@babel/helper-module-transforms" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-named-capturing-groups-regex@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.3.tgz" integrity sha512-c6HrD/LpUdNNJsISQZpds3TXvfYIAbo+efE9aWmY/PmSRD0agrJ9cPMt4BmArwUQ7ZymEWTFjTyp+yReLJZh0Q== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-new-target@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.3.tgz" integrity sha512-5RuJdSo89wKdkRTqtM9RVVJzHum9c2s0te9rB7vZC1zKKxcioWIy+xcu4OoIAjyFZhb/bp5KkunuLin1q7Ct+w== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-nullish-coalescing-operator@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.3.tgz" integrity sha512-CpaoNp16nX7ROtLONNuCyenYdY/l7ZsR6aoVa7rW7nMWisoNoQNIH5Iay/4LDyRjKMuElMqXiBoOQCDLTMGZiw== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-transform-numeric-separator@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.3.tgz" integrity sha512-+AF88fPDJrnseMh5vD9+SH6wq4ZMvpiTMHh58uLs+giMEyASFVhcT3NkoyO+NebFCNnpHJEq5AXO2txV4AGPDQ== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-transform-object-rest-spread@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.3.tgz" integrity sha512-38bzTsqMMCI46/TQnJwPPpy33EjLCc1Gsm2hRTF6zTMWnKsN61vdrpuzIEGQyKEhDSYDKyZHrrd5FMj4gcUHhw== dependencies: "@babel/compat-data" "^7.22.3" "@babel/helper-compilation-targets" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.22.3" "@babel/plugin-transform-object-super@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz" integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/helper-replace-supers" "^7.18.6" "@babel/plugin-transform-optional-catch-binding@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.3.tgz" integrity sha512-bnDFWXFzWY0BsOyqaoSXvMQ2F35zutQipugog/rqotL2S4ciFOKlRYUu9djt4iq09oh2/34hqfRR2k1dIvuu4g== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-transform-optional-chaining@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.3.tgz" integrity sha512-63v3/UFFxhPKT8j8u1jTTGVyITxl7/7AfOqK8C5gz1rHURPUGe3y5mvIf68eYKGoBNahtJnTxBKug4BQOnzeJg== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-transform-parameters@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.3.tgz" integrity sha512-x7QHQJHPuD9VmfpzboyGJ5aHEr9r7DsAsdxdhJiTB3J3j8dyl+NFZ+rX5Q2RWFDCs61c06qBfS4ys2QYn8UkMw== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-private-methods@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.3.tgz" integrity sha512-fC7jtjBPFqhqpPAE+O4LKwnLq7gGkD3ZmC2E3i4qWH34mH3gOg2Xrq5YMHUq6DM30xhqM1DNftiRaSqVjEG+ug== dependencies: "@babel/helper-create-class-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-private-property-in-object@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.3.tgz" integrity sha512-C7MMl4qWLpgVCbXfj3UW8rR1xeCnisQ0cU7YJHV//8oNBS0aCIVg1vFnZXxOckHhEpQyqNNkWmvSEWnMLlc+Vw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-create-class-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-transform-property-literals@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz" integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-regenerator@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.21.5.tgz" integrity sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w== dependencies: "@babel/helper-plugin-utils" "^7.21.5" regenerator-transform "^0.15.1" "@babel/plugin-transform-reserved-words@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz" integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-shorthand-properties@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz" integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-spread@^7.20.7": version "7.20.7" resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz" integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/plugin-transform-sticky-regex@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz" integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== dependencies: "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-template-literals@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz" integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== dependencies: "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-typeof-symbol@^7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz" integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== dependencies: "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-unicode-escapes@^7.21.5": version "7.21.5" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.21.5.tgz" integrity sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg== dependencies: "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-unicode-property-regex@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.3.tgz" integrity sha512-5ScJ+OmdX+O6HRuMGW4kv7RL9vIKdtdAj9wuWUKy1wbHY3jaM/UlyIiC1G7J6UJiiyMukjjK0QwL3P0vBd0yYg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-unicode-regex@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz" integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-unicode-sets-regex@^7.22.3": version "7.22.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.3.tgz" integrity sha512-hNufLdkF8vqywRp+P55j4FHXqAX2LRUccoZHH7AFn1pq5ZOO2ISKW9w13bFZVjBoTqeve2HOgoJCcaziJVhGNw== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/preset-env@^7.22.4": version "7.22.4" resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.4.tgz" integrity sha512-c3lHOjbwBv0TkhYCr+XCR6wKcSZ1QbQTVdSkZUaVpLv8CVWotBMArWUi5UAJrcrQaEnleVkkvaV8F/pmc/STZQ== dependencies: "@babel/compat-data" "^7.22.3" "@babel/helper-compilation-targets" "^7.22.1" "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-validator-option" "^7.21.0" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.3" "@babel/plugin-proposal-private-property-in-object" "^7.21.0" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-import-assertions" "^7.20.0" "@babel/plugin-syntax-import-attributes" "^7.22.3" "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.21.5" "@babel/plugin-transform-async-generator-functions" "^7.22.3" "@babel/plugin-transform-async-to-generator" "^7.20.7" "@babel/plugin-transform-block-scoped-functions" "^7.18.6" "@babel/plugin-transform-block-scoping" "^7.21.0" "@babel/plugin-transform-class-properties" "^7.22.3" "@babel/plugin-transform-class-static-block" "^7.22.3" "@babel/plugin-transform-classes" "^7.21.0" "@babel/plugin-transform-computed-properties" "^7.21.5" "@babel/plugin-transform-destructuring" "^7.21.3" "@babel/plugin-transform-dotall-regex" "^7.18.6" "@babel/plugin-transform-duplicate-keys" "^7.18.9" "@babel/plugin-transform-dynamic-import" "^7.22.1" "@babel/plugin-transform-exponentiation-operator" "^7.18.6" "@babel/plugin-transform-export-namespace-from" "^7.22.3" "@babel/plugin-transform-for-of" "^7.21.5" "@babel/plugin-transform-function-name" "^7.18.9" "@babel/plugin-transform-json-strings" "^7.22.3" "@babel/plugin-transform-literals" "^7.18.9" "@babel/plugin-transform-logical-assignment-operators" "^7.22.3" "@babel/plugin-transform-member-expression-literals" "^7.18.6" "@babel/plugin-transform-modules-amd" "^7.20.11" "@babel/plugin-transform-modules-commonjs" "^7.21.5" "@babel/plugin-transform-modules-systemjs" "^7.22.3" "@babel/plugin-transform-modules-umd" "^7.18.6" "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.3" "@babel/plugin-transform-new-target" "^7.22.3" "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.3" "@babel/plugin-transform-numeric-separator" "^7.22.3" "@babel/plugin-transform-object-rest-spread" "^7.22.3" "@babel/plugin-transform-object-super" "^7.18.6" "@babel/plugin-transform-optional-catch-binding" "^7.22.3" "@babel/plugin-transform-optional-chaining" "^7.22.3" "@babel/plugin-transform-parameters" "^7.22.3" "@babel/plugin-transform-private-methods" "^7.22.3" "@babel/plugin-transform-private-property-in-object" "^7.22.3" "@babel/plugin-transform-property-literals" "^7.18.6" "@babel/plugin-transform-regenerator" "^7.21.5" "@babel/plugin-transform-reserved-words" "^7.18.6" "@babel/plugin-transform-shorthand-properties" "^7.18.6" "@babel/plugin-transform-spread" "^7.20.7" "@babel/plugin-transform-sticky-regex" "^7.18.6" "@babel/plugin-transform-template-literals" "^7.18.9" "@babel/plugin-transform-typeof-symbol" "^7.18.9" "@babel/plugin-transform-unicode-escapes" "^7.21.5" "@babel/plugin-transform-unicode-property-regex" "^7.22.3" "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/plugin-transform-unicode-sets-regex" "^7.22.3" "@babel/preset-modules" "^0.1.5" "@babel/types" "^7.22.4" babel-plugin-polyfill-corejs2 "^0.4.3" babel-plugin-polyfill-corejs3 "^0.8.1" babel-plugin-polyfill-regenerator "^0.5.0" core-js-compat "^3.30.2" semver "^6.3.0" "@babel/preset-modules@^0.1.5": version "0.1.5" resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz" integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/types" "^7.4.4" esutils "^2.0.2" "@babel/regjsgen@^0.8.0": version "0.8.0" resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.8.4": version "7.22.3" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz" integrity sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ== dependencies: regenerator-runtime "^0.13.11" "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.21.9", "@babel/template@^7.22.15", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: "@babel/code-frame" "^7.22.13" "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" "@babel/traverse@^7.20.5", "@babel/traverse@^7.22.1", "@babel/traverse@^7.7.2": version "7.23.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== dependencies: "@babel/code-frame" "^7.22.13" "@babel/generator" "^7.23.0" "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" "@babel/parser" "^7.23.0" "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" "@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.22.0", "@babel/types@^7.22.15", "@babel/types@^7.22.3", "@babel/types@^7.22.4", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== dependencies: "@babel/helper-string-parser" "^7.22.5" "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.4.0": version "4.5.1" resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz" integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== "@eslint/eslintrc@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz" integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.5.2" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" "@eslint/js@8.41.0": version "8.41.0" resolved "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz" integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA== "@faker-js/faker@^8.4.1": version "8.4.1" resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.4.1.tgz#5d5e8aee8fce48f5e189bf730ebd1f758f491451" integrity sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz" integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== dependencies: camelcase "^5.3.1" find-up "^4.1.0" get-package-type "^0.1.0" js-yaml "^3.13.1" resolve-from "^5.0.0" "@istanbuljs/schema@^0.1.2": version "0.1.3" resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== "@jest/console@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/console/-/console-29.5.0.tgz" integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== dependencies: "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" jest-message-util "^29.5.0" jest-util "^29.5.0" slash "^3.0.0" "@jest/core@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz" integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== dependencies: "@jest/console" "^29.5.0" "@jest/reporters" "^29.5.0" "@jest/test-result" "^29.5.0" "@jest/transform" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.5.0" jest-config "^29.5.0" jest-haste-map "^29.5.0" jest-message-util "^29.5.0" jest-regex-util "^29.4.3" jest-resolve "^29.5.0" jest-resolve-dependencies "^29.5.0" jest-runner "^29.5.0" jest-runtime "^29.5.0" jest-snapshot "^29.5.0" jest-util "^29.5.0" jest-validate "^29.5.0" jest-watcher "^29.5.0" micromatch "^4.0.4" pretty-format "^29.5.0" slash "^3.0.0" strip-ansi "^6.0.0" "@jest/environment@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz" integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== dependencies: "@jest/fake-timers" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" jest-mock "^29.5.0" "@jest/expect-utils@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz" integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== dependencies: jest-get-type "^29.4.3" "@jest/expect@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz" integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== dependencies: expect "^29.5.0" jest-snapshot "^29.5.0" "@jest/fake-timers@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz" integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== dependencies: "@jest/types" "^29.5.0" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" jest-message-util "^29.5.0" jest-mock "^29.5.0" jest-util "^29.5.0" "@jest/globals@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz" integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== dependencies: "@jest/environment" "^29.5.0" "@jest/expect" "^29.5.0" "@jest/types" "^29.5.0" jest-mock "^29.5.0" "@jest/reporters@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz" integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^29.5.0" "@jest/test-result" "^29.5.0" "@jest/transform" "^29.5.0" "@jest/types" "^29.5.0" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" jest-message-util "^29.5.0" jest-util "^29.5.0" jest-worker "^29.5.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" "@jest/schemas@^29.4.3": version "29.4.3" resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz" integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== dependencies: "@sinclair/typebox" "^0.25.16" "@jest/source-map@^29.4.3": version "29.4.3" resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz" integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== dependencies: "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" "@jest/test-result@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz" integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== dependencies: "@jest/console" "^29.5.0" "@jest/types" "^29.5.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" "@jest/test-sequencer@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz" integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== dependencies: "@jest/test-result" "^29.5.0" graceful-fs "^4.2.9" jest-haste-map "^29.5.0" slash "^3.0.0" "@jest/transform@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz" integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.5.0" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" jest-haste-map "^29.5.0" jest-regex-util "^29.4.3" jest-util "^29.5.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" "@jest/types@^29.5.0": version "29.5.0" resolved "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz" integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== dependencies: "@jest/schemas" "^29.4.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" "@types/yargs" "^17.0.8" chalk "^4.0.0" "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz" integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== dependencies: "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" "@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== "@jridgewell/sourcemap-codec@1.4.14": version "1.4.14" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.15" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz" integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== dependencies: "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" "@langchain/core@^0.3.14": version "0.3.14" resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.3.14.tgz#9d10df13566fd7a102baa7cd68058f763c612121" integrity sha512-RFeE89ZzFG77MymVxaaJmYMdKPjhZbSH8pPKskNkUnqvC1gH1IyxmMIIvnm67vUGYQVZCxeLaRXZH6IzbYj3Ow== dependencies: ansi-styles "^5.0.0" camelcase "6" decamelize "1.2.0" js-tiktoken "^1.0.12" langsmith "^0.1.65" mustache "^4.2.0" p-queue "^6.6.2" p-retry "4" uuid "^10.0.0" zod "^3.22.4" zod-to-json-schema "^3.22.3" "@langchain/langgraph-checkpoint@~0.0.10": version "0.0.11" resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.11.tgz#65c40bc175faca98ed0901df9e76682585710e8d" integrity sha512-nroHHkAi/UPn9LqqZcgOydfB8qZw5TXuXDFc43MIydnW4lb8m9hVHnQ3lgb2WGSgtbZJnsIx0TzL19oemJBRKg== dependencies: uuid "^10.0.0" "@langchain/langgraph-sdk@~0.0.20": version "0.0.25" resolved "https://registry.yarnpkg.com/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.25.tgz#35feaf85436d5c9cc3131520db07dde07db28416" integrity sha512-12QYwGuhZ9HPbXFb+SNyUse3V8Hx8d375ytHPuMPZ5nS+UTFozIBxLzCTE0QMoXt0Hfr4X772W/YP6P+v751gw== dependencies: "@types/json-schema" "^7.0.15" p-queue "^6.6.2" p-retry "4" uuid "^9.0.0" "@langchain/langgraph@^0.2.20": version "0.2.20" resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.20.tgz#0773b9262351ed07a125d6ae6188def519488d3c" integrity sha512-MMD4G++gHs+5OO5Uu75gduskTboJ8Q7ZAwzd1s64a1Y/38pdgDqJdYRHRCGpx8eeCuKhsRzV2Sssnl5lujfj8w== dependencies: "@langchain/langgraph-checkpoint" "~0.0.10" "@langchain/langgraph-sdk" "~0.0.20" uuid "^10.0.0" zod "^3.23.8" "@langchain/openai@>=0.1.0 <0.4.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.3.0.tgz#89329ab9350187269a471dac2c2f4fca5f1fc5a3" integrity sha512-yXrz5Qn3t9nq3NQAH2l4zZOI4ev2CFdLC5kvmi5SdW4bggRuM40SXTUAY3VRld4I5eocYfk82VbrlA+6dvN5EA== dependencies: js-tiktoken "^1.0.12" openai "^4.57.3" zod "^3.22.4" zod-to-json-schema "^3.22.3" "@langchain/openai@^0.3.11": version "0.3.11" resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.3.11.tgz#c93ee298a87318562a1da6c2915a180fe5155ac4" integrity sha512-mEFbpJ8w8NPArsquUlCwxvZTKNkXxqwzvTEYzv6Jb7gUoBDOZtwLg6AdcngTJ+w5VFh3wxgPy0g3zb9Aw0Qbpw== dependencies: js-tiktoken "^1.0.12" openai "^4.68.0" zod "^3.22.4" zod-to-json-schema "^3.22.3" "@langchain/textsplitters@>=0.0.0 <0.2.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@langchain/textsplitters/-/textsplitters-0.1.0.tgz#f37620992192df09ecda3dfbd545b36a6bcbae46" integrity sha512-djI4uw9rlkAb5iMhtLED+xJebDdAG935AdP4eRTB02R7OB/act55Bj9wsskhZsvuyQRpO4O1wQOp85s6T6GWmw== dependencies: js-tiktoken "^1.0.12" "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" "@opentelemetry/api@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== "@opentelemetry/context-async-hooks@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz#fa92f722cf685685334bba95f258d3ef9fce60f6" integrity sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg== "@opentelemetry/core@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.26.0.tgz#7d84265aaa850ed0ca5813f97d831155be42b328" integrity sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ== dependencies: "@opentelemetry/semantic-conventions" "1.27.0" "@opentelemetry/propagator-b3@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-b3/-/propagator-b3-1.26.0.tgz#3ebbeff26a3fb81e8be011666ea6d07ff3e4fba7" integrity sha512-vvVkQLQ/lGGyEy9GT8uFnI047pajSOVnZI2poJqVGD3nJ+B9sFGdlHNnQKophE3lHfnIH0pw2ubrCTjZCgIj+Q== dependencies: "@opentelemetry/core" "1.26.0" "@opentelemetry/propagator-jaeger@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.26.0.tgz#096ac03d754204921cd5a886c77b5c9bd4677cd7" integrity sha512-DelFGkCdaxA1C/QA0Xilszfr0t4YbGd3DjxiCDPh34lfnFr+VkkrjV9S8ZTJvAzfdKERXhfOxIKBoGPJwoSz7Q== dependencies: "@opentelemetry/core" "1.26.0" "@opentelemetry/resources@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.26.0.tgz#da4c7366018bd8add1f3aa9c91c6ac59fd503cef" integrity sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw== dependencies: "@opentelemetry/core" "1.26.0" "@opentelemetry/semantic-conventions" "1.27.0" "@opentelemetry/sdk-trace-base@1.26.0", "@opentelemetry/sdk-trace-base@^1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz#0c913bc6d2cfafd901de330e4540952269ae579c" integrity sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw== dependencies: "@opentelemetry/core" "1.26.0" "@opentelemetry/resources" "1.26.0" "@opentelemetry/semantic-conventions" "1.27.0" "@opentelemetry/sdk-trace-node@^1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.26.0.tgz#169ef4fc058e82a12460da18cedaf6e4615fc617" integrity sha512-Fj5IVKrj0yeUwlewCRwzOVcr5avTuNnMHWf7GPc1t6WaT78J6CJyF3saZ/0RkZfdeNO8IcBl/bNcWMVZBMRW8Q== dependencies: "@opentelemetry/context-async-hooks" "1.26.0" "@opentelemetry/core" "1.26.0" "@opentelemetry/propagator-b3" "1.26.0" "@opentelemetry/propagator-jaeger" "1.26.0" "@opentelemetry/sdk-trace-base" "1.26.0" semver "^7.5.2" "@opentelemetry/semantic-conventions@1.27.0": version "1.27.0" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz#1a857dcc95a5ab30122e04417148211e6f945e6c" integrity sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg== "@sinclair/typebox@^0.25.16": version "0.25.24" resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz" integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== "@sinonjs/commons@^3.0.0": version "3.0.0" resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz" integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: type-detect "4.0.8" "@sinonjs/fake-timers@^10.0.2": version "10.2.0" resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.2.0.tgz" integrity sha512-OPwQlEdg40HAj5KNF8WW6q2KG4Z+cBCZb3m4ninfTZKaBmbIJodviQsDBoYMPHkOyJJMHnOJo5j2+LKDOhOACg== dependencies: "@sinonjs/commons" "^3.0.0" "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz" integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== "@tsconfig/node12@^1.0.7": version "1.0.11" resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz" integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": version "1.0.3" resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz" integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": version "1.0.4" resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@tsconfig/recommended@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@tsconfig/recommended/-/recommended-1.0.2.tgz" integrity sha512-dbHBtbWBOjq0/otpopAE02NT2Cm05Qe2JsEKeCf/wjSYbI2hz8nCqnpnOJWHATgjDz4fd3dchs3Wy1gQGjfN6w== "@types/babel__core@^7.1.14": version "7.20.1" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz" integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" "@types/babel__generator" "*" "@types/babel__template" "*" "@types/babel__traverse" "*" "@types/babel__generator@*": version "7.6.4" resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz" integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": version "7.4.1" resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz" integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.20.0" resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.0.tgz" integrity sha512-TBOjqAGf0hmaqRwpii5LLkJLg7c6OMm4nHLmpsUxwk9bBHtoTC6dAHdVWdGv4TBxj2CZOZY8Xfq8WmfoVi7n4Q== dependencies: "@babel/types" "^7.20.7" "@types/diff-match-patch@^1.0.36": version "1.0.36" resolved "https://registry.yarnpkg.com/@types/diff-match-patch/-/diff-match-patch-1.0.36.tgz#dcef10a69d357fe9d43ac4ff2eca6b85dbf466af" integrity sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg== "@types/graceful-fs@^4.1.3": version "4.1.6" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz" integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.4" resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz" integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== "@types/istanbul-lib-report@*": version "3.0.0" resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": version "3.0.1" resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz" integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== dependencies: "@types/istanbul-lib-report" "*" "@types/jest@^29.5.1": version "29.5.1" resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz" integrity sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ== dependencies: expect "^29.0.0" pretty-format "^29.0.0" "@types/json-schema@^7.0.15": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/json-schema@^7.0.9": version "7.0.12" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== "@types/node-fetch@^2.6.4": version "2.6.11" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24" integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g== dependencies: "@types/node" "*" form-data "^4.0.0" "@types/node@*": version "20.2.5" resolved "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz" integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ== "@types/node@^18.11.18": version "18.19.17" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.17.tgz#a581a9fb4b2cfdbc61f008804f4436b2d5c40354" integrity sha512-SzyGKgwPzuWp2SHhlpXKzCX0pIOfcI4V2eF37nNBJOhwlegQ83omtVQ1XxZpDE06V/d6AQvfQdPfnw0tRC//Ng== dependencies: undici-types "~5.26.4" "@types/prettier@^2.1.5": version "2.7.2" resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz" integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== "@types/qs@^6.9.15": version "6.9.16" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794" integrity sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A== "@types/retry@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== "@types/semver@^7.3.12": version "7.5.0" resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/uuid@^10.0.0": version "10.0.0" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz" integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": version "17.0.24" resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz" integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== dependencies: "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz" integrity sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ== dependencies: "@eslint-community/regexpp" "^4.4.0" "@typescript-eslint/scope-manager" "5.59.8" "@typescript-eslint/type-utils" "5.59.8" "@typescript-eslint/utils" "5.59.8" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" semver "^7.3.7" tsutils "^3.21.0" "@typescript-eslint/parser@^5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz" integrity sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw== dependencies: "@typescript-eslint/scope-manager" "5.59.8" "@typescript-eslint/types" "5.59.8" "@typescript-eslint/typescript-estree" "5.59.8" debug "^4.3.4" "@typescript-eslint/scope-manager@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz" integrity sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig== dependencies: "@typescript-eslint/types" "5.59.8" "@typescript-eslint/visitor-keys" "5.59.8" "@typescript-eslint/type-utils@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz" integrity sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA== dependencies: "@typescript-eslint/typescript-estree" "5.59.8" "@typescript-eslint/utils" "5.59.8" debug "^4.3.4" tsutils "^3.21.0" "@typescript-eslint/types@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz" integrity sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w== "@typescript-eslint/typescript-estree@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz" integrity sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg== dependencies: "@typescript-eslint/types" "5.59.8" "@typescript-eslint/visitor-keys" "5.59.8" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" "@typescript-eslint/utils@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz" integrity sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" "@typescript-eslint/scope-manager" "5.59.8" "@typescript-eslint/types" "5.59.8" "@typescript-eslint/typescript-estree" "5.59.8" eslint-scope "^5.1.1" semver "^7.3.7" "@typescript-eslint/visitor-keys@5.59.8": version "5.59.8" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz" integrity sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ== dependencies: "@typescript-eslint/types" "5.59.8" eslint-visitor-keys "^3.3.0" abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== dependencies: event-target-shim "^5.0.0" acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.4.1, acorn@^8.8.0: version "8.8.2" resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== agentkeepalive@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== dependencies: humanize-ms "^1.2.1" ai@^3.4.17: version "3.4.17" resolved "https://registry.yarnpkg.com/ai/-/ai-3.4.17.tgz#9c5bbce9a2a2fdb49058ded31f0d5ba9f8531bfd" integrity sha512-QZc+NgNlzPT34ZTHaCGGXVJ+stbMLj98hwq+vJaIzD1lns6HlDatrmlFjJsYYf8FtnfqGV7yPNu8DrH8a274vA== dependencies: "@ai-sdk/provider" "0.0.24" "@ai-sdk/provider-utils" "1.0.20" "@ai-sdk/react" "0.0.64" "@ai-sdk/solid" "0.0.50" "@ai-sdk/svelte" "0.0.52" "@ai-sdk/ui-utils" "0.0.46" "@ai-sdk/vue" "0.0.55" "@opentelemetry/api" "1.9.0" eventsource-parser "1.1.2" json-schema "0.4.0" jsondiffpatch "0.6.0" nanoid "3.3.6" secure-json-parse "2.7.0" zod-to-json-schema "3.23.2" ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: type-fest "^0.21.3" ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" ansi-styles@^5.0.0: version "5.2.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== anymatch@^3.0.3: version "3.1.3" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" arg@^4.1.0: version "4.1.3" resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argparse@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== array-buffer-byte-length@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz" integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== dependencies: call-bind "^1.0.2" is-array-buffer "^3.0.1" array-includes@^3.1.6: version "3.1.6" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz" integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" get-intrinsic "^1.1.3" is-string "^1.0.7" array-union@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== array.prototype.flat@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz" integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" array.prototype.flatmap@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz" integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== babel-jest@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz" integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== dependencies: "@jest/transform" "^29.5.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.5.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@istanbuljs/load-nyc-config" "^1.0.0" "@istanbuljs/schema" "^0.1.2" istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" babel-plugin-jest-hoist@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz" integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" babel-plugin-polyfill-corejs2@^0.4.3: version "0.4.3" resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz" integrity sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw== dependencies: "@babel/compat-data" "^7.17.7" "@babel/helper-define-polyfill-provider" "^0.4.0" semver "^6.1.1" babel-plugin-polyfill-corejs3@^0.8.1: version "0.8.1" resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz" integrity sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q== dependencies: "@babel/helper-define-polyfill-provider" "^0.4.0" core-js-compat "^3.30.1" babel-plugin-polyfill-regenerator@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz" integrity sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g== dependencies: "@babel/helper-define-polyfill-provider" "^0.4.0" babel-preset-current-node-syntax@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz" integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" "@babel/plugin-syntax-class-properties" "^7.8.3" "@babel/plugin-syntax-import-meta" "^7.8.3" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-syntax-numeric-separator" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" babel-preset-jest@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz" integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== dependencies: babel-plugin-jest-hoist "^29.5.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" braces@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" browserslist@^4.21.3, browserslist@^4.21.5: version "4.21.7" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.7.tgz" integrity sha512-BauCXrQ7I2ftSqd2mvKHGo85XR0u7Ru3C/Hxsy/0TkfCtjrmAbPdzLGasmoiBxplpDXlPvdjX9u7srIMfgasNA== dependencies: caniuse-lite "^1.0.30001489" electron-to-chromium "^1.4.411" node-releases "^2.0.12" update-browserslist-db "^1.0.11" bs-logger@0.x: version "0.2.6" resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== dependencies: node-int64 "^0.4.0" buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== dependencies: function-bind "^1.1.1" get-intrinsic "^1.0.2" call-bind@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: es-define-property "^1.0.0" es-errors "^1.3.0" function-bind "^1.1.2" get-intrinsic "^1.2.4" set-function-length "^1.2.1" callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase@6, camelcase@^6.2.0: version "6.3.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001489: version "1.0.30001491" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001491.tgz" integrity sha512-17EYIi4TLnPiTzVKMveIxU5ETlxbSO3B6iPvMbprqnKh4qJsQGk5Nh1Lp4jIMAE0XfrujsJuWZAM3oJdMHaKBA== chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" chalk@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== char-regex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: version "3.8.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cjs-module-lexer@^1.0.0: version "1.2.2" resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== client-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== cliui@^8.0.1: version "8.0.1" resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" strip-ansi "^6.0.1" wrap-ansi "^7.0.0" co@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz" integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" commander@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== concat-map@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== core-js-compat@^3.30.1, core-js-compat@^3.30.2: version "3.30.2" resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.30.2.tgz" integrity sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA== dependencies: browserslist "^4.21.5" create-require@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-env@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== dependencies: cross-spawn "^7.0.1" cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" debug@^3.2.7: version "3.2.7" resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" decamelize@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== dedent@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-is@^0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: version "4.3.1" resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== dependencies: es-define-property "^1.0.0" es-errors "^1.3.0" gopd "^1.0.1" define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== dependencies: has-property-descriptors "^1.0.0" object-keys "^1.1.1" delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== diff-match-patch@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.5.tgz#abb584d5f10cd1196dfc55aa03701592ae3f7b37" integrity sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw== diff-sequences@^29.4.3: version "29.4.3" resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz" integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== dependencies: path-type "^4.0.0" doctrine@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz" integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" doctrine@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" dotenv@^16.1.3: version "16.1.3" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.1.3.tgz#0c67e90d0ddb48d08c570888f709b41844928210" integrity sha512-FYssxsmCTtKL72fGBSvb1K9dRz0/VZeWqFme/vSb7r7323x4CRaHu4LvQ5JG3+s6yt2YPbBrkpiEODktfyjI9A== electron-to-chromium@^1.4.411: version "1.4.414" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.414.tgz" integrity sha512-RRuCvP6ekngVh2SAJaOKT/hxqc9JAsK+Pe0hP5tGQIfonU2Zy9gMGdJ+mBdyl/vNucMG6gkXYtuM4H/1giws5w== emittery@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz" integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4: version "1.21.2" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz" integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== dependencies: array-buffer-byte-length "^1.0.0" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" function.prototype.name "^1.1.5" get-intrinsic "^1.2.0" get-symbol-description "^1.0.0" globalthis "^1.0.3" gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" has-proto "^1.0.1" has-symbols "^1.0.3" internal-slot "^1.0.5" is-array-buffer "^3.0.2" is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" is-typed-array "^1.1.10" is-weakref "^1.0.2" object-inspect "^1.12.3" object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" which-typed-array "^1.1.9" es-define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== dependencies: get-intrinsic "^1.2.4" es-errors@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-set-tostringtag@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz" integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== dependencies: get-intrinsic "^1.1.3" has "^1.0.3" has-tostringtag "^1.0.0" es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz" integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== dependencies: has "^1.0.3" es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" is-symbol "^1.0.2" escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.8.0: version "8.8.0" resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz" integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== eslint-import-resolver-node@^0.3.7: version "0.3.7" resolved "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz" integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== dependencies: debug "^3.2.7" is-core-module "^2.11.0" resolve "^1.22.1" eslint-module-utils@^2.7.4: version "2.8.0" resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz" integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== dependencies: debug "^3.2.7" eslint-plugin-import@^2.27.5: version "2.27.5" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== dependencies: array-includes "^3.1.6" array.prototype.flat "^1.3.1" array.prototype.flatmap "^1.3.1" debug "^3.2.7" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.7" eslint-module-utils "^2.7.4" has "^1.0.3" is-core-module "^2.11.0" is-glob "^4.0.3" minimatch "^3.1.2" object.values "^1.1.6" resolve "^1.22.1" semver "^6.3.0" tsconfig-paths "^3.14.1" eslint-plugin-no-instanceof@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-no-instanceof/-/eslint-plugin-no-instanceof-1.0.1.tgz#5d9fc86d160df6991b654b294a62390207f1bb97" integrity sha512-zlqQ7EsfzbRO68uI+p8FIE7zYB4njs+nNbkNjSb5QmLi2et67zQLqSeaao5U9SpnlZTTJC87nS2oyHo2ACtajw== eslint-plugin-prettier@^4.2.1: version "4.2.1" resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz" integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== dependencies: prettier-linter-helpers "^1.0.0" eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: esrecurse "^4.3.0" estraverse "^4.1.1" eslint-scope@^7.2.0: version "7.2.0" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz" integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.1" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz" integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.41.0: version "8.41.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz" integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" "@eslint/js" "8.41.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.2.0" eslint-visitor-keys "^3.4.1" espree "^9.5.2" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" glob-parent "^6.0.2" globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" espree@^9.5.2: version "9.5.2" resolved "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz" integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.4.2: version "1.5.0" resolved "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz" integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" estraverse@^4.1.1: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== event-target-shim@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== eventemitter3@^4.0.4: version "4.0.7" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== eventsource-parser@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/eventsource-parser/-/eventsource-parser-1.1.2.tgz#ed6154a4e3dbe7cda9278e5e35d2ffc58b309f89" integrity sha512-v0eOBUbiaFojBu2s2NPBfYUoRR9GjcDNvCXVaqEf5vVfpIAh9f8RCo4vXTP8c63QRKCFwoLpMpTdPwwhEKVgzA== execa@^5.0.0: version "5.1.1" resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== dependencies: cross-spawn "^7.0.3" get-stream "^6.0.0" human-signals "^2.1.0" is-stream "^2.0.0" merge-stream "^2.0.0" npm-run-path "^4.0.1" onetime "^5.1.2" signal-exit "^3.0.3" strip-final-newline "^2.0.0" exit@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== expect@^29.0.0, expect@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz" integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== dependencies: "@jest/expect-utils" "^29.5.0" jest-get-type "^29.4.3" jest-matcher-utils "^29.5.0" jest-message-util "^29.5.0" jest-util "^29.5.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-diff@^1.1.2: version "1.3.0" resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" glob-parent "^5.1.2" merge2 "^1.3.0" micromatch "^4.0.4" fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: version "1.15.0" resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== dependencies: reusify "^1.0.4" fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" path-exists "^4.0.0" find-up@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" path-exists "^4.0.0" flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: flatted "^3.1.0" rimraf "^3.0.2" flatted@^3.1.0: version "3.2.7" resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== for-each@^0.3.3: version "0.3.3" resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz" integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" form-data-encoder@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" mime-types "^2.1.12" formdata-node@^4.3.2: version "4.4.1" resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.4.1.tgz#23f6a5cb9cb55315912cbec4ff7b0f59bbd191e2" integrity sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ== dependencies: node-domexception "1.0.0" web-streams-polyfill "4.0.0-beta.3" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2: version "2.3.2" resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== function.prototype.name@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" es-abstract "^1.19.0" functions-have-names "^1.2.2" functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: version "1.2.1" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== dependencies: function-bind "^1.1.1" has "^1.0.3" has-proto "^1.0.1" has-symbols "^1.0.3" get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== dependencies: es-errors "^1.3.0" function-bind "^1.1.2" has-proto "^1.0.1" has-symbols "^1.0.3" hasown "^2.0.0" get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== dependencies: call-bind "^1.0.2" get-intrinsic "^1.1.1" glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: is-glob "^4.0.3" glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" globals@^11.1.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: version "13.20.0" resolved "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz" integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== dependencies: type-fest "^0.20.2" globalthis@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" fast-glob "^3.2.9" ignore "^5.2.0" merge2 "^1.4.1" slash "^3.0.0" gopd@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz" integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== dependencies: get-intrinsic "^1.1.3" graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== graphemer@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-property-descriptors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== dependencies: get-intrinsic "^1.1.1" has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== dependencies: es-define-property "^1.0.0" has-proto@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== has-tostringtag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== dependencies: has-symbols "^1.0.2" has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hasown@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: function-bind "^1.1.2" html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== human-signals@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== dependencies: ms "^2.0.0" ignore@^5.2.0: version "5.2.4" resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" import-local@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz" integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" inherits@2: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== internal-slot@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz" integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== dependencies: get-intrinsic "^1.2.0" has "^1.0.3" side-channel "^1.0.4" is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz" integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== dependencies: call-bind "^1.0.2" get-intrinsic "^1.2.0" is-typed-array "^1.1.10" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== dependencies: has-bigints "^1.0.1" is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" has-tostringtag "^1.0.0" is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-core-module@^2.11.0: version "2.12.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz" integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== dependencies: has "^1.0.3" is-date-object@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== dependencies: has-tostringtag "^1.0.0" is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-generator-fn@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== dependencies: has-tostringtag "^1.0.0" is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== is-regex@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" has-tostringtag "^1.0.0" is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== dependencies: call-bind "^1.0.2" is-stream@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== dependencies: has-symbols "^1.0.2" is-typed-array@^1.1.10, is-typed-array@^1.1.9: version "1.1.10" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz" integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== dependencies: call-bind "^1.0.2" isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.2.1" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" "@istanbuljs/schema" "^0.1.2" istanbul-lib-coverage "^3.2.0" semver "^6.3.0" istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== dependencies: istanbul-lib-coverage "^3.0.0" make-dir "^3.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.1.3: version "3.1.5" resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz" integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" jest-changed-files@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz" integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== dependencies: execa "^5.0.0" p-limit "^3.1.0" jest-circus@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.5.0.tgz" integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== dependencies: "@jest/environment" "^29.5.0" "@jest/expect" "^29.5.0" "@jest/test-result" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" jest-each "^29.5.0" jest-matcher-utils "^29.5.0" jest-message-util "^29.5.0" jest-runtime "^29.5.0" jest-snapshot "^29.5.0" jest-util "^29.5.0" p-limit "^3.1.0" pretty-format "^29.5.0" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" jest-cli@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz" integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== dependencies: "@jest/core" "^29.5.0" "@jest/test-result" "^29.5.0" "@jest/types" "^29.5.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" jest-config "^29.5.0" jest-util "^29.5.0" jest-validate "^29.5.0" prompts "^2.0.1" yargs "^17.3.1" jest-config@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz" integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== dependencies: "@babel/core" "^7.11.6" "@jest/test-sequencer" "^29.5.0" "@jest/types" "^29.5.0" babel-jest "^29.5.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" jest-circus "^29.5.0" jest-environment-node "^29.5.0" jest-get-type "^29.4.3" jest-regex-util "^29.4.3" jest-resolve "^29.5.0" jest-runner "^29.5.0" jest-util "^29.5.0" jest-validate "^29.5.0" micromatch "^4.0.4" parse-json "^5.2.0" pretty-format "^29.5.0" slash "^3.0.0" strip-json-comments "^3.1.1" jest-diff@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz" integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== dependencies: chalk "^4.0.0" diff-sequences "^29.4.3" jest-get-type "^29.4.3" pretty-format "^29.5.0" jest-docblock@^29.4.3: version "29.4.3" resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz" integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== dependencies: detect-newline "^3.0.0" jest-each@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.5.0.tgz" integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== dependencies: "@jest/types" "^29.5.0" chalk "^4.0.0" jest-get-type "^29.4.3" jest-util "^29.5.0" pretty-format "^29.5.0" jest-environment-node@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz" integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== dependencies: "@jest/environment" "^29.5.0" "@jest/fake-timers" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" jest-mock "^29.5.0" jest-util "^29.5.0" jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== jest-haste-map@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz" integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== dependencies: "@jest/types" "^29.5.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.4.3" jest-util "^29.5.0" jest-worker "^29.5.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" jest-leak-detector@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz" integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== dependencies: jest-get-type "^29.4.3" pretty-format "^29.5.0" jest-matcher-utils@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz" integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== dependencies: chalk "^4.0.0" jest-diff "^29.5.0" jest-get-type "^29.4.3" pretty-format "^29.5.0" jest-message-util@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz" integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^29.5.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" pretty-format "^29.5.0" slash "^3.0.0" stack-utils "^2.0.3" jest-mock@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz" integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== dependencies: "@jest/types" "^29.5.0" "@types/node" "*" jest-util "^29.5.0" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^29.4.3: version "29.4.3" resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz" integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== jest-resolve-dependencies@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz" integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== dependencies: jest-regex-util "^29.4.3" jest-snapshot "^29.5.0" jest-resolve@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz" integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" jest-haste-map "^29.5.0" jest-pnp-resolver "^1.2.2" jest-util "^29.5.0" jest-validate "^29.5.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" jest-runner@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz" integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== dependencies: "@jest/console" "^29.5.0" "@jest/environment" "^29.5.0" "@jest/test-result" "^29.5.0" "@jest/transform" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.4.3" jest-environment-node "^29.5.0" jest-haste-map "^29.5.0" jest-leak-detector "^29.5.0" jest-message-util "^29.5.0" jest-resolve "^29.5.0" jest-runtime "^29.5.0" jest-util "^29.5.0" jest-watcher "^29.5.0" jest-worker "^29.5.0" p-limit "^3.1.0" source-map-support "0.5.13" jest-runtime@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz" integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== dependencies: "@jest/environment" "^29.5.0" "@jest/fake-timers" "^29.5.0" "@jest/globals" "^29.5.0" "@jest/source-map" "^29.4.3" "@jest/test-result" "^29.5.0" "@jest/transform" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" jest-haste-map "^29.5.0" jest-message-util "^29.5.0" jest-mock "^29.5.0" jest-regex-util "^29.4.3" jest-resolve "^29.5.0" jest-snapshot "^29.5.0" jest-util "^29.5.0" slash "^3.0.0" strip-bom "^4.0.0" jest-snapshot@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz" integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" "@jest/expect-utils" "^29.5.0" "@jest/transform" "^29.5.0" "@jest/types" "^29.5.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" expect "^29.5.0" graceful-fs "^4.2.9" jest-diff "^29.5.0" jest-get-type "^29.4.3" jest-matcher-utils "^29.5.0" jest-message-util "^29.5.0" jest-util "^29.5.0" natural-compare "^1.4.0" pretty-format "^29.5.0" semver "^7.3.5" jest-util@^29.0.0, jest-util@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz" integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== dependencies: "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" jest-validate@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz" integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== dependencies: "@jest/types" "^29.5.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.4.3" leven "^3.1.0" pretty-format "^29.5.0" jest-watcher@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz" integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== dependencies: "@jest/test-result" "^29.5.0" "@jest/types" "^29.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" jest-util "^29.5.0" string-length "^4.0.1" jest-worker@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz" integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== dependencies: "@types/node" "*" jest-util "^29.5.0" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz" integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== dependencies: "@jest/core" "^29.5.0" "@jest/types" "^29.5.0" import-local "^3.0.2" jest-cli "^29.5.0" js-tiktoken@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.12.tgz#af0f5cf58e5e7318240d050c8413234019424211" integrity sha512-L7wURW1fH9Qaext0VzaUDpFGVQgjkdE3Dgsy9/+yXyGEpBKnylTd0mU0bfbNkKDlXRb6TEsZkwuflu1B8uQbJQ== dependencies: base64-js "^1.5.1" js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" jsesc@^2.5.1: version "2.5.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz" integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsondiffpatch@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/jsondiffpatch/-/jsondiffpatch-0.6.0.tgz#daa6a25bedf0830974c81545568d5f671c82551f" integrity sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ== dependencies: "@types/diff-match-patch" "^1.0.36" chalk "^5.3.0" diff-match-patch "^1.0.5" jsonpointer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== kleur@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== langchain@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.3.3.tgz#4e1157d00ea9973486ba996d106670afd405793f" integrity sha512-xy63PAh1PUuF2VdjLxacP8SeUQKF++ixvAhMhl/+3GkzloEKce41xlbQC3xNGVToYaqzIsDrueps/JU0zYYXHw== dependencies: "@langchain/openai" ">=0.1.0 <0.4.0" "@langchain/textsplitters" ">=0.0.0 <0.2.0" js-tiktoken "^1.0.12" js-yaml "^4.1.0" jsonpointer "^5.0.1" langsmith "^0.1.56" openapi-types "^12.1.3" p-retry "4" uuid "^10.0.0" yaml "^2.2.1" zod "^3.22.4" zod-to-json-schema "^3.22.3" langsmith@^0.1.56, langsmith@^0.1.65: version "0.1.67" resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.67.tgz#0c395cace1d2816dd44d85d1996fbc756b13f292" integrity sha512-2jb22AjcFfhCX7jD7ILAlzxY1MDWnEINA3eE8iObL9CqHvq2k61TeE3cnl6zkepZqnfi39o6Fu85qGZ76qPRPg== dependencies: "@types/uuid" "^10.0.0" commander "^10.0.1" p-queue "^6.6.2" p-retry "4" semver "^7.6.3" uuid "^10.0.0" leven@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== levn@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: prelude-ls "^1.2.1" type-check "~0.4.0" lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== locate-path@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" locate-path@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== lodash.memoize@4.x: version "4.1.2" resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== dependencies: yallist "^4.0.0" make-dir@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== makeerror@1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: tmpl "1.0.5" merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1" mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== ms@^2.0.0, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== mustache@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== nanoid@3.3.6: version "3.3.6" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== natural-compare-lite@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz" integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== node-domexception@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" node-int64@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.12: version "2.0.12" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz" integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== object-inspect@^1.13.1: version "1.13.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== object-keys@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.4: version "4.1.4" resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz" integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" has-symbols "^1.0.3" object-keys "^1.1.1" object.values@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz" integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" once@^1.3.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" onetime@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" openai@^4.57.3: version "4.61.1" resolved "https://registry.yarnpkg.com/openai/-/openai-4.61.1.tgz#1fe2fa231b6de54fad32785528d7628dbbf68ab4" integrity sha512-jZ2WRn+f4QWZkYnrUS+xzEUIBllsGN75dUCaXmMIHcv2W9yn7O8amaReTbGHCNEYkL43vuDOcxPUWfNPUmoD3Q== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" "@types/qs" "^6.9.15" abort-controller "^3.0.0" agentkeepalive "^4.2.1" form-data-encoder "1.7.2" formdata-node "^4.3.2" node-fetch "^2.6.7" qs "^6.10.3" openai@^4.67.3: version "4.67.3" resolved "https://registry.yarnpkg.com/openai/-/openai-4.67.3.tgz#a7c1b59cb9eca064f3ff3d439b7bf51487d88a49" integrity sha512-HT2tZgjLgRqbLQNKmYtjdF/4TQuiBvg1oGvTDhwpSEQzxo6/oM1us8VQ53vBK2BiKvCxFuq6gKGG70qfwrNhKg== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" abort-controller "^3.0.0" agentkeepalive "^4.2.1" form-data-encoder "1.7.2" formdata-node "^4.3.2" node-fetch "^2.6.7" openai@^4.68.0: version "4.68.4" resolved "https://registry.yarnpkg.com/openai/-/openai-4.68.4.tgz#f8d684c1f2408d362164ad71916e961941aeedd1" integrity sha512-LRinV8iU9VQplkr25oZlyrsYGPGasIwYN8KFMAAFTHHLHjHhejtJ5BALuLFrkGzY4wfbKhOhuT+7lcHZ+F3iEA== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" abort-controller "^3.0.0" agentkeepalive "^4.2.1" form-data-encoder "1.7.2" formdata-node "^4.3.2" node-fetch "^2.6.7" openapi-types@^12.1.3: version "12.1.3" resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3" integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw== optionator@^0.9.1: version "0.9.1" resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz" integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" word-wrap "^1.2.3" p-finally@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-limit@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-locate@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" p-queue@^6.6.2: version "6.6.2" resolved "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz" integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== dependencies: eventemitter3 "^4.0.4" p-timeout "^3.2.0" p-retry@4: version "4.6.2" resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== dependencies: "@types/retry" "0.12.0" retry "^0.13.1" p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== dependencies: p-finally "^1.0.0" p-try@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" parse-json@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: version "4.0.5" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz" integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz" integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== dependencies: fast-diff "^1.1.2" prettier@^2.8.8: version "2.8.8" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== pretty-format@^29.0.0, pretty-format@^29.5.0: version "29.5.0" resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz" integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== dependencies: "@jest/schemas" "^29.4.3" ansi-styles "^5.0.0" react-is "^18.0.0" prompts@^2.0.1: version "2.4.2" resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" sisteransi "^1.0.5" punycode@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== pure-rand@^6.0.0: version "6.0.2" resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz" integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ== qs@^6.10.3: version "6.13.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: side-channel "^1.0.6" queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== react-is@^18.0.0: version "18.2.0" resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== regenerate-unicode-properties@^10.1.0: version "10.1.0" resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz" integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== dependencies: regenerate "^1.4.2" regenerate@^1.4.2: version "1.4.2" resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== regenerator-runtime@^0.13.11: version "0.13.11" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== regenerator-transform@^0.15.1: version "0.15.1" resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz" integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== dependencies: "@babel/runtime" "^7.8.4" regexp.prototype.flags@^1.4.3: version "1.5.0" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz" integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== dependencies: call-bind "^1.0.2" define-properties "^1.2.0" functions-have-names "^1.2.3" regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz" integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== dependencies: "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" regenerate-unicode-properties "^10.1.0" regjsparser "^0.9.1" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" regjsparser@^0.9.1: version "0.9.1" resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz" integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== dependencies: jsesc "~0.5.0" require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: resolve-from "^5.0.0" resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1: version "1.22.2" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" retry@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== dependencies: queue-microtask "^1.2.2" safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz" integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== dependencies: call-bind "^1.0.2" get-intrinsic "^1.1.3" is-regex "^1.1.4" secure-json-parse@2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== semver@7.x, semver@^7.3.5, semver@^7.3.7: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.5.2, semver@^7.6.3: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== set-function-length@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== dependencies: define-data-property "^1.1.4" es-errors "^1.3.0" function-bind "^1.1.2" get-intrinsic "^1.2.4" gopd "^1.0.1" has-property-descriptors "^1.0.2" shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== side-channel@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== dependencies: call-bind "^1.0.0" get-intrinsic "^1.0.2" object-inspect "^1.9.0" side-channel@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== dependencies: call-bind "^1.0.7" es-errors "^1.3.0" get-intrinsic "^1.2.4" object-inspect "^1.13.1" signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== source-map-support@0.5.13: version "0.5.13" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== sswr@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/sswr/-/sswr-2.1.0.tgz#1eb64cd647cc9e11f871e7f43554abd8c64e1103" integrity sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ== dependencies: swrev "^4.0.0" stack-utils@^2.0.3: version "2.0.6" resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz" integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: char-regex "^1.0.2" strip-ansi "^6.0.0" string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" string.prototype.trim@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz" integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz" integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" string.prototype.trimstart@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz" integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" es-abstract "^1.20.4" strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@^5.3.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" supports-color@^8.0.0: version "8.1.1" resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== swr@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.5.tgz#063eea0e9939f947227d5ca760cc53696f46446b" integrity sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg== dependencies: client-only "^0.0.1" use-sync-external-store "^1.2.0" swrev@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/swrev/-/swrev-4.0.0.tgz#83da6983c7ef9d71ac984a9b169fc197cbf18ff8" integrity sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA== swrv@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/swrv/-/swrv-1.0.4.tgz#278b4811ed4acbb1ae46654972a482fd1847e480" integrity sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g== test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: "@istanbuljs/schema" "^0.1.2" glob "^7.1.4" minimatch "^3.0.4" text-table@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== tmpl@1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.1.0: version "29.1.0" resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz" integrity sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" jest-util "^29.0.0" json5 "^2.2.3" lodash.memoize "4.x" make-error "1.x" semver "7.x" yargs-parser "^21.0.1" ts-node@^10.9.1: version "10.9.1" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" "@tsconfig/node12" "^1.0.7" "@tsconfig/node14" "^1.0.0" "@tsconfig/node16" "^1.0.2" acorn "^8.4.1" acorn-walk "^8.1.1" arg "^4.1.0" create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" v8-compile-cache-lib "^3.0.1" yn "3.1.1" tsconfig-paths@^3.14.1: version "3.14.2" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz" integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.2" minimist "^1.2.6" strip-bom "^3.0.0" tslib@^1.8.1: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tsutils@^3.21.0: version "3.21.0" resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== dependencies: tslib "^1.8.1" type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: prelude-ls "^1.2.1" type-detect@4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== type-fest@^0.20.2: version "0.20.2" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== type-fest@^0.21.3: version "0.21.3" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz" integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== dependencies: call-bind "^1.0.2" for-each "^0.3.3" is-typed-array "^1.1.9" typescript@^5.4.5: version "5.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== dependencies: call-bind "^1.0.2" has-bigints "^1.0.2" has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" undici-types@~5.26.4: version "5.26.5" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== unicode-match-property-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" unicode-match-property-value-ecmascript@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz" integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz" integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== dependencies: escalade "^3.1.1" picocolors "^1.0.0" uri-js@^4.2.2: version "4.4.1" resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" use-sync-external-store@^1.2.0: version "1.2.2" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz#c3b6390f3a30eba13200d2302dcdf1e7b57b2ef9" integrity sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw== uuid@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== uuid@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== v8-to-istanbul@^9.0.1: version "9.1.0" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz" integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" walker@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: makeerror "1.0.12" web-streams-polyfill@4.0.0-beta.3: version "4.0.0-beta.3" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz#2898486b74f5156095e473efe989dcf185047a38" integrity sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug== webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== dependencies: is-bigint "^1.0.1" is-boolean-object "^1.1.0" is-number-object "^1.0.4" is-string "^1.0.5" is-symbol "^1.0.3" which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz" integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" is-typed-array "^1.1.10" which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" word-wrap@^1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" signal-exit "^3.0.7" y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^3.0.2: version "3.1.1" resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yallist@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yaml@^2.2.1: version "2.4.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.2.tgz#7a2b30f2243a5fc299e1f14ca58d475ed4bc5362" integrity sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA== yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1: version "17.7.2" resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" string-width "^4.2.3" y18n "^5.0.5" yargs-parser "^21.1.1" yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== zod-to-json-schema@3.23.2: version "3.23.2" resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.23.2.tgz#bc7e379c8050462538383e382964c03d8fe008f9" integrity sha512-uSt90Gzc/tUfyNqxnjlfBs8W6WSGpNBv0rVsNxP/BVSMHMKGdthPYff4xtCHYloJGM0CFxFsb3NbC0eqPhfImw== zod-to-json-schema@^3.22.3: version "3.22.4" resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.22.4.tgz#f8cc691f6043e9084375e85fb1f76ebafe253d70" integrity sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ== zod@^3.22.4: version "3.22.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== zod@^3.23.8: version "3.23.8" resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/jest.config.cjs
/** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { preset: "ts-jest/presets/default-esm", testEnvironment: "node", modulePathIgnorePatterns: ["dist/"], moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1", }, transform: { "^.+\\.m?[tj]sx?$": ["ts-jest", { useESM: true, diagnostics: false }], }, setupFiles: ["dotenv/config"], testTimeout: 20_000, };
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/babel.config.cjs
// babel.config.js module.exports = { presets: [ ["@babel/preset-env", { targets: { node: true } }] ], };
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/README.md
# LangSmith Client SDK ![NPM Version](https://img.shields.io/npm/v/langsmith?logo=npm) [![JS Downloads](https://img.shields.io/npm/dm/langsmith)](https://www.npmjs.com/package/langsmith) This package contains the TypeScript client for interacting with the [LangSmith platform](https://smith.langchain.com/). To install: ```bash yarn add langsmith ``` LangSmith helps you and your team develop and evaluate language models and intelligent agents. It is compatible with any LLM Application and provides seamless integration with [LangChain](https://github.com/hwchase17/langchainjs), a widely recognized open-source framework that simplifies the process for developers to create powerful language model applications. > **Note**: You can enjoy the benefits of LangSmith without using the LangChain open-source packages! To get started with your own proprietary framework, set up your account and then skip to [Logging Traces Outside LangChain](#logging-traces-outside-langchain). > **Cookbook:** For tutorials on how to get more value out of LangSmith, check out the [Langsmith Cookbook](https://github.com/langchain-ai/langsmith-cookbook/tree/main) repo. A typical workflow looks like: 1. Set up an account with LangSmith. 2. Log traces. 3. Debug, Create Datasets, and Evaluate Runs. We'll walk through these steps in more detail below. ## 1. Connect to LangSmith Sign up for [LangSmith](https://smith.langchain.com/) using your GitHub, Discord accounts, or an email address and password. If you sign up with an email, make sure to verify your email address before logging in. Then, create a unique API key on the [Settings Page](https://smith.langchain.com/settings). Note: Save the API Key in a secure location. It will not be shown again. ## 2. Log Traces You can log traces natively in your LangChain application or using a LangSmith RunTree. ### Logging Traces with LangChain LangSmith seamlessly integrates with the JavaScript LangChain library to record traces from your LLM applications. ```bash yarn add langchain ``` 1. **Copy the environment variables from the Settings Page and add them to your application.** Tracing can be activated by setting the following environment variables or by manually specifying the LangChainTracer. ```typescript process.env["LANGSMITH_TRACING"] = "true"; process.env["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"; // process.env["LANGCHAIN_ENDPOINT"] = "https://eu.api.smith.langchain.com"; // If signed up in the EU region process.env["LANGCHAIN_API_KEY"] = "<YOUR-LANGSMITH-API-KEY>"; // process.env["LANGCHAIN_PROJECT"] = "My Project Name"; // Optional: "default" is used if not set ``` > **Tip:** Projects are groups of traces. All runs are logged to a project. If not specified, the project is set to `default`. 2. **Run an Agent, Chain, or Language Model in LangChain** If the environment variables are correctly set, your application will automatically connect to the LangSmith platform. ```typescript import { ChatOpenAI } from "langchain/chat_models/openai"; const chat = new ChatOpenAI({ temperature: 0 }); const response = await chat.predict( "Translate this sentence from English to French. I love programming." ); console.log(response); ``` ### Logging Traces Outside LangChain You can still use the LangSmith development platform without depending on any LangChain code. You can connect either by setting the appropriate environment variables, or by directly specifying the connection information in the RunTree. 1. **Copy the environment variables from the Settings Page and add them to your application.** ```shell export LANGCHAIN_API_KEY=<YOUR-LANGSMITH-API-KEY> # export LANGCHAIN_PROJECT="My Project Name" # Optional: "default" is used if not set # export LANGCHAIN_ENDPOINT=https://api.smith.langchain.com # or your own server ``` ## Integrations Langsmith's `traceable` wrapper function makes it easy to trace any function or LLM call in your own favorite framework. Below are some examples. ### OpenAI SDK <!-- markdown-link-check-disable --> The easiest way to trace calls from the [OpenAI SDK](https://platform.openai.com/docs/api-reference) with LangSmith is using the `wrapOpenAI` wrapper function available in LangSmith 0.1.3 and up. In order to use, you first need to set your LangSmith API key: ```shell export LANGCHAIN_API_KEY=<your-api-key> ``` Next, you will need to install the LangSmith SDK and the OpenAI SDK: ```shell npm install langsmith openai ``` After that, initialize your OpenAI client and wrap the client with `wrapOpenAI` method to enable tracing for the completions and chat completions methods: ```ts import { OpenAI } from "openai"; import { wrapOpenAI } from "langsmith/wrappers"; const openai = wrapOpenAI(new OpenAI()); await openai.chat.completions.create({ model: "gpt-3.5-turbo", messages: [{ content: "Hi there!", role: "user" }], }); ``` Alternatively, you can use the `traceable` function to wrap the client methods you want to use: ```ts import { traceable } from "langsmith/traceable"; const openai = new OpenAI(); const createCompletion = traceable( openai.chat.completions.create.bind(openai.chat.completions), { name: "OpenAI Chat Completion", run_type: "llm" } ); await createCompletion({ model: "gpt-3.5-turbo", messages: [{ content: "Hi there!", role: "user" }], }); ``` Note the use of `.bind` to preserve the function's context. The `run_type` field in the extra config object marks the function as an LLM call, and enables token usage tracking for OpenAI. Oftentimes, you use the OpenAI client inside of other functions or as part of a longer sequence. You can automatically get nested traces by using this wrapped method within other functions wrapped with `traceable`. ```ts const nestedTrace = traceable(async (text: string) => { const completion = await openai.chat.completions.create({ model: "gpt-3.5-turbo", messages: [{ content: text, role: "user" }], }); return completion; }); await nestedTrace("Why is the sky blue?"); ``` ``` { "id": "chatcmpl-8sPToJQLLVepJvyeTfzZMOMVIKjMo", "object": "chat.completion", "created": 1707978348, "model": "gpt-3.5-turbo-0613", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The sky appears blue because of a phenomenon known as Rayleigh scattering. The Earth's atmosphere is composed of tiny molecules, such as nitrogen and oxygen, which are much smaller than the wavelength of visible light. When sunlight interacts with these molecules, it gets scattered in all directions. However, shorter wavelengths of light (blue and violet) are scattered more compared to longer wavelengths (red, orange, and yellow). \n\nAs a result, when sunlight passes through the Earth's atmosphere, the blue and violet wavelengths are scattered in all directions, making the sky appear blue. This scattering of shorter wavelengths is also responsible for the vibrant colors observed during sunrise and sunset, when the sunlight has to pass through a thicker portion of the atmosphere, causing the longer wavelengths to dominate the scattered light." }, "logprobs": null, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 13, "completion_tokens": 154, "total_tokens": 167 }, "system_fingerprint": null } ``` :::tip [Click here](https://smith.langchain.com/public/4af46ef6-b065-46dc-9cf0-70f1274edb01/r) to see an example LangSmith trace of the above. ::: ## Next.js You can use the `traceable` wrapper function in Next.js apps to wrap arbitrary functions much like in the example above. One neat trick you can use for Next.js and other similar server frameworks is to wrap the entire exported handler for a route to group traces for the any sub-runs. Here's an example: ```ts import { NextRequest, NextResponse } from "next/server"; import { OpenAI } from "openai"; import { traceable } from "langsmith/traceable"; import { wrapOpenAI } from "langsmith/wrappers"; export const runtime = "edge"; const handler = traceable( async function () { const openai = wrapOpenAI(new OpenAI()); const completion = await openai.chat.completions.create({ model: "gpt-3.5-turbo", messages: [{ content: "Why is the sky blue?", role: "user" }], }); const response1 = completion.choices[0].message.content; const completion2 = await openai.chat.completions.create({ model: "gpt-3.5-turbo", messages: [ { content: "Why is the sky blue?", role: "user" }, { content: response1, role: "assistant" }, { content: "Cool thank you!", role: "user" }, ], }); const response2 = completion2.choices[0].message.content; return { text: response2, }; }, { name: "Simple Next.js handler", } ); export async function POST(req: NextRequest) { const result = await handler(); return NextResponse.json(result); } ``` The two OpenAI calls within the handler will be traced with appropriate inputs, outputs, and token usage information. :::tip [Click here](https://smith.langchain.com/public/faaf26ad-8c59-4622-bcfe-b7d896733ca6/r) to see an example LangSmith trace of the above. ::: ## Vercel AI SDK The [Vercel AI SDK](https://sdk.vercel.ai/docs) contains integrations with a variety of model providers. Here's an example of how you can trace outputs in a Next.js handler: ```ts import { traceable } from "langsmith/traceable"; import { OpenAIStream, StreamingTextResponse } from "ai"; // Note: There are no types for the Mistral API client yet. import MistralClient from "@mistralai/mistralai"; const client = new MistralClient(process.env.MISTRAL_API_KEY || ""); export async function POST(req: Request) { // Extract the `messages` from the body of the request const { messages } = await req.json(); const mistralChatStream = traceable(client.chatStream.bind(client), { name: "Mistral Stream", run_type: "llm", }); const response = await mistralChatStream({ model: "mistral-tiny", maxTokens: 1000, messages, }); // Convert the response into a friendly text-stream. The Mistral client responses are // compatible with the Vercel AI SDK OpenAIStream adapter. const stream = OpenAIStream(response as any); // Respond with the stream return new StreamingTextResponse(stream); } ``` See the [AI SDK docs](https://sdk.vercel.ai/docs) for more examples. ## Arbitrary SDKs You can use the generic `wrapSDK` method to add tracing for arbitrary SDKs. Do note that this will trace ALL methods in the SDK, not just chat completion endpoints. If the SDK you are wrapping has other methods, we recommend using it for only LLM calls. Here's an example using the Anthropic SDK: ```ts import { wrapSDK } from "langsmith/wrappers"; import { Anthropic } from "@anthropic-ai/sdk"; const originalSDK = new Anthropic(); const sdkWithTracing = wrapSDK(originalSDK); const response = await sdkWithTracing.messages.create({ messages: [ { role: "user", content: `What is 1 + 1? Respond only with "2" and nothing else.`, }, ], model: "claude-3-sonnet-20240229", max_tokens: 1024, }); ``` :::tip [Click here](https://smith.langchain.com/public/0e7248af-bbed-47cf-be9f-5967fea1dec1/r) to see an example LangSmith trace of the above. ::: #### Alternatives: **Log traces using a RunTree.** A RunTree tracks your application. Each RunTree object is required to have a name and run_type. These and other important attributes are as follows: - `name`: `string` - used to identify the component's purpose - `run_type`: `string` - Currently one of "llm", "chain" or "tool"; more options will be added in the future - `inputs`: `Record<string, any>` - the inputs to the component - `outputs`: `Optional<Record<string, any>>` - the (optional) returned values from the component - `error`: `Optional<string>` - Any error messages that may have arisen during the call ```typescript import { RunTree, RunTreeConfig } from "langsmith"; const parentRunConfig: RunTreeConfig = { name: "My Chat Bot", run_type: "chain", inputs: { text: "Summarize this morning's meetings.", }, serialized: {}, // Serialized representation of this chain // project_name: "Defaults to the LANGCHAIN_PROJECT env var" // apiUrl: "Defaults to the LANGCHAIN_ENDPOINT env var" // apiKey: "Defaults to the LANGCHAIN_API_KEY env var" }; const parentRun = new RunTree(parentRunConfig); await parentRun.postRun(); const childLlmRun = await parentRun.createChild({ name: "My Proprietary LLM", run_type: "llm", inputs: { prompts: [ "You are an AI Assistant. The time is XYZ." + " Summarize this morning's meetings.", ], }, }); await childLlmRun.postRun(); await childLlmRun.end({ outputs: { generations: [ "I should use the transcript_loader tool" + " to fetch meeting_transcripts from XYZ", ], }, }); await childLlmRun.patchRun(); const childToolRun = await parentRun.createChild({ name: "transcript_loader", run_type: "tool", inputs: { date: "XYZ", content_type: "meeting_transcripts", }, }); await childToolRun.postRun(); await childToolRun.end({ outputs: { meetings: ["Meeting1 notes.."], }, }); await childToolRun.patchRun(); const childChainRun = await parentRun.createChild({ name: "Unreliable Component", run_type: "tool", inputs: { input: "Summarize these notes...", }, }); await childChainRun.postRun(); try { // .... the component does work throw new Error("Something went wrong"); } catch (e) { await childChainRun.end({ error: `I errored again ${e.message}`, }); await childChainRun.patchRun(); throw e; } await childChainRun.patchRun(); await parentRun.end({ outputs: { output: ["The meeting notes are as follows:..."], }, }); // False directs to not exclude child runs await parentRun.patchRun(); ``` ## Evaluation #### Create a Dataset from Existing Runs Once your runs are stored in LangSmith, you can convert them into a dataset. For this example, we will do so using the Client, but you can also do this using the web interface, as explained in the [LangSmith docs](https://docs.smith.langchain.com/docs/). ```typescript import { Client } from "langsmith/client"; const client = new Client({ // apiUrl: "https://api.langchain.com", // Defaults to the LANGCHAIN_ENDPOINT env var // apiKey: "my_api_key", // Defaults to the LANGCHAIN_API_KEY env var /* callerOptions: { maxConcurrency?: Infinity; // Maximum number of concurrent requests to make maxRetries?: 6; // Maximum number of retries to make */ }); const datasetName = "Example Dataset"; // We will only use examples from the top level AgentExecutor run here, // and exclude runs that errored. const runs = await client.listRuns({ projectName: "my_project", executionOrder: 1, error: false, }); const dataset = await client.createDataset(datasetName, { description: "An example dataset", }); for (const run of runs) { await client.createExample(run.inputs, run.outputs ?? {}, { datasetId: dataset.id, }); } ``` # Evaluating Runs Check out the [LangSmith Testing & Evaluation dos](https://docs.smith.langchain.com/docs/evaluation/) for up-to-date workflows. For generating automated feedback on individual runs, you can run evaluations directly using the LangSmith client. ```ts import { StringEvaluator } from "langsmith/evaluation"; function jaccardChars(output: string, answer: string): number { const predictionChars = new Set(output.trim().toLowerCase()); const answerChars = new Set(answer.trim().toLowerCase()); const intersection = [...predictionChars].filter((x) => answerChars.has(x)); const union = new Set([...predictionChars, ...answerChars]); return intersection.length / union.size; } async function grader(config: { input: string; prediction: string; answer?: string; }): Promise<{ score: number; value: string }> { let value: string; let score: number; if (config.answer === null || config.answer === undefined) { value = "AMBIGUOUS"; score = 0.5; } else { score = jaccardChars(config.prediction, config.answer); value = score > 0.9 ? "CORRECT" : "INCORRECT"; } return { score: score, value: value }; } const evaluator = new StringEvaluator({ evaluationName: "Jaccard", gradingFunction: grader, }); const runs = await client.listRuns({ projectName: "my_project", executionOrder: 1, error: false, }); for (const run of runs) { client.evaluateRun(run, evaluator); } ``` ## Additional Documentation To learn more about the LangSmith platform, check out the [docs](https://docs.smith.langchain.com/docs/).
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/.eslintrc.cjs
module.exports = { extends: [ "eslint:recommended", "prettier", "plugin:@typescript-eslint/recommended", ], parserOptions: { ecmaVersion: 12, parser: "@typescript-eslint/parser", project: "./tsconfig.json", sourceType: "module", }, plugins: ["import", "@typescript-eslint", "no-instanceof"], ignorePatterns: [ ".eslintrc.cjs", "scripts", "src/utils/lodash/*", "node_modules", "dist", "dist-cjs", "*.js", "*.cjs", "*.d.ts", ], rules: { "no-process-env": 2, "no-instanceof/no-instanceof": 2, "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-shadow": 0, "@typescript-eslint/no-empty-interface": 0, "@typescript-eslint/no-use-before-define": ["error", "nofunc"], "@typescript-eslint/no-unused-vars": [ "warn", { args: "none", argsIgnorePattern: "^_", caughtErrors: "all", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", varsIgnorePattern: "^_", ignoreRestSiblings: true, }, ], "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-misused-promises": "error", camelcase: 0, "class-methods-use-this": 0, "import/extensions": [2, "ignorePackages"], "import/no-extraneous-dependencies": [ "error", { devDependencies: ["**/*.test.ts"] }, ], "import/no-unresolved": 0, "import/prefer-default-export": 0, "keyword-spacing": "error", "max-classes-per-file": 0, "max-len": 0, "no-await-in-loop": 0, "no-bitwise": 0, "no-console": 0, "no-restricted-syntax": 0, "no-shadow": 0, "no-continue": 0, "no-underscore-dangle": 0, "no-use-before-define": 0, "no-useless-constructor": 0, "no-return-await": 0, "consistent-return": 0, "no-else-return": 0, "new-cap": ["error", { properties: false, capIsNew: false }], }, };
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/package.json
{ "name": "langsmith", "version": "0.2.10", "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", "packageManager": "yarn@1.22.19", "files": [ "dist/", "client.cjs", "client.js", "client.d.ts", "client.d.cts", "run_trees.cjs", "run_trees.js", "run_trees.d.ts", "run_trees.d.cts", "traceable.cjs", "traceable.js", "traceable.d.ts", "traceable.d.cts", "evaluation.cjs", "evaluation.js", "evaluation.d.ts", "evaluation.d.cts", "evaluation/langchain.cjs", "evaluation/langchain.js", "evaluation/langchain.d.ts", "evaluation/langchain.d.cts", "schemas.cjs", "schemas.js", "schemas.d.ts", "schemas.d.cts", "langchain.cjs", "langchain.js", "langchain.d.ts", "langchain.d.cts", "vercel.cjs", "vercel.js", "vercel.d.ts", "vercel.d.cts", "wrappers.cjs", "wrappers.js", "wrappers.d.ts", "wrappers.d.cts", "anonymizer.cjs", "anonymizer.js", "anonymizer.d.ts", "anonymizer.d.cts", "wrappers/openai.cjs", "wrappers/openai.js", "wrappers/openai.d.ts", "wrappers/openai.d.cts", "wrappers/vercel.cjs", "wrappers/vercel.js", "wrappers/vercel.d.ts", "wrappers/vercel.d.cts", "singletons/traceable.cjs", "singletons/traceable.js", "singletons/traceable.d.ts", "singletons/traceable.d.cts", "index.cjs", "index.js", "index.d.ts", "index.d.cts" ], "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { "build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js", "bump-version": "node scripts/bump-version.js", "check-version": "node scripts/check-version.js", "check-npm-version": "node scripts/check-npm-version.js", "clean": "rm -rf dist/ && node scripts/create-entrypoints.js clean", "build:esm": "rm -f src/package.json && tsc --outDir dist/ && rm -rf dist/tests dist/**/tests", "build:cjs": "echo '{}' > src/package.json && tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rm -r dist-cjs src/package.json", "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests --testPathIgnorePatterns='\\.int\\.test.[tj]s' --testTimeout 30000", "test:integration": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000", "test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000", "watch:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --watch --config jest.config.cjs --testTimeout 100000", "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/", "lint:fix": "yarn lint --fix", "format": "prettier --write 'src/**/*.{ts,tsx}'", "format:check": "prettier --check 'src/**/*.{ts,tsx}'", "precommit": "lint-staged", "prepublish": "yarn run build" }, "repository": { "type": "git", "url": "git+https://github.com/langchain-ai/langsmith-sdk.git" }, "keywords": [ "LLM", "Tracing", "Evaluation", "LangChain" ], "author": "LangChain", "license": "MIT", "bugs": { "url": "https://github.com/langchain-ai/langsmith-sdk/issues" }, "homepage": "https://github.com/langchain-ai/langsmith-sdk#readme", "dependencies": { "@types/uuid": "^10.0.0", "commander": "^10.0.1", "p-queue": "^6.6.2", "p-retry": "4", "semver": "^7.6.3", "uuid": "^10.0.0" }, "devDependencies": { "@ai-sdk/openai": "^0.0.68", "@babel/preset-env": "^7.22.4", "@faker-js/faker": "^8.4.1", "@jest/globals": "^29.5.0", "@langchain/core": "^0.3.14", "@langchain/langgraph": "^0.2.20", "@langchain/openai": "^0.3.11", "@opentelemetry/sdk-trace-base": "^1.26.0", "@opentelemetry/sdk-trace-node": "^1.26.0", "@tsconfig/recommended": "^1.0.2", "@types/jest": "^29.5.1", "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.59.8", "ai": "^3.4.17", "babel-jest": "^29.5.0", "cross-env": "^7.0.3", "dotenv": "^16.1.3", "eslint": "^8.41.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-no-instanceof": "^1.0.1", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.5.0", "langchain": "^0.3.3", "node-fetch": "^2.7.0", "openai": "^4.67.3", "prettier": "^2.8.8", "ts-jest": "^29.1.0", "ts-node": "^10.9.1", "typescript": "^5.4.5", "zod": "^3.23.8" }, "peerDependencies": { "openai": "*" }, "peerDependenciesMeta": { "openai": { "optional": true } }, "lint-staged": { "**/*.{ts,tsx}": [ "prettier --write --ignore-unknown", "eslint --cache --fix" ] }, "exports": { ".": { "types": { "import": "./index.d.ts", "require": "./index.d.cts", "default": "./index.d.ts" }, "import": "./index.js", "require": "./index.cjs" }, "./client": { "types": { "import": "./client.d.ts", "require": "./client.d.cts", "default": "./client.d.ts" }, "import": "./client.js", "require": "./client.cjs" }, "./run_trees": { "types": { "import": "./run_trees.d.ts", "require": "./run_trees.d.cts", "default": "./run_trees.d.ts" }, "import": "./run_trees.js", "require": "./run_trees.cjs" }, "./traceable": { "types": { "import": "./traceable.d.ts", "require": "./traceable.d.cts", "default": "./traceable.d.ts" }, "import": "./traceable.js", "require": "./traceable.cjs" }, "./evaluation": { "types": { "import": "./evaluation.d.ts", "require": "./evaluation.d.cts", "default": "./evaluation.d.ts" }, "import": "./evaluation.js", "require": "./evaluation.cjs" }, "./evaluation/langchain": { "types": { "import": "./evaluation/langchain.d.ts", "require": "./evaluation/langchain.d.cts", "default": "./evaluation/langchain.d.ts" }, "import": "./evaluation/langchain.js", "require": "./evaluation/langchain.cjs" }, "./schemas": { "types": { "import": "./schemas.d.ts", "require": "./schemas.d.cts", "default": "./schemas.d.ts" }, "import": "./schemas.js", "require": "./schemas.cjs" }, "./langchain": { "types": { "import": "./langchain.d.ts", "require": "./langchain.d.cts", "default": "./langchain.d.ts" }, "import": "./langchain.js", "require": "./langchain.cjs" }, "./vercel": { "types": { "import": "./vercel.d.ts", "require": "./vercel.d.cts", "default": "./vercel.d.ts" }, "import": "./vercel.js", "require": "./vercel.cjs" }, "./wrappers": { "types": { "import": "./wrappers.d.ts", "require": "./wrappers.d.cts", "default": "./wrappers.d.ts" }, "import": "./wrappers.js", "require": "./wrappers.cjs" }, "./anonymizer": { "types": { "import": "./anonymizer.d.ts", "require": "./anonymizer.d.cts", "default": "./anonymizer.d.ts" }, "import": "./anonymizer.js", "require": "./anonymizer.cjs" }, "./wrappers/openai": { "types": { "import": "./wrappers/openai.d.ts", "require": "./wrappers/openai.d.cts", "default": "./wrappers/openai.d.ts" }, "import": "./wrappers/openai.js", "require": "./wrappers/openai.cjs" }, "./wrappers/vercel": { "types": { "import": "./wrappers/vercel.d.ts", "require": "./wrappers/vercel.d.cts", "default": "./wrappers/vercel.d.ts" }, "import": "./wrappers/vercel.js", "require": "./wrappers/vercel.cjs" }, "./singletons/traceable": { "types": { "import": "./singletons/traceable.d.ts", "require": "./singletons/traceable.d.cts", "default": "./singletons/traceable.d.ts" }, "import": "./singletons/traceable.js", "require": "./singletons/traceable.cjs" }, "./package.json": "./package.json" } }
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/tsconfig.cjs.json
{ "extends": "./tsconfig.json", "compilerOptions": { "declaration": false }, "exclude": [ "node_modules", "dist", "docs", "**/tests" ] }
0
lc_public_repos/langsmith-sdk
lc_public_repos/langsmith-sdk/js/.prettierrc
{ "endOfLine": "lf" }
0
lc_public_repos/langsmith-sdk/js
lc_public_repos/langsmith-sdk/js/src/vercel.types.ts
import type { ReadableSpan } from "@opentelemetry/sdk-trace-base"; // eslint-disable-next-line @typescript-eslint/ban-types type AnyString = string & {}; interface TypedReadableSpan<Name, Attributes> extends Omit<ReadableSpan, "name" | "attributes"> { name: Name; attributes: Attributes; } interface BaseLLMSpanAttributes { "ai.model.id": string; "ai.model.provider": string; "ai.usage.promptTokens": number; "ai.usage.completionTokens": number; "ai.telemetry.functionId"?: string; "resource.name"?: string; } interface CallLLMSpanAttributes extends BaseLLMSpanAttributes { "ai.response.model": string; "ai.response.id": string; "ai.response.timestamp": number; } interface BaseEmbedSpanAttributes { "ai.model.id": string; "ai.model.provider": string; "ai.usage.tokens": number; "ai.telemetry.functionId"?: string; "resource.name"?: string; } type ToolCallSpan = TypedReadableSpan< "ai.toolCall", { "operation.name": "ai.toolCall"; "ai.operationId": "ai.toolCall"; "ai.toolCall.name": string; "ai.toolCall.id": string; "ai.toolCall.args": string; "ai.toolCall.result"?: string; } >; type GenerateTextSpan = TypedReadableSpan< "ai.generateText", BaseLLMSpanAttributes & { "operation.name": "ai.generateText"; "ai.operationId": "ai.generateText"; "ai.prompt": string; "ai.response.text": string; "ai.response.toolCalls": string; "ai.response.finishReason": string; "ai.settings.maxSteps": number; } >; type DoGenerateTextSpan = TypedReadableSpan< "ai.generateText.doGenerate", CallLLMSpanAttributes & { "operation.name": "ai.generateText.doGenerate"; "ai.operationId": "ai.generateText.doGenerate"; "ai.prompt.format": string; "ai.prompt.messages": string; "ai.response.text": string; "ai.response.toolCalls": string; "ai.response.finishReason": string; } >; type StreamTextSpan = TypedReadableSpan< "ai.streamText", BaseLLMSpanAttributes & { "operation.name": "ai.streamText"; "ai.operationId": "ai.streamText"; "ai.prompt": string; "ai.response.text": string; "ai.response.toolCalls": string; "ai.response.finishReason": string; "ai.settings.maxSteps": number; } >; type DoStreamTextSpan = TypedReadableSpan< "ai.streamText.doStream", CallLLMSpanAttributes & { "operation.name": "ai.streamText.doStream"; "ai.operationId": "ai.streamText.doStream"; "ai.prompt.format": string; "ai.prompt.messages": string; "ai.response.text": string; "ai.response.toolCalls": string; "ai.response.msToFirstChunk": number; "ai.response.msToFinish": number; "ai.response.avgCompletionTokensPerSecond": number; "ai.response.finishReason": string; } >; type GenerateObjectSpan = TypedReadableSpan< "ai.generateObject", BaseLLMSpanAttributes & { "operation.name": "ai.generateObject"; "ai.operationId": "ai.generateObject"; "ai.prompt": string; "ai.schema": string; "ai.schema.name": string; "ai.schema.description": string; "ai.response.object": string; "ai.settings.mode": "json" | AnyString; "ai.settings.output": "object" | "no-schema" | AnyString; } >; type DoGenerateObjectSpan = TypedReadableSpan< "ai.generateObject.doGenerate", CallLLMSpanAttributes & { "operation.name": "ai.generateObject.doGenerate"; "ai.operationId": "ai.generateObject.doGenerate"; "ai.prompt.format": string; "ai.prompt.messages": string; "ai.response.object": string; "ai.response.finishReason": string; "ai.settings.mode": "json" | AnyString; "ai.settings.output": "object" | "no-schema" | AnyString; } >; type StreamObjectSpan = TypedReadableSpan< "ai.streamObject", BaseLLMSpanAttributes & { "operation.name": "ai.streamObject"; "ai.operationId": "ai.streamObject"; "ai.prompt": string; "ai.schema": string; "ai.schema.name": string; "ai.schema.description": string; "ai.response.object": string; "ai.settings.mode": "json" | AnyString; "ai.settings.output": "object" | "no-schema" | AnyString; } >; type DoStreamObjectSpan = TypedReadableSpan< "ai.streamObject.doStream", CallLLMSpanAttributes & { "operation.name": "ai.streamObject.doStream"; "ai.operationId": "ai.streamObject.doStream"; "ai.prompt.format": string; "ai.prompt.messages": string; "ai.response.object": string; "ai.response.finishReason": string; "ai.response.msToFirstChunk": number; "ai.settings.mode": "json" | AnyString; } >; type EmbedSpan = TypedReadableSpan< "ai.embed", BaseEmbedSpanAttributes & { "operation.name": "ai.embed"; "ai.operationId": "ai.embed"; "ai.value": string; "ai.embedding": string; } >; type DoEmbedSpan = TypedReadableSpan< "ai.embed.doEmbed", BaseEmbedSpanAttributes & { "operation.name": "ai.embed.doEmbed"; "ai.operationId": "ai.embed.doEmbed"; "ai.values": string[]; "ai.embeddings": string[]; } >; type EmbedManySpan = TypedReadableSpan< "ai.embedMany", BaseEmbedSpanAttributes & { "operation.name": "ai.embedMany"; "ai.operationId": "ai.embedMany"; "ai.values": string[]; "ai.embeddings": string[]; } >; type DoEmbedManySpan = TypedReadableSpan< "ai.embedMany.doEmbed", BaseEmbedSpanAttributes & { "operation.name": "ai.embedMany.doEmbed"; "ai.operationId": "ai.embedMany.doEmbed"; "ai.values": string[]; "ai.embeddings": string[]; } >; /** @internal */ export type AISDKSpan = | ToolCallSpan | GenerateTextSpan | DoGenerateTextSpan | StreamTextSpan | DoStreamTextSpan | GenerateObjectSpan | DoGenerateObjectSpan | StreamObjectSpan | DoStreamObjectSpan | EmbedSpan | DoEmbedSpan | EmbedManySpan | DoEmbedManySpan;
0
lc_public_repos/langsmith-sdk/js
lc_public_repos/langsmith-sdk/js/src/env.ts
import { getLangSmithEnvironmentVariable } from "./utils/env.js"; export const isTracingEnabled = (tracingEnabled?: boolean): boolean => { if (tracingEnabled !== undefined) { return tracingEnabled; } const envVars = ["TRACING_V2", "TRACING"]; return !!envVars.find( (envVar) => getLangSmithEnvironmentVariable(envVar) === "true" ); };
0
lc_public_repos/langsmith-sdk/js
lc_public_repos/langsmith-sdk/js/src/schemas.ts
export interface TracerSession { // The ID of the tenant, or organization tenant_id: string; // The ID of the project (alias for session) id: string; // The start time of the project start_time: number; // The end time of the project end_time?: number; // A description of the project description?: string; // The name of the project name?: string; /** Extra metadata for the project. */ extra?: KVMap; // The reference dataset ID this session's runs were generated on. reference_dataset_id?: string; } // Fully loaded information about a Tracer Session (also known // as a Project) export interface TracerSessionResult extends TracerSession { // The number of runs in the session. run_count?: number; // The median (50th percentile) latency for the session. latency_p50?: number; // The 99th percentile latency for the session. latency_p99?: number; // The total number of tokens consumed in the session. total_tokens?: number; // The total number of prompt tokens consumed in the session. prompt_tokens?: number; // The total number of completion tokens consumed in the session. completion_tokens?: number; // The start time of the last run in the session. last_run_start_time?: number; // Feedback stats for the session. feedback_stats?: Record<string, unknown>; // Facets for the runs in the session. run_facets?: KVMap[]; } // eslint-disable-next-line @typescript-eslint/no-explicit-any export type KVMap = Record<string, any>; // DEPRECATED: Use a raw string instead. export type RunType = | "llm" | "chain" | "tool" | "retriever" | "embedding" | "prompt" | "parser"; export type ScoreType = number | boolean | null; export type ValueType = number | boolean | string | object | null; export type DataType = "kv" | "llm" | "chat"; export interface BaseExample { dataset_id: string; inputs: KVMap; outputs?: KVMap; metadata?: KVMap; source_run_id?: string; } export type AttachmentData = Uint8Array | ArrayBuffer; export type Attachments = Record<string, [string, AttachmentData]>; /** * A run can represent either a trace (root run) * or a child run (~span). */ export interface BaseRun { /** Optionally, a unique identifier for the run. */ id?: string; /** A human-readable name for the run. */ name: string; /** The epoch time at which the run started, if available. */ start_time?: number; /** Specifies the type of run (tool, chain, llm, etc.). */ run_type: string; /** The epoch time at which the run ended, if applicable. */ end_time?: number; /** Any additional metadata or settings for the run. */ extra?: KVMap; /** Error message, captured if the run faces any issues. */ error?: string; /** Serialized state of the run for potential future use. */ serialized?: object; /** Events like 'start', 'end' linked to the run. */ events?: KVMap[]; /** Inputs that were used to initiate the run. */ inputs: KVMap; /** Outputs produced by the run, if any. */ outputs?: KVMap; /** ID of an example that might be related to this run. */ reference_example_id?: string; /** ID of a parent run, if this run is part of a larger operation. */ parent_run_id?: string; /** Tags for further categorizing or annotating the run. */ tags?: string[]; /** Unique ID assigned to every run within this nested trace. **/ trace_id?: string; /** * The dotted order for the run. * * This is a string composed of {time}{run-uuid}.* so that a trace can be * sorted in the order it was executed. * * Example: * - Parent: 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8 * - Children: * - 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a * - 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c */ dotted_order?: string; /** * Attachments associated with the run. * Each entry is a tuple of [mime_type, bytes] */ attachments?: Attachments; } type S3URL = { ROOT: { /** A pre-signed URL */ presigned_url: string; /** The S3 path to the object in storage */ s3_url: string; }; }; /** * Describes properties of a run when loaded from the database. * Extends the BaseRun interface. */ export interface Run extends BaseRun { /** A unique identifier for the run, mandatory when loaded from DB. */ id: string; /** The ID of the project that owns this run. */ session_id?: string; /** IDs of any child runs spawned by this run. */ child_run_ids?: string[]; /** Child runs, loaded explicitly via a heavier query. */ child_runs?: Run[]; /** Stats capturing feedback for this run. */ feedback_stats?: KVMap; /** The URL path where this run is accessible within the app. */ app_path?: string; /** The manifest ID that correlates with this run. */ manifest_id?: string; /** The current status of the run, such as 'success'. */ status?: string; /** Number of tokens used in the prompt. */ prompt_tokens?: number; /** Number of tokens generated in the completion. */ completion_tokens?: number; /** Total token count, combining prompt and completion. */ total_tokens?: number; /** Time when the first token was processed. */ first_token_time?: number; /** IDs of parent runs, if multiple exist. */ parent_run_ids?: string[]; /** Whether the run is included in a dataset. */ in_dataset?: boolean; /** The output S3 URLs */ outputs_s3_urls?: S3URL; /** The input S3 URLs */ inputs_s3_urls?: S3URL; } export interface RunCreate extends BaseRun { revision_id?: string; child_runs?: this[]; session_name?: string; } export interface RunUpdate { id?: string; end_time?: number; extra?: KVMap; tags?: string[]; error?: string; inputs?: KVMap; outputs?: KVMap; parent_run_id?: string; reference_example_id?: string; events?: KVMap[]; session_id?: string; /** Unique ID assigned to every run within this nested trace. **/ trace_id?: string; /** * The dotted order for the run. * * This is a string composed of {time}{run-uuid}.* so that a trace can be * sorted in the order it was executed. * * Example: * - Parent: 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8 * - Children: * - 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a * - 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c */ dotted_order?: string; /** * Attachments associated with the run. * Each entry is a tuple of [mime_type, bytes] */ attachments?: Attachments; } export interface ExampleCreate extends BaseExample { id?: string; created_at?: string; split?: string | string[]; } export interface Example extends BaseExample { id: string; created_at: string; modified_at: string; source_run_id?: string; runs: Run[]; } export interface ExampleUpdate { dataset_id?: string; inputs?: KVMap; outputs?: KVMap; metadata?: KVMap; split?: string | string[]; } export interface ExampleUpdateWithId extends ExampleUpdate { id: string; } export interface ExampleSearch extends BaseExample { id: string; } export interface BaseDataset { name: string; description: string; tenant_id: string; data_type?: DataType; inputs_schema_definition?: KVMap; outputs_schema_definition?: KVMap; } export interface Dataset extends BaseDataset { id: string; created_at: string; modified_at: string; example_count?: number; session_count?: number; last_session_start_time?: number; } export interface DatasetShareSchema { dataset_id: string; share_token: string; url: string; } export interface FeedbackSourceBase { type: string; metadata?: KVMap; } export interface APIFeedbackSource extends FeedbackSourceBase { type: "api"; } export interface ModelFeedbackSource extends FeedbackSourceBase { type: "model"; } export interface FeedbackBase { created_at: string; modified_at: string; run_id: string; key: string; score: ScoreType; value: ValueType; comment: string | null; correction: string | object | null; feedback_source: APIFeedbackSource | ModelFeedbackSource | KVMap | null; } export interface FeedbackCreate extends FeedbackBase { id: string; } export interface Feedback extends FeedbackBase { id: string; } export interface LangChainBaseMessage { _getType: () => string; content: string; additional_kwargs?: KVMap; } export interface FeedbackIngestToken { id: string; url: string; expires_at: string; } export interface TimeDelta { days?: number; hours?: number; minutes?: number; } export interface FeedbackCategory { value: number; label?: string | null; } /** * Represents the configuration for feedback. * This determines how the LangSmith service interprets feedback * values of the associated key. */ export interface FeedbackConfig { /** * The type of feedback. * - "continuous": Feedback with a continuous numeric. * - "categorical": Feedback with a categorical value (classes) * - "freeform": Feedback with a freeform text value (notes). */ type: "continuous" | "categorical" | "freeform"; /** * The minimum value for continuous feedback. */ min?: number | null; /** * The maximum value for continuous feedback. */ max?: number | null; /** * The categories for categorical feedback. * Each category can be a string or an object with additional properties. * * If feedback is categorical, this defines the valid categories the server will accept. * Not applicable to continuous or freeform feedback types. */ categories?: FeedbackCategory[] | null; } export interface DatasetDiffInfo { examples_modified: string[]; examples_added: string[]; examples_removed: string[]; } export interface ComparisonEvaluationResult { key: string; scores: Record<string, ScoreType>; source_run_id?: string; } export interface ComparativeExperiment { id: string; name: string; description: string; tenant_id: string; created_at: string; modified_at: string; reference_dataset_id: string; extra?: Record<string, unknown>; experiments_info?: Array<Record<string, unknown>>; feedback_stats?: Record<string, unknown>; } /** * Represents the expected output schema returned by traceable * or by run tree output for LangSmith to correctly display * documents in the UI */ export type RetrieverOutput = Array<{ page_content: string; type: "Document"; metadata?: KVMap; }>; export interface InvocationParamsSchema { ls_provider?: string; ls_model_name?: string; ls_model_type: "chat" | "llm"; ls_temperature?: number; ls_max_tokens?: number; ls_stop?: string[]; } export interface PromptCommit { owner: string; repo: string; commit_hash: string; manifest: Record<string, any>; examples: Array<Record<any, any>>; } export interface Prompt { repo_handle: string; description?: string; readme?: string; id: string; tenant_id: string; created_at: string; updated_at: string; is_public: boolean; is_archived: boolean; tags: string[]; original_repo_id?: string; upstream_repo_id?: string; owner?: string; full_name: string; num_likes: number; num_downloads: number; num_views: number; liked_by_auth_user: boolean; last_commit_hash?: string; num_commits: number; original_repo_full_name?: string; upstream_repo_full_name?: string; } export interface ListPromptsResponse { repos: Prompt[]; total: number; } export interface ListCommitsResponse { commits: PromptCommit[]; total: number; } export type PromptSortField = | "num_downloads" | "num_views" | "updated_at" | "num_likes"; export interface LikePromptResponse { likes: number; } export interface LangSmithSettings { id: string; display_name: string; created_at: string; tenant_handle?: string; } export interface AnnotationQueue { /** The unique identifier of the annotation queue. */ id: string; /** The name of the annotation queue. */ name: string; /** An optional description of the annotation queue. */ description?: string; /** The timestamp when the annotation queue was created. */ created_at: string; /** The timestamp when the annotation queue was last updated. */ updated_at: string; /** The ID of the tenant associated with the annotation queue. */ tenant_id: string; } export interface RunWithAnnotationQueueInfo extends BaseRun { /** The last time this run was reviewed. */ last_reviewed_time?: string; /** The time this run was added to the queue. */ added_at?: string; } /** * Breakdown of input token counts. * * Does not *need* to sum to full input token count. Does *not* need to have all keys. */ export type InputTokenDetails = { /** * Audio input tokens. */ audio?: number; /** * Input tokens that were cached and there was a cache hit. * * Since there was a cache hit, the tokens were read from the cache. * More precisely, the model state given these tokens was read from the cache. */ cache_read?: number; /** * Input tokens that were cached and there was a cache miss. * * Since there was a cache miss, the cache was created from these tokens. */ cache_creation?: number; }; /** * Breakdown of output token counts. * * Does *not* need to sum to full output token count. Does *not* need to have all keys. */ export type OutputTokenDetails = { /** * Audio output tokens */ audio?: number; /** * Reasoning output tokens. * * Tokens generated by the model in a chain of thought process (i.e. by * OpenAI's o1 models) that are not returned as part of model output. */ reasoning?: number; }; /** * Usage metadata for a message, such as token counts. */ export type UsageMetadata = { /** * Count of input (or prompt) tokens. Sum of all input token types. */ input_tokens: number; /** * Count of output (or completion) tokens. Sum of all output token types. */ output_tokens: number; /** * Total token count. Sum of input_tokens + output_tokens. */ total_tokens: number; /** * Breakdown of input token counts. * * Does *not* need to sum to full input token count. Does *not* need to have all keys. */ input_token_details?: InputTokenDetails; /** * Breakdown of output token counts. * * Does *not* need to sum to full output token count. Does *not* need to have all keys. */ output_token_details?: OutputTokenDetails; };
0
lc_public_repos/langsmith-sdk/js
lc_public_repos/langsmith-sdk/js/src/run_trees.ts
import * as uuid from "uuid"; import { Attachments, BaseRun, KVMap, RunCreate, RunUpdate, } from "./schemas.js"; import { RuntimeEnvironment, getEnvironmentVariable, getRuntimeEnvironment, } from "./utils/env.js"; import { Client } from "./client.js"; import { isTracingEnabled } from "./env.js"; import { warnOnce } from "./utils/warn.js"; import { _LC_CONTEXT_VARIABLES_KEY } from "./singletons/constants.js"; function stripNonAlphanumeric(input: string) { return input.replace(/[-:.]/g, ""); } export function convertToDottedOrderFormat( epoch: number, runId: string, executionOrder = 1 ) { // Date only has millisecond precision, so we use the microseconds to break // possible ties, avoiding incorrect run order const paddedOrder = executionOrder.toFixed(0).slice(0, 3).padStart(3, "0"); return ( stripNonAlphanumeric( `${new Date(epoch).toISOString().slice(0, -1)}${paddedOrder}Z` ) + runId ); } export interface RunTreeConfig { name: string; run_type?: string; id?: string; project_name?: string; parent_run?: RunTree; parent_run_id?: string; child_runs?: RunTree[]; start_time?: number; end_time?: number; extra?: KVMap; metadata?: KVMap; tags?: string[]; error?: string; serialized?: object; inputs?: KVMap; outputs?: KVMap; reference_example_id?: string; client?: Client; tracingEnabled?: boolean; on_end?: (runTree: RunTree) => void; execution_order?: number; child_execution_order?: number; trace_id?: string; dotted_order?: string; attachments?: Attachments; } export interface RunnableConfigLike { /** * Tags for this call and any sub-calls (eg. a Chain calling an LLM). * You can use these to filter calls. */ tags?: string[]; /** * Metadata for this call and any sub-calls (eg. a Chain calling an LLM). * Keys should be strings, values should be JSON-serializable. */ metadata?: Record<string, unknown>; /** * Callbacks for this call and any sub-calls (eg. a Chain calling an LLM). * Tags are passed to all callbacks, metadata is passed to handle*Start callbacks. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any callbacks?: any; } interface CallbackManagerLike { handlers: TracerLike[]; getParentRunId?: () => string | undefined; copy?: () => CallbackManagerLike; } interface TracerLike { name: string; } interface LangChainTracerLike extends TracerLike { name: "langchain_tracer"; projectName: string; getRun?: (id: string) => RunTree | undefined; client: Client; updateFromRunTree?: (runTree: RunTree) => void; } interface HeadersLike { get(name: string): string | null; set(name: string, value: string): void; } /** * Baggage header information */ class Baggage { metadata: KVMap | undefined; tags: string[] | undefined; constructor(metadata: KVMap | undefined, tags: string[] | undefined) { this.metadata = metadata; this.tags = tags; } static fromHeader(value: string) { const items = value.split(","); let metadata: KVMap = {}; let tags: string[] = []; for (const item of items) { const [key, uriValue] = item.split("="); const value = decodeURIComponent(uriValue); if (key === "langsmith-metadata") { metadata = JSON.parse(value); } else if (key === "langsmith-tags") { tags = value.split(","); } } return new Baggage(metadata, tags); } toHeader(): string { const items = []; if (this.metadata && Object.keys(this.metadata).length > 0) { items.push( `langsmith-metadata=${encodeURIComponent( JSON.stringify(this.metadata) )}` ); } if (this.tags && this.tags.length > 0) { items.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`); } return items.join(","); } } export class RunTree implements BaseRun { private static sharedClient: Client | null = null; id: string; name: RunTreeConfig["name"]; run_type: string; project_name: string; parent_run?: RunTree; child_runs: RunTree[]; start_time: number; end_time?: number; extra: KVMap; tags?: string[]; error?: string; serialized: object; inputs: KVMap; outputs?: KVMap; reference_example_id?: string; client: Client; events?: KVMap[] | undefined; trace_id: string; dotted_order: string; tracingEnabled?: boolean; execution_order: number; child_execution_order: number; /** * Attachments associated with the run. * Each entry is a tuple of [mime_type, bytes] */ attachments?: Attachments; constructor(originalConfig: RunTreeConfig | RunTree) { // If you pass in a run tree directly, return a shallow clone if (isRunTree(originalConfig)) { Object.assign(this, { ...originalConfig }); return; } const defaultConfig = RunTree.getDefaultConfig(); const { metadata, ...config } = originalConfig; const client = config.client ?? RunTree.getSharedClient(); const dedupedMetadata = { ...metadata, ...config?.extra?.metadata, }; config.extra = { ...config.extra, metadata: dedupedMetadata }; Object.assign(this, { ...defaultConfig, ...config, client }); if (!this.trace_id) { if (this.parent_run) { this.trace_id = this.parent_run.trace_id ?? this.id; } else { this.trace_id = this.id; } } this.execution_order ??= 1; this.child_execution_order ??= 1; if (!this.dotted_order) { const currentDottedOrder = convertToDottedOrderFormat( this.start_time, this.id, this.execution_order ); if (this.parent_run) { this.dotted_order = this.parent_run.dotted_order + "." + currentDottedOrder; } else { this.dotted_order = currentDottedOrder; } } } private static getDefaultConfig(): object { return { id: uuid.v4(), run_type: "chain", project_name: getEnvironmentVariable("LANGCHAIN_PROJECT") ?? getEnvironmentVariable("LANGCHAIN_SESSION") ?? // TODO: Deprecate "default", child_runs: [], api_url: getEnvironmentVariable("LANGCHAIN_ENDPOINT") ?? "http://localhost:1984", api_key: getEnvironmentVariable("LANGCHAIN_API_KEY"), caller_options: {}, start_time: Date.now(), serialized: {}, inputs: {}, extra: {}, }; } private static getSharedClient(): Client { if (!RunTree.sharedClient) { RunTree.sharedClient = new Client(); } return RunTree.sharedClient; } public createChild(config: RunTreeConfig): RunTree { const child_execution_order = this.child_execution_order + 1; const child = new RunTree({ ...config, parent_run: this, project_name: this.project_name, client: this.client, tracingEnabled: this.tracingEnabled, execution_order: child_execution_order, child_execution_order: child_execution_order, }); // Copy context vars over into the new run tree. if (_LC_CONTEXT_VARIABLES_KEY in this) { // eslint-disable-next-line @typescript-eslint/no-explicit-any (child as any)[_LC_CONTEXT_VARIABLES_KEY] = this[_LC_CONTEXT_VARIABLES_KEY]; } type ExtraWithSymbol = Record<string | symbol, unknown>; const LC_CHILD = Symbol.for("lc:child_config"); const presentConfig = (config.extra as ExtraWithSymbol | undefined)?.[LC_CHILD] ?? (this.extra as ExtraWithSymbol)[LC_CHILD]; // tracing for LangChain is defined by the _parentRunId and runMap of the tracer if (isRunnableConfigLike(presentConfig)) { const newConfig: RunnableConfigLike = { ...presentConfig }; const callbacks: CallbackManagerLike | unknown[] | undefined = isCallbackManagerLike(newConfig.callbacks) ? newConfig.callbacks.copy?.() : undefined; if (callbacks) { // update the parent run id Object.assign(callbacks, { _parentRunId: child.id }); // only populate if we're in a newer LC.JS version callbacks.handlers ?.find(isLangChainTracerLike) ?.updateFromRunTree?.(child); newConfig.callbacks = callbacks; } (child.extra as ExtraWithSymbol)[LC_CHILD] = newConfig; } // propagate child_execution_order upwards const visited = new Set<string>(); let current: RunTree | undefined = this as RunTree; while (current != null && !visited.has(current.id)) { visited.add(current.id); current.child_execution_order = Math.max( current.child_execution_order, child_execution_order ); current = current.parent_run; } this.child_runs.push(child); return child; } async end( outputs?: KVMap, error?: string, endTime = Date.now(), metadata?: KVMap ): Promise<void> { this.outputs = this.outputs ?? outputs; this.error = this.error ?? error; this.end_time = this.end_time ?? endTime; if (metadata && Object.keys(metadata).length > 0) { this.extra = this.extra ? { ...this.extra, metadata: { ...this.extra.metadata, ...metadata } } : { metadata }; } } private _convertToCreate( run: RunTree, runtimeEnv: RuntimeEnvironment | undefined, excludeChildRuns = true ): RunCreate { const runExtra = run.extra ?? {}; if (!runExtra.runtime) { runExtra.runtime = {}; } if (runtimeEnv) { for (const [k, v] of Object.entries(runtimeEnv)) { if (!runExtra.runtime[k]) { runExtra.runtime[k] = v; } } } let child_runs: RunCreate[]; let parent_run_id: string | undefined; if (!excludeChildRuns) { child_runs = run.child_runs.map((child_run) => this._convertToCreate(child_run, runtimeEnv, excludeChildRuns) ); parent_run_id = undefined; } else { parent_run_id = run.parent_run?.id; child_runs = []; } const persistedRun: RunCreate = { id: run.id, name: run.name, start_time: run.start_time, end_time: run.end_time, run_type: run.run_type, reference_example_id: run.reference_example_id, extra: runExtra, serialized: run.serialized, error: run.error, inputs: run.inputs, outputs: run.outputs, session_name: run.project_name, child_runs: child_runs, parent_run_id: parent_run_id, trace_id: run.trace_id, dotted_order: run.dotted_order, tags: run.tags, attachments: run.attachments, }; return persistedRun; } async postRun(excludeChildRuns = true): Promise<void> { try { const runtimeEnv = getRuntimeEnvironment(); const runCreate = await this._convertToCreate(this, runtimeEnv, true); await this.client.createRun(runCreate); if (!excludeChildRuns) { warnOnce( "Posting with excludeChildRuns=false is deprecated and will be removed in a future version." ); for (const childRun of this.child_runs) { await childRun.postRun(false); } } } catch (error) { console.error(`Error in postRun for run ${this.id}:`, error); } } async patchRun(): Promise<void> { try { const runUpdate: RunUpdate = { end_time: this.end_time, error: this.error, inputs: this.inputs, outputs: this.outputs, parent_run_id: this.parent_run?.id, reference_example_id: this.reference_example_id, extra: this.extra, events: this.events, dotted_order: this.dotted_order, trace_id: this.trace_id, tags: this.tags, attachments: this.attachments, }; await this.client.updateRun(this.id, runUpdate); } catch (error) { console.error(`Error in patchRun for run ${this.id}`, error); } } toJSON() { return this._convertToCreate(this, undefined, false); } static fromRunnableConfig( parentConfig: RunnableConfigLike, props: RunTreeConfig ): RunTree { // We only handle the callback manager case for now const callbackManager = parentConfig?.callbacks as | CallbackManagerLike | undefined; let parentRun: RunTree | undefined; let projectName: string | undefined; let client: Client | undefined; let tracingEnabled = isTracingEnabled(); if (callbackManager) { const parentRunId = callbackManager?.getParentRunId?.() ?? ""; const langChainTracer = callbackManager?.handlers?.find( (handler: TracerLike) => handler?.name == "langchain_tracer" ) as LangChainTracerLike | undefined; parentRun = langChainTracer?.getRun?.(parentRunId); projectName = langChainTracer?.projectName; client = langChainTracer?.client; tracingEnabled = tracingEnabled || !!langChainTracer; } if (!parentRun) { return new RunTree({ ...props, client, tracingEnabled, project_name: projectName, }); } const parentRunTree = new RunTree({ name: parentRun.name, id: parentRun.id, trace_id: parentRun.trace_id, dotted_order: parentRun.dotted_order, client, tracingEnabled, project_name: projectName, tags: [ ...new Set((parentRun?.tags ?? []).concat(parentConfig?.tags ?? [])), ], extra: { metadata: { ...parentRun?.extra?.metadata, ...parentConfig?.metadata, }, }, }); return parentRunTree.createChild(props); } static fromDottedOrder(dottedOrder: string): RunTree | undefined { return this.fromHeaders({ "langsmith-trace": dottedOrder }); } static fromHeaders( headers: Record<string, string | string[]> | HeadersLike, inheritArgs?: RunTreeConfig ): RunTree | undefined { const rawHeaders: Record<string, string | string[] | null> = "get" in headers && typeof headers.get === "function" ? { "langsmith-trace": headers.get("langsmith-trace"), baggage: headers.get("baggage"), } : (headers as Record<string, string | string[]>); const headerTrace = rawHeaders["langsmith-trace"]; if (!headerTrace || typeof headerTrace !== "string") return undefined; const parentDottedOrder = headerTrace.trim(); const parsedDottedOrder = parentDottedOrder.split(".").map((part) => { const [strTime, uuid] = part.split("Z"); return { strTime, time: Date.parse(strTime + "Z"), uuid }; }); const traceId = parsedDottedOrder[0].uuid; const config: RunTreeConfig = { ...inheritArgs, name: inheritArgs?.["name"] ?? "parent", run_type: inheritArgs?.["run_type"] ?? "chain", start_time: inheritArgs?.["start_time"] ?? Date.now(), id: parsedDottedOrder.at(-1)?.uuid, trace_id: traceId, dotted_order: parentDottedOrder, }; if (rawHeaders["baggage"] && typeof rawHeaders["baggage"] === "string") { const baggage = Baggage.fromHeader(rawHeaders["baggage"]); config.metadata = baggage.metadata; config.tags = baggage.tags; } return new RunTree(config); } toHeaders(headers?: HeadersLike) { const result = { "langsmith-trace": this.dotted_order, baggage: new Baggage(this.extra?.metadata, this.tags).toHeader(), }; if (headers) { for (const [key, value] of Object.entries(result)) { headers.set(key, value); } } return result; } } export function isRunTree(x?: unknown): x is RunTree { return ( x !== undefined && typeof (x as RunTree).createChild === "function" && typeof (x as RunTree).postRun === "function" ); } function isLangChainTracerLike(x: unknown): x is LangChainTracerLike { return ( typeof x === "object" && x != null && typeof (x as LangChainTracerLike).name === "string" && (x as LangChainTracerLike).name === "langchain_tracer" ); } function containsLangChainTracerLike(x: unknown): x is LangChainTracerLike[] { return ( Array.isArray(x) && x.some((callback) => isLangChainTracerLike(callback)) ); } function isCallbackManagerLike(x: unknown): x is CallbackManagerLike { return ( typeof x === "object" && x != null && Array.isArray((x as CallbackManagerLike).handlers) ); } export function isRunnableConfigLike(x?: unknown): x is RunnableConfigLike { // Check that it's an object with a callbacks arg // that has either a CallbackManagerLike object with a langchain tracer within it // or an array with a LangChainTracerLike object within it return ( x !== undefined && typeof (x as RunnableConfigLike).callbacks === "object" && // Callback manager with a langchain tracer (containsLangChainTracerLike( (x as RunnableConfigLike).callbacks?.handlers ) || // Or it's an array with a LangChainTracerLike object within it containsLangChainTracerLike((x as RunnableConfigLike).callbacks)) ); }
0
lc_public_repos/langsmith-sdk/js
lc_public_repos/langsmith-sdk/js/src/client.ts
import * as uuid from "uuid"; import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js"; import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, ListCommitsResponse, ListPromptsResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, ExampleSearch, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, } from "./schemas.js"; import { convertLangChainMessageToExample, isLangChainMessage, } from "./utils/messages.js"; import { getEnvironmentVariable, getLangChainEnvVarsMetadata, getLangSmithEnvironmentVariable, getRuntimeEnvironment, } from "./utils/env.js"; import { EvaluationResult, EvaluationResults, RunEvaluator, } from "./evaluation/evaluator.js"; import { __version__ } from "./index.js"; import { assertUuid } from "./utils/_uuid.js"; import { warnOnce } from "./utils/warn.js"; import { isVersionGreaterOrEqual, parsePromptIdentifier, } from "./utils/prompts.js"; import { raiseForStatus } from "./utils/error.js"; import { _getFetchImplementation } from "./singletons/fetch.js"; import { stringify as stringifyForTracing } from "./utils/fast-safe-stringify/index.js"; export interface ClientConfig { apiUrl?: string; apiKey?: string; callerOptions?: AsyncCallerParams; timeout_ms?: number; webUrl?: string; anonymizer?: (values: KVMap) => KVMap; hideInputs?: boolean | ((inputs: KVMap) => KVMap); hideOutputs?: boolean | ((outputs: KVMap) => KVMap); autoBatchTracing?: boolean; batchSizeBytesLimit?: number; blockOnRootRunFinalization?: boolean; traceBatchConcurrency?: number; fetchOptions?: RequestInit; } /** * Represents the parameters for listing runs (spans) from the Langsmith server. */ interface ListRunsParams { /** * The ID or IDs of the project(s) to filter by. */ projectId?: string | string[]; /** * The name or names of the project(s) to filter by. */ projectName?: string | string[]; /** * The ID of the trace to filter by. */ traceId?: string; /** * isRoot - Whether to only include root runs. * */ isRoot?: boolean; /** * The execution order to filter by. */ executionOrder?: number; /** * The ID of the parent run to filter by. */ parentRunId?: string; /** * The ID of the reference example to filter by. */ referenceExampleId?: string; /** * The start time to filter by. */ startTime?: Date; /** * The run type to filter by. */ runType?: string; /** * Indicates whether to filter by error runs. */ error?: boolean; /** * The ID or IDs of the runs to filter by. */ id?: string[]; /** * The maximum number of runs to retrieve. */ limit?: number; /** * The query string to filter by. */ query?: string; /** * The filter string to apply. * * Run Filtering: * Listing runs with query params is useful for simple queries, but doesn't support many common needs, such as filtering by metadata, tags, or other fields. * LangSmith supports a filter query language to permit more complex filtering operations when fetching runs. This guide will provide a high level overview of the grammar as well as a few examples of when it can be useful. * If you'd prefer a more visual guide, you can get a taste of the language by viewing the table of runs on any of your projects' pages. We provide some recommended filters to get you started that you can copy and use the SDK. * * Grammar: * The filtering grammar is based on common comparators on fields in the run object. Supported comparators include: * - gte (greater than or equal to) * - gt (greater than) * - lte (less than or equal to) * - lt (less than) * - eq (equal to) * - neq (not equal to) * - has (check if run contains a tag or metadata json blob) * - search (search for a substring in a string field) */ filter?: string; /** * Filter to apply to the ROOT run in the trace tree. This is meant to be used in conjunction with the regular * `filter` parameter to let you filter runs by attributes of the root run within a trace. Example is filtering by * feedback assigned to the trace. */ traceFilter?: string; /** * Filter to apply to OTHER runs in the trace tree, including sibling and child runs. This is meant to be used in * conjunction with the regular `filter` parameter to let you filter runs by attributes of any run within a trace. */ treeFilter?: string; /** * The values to include in the response. */ select?: string[]; } interface UploadCSVParams { csvFile: Blob; fileName: string; inputKeys: string[]; outputKeys: string[]; description?: string; dataType?: DataType; name?: string; } interface feedback_source { type: string; metadata?: KVMap; } interface FeedbackCreate { id: string; run_id: string | null; key: string; score?: ScoreType; value?: ValueType; correction?: object | null; comment?: string | null; feedback_source?: feedback_source | KVMap | null; feedbackConfig?: FeedbackConfig; session_id?: string; comparative_experiment_id?: string; } interface FeedbackUpdate { score?: ScoreType; value?: ValueType; correction?: object | null; comment?: string | null; } interface CreateRunParams { name: string; inputs: KVMap; run_type: string; id?: string; start_time?: number; end_time?: number; extra?: KVMap; error?: string; serialized?: object; outputs?: KVMap; reference_example_id?: string; child_runs?: RunCreate[]; parent_run_id?: string; project_name?: string; revision_id?: string; trace_id?: string; dotted_order?: string; attachments?: Attachments; } interface UpdateRunParams extends RunUpdate { id?: string; } interface ProjectOptions { projectName?: string; projectId?: string; } // eslint-disable-next-line @typescript-eslint/no-explicit-any type RecordStringAny = Record<string, any>; export type FeedbackSourceType = "model" | "api" | "app"; export type CreateExampleOptions = { /** The ID of the dataset to create the example in. */ datasetId?: string; /** The name of the dataset to create the example in (if dataset ID is not provided). */ datasetName?: string; /** The creation date of the example. */ createdAt?: Date; /** A unique identifier for the example. */ exampleId?: string; /** Additional metadata associated with the example. */ metadata?: KVMap; /** The split(s) to assign the example to. */ split?: string | string[]; /** The ID of the source run associated with this example. */ sourceRunId?: string; }; type AutoBatchQueueItem = { action: "create" | "update"; item: RunCreate | RunUpdate; }; type MultipartPart = { name: string; payload: Blob; }; export function mergeRuntimeEnvIntoRunCreate(run: RunCreate) { const runtimeEnv = getRuntimeEnvironment(); const envVars = getLangChainEnvVarsMetadata(); const extra = run.extra ?? {}; const metadata = extra.metadata; run.extra = { ...extra, runtime: { ...runtimeEnv, ...extra?.runtime, }, metadata: { ...envVars, ...(envVars.revision_id || run.revision_id ? { revision_id: run.revision_id ?? envVars.revision_id } : {}), ...metadata, }, }; return run; } const getTracingSamplingRate = () => { const samplingRateStr = getLangSmithEnvironmentVariable( "TRACING_SAMPLING_RATE" ); if (samplingRateStr === undefined) { return undefined; } const samplingRate = parseFloat(samplingRateStr); if (samplingRate < 0 || samplingRate > 1) { throw new Error( `LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${samplingRate}` ); } return samplingRate; }; // utility functions const isLocalhost = (url: string): boolean => { const strippedUrl = url.replace("http://", "").replace("https://", ""); const hostname = strippedUrl.split("/")[0].split(":")[0]; return ( hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" ); }; async function toArray<T>(iterable: AsyncIterable<T>): Promise<T[]> { const result: T[] = []; for await (const item of iterable) { result.push(item); } return result; } function trimQuotes(str?: string): string | undefined { if (str === undefined) { return undefined; } return str .trim() .replace(/^"(.*)"$/, "$1") .replace(/^'(.*)'$/, "$1"); } const handle429 = async (response?: Response) => { if (response?.status === 429) { const retryAfter = parseInt(response.headers.get("retry-after") ?? "30", 10) * 1000; if (retryAfter > 0) { await new Promise((resolve) => setTimeout(resolve, retryAfter)); // Return directly after calling this check return true; } } // Fall back to existing status checks return false; }; export class AutoBatchQueue { items: { action: "create" | "update"; payload: RunCreate | RunUpdate; itemPromiseResolve: () => void; itemPromise: Promise<void>; size: number; }[] = []; sizeBytes = 0; peek() { return this.items[0]; } push(item: AutoBatchQueueItem): Promise<void> { let itemPromiseResolve; const itemPromise = new Promise<void>((resolve) => { // Setting itemPromiseResolve is synchronous with promise creation: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise itemPromiseResolve = resolve; }); const size = stringifyForTracing(item.item).length; this.items.push({ action: item.action, payload: item.item, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion itemPromiseResolve: itemPromiseResolve!, itemPromise, size, }); this.sizeBytes += size; return itemPromise; } pop(upToSizeBytes: number): [AutoBatchQueueItem[], () => void] { if (upToSizeBytes < 1) { throw new Error("Number of bytes to pop off may not be less than 1."); } const popped: typeof this.items = []; let poppedSizeBytes = 0; // Pop items until we reach or exceed the size limit while ( poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes && this.items.length > 0 ) { const item = this.items.shift(); if (item) { popped.push(item); poppedSizeBytes += item.size; this.sizeBytes -= item.size; } } // If there is an item on the queue we were unable to pop, // just return it as a single batch. if (popped.length === 0 && this.items.length > 0) { const item = this.items.shift()!; popped.push(item); poppedSizeBytes += item.size; this.sizeBytes -= item.size; } return [ popped.map((it) => ({ action: it.action, item: it.payload })), () => popped.forEach((it) => it.itemPromiseResolve()), ]; } } // 20 MB export const DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520; const SERVER_INFO_REQUEST_TIMEOUT = 2500; export class Client implements LangSmithTracingClientInterface { private apiKey?: string; private apiUrl: string; private webUrl?: string; private caller: AsyncCaller; private batchIngestCaller: AsyncCaller; private timeout_ms: number; private _tenantId: string | null = null; private hideInputs?: boolean | ((inputs: KVMap) => KVMap); private hideOutputs?: boolean | ((outputs: KVMap) => KVMap); private tracingSampleRate?: number; private filteredPostUuids = new Set(); private autoBatchTracing = true; private autoBatchQueue = new AutoBatchQueue(); private autoBatchTimeout: ReturnType<typeof setTimeout> | undefined; private autoBatchAggregationDelayMs = 250; private batchSizeBytesLimit?: number; private fetchOptions: RequestInit; private settings: Promise<LangSmithSettings> | null; private blockOnRootRunFinalization = getEnvironmentVariable("LANGSMITH_TRACING_BACKGROUND") === "false"; private traceBatchConcurrency = 5; private _serverInfo: RecordStringAny | undefined; // eslint-disable-next-line @typescript-eslint/no-explicit-any private _getServerInfoPromise?: Promise<Record<string, any>>; constructor(config: ClientConfig = {}) { const defaultConfig = Client.getDefaultClientConfig(); this.tracingSampleRate = getTracingSamplingRate(); this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? ""; if (this.apiUrl.endsWith("/")) { this.apiUrl = this.apiUrl.slice(0, -1); } this.apiKey = trimQuotes(config.apiKey ?? defaultConfig.apiKey); this.webUrl = trimQuotes(config.webUrl ?? defaultConfig.webUrl); if (this.webUrl?.endsWith("/")) { this.webUrl = this.webUrl.slice(0, -1); } this.timeout_ms = config.timeout_ms ?? 90_000; this.caller = new AsyncCaller(config.callerOptions ?? {}); this.traceBatchConcurrency = config.traceBatchConcurrency ?? this.traceBatchConcurrency; if (this.traceBatchConcurrency < 1) { throw new Error("Trace batch concurrency must be positive."); } this.batchIngestCaller = new AsyncCaller({ maxRetries: 2, maxConcurrency: this.traceBatchConcurrency, ...(config.callerOptions ?? {}), onFailedResponseHook: handle429, }); this.hideInputs = config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs; this.hideOutputs = config.hideOutputs ?? config.anonymizer ?? defaultConfig.hideOutputs; this.autoBatchTracing = config.autoBatchTracing ?? this.autoBatchTracing; this.blockOnRootRunFinalization = config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization; this.batchSizeBytesLimit = config.batchSizeBytesLimit; this.fetchOptions = config.fetchOptions || {}; } public static getDefaultClientConfig(): { apiUrl: string; apiKey?: string; webUrl?: string; hideInputs?: boolean; hideOutputs?: boolean; } { const apiKey = getLangSmithEnvironmentVariable("API_KEY"); const apiUrl = getLangSmithEnvironmentVariable("ENDPOINT") ?? "https://api.smith.langchain.com"; const hideInputs = getLangSmithEnvironmentVariable("HIDE_INPUTS") === "true"; const hideOutputs = getLangSmithEnvironmentVariable("HIDE_OUTPUTS") === "true"; return { apiUrl: apiUrl, apiKey: apiKey, webUrl: undefined, hideInputs: hideInputs, hideOutputs: hideOutputs, }; } public getHostUrl(): string { if (this.webUrl) { return this.webUrl; } else if (isLocalhost(this.apiUrl)) { this.webUrl = "http://localhost:3000"; return this.webUrl; } else if ( this.apiUrl.includes("/api") && !this.apiUrl.split(".", 1)[0].endsWith("api") ) { this.webUrl = this.apiUrl.replace("/api", ""); return this.webUrl; } else if (this.apiUrl.split(".", 1)[0].includes("dev")) { this.webUrl = "https://dev.smith.langchain.com"; return this.webUrl; } else if (this.apiUrl.split(".", 1)[0].includes("eu")) { this.webUrl = "https://eu.smith.langchain.com"; return this.webUrl; } else { this.webUrl = "https://smith.langchain.com"; return this.webUrl; } } private get headers(): { [header: string]: string } { const headers: { [header: string]: string } = { "User-Agent": `langsmith-js/${__version__}`, }; if (this.apiKey) { headers["x-api-key"] = `${this.apiKey}`; } return headers; } private processInputs(inputs: KVMap): KVMap { if (this.hideInputs === false) { return inputs; } if (this.hideInputs === true) { return {}; } if (typeof this.hideInputs === "function") { return this.hideInputs(inputs); } return inputs; } private processOutputs(outputs: KVMap): KVMap { if (this.hideOutputs === false) { return outputs; } if (this.hideOutputs === true) { return {}; } if (typeof this.hideOutputs === "function") { return this.hideOutputs(outputs); } return outputs; } private prepareRunCreateOrUpdateInputs(run: RunUpdate): RunUpdate; private prepareRunCreateOrUpdateInputs(run: RunCreate): RunCreate; private prepareRunCreateOrUpdateInputs( run: RunCreate | RunUpdate ): RunCreate | RunUpdate { const runParams = { ...run }; if (runParams.inputs !== undefined) { runParams.inputs = this.processInputs(runParams.inputs); } if (runParams.outputs !== undefined) { runParams.outputs = this.processOutputs(runParams.outputs); } return runParams; } private async _getResponse( path: string, queryParams?: URLSearchParams ): Promise<Response> { const paramsString = queryParams?.toString() ?? ""; const url = `${this.apiUrl}${path}?${paramsString}`; const response = await this.caller.call(_getFetchImplementation(), url, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, }); await raiseForStatus(response, `Failed to fetch ${path}`); return response; } private async _get<T>( path: string, queryParams?: URLSearchParams ): Promise<T> { const response = await this._getResponse(path, queryParams); return response.json() as T; } private async *_getPaginated<T, TResponse = unknown>( path: string, queryParams: URLSearchParams = new URLSearchParams(), transform?: (data: TResponse) => T[] ): AsyncIterable<T[]> { let offset = Number(queryParams.get("offset")) || 0; const limit = Number(queryParams.get("limit")) || 100; while (true) { queryParams.set("offset", String(offset)); queryParams.set("limit", String(limit)); const url = `${this.apiUrl}${path}?${queryParams}`; const response = await this.caller.call(_getFetchImplementation(), url, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, }); await raiseForStatus(response, `Failed to fetch ${path}`); const items: T[] = transform ? transform(await response.json()) : await response.json(); if (items.length === 0) { break; } yield items; if (items.length < limit) { break; } offset += items.length; } } private async *_getCursorPaginatedList<T>( path: string, body: RecordStringAny | null = null, requestMethod = "POST", dataKey = "runs" ): AsyncIterable<T[]> { const bodyParams = body ? { ...body } : {}; while (true) { const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}${path}`, { method: requestMethod, headers: { ...this.headers, "Content-Type": "application/json" }, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, body: JSON.stringify(bodyParams), } ); const responseBody = await response.json(); if (!responseBody) { break; } if (!responseBody[dataKey]) { break; } yield responseBody[dataKey]; const cursors = responseBody.cursors; if (!cursors) { break; } if (!cursors.next) { break; } bodyParams.cursor = cursors.next; } } private _filterForSampling( runs: CreateRunParams[] | UpdateRunParams[], patch = false ) { if (this.tracingSampleRate === undefined) { return runs; } if (patch) { const sampled = []; for (const run of runs) { if (!this.filteredPostUuids.has(run.id)) { sampled.push(run); } else { this.filteredPostUuids.delete(run.id); } } return sampled; } else { const sampled = []; for (const run of runs) { if ( (run.id !== run.trace_id && !this.filteredPostUuids.has(run.trace_id)) || Math.random() < this.tracingSampleRate ) { sampled.push(run); } else { this.filteredPostUuids.add(run.id); } } return sampled; } } private async _getBatchSizeLimitBytes(): Promise<number> { const serverInfo = await this._ensureServerInfo(); return ( this.batchSizeBytesLimit ?? serverInfo.batch_ingest_config?.size_limit_bytes ?? DEFAULT_BATCH_SIZE_LIMIT_BYTES ); } private drainAutoBatchQueue(batchSizeLimit: number) { while (this.autoBatchQueue.items.length > 0) { const [batch, done] = this.autoBatchQueue.pop(batchSizeLimit); if (!batch.length) { done(); break; } void this._processBatch(batch, done).catch(console.error); } } private async _processBatch(batch: AutoBatchQueueItem[], done: () => void) { if (!batch.length) { done(); return; } try { const ingestParams = { runCreates: batch .filter((item) => item.action === "create") .map((item) => item.item) as RunCreate[], runUpdates: batch .filter((item) => item.action === "update") .map((item) => item.item) as RunUpdate[], }; const serverInfo = await this._ensureServerInfo(); if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) { await this.multipartIngestRuns(ingestParams); } else { await this.batchIngestRuns(ingestParams); } } finally { done(); } } private async processRunOperation(item: AutoBatchQueueItem) { clearTimeout(this.autoBatchTimeout); this.autoBatchTimeout = undefined; if (item.action === "create") { item.item = mergeRuntimeEnvIntoRunCreate(item.item as RunCreate); } const itemPromise = this.autoBatchQueue.push(item); const sizeLimitBytes = await this._getBatchSizeLimitBytes(); if (this.autoBatchQueue.sizeBytes > sizeLimitBytes) { this.drainAutoBatchQueue(sizeLimitBytes); } if (this.autoBatchQueue.items.length > 0) { this.autoBatchTimeout = setTimeout(() => { this.autoBatchTimeout = undefined; this.drainAutoBatchQueue(sizeLimitBytes); }, this.autoBatchAggregationDelayMs); } return itemPromise; } protected async _getServerInfo() { const response = await _getFetchImplementation()(`${this.apiUrl}/info`, { method: "GET", headers: { Accept: "application/json" }, signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT), ...this.fetchOptions, }); await raiseForStatus(response, "get server info"); return response.json(); } protected async _ensureServerInfo() { if (this._getServerInfoPromise === undefined) { this._getServerInfoPromise = (async () => { if (this._serverInfo === undefined) { try { this._serverInfo = await this._getServerInfo(); } catch (e) { console.warn( `[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.` ); } } return this._serverInfo ?? {}; })(); } return this._getServerInfoPromise.then((serverInfo) => { if (this._serverInfo === undefined) { this._getServerInfoPromise = undefined; } return serverInfo; }); } protected async _getSettings() { if (!this.settings) { this.settings = this._get("/settings"); } return await this.settings; } public async createRun(run: CreateRunParams): Promise<void> { if (!this._filterForSampling([run]).length) { return; } const headers = { ...this.headers, "Content-Type": "application/json" }; const session_name = run.project_name; delete run.project_name; const runCreate: RunCreate = this.prepareRunCreateOrUpdateInputs({ session_name, ...run, start_time: run.start_time ?? Date.now(), }); if ( this.autoBatchTracing && runCreate.trace_id !== undefined && runCreate.dotted_order !== undefined ) { void this.processRunOperation({ action: "create", item: runCreate, }).catch(console.error); return; } const mergedRunCreateParam = mergeRuntimeEnvIntoRunCreate(runCreate); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs`, { method: "POST", headers, body: stringifyForTracing(mergedRunCreateParam), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create run", true); } /** * Batch ingest/upsert multiple runs in the Langsmith system. * @param runs */ public async batchIngestRuns({ runCreates, runUpdates, }: { runCreates?: RunCreate[]; runUpdates?: RunUpdate[]; }) { if (runCreates === undefined && runUpdates === undefined) { return; } let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create) ) ?? []; let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update) ) ?? []; if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) { const createById = preparedCreateParams.reduce( (params: Record<string, RunCreate>, run) => { if (!run.id) { return params; } params[run.id] = run; return params; }, {} ); const standaloneUpdates = []; for (const updateParam of preparedUpdateParams) { if (updateParam.id !== undefined && createById[updateParam.id]) { createById[updateParam.id] = { ...createById[updateParam.id], ...updateParam, }; } else { standaloneUpdates.push(updateParam); } } preparedCreateParams = Object.values(createById); preparedUpdateParams = standaloneUpdates; } const rawBatch = { post: this._filterForSampling(preparedCreateParams), patch: this._filterForSampling(preparedUpdateParams, true), }; if (!rawBatch.post.length && !rawBatch.patch.length) { return; } const batchChunks = { post: [] as (typeof rawBatch)["post"], patch: [] as (typeof rawBatch)["patch"], }; for (const k of ["post", "patch"]) { const key = k as keyof typeof rawBatch; const batchItems = rawBatch[key].reverse(); let batchItem = batchItems.pop(); while (batchItem !== undefined) { batchChunks[key].push(batchItem); batchItem = batchItems.pop(); } } if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) { await this._postBatchIngestRuns(stringifyForTracing(batchChunks)); } } private async _postBatchIngestRuns(body: string) { const headers = { ...this.headers, "Content-Type": "application/json", Accept: "application/json", }; const response = await this.batchIngestCaller.call( _getFetchImplementation(), `${this.apiUrl}/runs/batch`, { method: "POST", headers, body: body, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "batch create run", true); } /** * Batch ingest/upsert multiple runs in the Langsmith system. * @param runs */ public async multipartIngestRuns({ runCreates, runUpdates, }: { runCreates?: RunCreate[]; runUpdates?: RunUpdate[]; }) { if (runCreates === undefined && runUpdates === undefined) { return; } // transform and convert to dicts const allAttachments: Record<string, Attachments> = {}; let preparedCreateParams = []; for (const create of runCreates ?? []) { const preparedCreate = this.prepareRunCreateOrUpdateInputs(create); if ( preparedCreate.id !== undefined && preparedCreate.attachments !== undefined ) { allAttachments[preparedCreate.id] = preparedCreate.attachments; } delete preparedCreate.attachments; preparedCreateParams.push(preparedCreate); } let preparedUpdateParams = []; for (const update of runUpdates ?? []) { preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update)); } // require trace_id and dotted_order const invalidRunCreate = preparedCreateParams.find((runCreate) => { return ( runCreate.trace_id === undefined || runCreate.dotted_order === undefined ); }); if (invalidRunCreate !== undefined) { throw new Error( `Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run` ); } const invalidRunUpdate = preparedUpdateParams.find((runUpdate) => { return ( runUpdate.trace_id === undefined || runUpdate.dotted_order === undefined ); }); if (invalidRunUpdate !== undefined) { throw new Error( `Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run` ); } // combine post and patch dicts where possible if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) { const createById = preparedCreateParams.reduce( (params: Record<string, RunCreate>, run) => { if (!run.id) { return params; } params[run.id] = run; return params; }, {} ); const standaloneUpdates = []; for (const updateParam of preparedUpdateParams) { if (updateParam.id !== undefined && createById[updateParam.id]) { createById[updateParam.id] = { ...createById[updateParam.id], ...updateParam, }; } else { standaloneUpdates.push(updateParam); } } preparedCreateParams = Object.values(createById); preparedUpdateParams = standaloneUpdates; } if ( preparedCreateParams.length === 0 && preparedUpdateParams.length === 0 ) { return; } // send the runs in multipart requests const accumulatedContext: string[] = []; const accumulatedParts: MultipartPart[] = []; for (const [method, payloads] of [ ["post", preparedCreateParams] as const, ["patch", preparedUpdateParams] as const, ]) { for (const originalPayload of payloads) { // collect fields to be sent as separate parts const { inputs, outputs, events, attachments, ...payload } = originalPayload; const fields = { inputs, outputs, events }; // encode the main run payload const stringifiedPayload = stringifyForTracing(payload); accumulatedParts.push({ name: `${method}.${payload.id}`, payload: new Blob([stringifiedPayload], { type: `application/json; length=${stringifiedPayload.length}`, // encoding=gzip }), }); // encode the fields we collected for (const [key, value] of Object.entries(fields)) { if (value === undefined) { continue; } const stringifiedValue = stringifyForTracing(value); accumulatedParts.push({ name: `${method}.${payload.id}.${key}`, payload: new Blob([stringifiedValue], { type: `application/json; length=${stringifiedValue.length}`, }), }); } // encode the attachments if (payload.id !== undefined) { const attachments = allAttachments[payload.id]; if (attachments) { delete allAttachments[payload.id]; for (const [name, [contentType, content]] of Object.entries( attachments )) { // Validate that the attachment name doesn't contain a '.' if (name.includes(".")) { console.warn( `Skipping attachment '${name}' for run ${payload.id}: Invalid attachment name. ` + `Attachment names must not contain periods ('.'). Please rename the attachment and try again.` ); continue; } accumulatedParts.push({ name: `attachment.${payload.id}.${name}`, payload: new Blob([content], { type: `${contentType}; length=${content.byteLength}`, }), }); } } } // compute context accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`); } } await this._sendMultipartRequest( accumulatedParts, accumulatedContext.join("; ") ); } private async _sendMultipartRequest(parts: MultipartPart[], context: string) { try { // Create multipart form data manually using Blobs const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2); const chunks: Blob[] = []; for (const part of parts) { // Add field boundary chunks.push(new Blob([`--${boundary}\r\n`])); chunks.push( new Blob([ `Content-Disposition: form-data; name="${part.name}"\r\n`, `Content-Type: ${part.payload.type}\r\n\r\n`, ]) ); chunks.push(part.payload); chunks.push(new Blob(["\r\n"])); } // Add final boundary chunks.push(new Blob([`--${boundary}--\r\n`])); // Combine all chunks into a single Blob const body = new Blob(chunks); // Convert Blob to ArrayBuffer for compatibility const arrayBuffer = await body.arrayBuffer(); const res = await this.batchIngestCaller.call( _getFetchImplementation(), `${this.apiUrl}/runs/multipart`, { method: "POST", headers: { ...this.headers, "Content-Type": `multipart/form-data; boundary=${boundary}`, }, body: arrayBuffer, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(res, "ingest multipart runs", true); // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { console.warn(`${e.message.trim()}\n\nContext: ${context}`); } } public async updateRun(runId: string, run: RunUpdate): Promise<void> { assertUuid(runId); if (run.inputs) { run.inputs = this.processInputs(run.inputs); } if (run.outputs) { run.outputs = this.processOutputs(run.outputs); } // TODO: Untangle types const data: UpdateRunParams = { ...run, id: runId }; if (!this._filterForSampling([data], true).length) { return; } if ( this.autoBatchTracing && data.trace_id !== undefined && data.dotted_order !== undefined ) { if ( run.end_time !== undefined && data.parent_run_id === undefined && this.blockOnRootRunFinalization ) { // Trigger batches as soon as a root trace ends and wait to ensure trace finishes // in serverless environments. await this.processRunOperation({ action: "update", item: data }).catch( console.error ); return; } else { void this.processRunOperation({ action: "update", item: data }).catch( console.error ); } return; } const headers = { ...this.headers, "Content-Type": "application/json" }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs/${runId}`, { method: "PATCH", headers, body: stringifyForTracing(run), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update run", true); } public async readRun( runId: string, { loadChildRuns }: { loadChildRuns: boolean } = { loadChildRuns: false } ): Promise<Run> { assertUuid(runId); let run = await this._get<Run>(`/runs/${runId}`); if (loadChildRuns && run.child_run_ids) { run = await this._loadChildRuns(run); } return run; } public async getRunUrl({ runId, run, projectOpts, }: { runId?: string; run?: Run; projectOpts?: ProjectOptions; }): Promise<string> { if (run !== undefined) { let sessionId: string; if (run.session_id) { sessionId = run.session_id; } else if (projectOpts?.projectName) { sessionId = ( await this.readProject({ projectName: projectOpts?.projectName }) ).id; } else if (projectOpts?.projectId) { sessionId = projectOpts?.projectId; } else { const project = await this.readProject({ projectName: getLangSmithEnvironmentVariable("PROJECT") || "default", }); sessionId = project.id; } const tenantId = await this._getTenantId(); return `${this.getHostUrl()}/o/${tenantId}/projects/p/${sessionId}/r/${ run.id }?poll=true`; } else if (runId !== undefined) { const run_ = await this.readRun(runId); if (!run_.app_path) { throw new Error(`Run ${runId} has no app_path`); } const baseUrl = this.getHostUrl(); return `${baseUrl}${run_.app_path}`; } else { throw new Error("Must provide either runId or run"); } } private async _loadChildRuns(run: Run): Promise<Run> { const childRuns = await toArray(this.listRuns({ id: run.child_run_ids })); const treemap: { [key: string]: Run[] } = {}; const runs: { [key: string]: Run } = {}; // TODO: make dotted order required when the migration finishes childRuns.sort((a, b) => (a?.dotted_order ?? "").localeCompare(b?.dotted_order ?? "") ); for (const childRun of childRuns) { if ( childRun.parent_run_id === null || childRun.parent_run_id === undefined ) { throw new Error(`Child run ${childRun.id} has no parent`); } if (!(childRun.parent_run_id in treemap)) { treemap[childRun.parent_run_id] = []; } treemap[childRun.parent_run_id].push(childRun); runs[childRun.id] = childRun; } run.child_runs = treemap[run.id] || []; for (const runId in treemap) { if (runId !== run.id) { runs[runId].child_runs = treemap[runId]; } } return run; } /** * List runs from the LangSmith server. * @param projectId - The ID of the project to filter by. * @param projectName - The name of the project to filter by. * @param parentRunId - The ID of the parent run to filter by. * @param traceId - The ID of the trace to filter by. * @param referenceExampleId - The ID of the reference example to filter by. * @param startTime - The start time to filter by. * @param isRoot - Indicates whether to only return root runs. * @param runType - The run type to filter by. * @param error - Indicates whether to filter by error runs. * @param id - The ID of the run to filter by. * @param query - The query string to filter by. * @param filter - The filter string to apply to the run spans. * @param traceFilter - The filter string to apply on the root run of the trace. * @param limit - The maximum number of runs to retrieve. * @returns {AsyncIterable<Run>} - The runs. * * @example * // List all runs in a project * const projectRuns = client.listRuns({ projectName: "<your_project>" }); * * @example * // List LLM and Chat runs in the last 24 hours * const todaysLLMRuns = client.listRuns({ * projectName: "<your_project>", * start_time: new Date(Date.now() - 24 * 60 * 60 * 1000), * run_type: "llm", * }); * * @example * // List traces in a project * const rootRuns = client.listRuns({ * projectName: "<your_project>", * execution_order: 1, * }); * * @example * // List runs without errors * const correctRuns = client.listRuns({ * projectName: "<your_project>", * error: false, * }); * * @example * // List runs by run ID * const runIds = [ * "a36092d2-4ad5-4fb4-9c0d-0dba9a2ed836", * "9398e6be-964f-4aa4-8ae9-ad78cd4b7074", * ]; * const selectedRuns = client.listRuns({ run_ids: runIds }); * * @example * // List all "chain" type runs that took more than 10 seconds and had `total_tokens` greater than 5000 * const chainRuns = client.listRuns({ * projectName: "<your_project>", * filter: 'and(eq(run_type, "chain"), gt(latency, 10), gt(total_tokens, 5000))', * }); * * @example * // List all runs called "extractor" whose root of the trace was assigned feedback "user_score" score of 1 * const goodExtractorRuns = client.listRuns({ * projectName: "<your_project>", * filter: 'eq(name, "extractor")', * traceFilter: 'and(eq(feedback_key, "user_score"), eq(feedback_score, 1))', * }); * * @example * // List all runs that started after a specific timestamp and either have "error" not equal to null or a "Correctness" feedback score equal to 0 * const complexRuns = client.listRuns({ * projectName: "<your_project>", * filter: 'and(gt(start_time, "2023-07-15T12:34:56Z"), or(neq(error, null), and(eq(feedback_key, "Correctness"), eq(feedback_score, 0.0))))', * }); * * @example * // List all runs where `tags` include "experimental" or "beta" and `latency` is greater than 2 seconds * const taggedRuns = client.listRuns({ * projectName: "<your_project>", * filter: 'and(or(has(tags, "experimental"), has(tags, "beta")), gt(latency, 2))', * }); */ public async *listRuns(props: ListRunsParams): AsyncIterable<Run> { const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props; let projectIds: string[] = []; if (projectId) { projectIds = Array.isArray(projectId) ? projectId : [projectId]; } if (projectName) { const projectNames = Array.isArray(projectName) ? projectName : [projectName]; const projectIds_ = await Promise.all( projectNames.map((name) => this.readProject({ projectName: name }).then((project) => project.id) ) ); projectIds.push(...projectIds_); } const default_select = [ "app_path", "child_run_ids", "completion_cost", "completion_tokens", "dotted_order", "end_time", "error", "events", "extra", "feedback_stats", "first_token_time", "id", "inputs", "name", "outputs", "parent_run_id", "parent_run_ids", "prompt_cost", "prompt_tokens", "reference_example_id", "run_type", "session_id", "start_time", "status", "tags", "total_cost", "total_tokens", "trace_id", ]; const body = { session: projectIds.length ? projectIds : null, run_type: runType, reference_example: referenceExampleId, query, filter, trace_filter: traceFilter, tree_filter: treeFilter, execution_order: executionOrder, parent_run: parentRunId, start_time: startTime ? startTime.toISOString() : null, error, id, limit, trace: traceId, select: select ? select : default_select, is_root: isRoot, }; let runsYielded = 0; for await (const runs of this._getCursorPaginatedList<Run>( "/runs/query", body )) { if (limit) { if (runsYielded >= limit) { break; } if (runs.length + runsYielded > limit) { const newRuns = runs.slice(0, limit - runsYielded); yield* newRuns; break; } runsYielded += runs.length; yield* runs; } else { yield* runs; } } } public async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }: { id?: string[]; trace?: string; parentRun?: string; runType?: string; projectNames?: string[]; projectIds?: string[]; referenceExampleIds?: string[]; startTime?: string; endTime?: string; error?: boolean; query?: string; filter?: string; traceFilter?: string; treeFilter?: string; isRoot?: boolean; dataSourceType?: string; }): Promise<any> { let projectIds_ = projectIds || []; if (projectNames) { projectIds_ = [ ...(projectIds || []), ...(await Promise.all( projectNames.map((name) => this.readProject({ projectName: name }).then( (project) => project.id ) ) )), ]; } const payload = { id, trace, parent_run: parentRun, run_type: runType, session: projectIds_, reference_example: referenceExampleIds, start_time: startTime, end_time: endTime, error, query, filter, trace_filter: traceFilter, tree_filter: treeFilter, is_root: isRoot, data_source_type: dataSourceType, }; // Remove undefined values from the payload const filteredPayload = Object.fromEntries( Object.entries(payload).filter(([_, value]) => value !== undefined) ); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs/stats`, { method: "POST", headers: this.headers, body: JSON.stringify(filteredPayload), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const result = await response.json(); return result; } public async shareRun( runId: string, { shareId }: { shareId?: string } = {} ): Promise<string> { const data = { run_id: runId, share_token: shareId || uuid.v4(), }; assertUuid(runId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, { method: "PUT", headers: this.headers, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const result = await response.json(); if (result === null || !("share_token" in result)) { throw new Error("Invalid response from server"); } return `${this.getHostUrl()}/public/${result["share_token"]}/r`; } public async unshareRun(runId: string): Promise<void> { assertUuid(runId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "unshare run", true); } public async readRunSharedLink(runId: string): Promise<string | undefined> { assertUuid(runId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const result = await response.json(); if (result === null || !("share_token" in result)) { return undefined; } return `${this.getHostUrl()}/public/${result["share_token"]}/r`; } public async listSharedRuns( shareToken: string, { runIds, }: { runIds?: string[]; } = {} ): Promise<Run[]> { const queryParams = new URLSearchParams({ share_token: shareToken, }); if (runIds !== undefined) { for (const runId of runIds) { queryParams.append("id", runId); } } assertUuid(shareToken); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/runs${queryParams}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const runs = await response.json(); return runs as Run[]; } public async readDatasetSharedSchema( datasetId?: string, datasetName?: string ): Promise<DatasetShareSchema> { if (!datasetId && !datasetName) { throw new Error("Either datasetId or datasetName must be given"); } if (!datasetId) { const dataset = await this.readDataset({ datasetName }); datasetId = dataset.id; } assertUuid(datasetId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const shareSchema = await response.json(); shareSchema.url = `${this.getHostUrl()}/public/${ shareSchema.share_token }/d`; return shareSchema as DatasetShareSchema; } public async shareDataset( datasetId?: string, datasetName?: string ): Promise<DatasetShareSchema> { if (!datasetId && !datasetName) { throw new Error("Either datasetId or datasetName must be given"); } if (!datasetId) { const dataset = await this.readDataset({ datasetName }); datasetId = dataset.id; } const data = { dataset_id: datasetId, }; assertUuid(datasetId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, { method: "PUT", headers: this.headers, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const shareSchema = await response.json(); shareSchema.url = `${this.getHostUrl()}/public/${ shareSchema.share_token }/d`; return shareSchema as DatasetShareSchema; } public async unshareDataset(datasetId: string): Promise<void> { assertUuid(datasetId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "unshare dataset", true); } public async readSharedDataset(shareToken: string): Promise<Dataset> { assertUuid(shareToken); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/datasets`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const dataset = await response.json(); return dataset as Dataset; } /** * Get shared examples. * * @param {string} shareToken The share token to get examples for. A share token is the UUID (or LangSmith URL, including UUID) generated when explicitly marking an example as public. * @param {Object} [options] Additional options for listing the examples. * @param {string[] | undefined} [options.exampleIds] A list of example IDs to filter by. * @returns {Promise<Example[]>} The shared examples. */ public async listSharedExamples( shareToken: string, options?: { exampleIds?: string[] } ): Promise<Example[]> { const params: Record<string, string | string[]> = {}; if (options?.exampleIds) { params.id = options.exampleIds; } const urlParams = new URLSearchParams(); Object.entries(params).forEach(([key, value]) => { if (Array.isArray(value)) { value.forEach((v) => urlParams.append(key, v)); } else { urlParams.append(key, value); } }); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const result = await response.json(); if (!response.ok) { if ("detail" in result) { throw new Error( `Failed to list shared examples.\nStatus: ${ response.status }\nMessage: ${result.detail.join("\n")}` ); } throw new Error( `Failed to list shared examples: ${response.status} ${response.statusText}` ); } return result.map((example: any) => ({ ...example, _hostUrl: this.getHostUrl(), })); } public async createProject({ projectName, description = null, metadata = null, upsert = false, projectExtra = null, referenceDatasetId = null, }: { projectName: string; description?: string | null; metadata?: RecordStringAny | null; upsert?: boolean; projectExtra?: RecordStringAny | null; referenceDatasetId?: string | null; }): Promise<TracerSession> { const upsert_ = upsert ? `?upsert=true` : ""; const endpoint = `${this.apiUrl}/sessions${upsert_}`; const extra: RecordStringAny = projectExtra || {}; if (metadata) { extra["metadata"] = metadata; } const body: RecordStringAny = { name: projectName, extra, description, }; if (referenceDatasetId !== null) { body["reference_dataset_id"] = referenceDatasetId; } const response = await this.caller.call( _getFetchImplementation(), endpoint, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create project"); const result = await response.json(); return result as TracerSession; } public async updateProject( projectId: string, { name = null, description = null, metadata = null, projectExtra = null, endTime = null, }: { name?: string | null; description?: string | null; metadata?: RecordStringAny | null; projectExtra?: RecordStringAny | null; endTime?: string | null; } ): Promise<TracerSession> { const endpoint = `${this.apiUrl}/sessions/${projectId}`; let extra = projectExtra; if (metadata) { extra = { ...(extra || {}), metadata }; } const body: RecordStringAny = { name, extra, description, end_time: endTime ? new Date(endTime).toISOString() : null, }; const response = await this.caller.call( _getFetchImplementation(), endpoint, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update project"); const result = await response.json(); return result as TracerSession; } public async hasProject({ projectId, projectName, }: { projectId?: string; projectName?: string; }): Promise<boolean> { // TODO: Add a head request let path = "/sessions"; const params = new URLSearchParams(); if (projectId !== undefined && projectName !== undefined) { throw new Error("Must provide either projectName or projectId, not both"); } else if (projectId !== undefined) { assertUuid(projectId); path += `/${projectId}`; } else if (projectName !== undefined) { params.append("name", projectName); } else { throw new Error("Must provide projectName or projectId"); } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}${path}?${params}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); // consume the response body to release the connection // https://undici.nodejs.org/#/?id=garbage-collection try { const result = await response.json(); if (!response.ok) { return false; } // If it's OK and we're querying by name, need to check the list is not empty if (Array.isArray(result)) { return result.length > 0; } // projectId querying return true; } catch (e) { return false; } } public async readProject({ projectId, projectName, includeStats, }: { projectId?: string; projectName?: string; includeStats?: boolean; }): Promise<TracerSessionResult> { let path = "/sessions"; const params = new URLSearchParams(); if (projectId !== undefined && projectName !== undefined) { throw new Error("Must provide either projectName or projectId, not both"); } else if (projectId !== undefined) { assertUuid(projectId); path += `/${projectId}`; } else if (projectName !== undefined) { params.append("name", projectName); } else { throw new Error("Must provide projectName or projectId"); } if (includeStats !== undefined) { params.append("include_stats", includeStats.toString()); } const response = await this._get<TracerSession | TracerSession[]>( path, params ); let result: TracerSession; if (Array.isArray(response)) { if (response.length === 0) { throw new Error( `Project[id=${projectId}, name=${projectName}] not found` ); } result = response[0] as TracerSessionResult; } else { result = response as TracerSessionResult; } return result; } public async getProjectUrl({ projectId, projectName, }: { projectId?: string; projectName?: string; }) { if (projectId === undefined && projectName === undefined) { throw new Error("Must provide either projectName or projectId"); } const project = await this.readProject({ projectId, projectName }); const tenantId = await this._getTenantId(); return `${this.getHostUrl()}/o/${tenantId}/projects/p/${project.id}`; } public async getDatasetUrl({ datasetId, datasetName, }: { datasetId?: string; datasetName?: string; }) { if (datasetId === undefined && datasetName === undefined) { throw new Error("Must provide either datasetName or datasetId"); } const dataset = await this.readDataset({ datasetId, datasetName }); const tenantId = await this._getTenantId(); return `${this.getHostUrl()}/o/${tenantId}/datasets/${dataset.id}`; } private async _getTenantId(): Promise<string> { if (this._tenantId !== null) { return this._tenantId; } const queryParams = new URLSearchParams({ limit: "1" }); for await (const projects of this._getPaginated<TracerSession>( "/sessions", queryParams )) { this._tenantId = projects[0].tenant_id; return projects[0].tenant_id; } throw new Error("No projects found to resolve tenant."); } public async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, }: { projectIds?: string[]; name?: string; nameContains?: string; referenceDatasetId?: string; referenceDatasetName?: string; referenceFree?: boolean; metadata?: RecordStringAny; } = {}): AsyncIterable<TracerSession> { const params = new URLSearchParams(); if (projectIds !== undefined) { for (const projectId of projectIds) { params.append("id", projectId); } } if (name !== undefined) { params.append("name", name); } if (nameContains !== undefined) { params.append("name_contains", nameContains); } if (referenceDatasetId !== undefined) { params.append("reference_dataset", referenceDatasetId); } else if (referenceDatasetName !== undefined) { const dataset = await this.readDataset({ datasetName: referenceDatasetName, }); params.append("reference_dataset", dataset.id); } if (referenceFree !== undefined) { params.append("reference_free", referenceFree.toString()); } if (metadata !== undefined) { params.append("metadata", JSON.stringify(metadata)); } for await (const projects of this._getPaginated<TracerSession>( "/sessions", params )) { yield* projects; } } public async deleteProject({ projectId, projectName, }: { projectId?: string; projectName?: string; }): Promise<void> { let projectId_: string | undefined; if (projectId === undefined && projectName === undefined) { throw new Error("Must provide projectName or projectId"); } else if (projectId !== undefined && projectName !== undefined) { throw new Error("Must provide either projectName or projectId, not both"); } else if (projectId === undefined) { projectId_ = (await this.readProject({ projectName })).id; } else { projectId_ = projectId; } assertUuid(projectId_); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/sessions/${projectId_}`, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus( response, `delete session ${projectId_} (${projectName})`, true ); } public async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }: UploadCSVParams): Promise<Dataset> { const url = `${this.apiUrl}/datasets/upload`; const formData = new FormData(); formData.append("file", csvFile, fileName); inputKeys.forEach((key) => { formData.append("input_keys", key); }); outputKeys.forEach((key) => { formData.append("output_keys", key); }); if (description) { formData.append("description", description); } if (dataType) { formData.append("data_type", dataType); } if (name) { formData.append("name", name); } const response = await this.caller.call(_getFetchImplementation(), url, { method: "POST", headers: this.headers, body: formData, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, }); await raiseForStatus(response, "upload CSV"); const result = await response.json(); return result as Dataset; } public async createDataset( name: string, { description, dataType, inputsSchema, outputsSchema, metadata, }: { description?: string; dataType?: DataType; inputsSchema?: KVMap; outputsSchema?: KVMap; metadata?: RecordStringAny; } = {} ): Promise<Dataset> { const body: KVMap = { name, description, extra: metadata ? { metadata } : undefined, }; if (dataType) { body.data_type = dataType; } if (inputsSchema) { body.inputs_schema_definition = inputsSchema; } if (outputsSchema) { body.outputs_schema_definition = outputsSchema; } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create dataset"); const result = await response.json(); return result as Dataset; } public async readDataset({ datasetId, datasetName, }: { datasetId?: string; datasetName?: string; }): Promise<Dataset> { let path = "/datasets"; // limit to 1 result const params = new URLSearchParams({ limit: "1" }); if (datasetId !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId !== undefined) { assertUuid(datasetId); path += `/${datasetId}`; } else if (datasetName !== undefined) { params.append("name", datasetName); } else { throw new Error("Must provide datasetName or datasetId"); } const response = await this._get<Dataset | Dataset[]>(path, params); let result: Dataset; if (Array.isArray(response)) { if (response.length === 0) { throw new Error( `Dataset[id=${datasetId}, name=${datasetName}] not found` ); } result = response[0] as Dataset; } else { result = response as Dataset; } return result; } public async hasDataset({ datasetId, datasetName, }: { datasetId?: string; datasetName?: string; }): Promise<boolean> { try { await this.readDataset({ datasetId, datasetName }); return true; } catch (e) { if ( // eslint-disable-next-line no-instanceof/no-instanceof e instanceof Error && e.message.toLocaleLowerCase().includes("not found") ) { return false; } throw e; } } public async diffDatasetVersions({ datasetId, datasetName, fromVersion, toVersion, }: { datasetId?: string; datasetName?: string; fromVersion: string | Date; toVersion: string | Date; }): Promise<DatasetDiffInfo> { let datasetId_ = datasetId; if (datasetId_ === undefined && datasetName === undefined) { throw new Error("Must provide either datasetName or datasetId"); } else if (datasetId_ !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId_ === undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } const urlParams = new URLSearchParams({ from_version: typeof fromVersion === "string" ? fromVersion : fromVersion.toISOString(), to_version: typeof toVersion === "string" ? toVersion : toVersion.toISOString(), }); const response = await this._get<DatasetDiffInfo>( `/datasets/${datasetId_}/versions/diff`, urlParams ); return response as DatasetDiffInfo; } public async readDatasetOpenaiFinetuning({ datasetId, datasetName, }: { datasetId?: string; datasetName?: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any }): Promise<any[]> { const path = "/datasets"; if (datasetId !== undefined) { // do nothing } else if (datasetName !== undefined) { datasetId = (await this.readDataset({ datasetName })).id; } else { throw new Error("Must provide datasetName or datasetId"); } const response = await this._getResponse(`${path}/${datasetId}/openai_ft`); const datasetText = await response.text(); const dataset = datasetText .trim() .split("\n") .map((line: string) => JSON.parse(line)); return dataset; } public async *listDatasets({ limit = 100, offset = 0, datasetIds, datasetName, datasetNameContains, metadata, }: { limit?: number; offset?: number; datasetIds?: string[]; datasetName?: string; datasetNameContains?: string; metadata?: RecordStringAny; } = {}): AsyncIterable<Dataset> { const path = "/datasets"; const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString(), }); if (datasetIds !== undefined) { for (const id_ of datasetIds) { params.append("id", id_); } } if (datasetName !== undefined) { params.append("name", datasetName); } if (datasetNameContains !== undefined) { params.append("name_contains", datasetNameContains); } if (metadata !== undefined) { params.append("metadata", JSON.stringify(metadata)); } for await (const datasets of this._getPaginated<Dataset>(path, params)) { yield* datasets; } } /** * Update a dataset * @param props The dataset details to update * @returns The updated dataset */ public async updateDataset(props: { datasetId?: string; datasetName?: string; name?: string; description?: string; }): Promise<Dataset> { const { datasetId, datasetName, ...update } = props; if (!datasetId && !datasetName) { throw new Error("Must provide either datasetName or datasetId"); } const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id; assertUuid(_datasetId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${_datasetId}`, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(update), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update dataset"); return (await response.json()) as Dataset; } public async deleteDataset({ datasetId, datasetName, }: { datasetId?: string; datasetName?: string; }): Promise<void> { let path = "/datasets"; let datasetId_ = datasetId; if (datasetId !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetName !== undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } if (datasetId_ !== undefined) { assertUuid(datasetId_); path += `/${datasetId_}`; } else { throw new Error("Must provide datasetName or datasetId"); } const response = await this.caller.call( _getFetchImplementation(), this.apiUrl + path, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, `delete ${path}`); await response.json(); } public async indexDataset({ datasetId, datasetName, tag, }: { datasetId?: string; datasetName?: string; tag?: string; }): Promise<void> { let datasetId_ = datasetId; if (!datasetId_ && !datasetName) { throw new Error("Must provide either datasetName or datasetId"); } else if (datasetId_ && datasetName) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (!datasetId_) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } assertUuid(datasetId_); const data = { tag: tag, }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId_}/index`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "index dataset"); await response.json(); } /** * Lets you run a similarity search query on a dataset. * * Requires the dataset to be indexed. Please see the `indexDataset` method to set up indexing. * * @param inputs The input on which to run the similarity search. Must have the * same schema as the dataset. * * @param datasetId The dataset to search for similar examples. * * @param limit The maximum number of examples to return. Will return the top `limit` most * similar examples in order of most similar to least similar. If no similar * examples are found, random examples will be returned. * * @param filter A filter string to apply to the search. Only examples will be returned that * match the filter string. Some examples of filters * * - eq(metadata.mykey, "value") * - and(neq(metadata.my.nested.key, "value"), neq(metadata.mykey, "value")) * - or(eq(metadata.mykey, "value"), eq(metadata.mykey, "othervalue")) * * @returns A list of similar examples. * * * @example * dataset_id = "123e4567-e89b-12d3-a456-426614174000" * inputs = {"text": "How many people live in Berlin?"} * limit = 5 * examples = await client.similarExamples(inputs, dataset_id, limit) */ public async similarExamples( inputs: KVMap, datasetId: string, limit: number, { filter, }: { filter?: string; } = {} ): Promise<ExampleSearch[]> { const data: KVMap = { limit: limit, inputs: inputs, }; if (filter !== undefined) { data["filter"] = filter; } assertUuid(datasetId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/search`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "fetch similar examples"); const result = await response.json(); return result["examples"] as ExampleSearch[]; } public async createExample( inputs: KVMap, outputs: KVMap, { datasetId, datasetName, createdAt, exampleId, metadata, split, sourceRunId, }: CreateExampleOptions ): Promise<Example> { let datasetId_ = datasetId; if (datasetId_ === undefined && datasetName === undefined) { throw new Error("Must provide either datasetName or datasetId"); } else if (datasetId_ !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId_ === undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } const createdAt_ = createdAt || new Date(); const data: ExampleCreate = { dataset_id: datasetId_, inputs, outputs, created_at: createdAt_?.toISOString(), id: exampleId, metadata, split, source_run_id: sourceRunId, }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/examples`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create example"); const result = await response.json(); return result as Example; } public async createExamples(props: { inputs: Array<KVMap>; outputs?: Array<KVMap>; metadata?: Array<KVMap>; splits?: Array<string | Array<string>>; sourceRunIds?: Array<string>; exampleIds?: Array<string>; datasetId?: string; datasetName?: string; }): Promise<Example[]> { const { inputs, outputs, metadata, sourceRunIds, exampleIds, datasetId, datasetName, } = props; let datasetId_ = datasetId; if (datasetId_ === undefined && datasetName === undefined) { throw new Error("Must provide either datasetName or datasetId"); } else if (datasetId_ !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId_ === undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } const formattedExamples = inputs.map((input, idx) => { return { dataset_id: datasetId_, inputs: input, outputs: outputs ? outputs[idx] : undefined, metadata: metadata ? metadata[idx] : undefined, split: props.splits ? props.splits[idx] : undefined, id: exampleIds ? exampleIds[idx] : undefined, source_run_id: sourceRunIds ? sourceRunIds[idx] : undefined, }; }); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/examples/bulk`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(formattedExamples), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create examples"); const result = await response.json(); return result as Example[]; } public async createLLMExample( input: string, generation: string | undefined, options: CreateExampleOptions ) { return this.createExample({ input }, { output: generation }, options); } public async createChatExample( input: KVMap[] | LangChainBaseMessage[], generations: KVMap | LangChainBaseMessage | undefined, options: CreateExampleOptions ) { const finalInput = input.map((message) => { if (isLangChainMessage(message)) { return convertLangChainMessageToExample(message); } return message; }); const finalOutput = isLangChainMessage(generations) ? convertLangChainMessageToExample(generations) : generations; return this.createExample( { input: finalInput }, { output: finalOutput }, options ); } public async readExample(exampleId: string): Promise<Example> { assertUuid(exampleId); const path = `/examples/${exampleId}`; return await this._get<Example>(path); } public async *listExamples({ datasetId, datasetName, exampleIds, asOf, splits, inlineS3Urls, metadata, limit, offset, filter, }: { datasetId?: string; datasetName?: string; exampleIds?: string[]; asOf?: string | Date; splits?: string[]; inlineS3Urls?: boolean; metadata?: KVMap; limit?: number; offset?: number; filter?: string; } = {}): AsyncIterable<Example> { let datasetId_; if (datasetId !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId !== undefined) { datasetId_ = datasetId; } else if (datasetName !== undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } else { throw new Error("Must provide a datasetName or datasetId"); } const params = new URLSearchParams({ dataset: datasetId_ }); const dataset_version = asOf ? typeof asOf === "string" ? asOf : asOf?.toISOString() : undefined; if (dataset_version) { params.append("as_of", dataset_version); } const inlineS3Urls_ = inlineS3Urls ?? true; params.append("inline_s3_urls", inlineS3Urls_.toString()); if (exampleIds !== undefined) { for (const id_ of exampleIds) { params.append("id", id_); } } if (splits !== undefined) { for (const split of splits) { params.append("splits", split); } } if (metadata !== undefined) { const serializedMetadata = JSON.stringify(metadata); params.append("metadata", serializedMetadata); } if (limit !== undefined) { params.append("limit", limit.toString()); } if (offset !== undefined) { params.append("offset", offset.toString()); } if (filter !== undefined) { params.append("filter", filter); } let i = 0; for await (const examples of this._getPaginated<Example>( "/examples", params )) { for (const example of examples) { yield example; i++; } if (limit !== undefined && i >= limit) { break; } } } public async deleteExample(exampleId: string): Promise<void> { assertUuid(exampleId); const path = `/examples/${exampleId}`; const response = await this.caller.call( _getFetchImplementation(), this.apiUrl + path, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, `delete ${path}`); await response.json(); } public async updateExample( exampleId: string, update: ExampleUpdate ): Promise<object> { assertUuid(exampleId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/examples/${exampleId}`, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(update), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update example"); const result = await response.json(); return result; } public async updateExamples(update: ExampleUpdateWithId[]): Promise<object> { const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/examples/bulk`, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(update), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update examples"); const result = await response.json(); return result; } public async listDatasetSplits({ datasetId, datasetName, asOf, }: { datasetId?: string; datasetName?: string; asOf?: string | Date; }): Promise<string[]> { let datasetId_: string; if (datasetId === undefined && datasetName === undefined) { throw new Error("Must provide dataset name or ID"); } else if (datasetId !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId === undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } else { datasetId_ = datasetId; } assertUuid(datasetId_); const params = new URLSearchParams(); const dataset_version = asOf ? typeof asOf === "string" ? asOf : asOf?.toISOString() : undefined; if (dataset_version) { params.append("as_of", dataset_version); } const response = await this._get<string[]>( `/datasets/${datasetId_}/splits`, params ); return response; } public async updateDatasetSplits({ datasetId, datasetName, splitName, exampleIds, remove = false, }: { datasetId?: string; datasetName?: string; splitName: string; exampleIds: string[]; remove?: boolean; }): Promise<void> { let datasetId_: string; if (datasetId === undefined && datasetName === undefined) { throw new Error("Must provide dataset name or ID"); } else if (datasetId !== undefined && datasetName !== undefined) { throw new Error("Must provide either datasetName or datasetId, not both"); } else if (datasetId === undefined) { const dataset = await this.readDataset({ datasetName }); datasetId_ = dataset.id; } else { datasetId_ = datasetId; } assertUuid(datasetId_); const data = { split_name: splitName, examples: exampleIds.map((id) => { assertUuid(id); return id; }), remove, }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId_}/splits`, { method: "PUT", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update dataset splits", true); } /** * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead. */ public async evaluateRun( run: Run | string, evaluator: RunEvaluator, { sourceInfo, loadChildRuns, referenceExample, }: { sourceInfo?: KVMap; loadChildRuns: boolean; referenceExample?: Example; } = { loadChildRuns: false } ): Promise<Feedback> { warnOnce( "This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead." ); let run_: Run; if (typeof run === "string") { run_ = await this.readRun(run, { loadChildRuns }); } else if (typeof run === "object" && "id" in run) { run_ = run as Run; } else { throw new Error(`Invalid run type: ${typeof run}`); } if ( run_.reference_example_id !== null && run_.reference_example_id !== undefined ) { referenceExample = await this.readExample(run_.reference_example_id); } const feedbackResult = await evaluator.evaluateRun(run_, referenceExample); const [_, feedbacks] = await this._logEvaluationFeedback( feedbackResult, run_, sourceInfo ); return feedbacks[0]; } public async createFeedback( runId: string | null, key: string, { score, value, correction, comment, sourceInfo, feedbackSourceType = "api", sourceRunId, feedbackId, feedbackConfig, projectId, comparativeExperimentId, }: { score?: ScoreType; value?: ValueType; correction?: object; comment?: string; sourceInfo?: object; feedbackSourceType?: FeedbackSourceType; feedbackConfig?: FeedbackConfig; sourceRunId?: string; feedbackId?: string; eager?: boolean; projectId?: string; comparativeExperimentId?: string; } ): Promise<Feedback> { if (!runId && !projectId) { throw new Error("One of runId or projectId must be provided"); } if (runId && projectId) { throw new Error("Only one of runId or projectId can be provided"); } const feedback_source: feedback_source = { type: feedbackSourceType ?? "api", metadata: sourceInfo ?? {}, }; if ( sourceRunId !== undefined && feedback_source?.metadata !== undefined && !feedback_source.metadata["__run"] ) { feedback_source.metadata["__run"] = { run_id: sourceRunId }; } if ( feedback_source?.metadata !== undefined && feedback_source.metadata["__run"]?.run_id !== undefined ) { assertUuid(feedback_source.metadata["__run"].run_id); } const feedback: FeedbackCreate = { id: feedbackId ?? uuid.v4(), run_id: runId, key, score, value, correction, comment, feedback_source: feedback_source, comparative_experiment_id: comparativeExperimentId, feedbackConfig, session_id: projectId, }; const url = `${this.apiUrl}/feedback`; const response = await this.caller.call(_getFetchImplementation(), url, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(feedback), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, }); await raiseForStatus(response, "create feedback", true); return feedback as Feedback; } public async updateFeedback( feedbackId: string, { score, value, correction, comment, }: { score?: number | boolean | null; value?: number | boolean | string | object | null; correction?: object | null; comment?: string | null; } ): Promise<void> { const feedbackUpdate: FeedbackUpdate = {}; if (score !== undefined && score !== null) { feedbackUpdate["score"] = score; } if (value !== undefined && value !== null) { feedbackUpdate["value"] = value; } if (correction !== undefined && correction !== null) { feedbackUpdate["correction"] = correction; } if (comment !== undefined && comment !== null) { feedbackUpdate["comment"] = comment; } assertUuid(feedbackId); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/feedback/${feedbackId}`, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(feedbackUpdate), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update feedback", true); } public async readFeedback(feedbackId: string): Promise<Feedback> { assertUuid(feedbackId); const path = `/feedback/${feedbackId}`; const response = await this._get<Feedback>(path); return response; } public async deleteFeedback(feedbackId: string): Promise<void> { assertUuid(feedbackId); const path = `/feedback/${feedbackId}`; const response = await this.caller.call( _getFetchImplementation(), this.apiUrl + path, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, `delete ${path}`); await response.json(); } public async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, }: { runIds?: string[]; feedbackKeys?: string[]; feedbackSourceTypes?: FeedbackSourceType[]; } = {}): AsyncIterable<Feedback> { const queryParams = new URLSearchParams(); if (runIds) { queryParams.append("run", runIds.join(",")); } if (feedbackKeys) { for (const key of feedbackKeys) { queryParams.append("key", key); } } if (feedbackSourceTypes) { for (const type of feedbackSourceTypes) { queryParams.append("source", type); } } for await (const feedbacks of this._getPaginated<Feedback>( "/feedback", queryParams )) { yield* feedbacks; } } /** * Creates a presigned feedback token and URL. * * The token can be used to authorize feedback metrics without * needing an API key. This is useful for giving browser-based * applications the ability to submit feedback without needing * to expose an API key. * * @param runId - The ID of the run. * @param feedbackKey - The feedback key. * @param options - Additional options for the token. * @param options.expiration - The expiration time for the token. * * @returns A promise that resolves to a FeedbackIngestToken. */ public async createPresignedFeedbackToken( runId: string, feedbackKey: string, { expiration, feedbackConfig, }: { expiration?: string | TimeDelta; feedbackConfig?: FeedbackConfig; } = {} ): Promise<FeedbackIngestToken> { const body: KVMap = { run_id: runId, feedback_key: feedbackKey, feedback_config: feedbackConfig, }; if (expiration) { if (typeof expiration === "string") { body["expires_at"] = expiration; } else if (expiration?.hours || expiration?.minutes || expiration?.days) { body["expires_in"] = expiration; } } else { body["expires_in"] = { hours: 3, }; } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/feedback/tokens`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const result = await response.json(); return result as FeedbackIngestToken; } public async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }: { name: string; experimentIds: Array<string>; referenceDatasetId?: string; createdAt?: Date; description?: string; metadata?: Record<string, unknown>; id?: string; }): Promise<ComparativeExperiment> { if (experimentIds.length === 0) { throw new Error("At least one experiment is required"); } if (!referenceDatasetId) { referenceDatasetId = ( await this.readProject({ projectId: experimentIds[0], }) ).reference_dataset_id; } if (!referenceDatasetId == null) { throw new Error("A reference dataset is required"); } const body = { id, name, experiment_ids: experimentIds, reference_dataset_id: referenceDatasetId, description, created_at: (createdAt ?? new Date())?.toISOString(), extra: {} as Record<string, unknown>, }; if (metadata) body.extra["metadata"] = metadata; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/datasets/comparative`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(body), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); return await response.json(); } /** * Retrieves a list of presigned feedback tokens for a given run ID. * @param runId The ID of the run. * @returns An async iterable of FeedbackIngestToken objects. */ public async *listPresignedFeedbackTokens( runId: string ): AsyncIterable<FeedbackIngestToken> { assertUuid(runId); const params = new URLSearchParams({ run_id: runId }); for await (const tokens of this._getPaginated<FeedbackIngestToken>( "/feedback/tokens", params )) { yield* tokens; } } _selectEvalResults( results: EvaluationResult | EvaluationResults ): Array<EvaluationResult> { let results_: Array<EvaluationResult>; if ("results" in results) { results_ = results.results; } else { results_ = [results]; } return results_; } async _logEvaluationFeedback( evaluatorResponse: EvaluationResult | EvaluationResults, run?: Run, sourceInfo?: { [key: string]: any } ): Promise<[results: EvaluationResult[], feedbacks: Feedback[]]> { const evalResults: Array<EvaluationResult> = this._selectEvalResults(evaluatorResponse); const feedbacks: Feedback[] = []; for (const res of evalResults) { let sourceInfo_ = sourceInfo || {}; if (res.evaluatorInfo) { sourceInfo_ = { ...res.evaluatorInfo, ...sourceInfo_ }; } let runId_: string | null = null; if (res.targetRunId) { runId_ = res.targetRunId; } else if (run) { runId_ = run.id; } feedbacks.push( await this.createFeedback(runId_, res.key, { score: res.score, value: res.value, comment: res.comment, correction: res.correction, sourceInfo: sourceInfo_, sourceRunId: res.sourceRunId, feedbackConfig: res.feedbackConfig as FeedbackConfig | undefined, feedbackSourceType: "model", }) ); } return [evalResults, feedbacks]; } public async logEvaluationFeedback( evaluatorResponse: EvaluationResult | EvaluationResults, run?: Run, sourceInfo?: { [key: string]: any } ): Promise<EvaluationResult[]> { const [results] = await this._logEvaluationFeedback( evaluatorResponse, run, sourceInfo ); return results; } /** * API for managing annotation queues */ /** * List the annotation queues on the LangSmith API. * @param options - The options for listing annotation queues * @param options.queueIds - The IDs of the queues to filter by * @param options.name - The name of the queue to filter by * @param options.nameContains - The substring that the queue name should contain * @param options.limit - The maximum number of queues to return * @returns An iterator of AnnotationQueue objects */ public async *listAnnotationQueues( options: { queueIds?: string[]; name?: string; nameContains?: string; limit?: number; } = {} ): AsyncIterableIterator<AnnotationQueue> { const { queueIds, name, nameContains, limit } = options; const params = new URLSearchParams(); if (queueIds) { queueIds.forEach((id, i) => { assertUuid(id, `queueIds[${i}]`); params.append("ids", id); }); } if (name) params.append("name", name); if (nameContains) params.append("name_contains", nameContains); params.append( "limit", (limit !== undefined ? Math.min(limit, 100) : 100).toString() ); let count = 0; for await (const queues of this._getPaginated<AnnotationQueue>( "/annotation-queues", params )) { yield* queues; count++; if (limit !== undefined && count >= limit) break; } } /** * Create an annotation queue on the LangSmith API. * @param options - The options for creating an annotation queue * @param options.name - The name of the annotation queue * @param options.description - The description of the annotation queue * @param options.queueId - The ID of the annotation queue * @returns The created AnnotationQueue object */ public async createAnnotationQueue(options: { name: string; description?: string; queueId?: string; }): Promise<AnnotationQueue> { const { name, description, queueId } = options; const body = { name, description, id: queueId || uuid.v4(), }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/annotation-queues`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify( Object.fromEntries( Object.entries(body).filter(([_, v]) => v !== undefined) ) ), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create annotation queue"); const data = await response.json(); return data as AnnotationQueue; } /** * Read an annotation queue with the specified queue ID. * @param queueId - The ID of the annotation queue to read * @returns The AnnotationQueue object */ public async readAnnotationQueue(queueId: string): Promise<AnnotationQueue> { // TODO: Replace when actual endpoint is added const queueIteratorResult = await this.listAnnotationQueues({ queueIds: [queueId], }).next(); if (queueIteratorResult.done) { throw new Error(`Annotation queue with ID ${queueId} not found`); } return queueIteratorResult.value; } /** * Update an annotation queue with the specified queue ID. * @param queueId - The ID of the annotation queue to update * @param options - The options for updating the annotation queue * @param options.name - The new name for the annotation queue * @param options.description - The new description for the annotation queue */ public async updateAnnotationQueue( queueId: string, options: { name: string; description?: string; } ): Promise<void> { const { name, description } = options; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, { method: "PATCH", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify({ name, description }), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update annotation queue"); } /** * Delete an annotation queue with the specified queue ID. * @param queueId - The ID of the annotation queue to delete */ public async deleteAnnotationQueue(queueId: string): Promise<void> { const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, { method: "DELETE", headers: { ...this.headers, Accept: "application/json" }, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "delete annotation queue"); } /** * Add runs to an annotation queue with the specified queue ID. * @param queueId - The ID of the annotation queue * @param runIds - The IDs of the runs to be added to the annotation queue */ public async addRunsToAnnotationQueue( queueId: string, runIds: string[] ): Promise<void> { const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify( runIds.map((id, i) => assertUuid(id, `runIds[${i}]`).toString()) ), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "add runs to annotation queue"); } /** * Get a run from an annotation queue at the specified index. * @param queueId - The ID of the annotation queue * @param index - The index of the run to retrieve * @returns A Promise that resolves to a RunWithAnnotationQueueInfo object * @throws {Error} If the run is not found at the given index or for other API-related errors */ public async getRunFromAnnotationQueue( queueId: string, index: number ): Promise<RunWithAnnotationQueueInfo> { const baseUrl = `/annotation-queues/${assertUuid(queueId, "queueId")}/run`; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}${baseUrl}/${index}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "get run from annotation queue"); return await response.json(); } protected async _currentTenantIsOwner(owner: string): Promise<boolean> { const settings = await this._getSettings(); return owner == "-" || settings.tenant_handle === owner; } protected async _ownerConflictError( action: string, owner: string ): Promise<Error> { const settings = await this._getSettings(); return new Error( `Cannot ${action} for another tenant.\n Current tenant: ${settings.tenant_handle}\n Requested tenant: ${owner}` ); } protected async _getLatestCommitHash( promptOwnerAndName: string ): Promise<string | undefined> { const res = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); const json = await res.json(); if (!res.ok) { const detail = typeof json.detail === "string" ? json.detail : JSON.stringify(json.detail); const error = new Error( `Error ${res.status}: ${res.statusText}\n${detail}` ); // eslint-disable-next-line @typescript-eslint/no-explicit-any (error as any).statusCode = res.status; throw error; } if (json.commits.length === 0) { return undefined; } return json.commits[0].commit_hash; } protected async _likeOrUnlikePrompt( promptIdentifier: string, like: boolean ): Promise<LikePromptResponse> { const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/likes/${owner}/${promptName}`, { method: "POST", body: JSON.stringify({ like: like }), headers: { ...this.headers, "Content-Type": "application/json" }, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, `${like ? "like" : "unlike"} prompt`); return await response.json(); } protected async _getPromptUrl(promptIdentifier: string): Promise<string> { const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier); if (!(await this._currentTenantIsOwner(owner))) { if (commitHash !== "latest") { return `${this.getHostUrl()}/hub/${owner}/${promptName}/${commitHash.substring( 0, 8 )}`; } else { return `${this.getHostUrl()}/hub/${owner}/${promptName}`; } } else { const settings = await this._getSettings(); if (commitHash !== "latest") { return `${this.getHostUrl()}/prompts/${promptName}/${commitHash.substring( 0, 8 )}?organizationId=${settings.id}`; } else { return `${this.getHostUrl()}/prompts/${promptName}?organizationId=${ settings.id }`; } } } public async promptExists(promptIdentifier: string): Promise<boolean> { const prompt = await this.getPrompt(promptIdentifier); return !!prompt; } public async likePrompt( promptIdentifier: string ): Promise<LikePromptResponse> { return this._likeOrUnlikePrompt(promptIdentifier, true); } public async unlikePrompt( promptIdentifier: string ): Promise<LikePromptResponse> { return this._likeOrUnlikePrompt(promptIdentifier, false); } public async *listCommits( promptOwnerAndName: string ): AsyncIterableIterator<PromptCommit> { for await (const commits of this._getPaginated< PromptCommit, ListCommitsResponse >( `/commits/${promptOwnerAndName}/`, new URLSearchParams(), (res) => res.commits )) { yield* commits; } } public async *listPrompts(options?: { isPublic?: boolean; isArchived?: boolean; sortField?: PromptSortField; query?: string; }): AsyncIterableIterator<Prompt> { const params = new URLSearchParams(); params.append("sort_field", options?.sortField ?? "updated_at"); params.append("sort_direction", "desc"); params.append("is_archived", (!!options?.isArchived).toString()); if (options?.isPublic !== undefined) { params.append("is_public", options.isPublic.toString()); } if (options?.query) { params.append("query", options.query); } for await (const prompts of this._getPaginated<Prompt, ListPromptsResponse>( "/repos", params, (res) => res.repos )) { yield* prompts; } } public async getPrompt(promptIdentifier: string): Promise<Prompt | null> { const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier); const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); if (response.status === 404) { return null; } await raiseForStatus(response, "get prompt"); const result = await response.json(); if (result.repo) { return result.repo as Prompt; } else { return null; } } public async createPrompt( promptIdentifier: string, options?: { description?: string; readme?: string; tags?: string[]; isPublic?: boolean; } ): Promise<Prompt> { const settings = await this._getSettings(); if (options?.isPublic && !settings.tenant_handle) { throw new Error( `Cannot create a public prompt without first\n creating a LangChain Hub handle. You can add a handle by creating a public prompt at:\n https://smith.langchain.com/prompts` ); } const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier); if (!(await this._currentTenantIsOwner(owner))) { throw await this._ownerConflictError("create a prompt", owner); } const data = { repo_handle: promptName, ...(options?.description && { description: options.description }), ...(options?.readme && { readme: options.readme }), ...(options?.tags && { tags: options.tags }), is_public: !!options?.isPublic, }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/repos/`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(data), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create prompt"); const { repo } = await response.json(); return repo as Prompt; } public async createCommit( promptIdentifier: string, object: any, options?: { parentCommitHash?: string; } ): Promise<string> { if (!(await this.promptExists(promptIdentifier))) { throw new Error("Prompt does not exist, you must create it first."); } const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier); const resolvedParentCommitHash = options?.parentCommitHash === "latest" || !options?.parentCommitHash ? await this._getLatestCommitHash(`${owner}/${promptName}`) : options?.parentCommitHash; const payload = { manifest: JSON.parse(JSON.stringify(object)), parent_commit: resolvedParentCommitHash, }; const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}`, { method: "POST", headers: { ...this.headers, "Content-Type": "application/json" }, body: JSON.stringify(payload), signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "create commit"); const result = await response.json(); return this._getPromptUrl( `${owner}/${promptName}${ result.commit_hash ? `:${result.commit_hash}` : "" }` ); } public async updatePrompt( promptIdentifier: string, options?: { description?: string; readme?: string; tags?: string[]; isPublic?: boolean; isArchived?: boolean; } ): Promise<Record<string, any>> { if (!(await this.promptExists(promptIdentifier))) { throw new Error("Prompt does not exist, you must create it first."); } const [owner, promptName] = parsePromptIdentifier(promptIdentifier); if (!(await this._currentTenantIsOwner(owner))) { throw await this._ownerConflictError("update a prompt", owner); } const payload: Record<string, any> = {}; if (options?.description !== undefined) payload.description = options.description; if (options?.readme !== undefined) payload.readme = options.readme; if (options?.tags !== undefined) payload.tags = options.tags; if (options?.isPublic !== undefined) payload.is_public = options.isPublic; if (options?.isArchived !== undefined) payload.is_archived = options.isArchived; // Check if payload is empty if (Object.keys(payload).length === 0) { throw new Error("No valid update options provided"); } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, { method: "PATCH", body: JSON.stringify(payload), headers: { ...this.headers, "Content-Type": "application/json", }, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "update prompt"); return response.json(); } public async deletePrompt(promptIdentifier: string): Promise<void> { if (!(await this.promptExists(promptIdentifier))) { throw new Error("Prompt does not exist, you must create it first."); } const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier); if (!(await this._currentTenantIsOwner(owner))) { throw await this._ownerConflictError("delete a prompt", owner); } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, { method: "DELETE", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); return await response.json(); } public async pullPromptCommit( promptIdentifier: string, options?: { includeModel?: boolean; } ): Promise<PromptCommit> { const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier); const serverInfo = await this._getServerInfo(); const useOptimization = isVersionGreaterOrEqual( serverInfo.version, "0.5.23" ); let passedCommitHash = commitHash; if (!useOptimization && commitHash === "latest") { const latestCommitHash = await this._getLatestCommitHash( `${owner}/${promptName}` ); if (!latestCommitHash) { throw new Error("No commits found"); } else { passedCommitHash = latestCommitHash; } } const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}/${passedCommitHash}${ options?.includeModel ? "?include_model=true" : "" }`, { method: "GET", headers: this.headers, signal: AbortSignal.timeout(this.timeout_ms), ...this.fetchOptions, } ); await raiseForStatus(response, "pull prompt commit"); const result = await response.json(); return { owner, repo: promptName, commit_hash: result.commit_hash, manifest: result.manifest, examples: result.examples, }; } /** * This method should not be used directly, use `import { pull } from "langchain/hub"` instead. * Using this method directly returns the JSON string of the prompt rather than a LangChain object. * @private */ public async _pullPrompt( promptIdentifier: string, options?: { includeModel?: boolean; } ): Promise<any> { const promptObject = await this.pullPromptCommit(promptIdentifier, { includeModel: options?.includeModel, }); const prompt = JSON.stringify(promptObject.manifest); return prompt; } public async pushPrompt( promptIdentifier: string, options?: { object?: any; parentCommitHash?: string; isPublic?: boolean; description?: string; readme?: string; tags?: string[]; } ): Promise<string> { // Create or update prompt metadata if (await this.promptExists(promptIdentifier)) { if (options && Object.keys(options).some((key) => key !== "object")) { await this.updatePrompt(promptIdentifier, { description: options?.description, readme: options?.readme, tags: options?.tags, isPublic: options?.isPublic, }); } } else { await this.createPrompt(promptIdentifier, { description: options?.description, readme: options?.readme, tags: options?.tags, isPublic: options?.isPublic, }); } if (!options?.object) { return await this._getPromptUrl(promptIdentifier); } // Create a commit with the new manifest const url = await this.createCommit(promptIdentifier, options?.object, { parentCommitHash: options?.parentCommitHash, }); return url; } /** * Clone a public dataset to your own langsmith tenant. * This operation is idempotent. If you already have a dataset with the given name, * this function will do nothing. * @param {string} tokenOrUrl The token of the public dataset to clone. * @param {Object} [options] Additional options for cloning the dataset. * @param {string} [options.sourceApiUrl] The URL of the langsmith server where the data is hosted. Defaults to the API URL of your current client. * @param {string} [options.datasetName] The name of the dataset to create in your tenant. Defaults to the name of the public dataset. * @returns {Promise<void>} */ async clonePublicDataset( tokenOrUrl: string, options: { sourceApiUrl?: string; datasetName?: string; } = {} ): Promise<void> { const { sourceApiUrl = this.apiUrl, datasetName } = options; const [parsedApiUrl, tokenUuid] = this.parseTokenOrUrl( tokenOrUrl, sourceApiUrl ); const sourceClient = new Client({ apiUrl: parsedApiUrl, // Placeholder API key not needed anymore in most cases, but // some private deployments may have API key-based rate limiting // that would cause this to fail if we provide no value. apiKey: "placeholder", }); const ds = await sourceClient.readSharedDataset(tokenUuid); const finalDatasetName = datasetName || ds.name; try { if (await this.hasDataset({ datasetId: finalDatasetName })) { console.log( `Dataset ${finalDatasetName} already exists in your tenant. Skipping.` ); return; } } catch (_) { // `.hasDataset` will throw an error if the dataset does not exist. // no-op in that case } // Fetch examples first, then create the dataset const examples = await sourceClient.listSharedExamples(tokenUuid); const dataset = await this.createDataset(finalDatasetName, { description: ds.description, dataType: ds.data_type || "kv", inputsSchema: ds.inputs_schema_definition ?? undefined, outputsSchema: ds.outputs_schema_definition ?? undefined, }); try { await this.createExamples({ inputs: examples.map((e) => e.inputs), outputs: examples.flatMap((e) => (e.outputs ? [e.outputs] : [])), datasetId: dataset.id, }); } catch (e) { console.error( `An error occurred while creating dataset ${finalDatasetName}. ` + "You should delete it manually." ); throw e; } } private parseTokenOrUrl( urlOrToken: string, apiUrl: string, numParts = 2, kind = "dataset" ): [string, string] { // Try parsing as UUID try { assertUuid(urlOrToken); // Will throw if it's not a UUID. return [apiUrl, urlOrToken]; } catch (_) { // no-op if it's not a uuid } // Parse as URL try { const parsedUrl = new URL(urlOrToken); const pathParts = parsedUrl.pathname .split("/") .filter((part) => part !== ""); if (pathParts.length >= numParts) { const tokenUuid = pathParts[pathParts.length - numParts]; return [apiUrl, tokenUuid]; } else { throw new Error(`Invalid public ${kind} URL: ${urlOrToken}`); } } catch (error) { throw new Error(`Invalid public ${kind} URL or token: ${urlOrToken}`); } } /** * Awaits all pending trace batches. Useful for environments where * you need to be sure that all tracing requests finish before execution ends, * such as serverless environments. * * @example * ``` * import { Client } from "langsmith"; * * const client = new Client(); * * try { * // Tracing happens here * ... * } finally { * await client.awaitPendingTraceBatches(); * } * ``` * * @returns A promise that resolves once all currently pending traces have sent. */ public awaitPendingTraceBatches() { return Promise.all([ ...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise), this.batchIngestCaller.queue.onIdle(), ]); } } export interface LangSmithTracingClientInterface { createRun: (run: CreateRunParams) => Promise<void>; updateRun: (runId: string, run: RunUpdate) => Promise<void>; }