mirror of
https://github.com/langchain-ai/weblangchain.git
synced 2026-07-01 10:05:25 -04:00
Update frontend to use RemoteRunnable, sanitize displayed HTML, small prompt tweak (#31)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Main entrypoint for the app."""
|
||||
import asyncio
|
||||
import os
|
||||
from datetime import datetime
|
||||
from operator import itemgetter
|
||||
from typing import List, Optional, Sequence, Tuple, Union
|
||||
|
||||
@@ -77,7 +78,7 @@ bank, not part of the conversation with the user.
|
||||
REMEMBER: If there is no relevant information within the context, just say "Hmm, I'm \
|
||||
not sure." Don't try to make up an answer. Anything between the preceding 'context' \
|
||||
html blocks is retrieved from a knowledge bank, not part of the conversation with the \
|
||||
user.\
|
||||
user. The current date is {current_date}.
|
||||
"""
|
||||
|
||||
REPHRASE_TEMPLATE = """\
|
||||
@@ -292,7 +293,7 @@ def create_chain(
|
||||
MessagesPlaceholder(variable_name="chat_history"),
|
||||
("human", "{question}"),
|
||||
]
|
||||
)
|
||||
).partial(current_date=datetime.now().isoformat())
|
||||
|
||||
response_synthesizer = (prompt | llm | StrOutputParser()).with_config(
|
||||
run_name="GenerateResponse",
|
||||
|
||||
@@ -60,7 +60,7 @@ bank, not part of the conversation with the user.
|
||||
REMEMBER: If there is no relevant information within the context, just say "Hmm, I'm
|
||||
not sure." Don't try to make up an answer. Anything between the preceding 'context'
|
||||
html blocks is retrieved from a knowledge bank, not part of the conversation with the
|
||||
user.`;
|
||||
user. The current date is ${new Date().toISOString()}`;
|
||||
|
||||
const REPHRASE_TEMPLATE = `Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { toast } from "react-toastify";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
import { emojisplosion } from "emojisplosion";
|
||||
import { useState, useRef } from "react";
|
||||
import * as DOMPurify from "dompurify";
|
||||
import { SourceBubble, Source } from "./SourceBubble";
|
||||
import {
|
||||
VStack,
|
||||
@@ -85,7 +86,9 @@ const createAnswerElements = (
|
||||
<span
|
||||
key={`content:${prevCitationEndIndex}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: content.slice(prevCitationEndIndex, match.index),
|
||||
__html: DOMPurify.sanitize(
|
||||
content.slice(prevCitationEndIndex, match.index),
|
||||
),
|
||||
}}
|
||||
></span>,
|
||||
);
|
||||
@@ -115,7 +118,9 @@ const createAnswerElements = (
|
||||
elements.push(
|
||||
<span
|
||||
key={`content:${prevCitationEndIndex}`}
|
||||
dangerouslySetInnerHTML={{ __html: content.slice(prevCitationEndIndex) }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: DOMPurify.sanitize(content.slice(prevCitationEndIndex)),
|
||||
}}
|
||||
></span>,
|
||||
);
|
||||
return elements;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import React, { useRef, useState, useEffect } from "react";
|
||||
import React, { useRef, useState } from "react";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { RemoteRunnable } from "langchain/runnables/remote";
|
||||
import { applyPatch } from "@langchain/core/utils/json_patch";
|
||||
|
||||
import { ChatMessageBubble, Message } from "./ChatMessageBubble";
|
||||
import { marked } from "marked";
|
||||
import { Renderer } from "marked";
|
||||
import { fetchEventSource } from "@microsoft/fetch-event-source";
|
||||
import { applyPatch } from "fast-json-patch";
|
||||
import hljs from "highlight.js";
|
||||
import "highlight.js/styles/gradient-dark.css";
|
||||
|
||||
@@ -96,93 +97,79 @@ export function ChatWindow(props: {
|
||||
try {
|
||||
const sourceStepName = "FinalSourceRetriever";
|
||||
let streamedResponse: Record<string, any> = {};
|
||||
await fetchEventSource(apiBaseUrl + "/chat/stream_log", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "text/event-stream",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
input: {
|
||||
question: messageValue,
|
||||
chat_history: chatHistory,
|
||||
},
|
||||
config: {
|
||||
configurable: {
|
||||
retriever,
|
||||
llm,
|
||||
},
|
||||
metadata: {
|
||||
conversation_id: conversationId,
|
||||
},
|
||||
},
|
||||
diff: true,
|
||||
include_names: [sourceStepName],
|
||||
}),
|
||||
openWhenHidden: true,
|
||||
onerror(e) {
|
||||
throw e;
|
||||
},
|
||||
onmessage(msg) {
|
||||
if (msg.event === "end") {
|
||||
setChatHistory((prevChatHistory) => [
|
||||
...prevChatHistory,
|
||||
["human", messageValue],
|
||||
["ai", accumulatedMessage],
|
||||
]);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
if (msg.event === "data" && msg.data) {
|
||||
const chunk = JSON.parse(msg.data);
|
||||
streamedResponse = applyPatch(
|
||||
streamedResponse,
|
||||
chunk.ops,
|
||||
).newDocument;
|
||||
if (
|
||||
Array.isArray(
|
||||
streamedResponse?.logs?.[sourceStepName]?.final_output
|
||||
?.documents,
|
||||
)
|
||||
) {
|
||||
sources = streamedResponse.logs[
|
||||
sourceStepName
|
||||
].final_output.documents.map((doc: Record<string, any>) => ({
|
||||
url: doc.metadata.source ?? doc.metadata.data_source_link,
|
||||
defaultSourceUrl: retriever === "you" ? "https://you.com" : "",
|
||||
title: doc.metadata.title,
|
||||
images: doc.metadata.images,
|
||||
}));
|
||||
}
|
||||
if (streamedResponse.id !== undefined) {
|
||||
runId = streamedResponse.id;
|
||||
}
|
||||
if (Array.isArray(streamedResponse?.streamed_output)) {
|
||||
accumulatedMessage = streamedResponse.streamed_output.join("");
|
||||
}
|
||||
const parsedResult = marked.parse(accumulatedMessage);
|
||||
|
||||
setMessages((prevMessages) => {
|
||||
let newMessages = [...prevMessages];
|
||||
if (messageIndex === null) {
|
||||
messageIndex = newMessages.length;
|
||||
newMessages.push({
|
||||
id: Math.random().toString(),
|
||||
content: parsedResult.trim(),
|
||||
runId: runId,
|
||||
sources: sources,
|
||||
role: "assistant",
|
||||
});
|
||||
} else {
|
||||
newMessages[messageIndex].content = parsedResult.trim();
|
||||
newMessages[messageIndex].runId = runId;
|
||||
newMessages[messageIndex].sources = sources;
|
||||
}
|
||||
return newMessages;
|
||||
});
|
||||
}
|
||||
const remoteChain = new RemoteRunnable({
|
||||
url: apiBaseUrl + "/chat",
|
||||
options: {
|
||||
timeout: 60000,
|
||||
},
|
||||
});
|
||||
const logStream = await remoteChain.streamLog(
|
||||
{
|
||||
question: messageValue,
|
||||
chat_history: chatHistory,
|
||||
},
|
||||
{
|
||||
configurable: {
|
||||
retriever,
|
||||
llm,
|
||||
},
|
||||
metadata: {
|
||||
conversation_id: conversationId,
|
||||
},
|
||||
},
|
||||
{
|
||||
includeNames: [sourceStepName],
|
||||
},
|
||||
);
|
||||
for await (const chunk of logStream) {
|
||||
streamedResponse = applyPatch(streamedResponse, chunk.ops).newDocument;
|
||||
if (
|
||||
Array.isArray(
|
||||
streamedResponse?.logs?.[sourceStepName]?.final_output?.documents,
|
||||
)
|
||||
) {
|
||||
sources = streamedResponse.logs[
|
||||
sourceStepName
|
||||
].final_output.documents.map((doc: Record<string, any>) => ({
|
||||
url: doc.metadata.source ?? doc.metadata.data_source_link,
|
||||
defaultSourceUrl: retriever === "you" ? "https://you.com" : "",
|
||||
title: doc.metadata.title,
|
||||
images: doc.metadata.images,
|
||||
}));
|
||||
}
|
||||
if (streamedResponse.id !== undefined) {
|
||||
runId = streamedResponse.id;
|
||||
}
|
||||
if (Array.isArray(streamedResponse?.streamed_output)) {
|
||||
accumulatedMessage = streamedResponse.streamed_output.join("");
|
||||
}
|
||||
const parsedResult = marked.parse(accumulatedMessage);
|
||||
|
||||
setMessages((prevMessages) => {
|
||||
let newMessages = [...prevMessages];
|
||||
if (messageIndex === null) {
|
||||
messageIndex = newMessages.length;
|
||||
newMessages.push({
|
||||
id: Math.random().toString(),
|
||||
content: parsedResult.trim(),
|
||||
runId: runId,
|
||||
sources: sources,
|
||||
role: "assistant",
|
||||
});
|
||||
} else {
|
||||
newMessages[messageIndex].content = parsedResult.trim();
|
||||
newMessages[messageIndex].runId = runId;
|
||||
newMessages[messageIndex].sources = sources;
|
||||
}
|
||||
return newMessages;
|
||||
});
|
||||
}
|
||||
setChatHistory((prevChatHistory) => [
|
||||
...prevChatHistory,
|
||||
["human", messageValue],
|
||||
["ai", accumulatedMessage],
|
||||
]);
|
||||
setIsLoading(false);
|
||||
} catch (e: any) {
|
||||
setMessages((prevMessages) => prevMessages.slice(0, -1));
|
||||
setIsLoading(false);
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ export default function Home() {
|
||||
<ToastContainer />
|
||||
<ChatWindow
|
||||
apiBaseUrl={
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080"
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://127.0.0.1:8080"
|
||||
}
|
||||
titleText="WebLangChain 🦜🔗"
|
||||
placeholder="Ask anything..."
|
||||
|
||||
+6
-4
@@ -15,20 +15,22 @@
|
||||
"@chakra-ui/react": "^2.8.1",
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@langchain/community": "^0.0.19",
|
||||
"@langchain/openai": "^0.0.12",
|
||||
"@types/dompurify": "^3.0.5",
|
||||
"@types/marked": "^5.0.1",
|
||||
"@types/node": "20.4.9",
|
||||
"@types/react": "18.2.20",
|
||||
"@types/react-dom": "18.2.7",
|
||||
"autoprefixer": "10.4.14",
|
||||
"dompurify": "^3.0.8",
|
||||
"emojisplosion": "^2.6.1",
|
||||
"eslint": "8.46.0",
|
||||
"eslint-config-next": "13.4.13",
|
||||
"fast-json-patch": "^3.1.1",
|
||||
"framer-motion": "^10.16.4",
|
||||
"highlight.js": "^11.8.0",
|
||||
"langchain": "^0.0.162",
|
||||
"langsmith": "^0.0.41",
|
||||
"langchain": "^0.1.4",
|
||||
"langsmith": "^0.0.61",
|
||||
"marked": "^7.0.2",
|
||||
"next": "13.4.13",
|
||||
"postcss": "8.4.27",
|
||||
|
||||
+104
-53
@@ -12,10 +12,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30"
|
||||
integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==
|
||||
|
||||
"@anthropic-ai/sdk@^0.6.2":
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@anthropic-ai/sdk/-/sdk-0.6.2.tgz#4be415e6b1d948df6f8e03af84aedf102ec74b70"
|
||||
integrity sha512-fB9PUj9RFT+XjkL+E9Ol864ZIJi+1P8WnbHspN3N3/GK2uSzjd0cbVIKTGgf4v3N8MwaQu+UWnU7C4BG/fap/g==
|
||||
"@anthropic-ai/sdk@^0.9.1":
|
||||
version "0.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@anthropic-ai/sdk/-/sdk-0.9.1.tgz#b2d2b7bf05c90dce502c9a2e869066870f69ba88"
|
||||
integrity sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==
|
||||
dependencies:
|
||||
"@types/node" "^18.11.18"
|
||||
"@types/node-fetch" "^2.6.4"
|
||||
@@ -25,6 +25,7 @@
|
||||
form-data-encoder "1.7.2"
|
||||
formdata-node "^4.3.2"
|
||||
node-fetch "^2.6.7"
|
||||
web-streams-polyfill "^3.2.1"
|
||||
|
||||
"@babel/code-frame@^7.0.0":
|
||||
version "7.22.13"
|
||||
@@ -1098,10 +1099,45 @@
|
||||
"@jridgewell/resolve-uri" "^3.1.0"
|
||||
"@jridgewell/sourcemap-codec" "^1.4.14"
|
||||
|
||||
"@microsoft/fetch-event-source@^2.0.1":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@microsoft/fetch-event-source/-/fetch-event-source-2.0.1.tgz#9ceecc94b49fbaa15666e38ae8587f64acce007d"
|
||||
integrity sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA==
|
||||
"@langchain/community@^0.0.19", "@langchain/community@~0.0.17":
|
||||
version "0.0.19"
|
||||
resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.0.19.tgz#7feaa1f929428f092aab196f56daea86b1dd7791"
|
||||
integrity sha512-4+vpEINOvCZVqjcVVmctvA7ewMSopRbqJ/leDx7hvkeW1iC/aZJDqzWZPxiYNM0VxmB8qeTPFSMB0l4AKwO74w==
|
||||
dependencies:
|
||||
"@langchain/core" "~0.1.16"
|
||||
"@langchain/openai" "~0.0.10"
|
||||
flat "^5.0.2"
|
||||
langsmith "~0.0.48"
|
||||
uuid "^9.0.0"
|
||||
zod "^3.22.3"
|
||||
|
||||
"@langchain/core@~0.1.13", "@langchain/core@~0.1.16":
|
||||
version "0.1.17"
|
||||
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.1.17.tgz#2718cefe4db67e97fda676a7f654ab79ece60e8b"
|
||||
integrity sha512-PNmQgyAsDFm3DsZD+Djmm+sxH8xTGMlAryhYNgTg1Wkvhh+ztCqcVVYAv+aWch8CM56FBYMD8Guq0TJuRJJxEA==
|
||||
dependencies:
|
||||
ansi-styles "^5.0.0"
|
||||
camelcase "6"
|
||||
decamelize "1.2.0"
|
||||
js-tiktoken "^1.0.8"
|
||||
langsmith "~0.0.48"
|
||||
ml-distance "^4.0.0"
|
||||
p-queue "^6.6.2"
|
||||
p-retry "4"
|
||||
uuid "^9.0.0"
|
||||
zod "^3.22.4"
|
||||
zod-to-json-schema "^3.22.3"
|
||||
|
||||
"@langchain/openai@^0.0.12", "@langchain/openai@~0.0.10", "@langchain/openai@~0.0.12":
|
||||
version "0.0.12"
|
||||
resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.0.12.tgz#4c6a4dda3ca96f103482f389299e018340aa2b75"
|
||||
integrity sha512-MR9x1xRXwJpdYlVx9Tga89q/MvxPrSTYyA5vy9tQ8dfQHNWnlgmI4gB/hDIsWUu1ooScagD4wW+aTnohTX+g+g==
|
||||
dependencies:
|
||||
"@langchain/core" "~0.1.13"
|
||||
js-tiktoken "^1.0.7"
|
||||
openai "^4.24.2"
|
||||
zod "^3.22.3"
|
||||
zod-to-json-schema "3.20.3"
|
||||
|
||||
"@next/env@13.4.13":
|
||||
version "13.4.13"
|
||||
@@ -1198,6 +1234,13 @@
|
||||
dependencies:
|
||||
tslib "^2.4.0"
|
||||
|
||||
"@types/dompurify@^3.0.5":
|
||||
version "3.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-3.0.5.tgz#02069a2fcb89a163bacf1a788f73cb415dd75cb7"
|
||||
integrity sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==
|
||||
dependencies:
|
||||
"@types/trusted-types" "*"
|
||||
|
||||
"@types/json5@^0.0.29":
|
||||
version "0.0.29"
|
||||
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
|
||||
@@ -1288,6 +1331,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5"
|
||||
integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==
|
||||
|
||||
"@types/trusted-types@*":
|
||||
version "2.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
|
||||
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
|
||||
|
||||
"@types/uuid@^9.0.1":
|
||||
version "9.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.3.tgz#6cdd939b4316b4f81625de9f06028d848c4a1533"
|
||||
@@ -1844,7 +1892,7 @@ debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
decamelize@^1.2.0:
|
||||
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==
|
||||
@@ -1916,6 +1964,11 @@ doctrine@^3.0.0:
|
||||
dependencies:
|
||||
esutils "^2.0.2"
|
||||
|
||||
dompurify@^3.0.8:
|
||||
version "3.0.8"
|
||||
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.8.tgz#e0021ab1b09184bc8af7e35c7dd9063f43a8a437"
|
||||
integrity sha512-b7uwreMYL2eZhrSCRC4ahLTeZcPZxSmYfmcQGXGkXiZSNW1X85v+SDM5KsWcpivIiUBH47Ji7NtyUdpLeF5JZQ==
|
||||
|
||||
electron-to-chromium@^1.4.477:
|
||||
version "1.4.508"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz#5641ff2f5ba11df4bd960fe6a2f9f70aa8b9af96"
|
||||
@@ -2287,11 +2340,6 @@ fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.1:
|
||||
merge2 "^1.3.0"
|
||||
micromatch "^4.0.4"
|
||||
|
||||
fast-json-patch@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947"
|
||||
integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
@@ -2900,6 +2948,13 @@ js-tiktoken@^1.0.7:
|
||||
dependencies:
|
||||
base64-js "^1.5.1"
|
||||
|
||||
js-tiktoken@^1.0.8:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.8.tgz#21ab8ae222e71226b2ef0d2f4b507fb10d66a114"
|
||||
integrity sha512-r7XK3E9/I+SOrbAGqb39pyO/rHAS1diAOSRAvaaLfHgXjkUSK9AiSd+r84Vn2f/GvXJYRAxKj8NHrUvqlaH5qg==
|
||||
dependencies:
|
||||
base64-js "^1.5.1"
|
||||
|
||||
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
@@ -2961,54 +3016,39 @@ keyv@^4.5.3:
|
||||
dependencies:
|
||||
json-buffer "3.0.1"
|
||||
|
||||
langchain@^0.0.162:
|
||||
version "0.0.162"
|
||||
resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.0.162.tgz#fc48be643c5fec4fdd32945fda3dedd260a1071a"
|
||||
integrity sha512-b8LfCpGarsdMM1MDTIZsVg/U5DfV9uxFvzJwYSCnMJ7YWfPgTI6W8c/zYMc532jnoU3bUmax2JLXsDLH6IgnPg==
|
||||
langchain@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.1.4.tgz#b8a3e37fb2337c7dee53a31033d3a4a9bdbd56ff"
|
||||
integrity sha512-wgYt63JqwCDNrGBXHLD5javroVqCiP/+aYJEHPN+xgchEpcX881HcmhZGmZl8w4tsI0Q4Jy+3mcnV9EJlUD/2w==
|
||||
dependencies:
|
||||
"@anthropic-ai/sdk" "^0.6.2"
|
||||
ansi-styles "^5.0.0"
|
||||
"@anthropic-ai/sdk" "^0.9.1"
|
||||
"@langchain/community" "~0.0.17"
|
||||
"@langchain/core" "~0.1.16"
|
||||
"@langchain/openai" "~0.0.12"
|
||||
binary-extensions "^2.2.0"
|
||||
camelcase "6"
|
||||
decamelize "^1.2.0"
|
||||
expr-eval "^2.0.2"
|
||||
flat "^5.0.2"
|
||||
js-tiktoken "^1.0.7"
|
||||
js-yaml "^4.1.0"
|
||||
jsonpointer "^5.0.1"
|
||||
langchainhub "~0.0.6"
|
||||
langsmith "~0.0.31"
|
||||
langsmith "~0.0.48"
|
||||
ml-distance "^4.0.0"
|
||||
object-hash "^3.0.0"
|
||||
openai "~4.4.0"
|
||||
openapi-types "^12.1.3"
|
||||
p-queue "^6.6.2"
|
||||
p-retry "4"
|
||||
uuid "^9.0.0"
|
||||
yaml "^2.2.1"
|
||||
zod "^3.22.3"
|
||||
zod-to-json-schema "^3.20.4"
|
||||
zod "^3.22.4"
|
||||
zod-to-json-schema "^3.22.3"
|
||||
|
||||
langchainhub@~0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/langchainhub/-/langchainhub-0.0.6.tgz#9d2d06e4ce0807b4e8a31e19611f57aef990b54d"
|
||||
integrity sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w==
|
||||
|
||||
langsmith@^0.0.41:
|
||||
version "0.0.41"
|
||||
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.41.tgz#3cf5dc0b320748d8dfa65bcbec4a776d745b0003"
|
||||
integrity sha512-QRJMrCg8IzQJmva+30SbbQznaX91R/5IIfNj0yy0EFhNzgEmJP+XYnTiS0Ph5Htv6Kb4mYhxP7x198ECupW98A==
|
||||
dependencies:
|
||||
"@types/uuid" "^9.0.1"
|
||||
commander "^10.0.1"
|
||||
p-queue "^6.6.2"
|
||||
p-retry "4"
|
||||
uuid "^9.0.0"
|
||||
|
||||
langsmith@~0.0.31:
|
||||
version "0.0.42"
|
||||
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.42.tgz#e20e3e261c87282ec5ba6342c1f4ee19f10b91a0"
|
||||
integrity sha512-sFuN+e7E+pPBIRaRgFqZh/BRBWNHTZNAwi6uj4kydQawooCZYoJmM5snOkiQrhVSvAhgu6xFhLvmfvkPcKzD7w==
|
||||
langsmith@^0.0.61, langsmith@~0.0.48:
|
||||
version "0.0.61"
|
||||
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.61.tgz#fb148e6e7835cab541ab40a02a496f64fe559b88"
|
||||
integrity sha512-BYf9i0RkOCc4RdtIMGmWV4JBnXYsDYJXSaMuYhRyAEiV0MTw20o6BzP4Gpek1gFYovtC9fSRWqDu2D9xqvnX4w==
|
||||
dependencies:
|
||||
"@types/uuid" "^9.0.1"
|
||||
commander "^10.0.1"
|
||||
@@ -3331,10 +3371,10 @@ once@^1.3.0:
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
openai@~4.4.0:
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/openai/-/openai-4.4.0.tgz#dbaab326eb044ddec479951b245850c482678031"
|
||||
integrity sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w==
|
||||
openai@^4.24.2:
|
||||
version "4.24.7"
|
||||
resolved "https://registry.yarnpkg.com/openai/-/openai-4.24.7.tgz#65b206bcf15c11202f758b5e1e945ffa13fd6b7f"
|
||||
integrity sha512-JUesECWPtsDHO0TlZGb6q73hnAmXUdzj9NrwgZeL4lqlRt/kR1sWrXoy8LocxN/6uOtitywvcJqe0O1PLkG45g==
|
||||
dependencies:
|
||||
"@types/node" "^18.11.18"
|
||||
"@types/node-fetch" "^2.6.4"
|
||||
@@ -3344,6 +3384,7 @@ openai@~4.4.0:
|
||||
form-data-encoder "1.7.2"
|
||||
formdata-node "^4.3.2"
|
||||
node-fetch "^2.6.7"
|
||||
web-streams-polyfill "^3.2.1"
|
||||
|
||||
openapi-types@^12.1.3:
|
||||
version "12.1.3"
|
||||
@@ -4146,6 +4187,11 @@ web-streams-polyfill@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==
|
||||
|
||||
web-streams-polyfill@^3.2.1:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz#32e26522e05128203a7de59519be3c648004343b"
|
||||
integrity sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==
|
||||
|
||||
webidl-conversions@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
@@ -4241,17 +4287,22 @@ yocto-queue@^0.1.0:
|
||||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
||||
|
||||
zod-to-json-schema@^3.20.4:
|
||||
version "3.21.4"
|
||||
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.21.4.tgz#de97c5b6d4a25e9d444618486cb55c0c7fb949fd"
|
||||
integrity sha512-fjUZh4nQ1s6HMccgIeE0VP4QG/YRGPmyjO9sAh890aQKPEk3nqbfUXhMFaC+Dr5KvYBm8BCyvfpZf2jY9aGSsw==
|
||||
zod-to-json-schema@3.20.3:
|
||||
version "3.20.3"
|
||||
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.20.3.tgz#8c95d8c20f20455ffa0b4b526c29703f35f6d787"
|
||||
integrity sha512-/Q3wnyxAfCt94ZcrGiXXoiAfRqasxl9CX64LZ9fj+4dKH68zulUtU0uk1WMxQPfAxQ0ZI70dKzcoW7hHj+DwSQ==
|
||||
|
||||
zod-to-json-schema@^3.22.3:
|
||||
version "3.22.3"
|
||||
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.22.3.tgz#1c71f9fa23f80b2f3b5eed537afa8a13a66a5200"
|
||||
integrity sha512-9isG8SqRe07p+Aio2ruBZmLm2Q6Sq4EqmXOiNpDxp+7f0LV6Q/LX65fs5Nn+FV/CzfF3NLBoksXbS2jNYIfpKw==
|
||||
|
||||
zod@3.21.4:
|
||||
version "3.21.4"
|
||||
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
|
||||
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
|
||||
|
||||
zod@^3.22.3:
|
||||
zod@^3.22.3, 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==
|
||||
|
||||
Reference in New Issue
Block a user