mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 14:40:22 +09:00
feat: claude function call
This commit is contained in:
parent
a0fc9bd316
commit
ad5d81d76a
@ -1,10 +1,10 @@
|
|||||||
|
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
||||||
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
import { ArxivAPIWrapper } from "@/app/api/langchain-tools/arxiv";
|
import { ArxivAPIWrapper } from "@/app/api/langchain-tools/arxiv";
|
||||||
import { DallEAPIWrapper } from "@/app/api/langchain-tools/dalle_image_generator";
|
import { DallEAPIWrapper } from "@/app/api/langchain-tools/dalle_image_generator";
|
||||||
import { StableDiffusionWrapper } from "@/app/api/langchain-tools/stable_diffusion_image_generator";
|
import { StableDiffusionWrapper } from "@/app/api/langchain-tools/stable_diffusion_image_generator";
|
||||||
import { BaseLanguageModel } from "langchain/dist/base_language";
|
import { Calculator } from "@langchain/community/tools/calculator";
|
||||||
import { Calculator } from "langchain/tools/calculator";
|
|
||||||
import { WebBrowser } from "langchain/tools/webbrowser";
|
import { WebBrowser } from "langchain/tools/webbrowser";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base.js";
|
|
||||||
import { WolframAlphaTool } from "@/app/api/langchain-tools/wolframalpha";
|
import { WolframAlphaTool } from "@/app/api/langchain-tools/wolframalpha";
|
||||||
import { BilibiliVideoInfoTool } from "./bilibili_vid_info";
|
import { BilibiliVideoInfoTool } from "./bilibili_vid_info";
|
||||||
import { BilibiliVideoSearchTool } from "./bilibili_vid_search";
|
import { BilibiliVideoSearchTool } from "./bilibili_vid_search";
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Tool } from "@langchain/core/tools";
|
import { Tool } from "@langchain/core/tools";
|
||||||
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
|
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
|
||||||
import { BaseLanguageModel } from "langchain/dist/base_language";
|
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
||||||
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
import { formatDocumentsAsString } from "langchain/util/document";
|
import { formatDocumentsAsString } from "langchain/util/document";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base.js";
|
|
||||||
import { getServerSideConfig } from "@/app/config/server";
|
import { getServerSideConfig } from "@/app/config/server";
|
||||||
import { SupabaseVectorStore } from "@langchain/community/vectorstores/supabase";
|
import { SupabaseVectorStore } from "@langchain/community/vectorstores/supabase";
|
||||||
import { createClient } from "@supabase/supabase-js";
|
import { createClient } from "@supabase/supabase-js";
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { BaseLanguageModel } from "langchain/dist/base_language";
|
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
||||||
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
import { PDFBrowser } from "@/app/api/langchain-tools/pdf_browser";
|
import { PDFBrowser } from "@/app/api/langchain-tools/pdf_browser";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base.js";
|
|
||||||
import { ArxivAPIWrapper } from "@/app/api/langchain-tools/arxiv";
|
import { ArxivAPIWrapper } from "@/app/api/langchain-tools/arxiv";
|
||||||
import { DallEAPINodeWrapper } from "@/app/api/langchain-tools/dalle_image_generator_node";
|
import { DallEAPINodeWrapper } from "@/app/api/langchain-tools/dalle_image_generator_node";
|
||||||
import { StableDiffusionNodeWrapper } from "@/app/api/langchain-tools/stable_diffusion_image_generator_node";
|
import { StableDiffusionNodeWrapper } from "@/app/api/langchain-tools/stable_diffusion_image_generator_node";
|
||||||
import { Calculator } from "langchain/tools/calculator";
|
import { Calculator } from "@langchain/community/tools/calculator";
|
||||||
import { WebBrowser } from "langchain/tools/webbrowser";
|
import { WebBrowser } from "langchain/tools/webbrowser";
|
||||||
import { WolframAlphaTool } from "@/app/api/langchain-tools/wolframalpha";
|
import { WolframAlphaTool } from "@/app/api/langchain-tools/wolframalpha";
|
||||||
import { BilibiliVideoInfoTool } from "./bilibili_vid_info";
|
import { BilibiliVideoInfoTool } from "./bilibili_vid_info";
|
||||||
|
@ -8,9 +8,9 @@ import {
|
|||||||
} from "langchain/text_splitter";
|
} from "langchain/text_splitter";
|
||||||
|
|
||||||
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
|
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
|
||||||
import { BaseLanguageModel } from "langchain/dist/base_language";
|
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
||||||
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
import { formatDocumentsAsString } from "langchain/util/document";
|
import { formatDocumentsAsString } from "langchain/util/document";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base.js";
|
|
||||||
import { RunnableSequence } from "@langchain/core/runnables";
|
import { RunnableSequence } from "@langchain/core/runnables";
|
||||||
import { StringOutputParser } from "@langchain/core/output_parsers";
|
import { StringOutputParser } from "@langchain/core/output_parsers";
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import S3FileStorage from "@/app/utils/s3_file_storage";
|
|||||||
import { OllamaEmbeddings } from "@langchain/community/embeddings/ollama";
|
import { OllamaEmbeddings } from "@langchain/community/embeddings/ollama";
|
||||||
import { SupabaseVectorStore } from "@langchain/community/vectorstores/supabase";
|
import { SupabaseVectorStore } from "@langchain/community/vectorstores/supabase";
|
||||||
import { createClient } from "@supabase/supabase-js";
|
import { createClient } from "@supabase/supabase-js";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base";
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
|
|
||||||
interface RequestBody {
|
interface RequestBody {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
|
@ -104,6 +104,7 @@ export class AgentApi {
|
|||||||
var controller = this.controller;
|
var controller = this.controller;
|
||||||
return BaseCallbackHandler.fromMethods({
|
return BaseCallbackHandler.fromMethods({
|
||||||
async handleLLMNewToken(token: string) {
|
async handleLLMNewToken(token: string) {
|
||||||
|
console.log(token);
|
||||||
if (token && !controller.signal.aborted) {
|
if (token && !controller.signal.aborted) {
|
||||||
var response = new ResponseBody();
|
var response = new ResponseBody();
|
||||||
response.message = token;
|
response.message = token;
|
||||||
@ -220,13 +221,14 @@ export class AgentApi {
|
|||||||
baseUrl = reqBaseUrl;
|
baseUrl = reqBaseUrl;
|
||||||
if (!baseUrl.endsWith("/v1"))
|
if (!baseUrl.endsWith("/v1"))
|
||||||
baseUrl = baseUrl.endsWith("/") ? `${baseUrl}v1` : `${baseUrl}/v1`;
|
baseUrl = baseUrl.endsWith("/") ? `${baseUrl}v1` : `${baseUrl}/v1`;
|
||||||
console.log("[baseUrl]", baseUrl);
|
console.log("[openai baseUrl]", baseUrl);
|
||||||
return baseUrl;
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
getLLM(reqBody: RequestBody, apiKey: string, baseUrl: string) {
|
getLLM(reqBody: RequestBody, apiKey: string, baseUrl: string) {
|
||||||
const serverConfig = getServerSideConfig();
|
const serverConfig = getServerSideConfig();
|
||||||
if (reqBody.isAzure || serverConfig.isAzure)
|
if (reqBody.isAzure || serverConfig.isAzure) {
|
||||||
|
console.log("[use Azure ChatOpenAI]");
|
||||||
return new ChatOpenAI({
|
return new ChatOpenAI({
|
||||||
temperature: reqBody.temperature,
|
temperature: reqBody.temperature,
|
||||||
streaming: reqBody.stream,
|
streaming: reqBody.stream,
|
||||||
@ -240,7 +242,9 @@ export class AgentApi {
|
|||||||
azureOpenAIApiDeploymentName: reqBody.model,
|
azureOpenAIApiDeploymentName: reqBody.model,
|
||||||
azureOpenAIBasePath: baseUrl,
|
azureOpenAIBasePath: baseUrl,
|
||||||
});
|
});
|
||||||
if (reqBody.provider === ServiceProvider.OpenAI)
|
}
|
||||||
|
if (reqBody.provider === ServiceProvider.OpenAI) {
|
||||||
|
console.log("[use ChatOpenAI]");
|
||||||
return new ChatOpenAI(
|
return new ChatOpenAI(
|
||||||
{
|
{
|
||||||
modelName: reqBody.model,
|
modelName: reqBody.model,
|
||||||
@ -253,7 +257,9 @@ export class AgentApi {
|
|||||||
},
|
},
|
||||||
{ basePath: baseUrl },
|
{ basePath: baseUrl },
|
||||||
);
|
);
|
||||||
if (reqBody.provider === ServiceProvider.Anthropic)
|
}
|
||||||
|
if (reqBody.provider === ServiceProvider.Anthropic) {
|
||||||
|
console.log("[use ChatAnthropic]");
|
||||||
return new ChatAnthropic({
|
return new ChatAnthropic({
|
||||||
model: reqBody.model,
|
model: reqBody.model,
|
||||||
apiKey: apiKey,
|
apiKey: apiKey,
|
||||||
@ -265,6 +271,7 @@ export class AgentApi {
|
|||||||
baseURL: baseUrl,
|
baseURL: baseUrl,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
throw new Error("Unsupported model providers");
|
throw new Error("Unsupported model providers");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,7 +301,10 @@ export class AgentApi {
|
|||||||
) {
|
) {
|
||||||
baseUrl = reqBody.baseUrl;
|
baseUrl = reqBody.baseUrl;
|
||||||
}
|
}
|
||||||
if (!isAzure && !baseUrl.endsWith("/v1")) {
|
if (
|
||||||
|
reqBody.provider === ServiceProvider.OpenAI &&
|
||||||
|
!baseUrl.endsWith("/v1")
|
||||||
|
) {
|
||||||
baseUrl = baseUrl.endsWith("/") ? `${baseUrl}v1` : `${baseUrl}/v1`;
|
baseUrl = baseUrl.endsWith("/") ? `${baseUrl}v1` : `${baseUrl}/v1`;
|
||||||
}
|
}
|
||||||
if (!reqBody.isAzure && serverConfig.isAzure) {
|
if (!reqBody.isAzure && serverConfig.isAzure) {
|
||||||
@ -408,8 +418,7 @@ export class AgentApi {
|
|||||||
typeof lastMessageContent === "string"
|
typeof lastMessageContent === "string"
|
||||||
? new HumanMessage(lastMessageContent)
|
? new HumanMessage(lastMessageContent)
|
||||||
: new HumanMessage({ content: lastMessageContent });
|
: new HumanMessage({ content: lastMessageContent });
|
||||||
|
const agent = createToolCallingAgent({
|
||||||
const agent = await createToolCallingAgent({
|
|
||||||
llm,
|
llm,
|
||||||
tools,
|
tools,
|
||||||
prompt,
|
prompt,
|
||||||
@ -423,7 +432,7 @@ export class AgentApi {
|
|||||||
{
|
{
|
||||||
input: lastMessageContent,
|
input: lastMessageContent,
|
||||||
chat_history: pastMessages,
|
chat_history: pastMessages,
|
||||||
signal: this.controller.signal,
|
// signal: this.controller.signal,
|
||||||
},
|
},
|
||||||
{ callbacks: [handler] },
|
{ callbacks: [handler] },
|
||||||
)
|
)
|
||||||
|
@ -4,8 +4,8 @@ import { auth } from "@/app/api/auth";
|
|||||||
import { NodeJSTool } from "@/app/api/langchain-tools/nodejs_tools";
|
import { NodeJSTool } from "@/app/api/langchain-tools/nodejs_tools";
|
||||||
import { ModelProvider } from "@/app/constant";
|
import { ModelProvider } from "@/app/constant";
|
||||||
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai";
|
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai";
|
||||||
import { Embeddings } from "langchain/dist/embeddings/base";
|
|
||||||
import { OllamaEmbeddings } from "@langchain/community/embeddings/ollama";
|
import { OllamaEmbeddings } from "@langchain/community/embeddings/ollama";
|
||||||
|
import { Embeddings } from "@langchain/core/embeddings";
|
||||||
|
|
||||||
async function handle(req: NextRequest) {
|
async function handle(req: NextRequest) {
|
||||||
if (req.method === "OPTIONS") {
|
if (req.method === "OPTIONS") {
|
||||||
|
@ -227,7 +227,7 @@ export class ClientApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getHeaders(ignoreHeaders?: boolean) {
|
export function getHeaders(ignoreHeaders?: boolean, isFunctionCall?: boolean) {
|
||||||
const accessStore = useAccessStore.getState();
|
const accessStore = useAccessStore.getState();
|
||||||
const chatStore = useChatStore.getState();
|
const chatStore = useChatStore.getState();
|
||||||
let headers: Record<string, string> = {};
|
let headers: Record<string, string> = {};
|
||||||
@ -285,6 +285,7 @@ export function getHeaders(ignoreHeaders?: boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getAuthHeader(): string {
|
function getAuthHeader(): string {
|
||||||
|
if (isFunctionCall) return "Authorization";
|
||||||
return isAzure ? "api-key" : isAnthropic ? "x-api-key" : "Authorization";
|
return isAzure ? "api-key" : isAnthropic ? "x-api-key" : "Authorization";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
import { ACCESS_CODE_PREFIX, Anthropic, ApiPath } from "@/app/constant";
|
import {
|
||||||
|
ACCESS_CODE_PREFIX,
|
||||||
|
Anthropic,
|
||||||
|
ApiPath,
|
||||||
|
REQUEST_TIMEOUT_MS,
|
||||||
|
ServiceProvider,
|
||||||
|
} from "@/app/constant";
|
||||||
import {
|
import {
|
||||||
AgentChatOptions,
|
AgentChatOptions,
|
||||||
ChatOptions,
|
ChatOptions,
|
||||||
@ -88,9 +94,164 @@ export class ClaudeApi implements LLMApi {
|
|||||||
transcription(options: TranscriptionOptions): Promise<string> {
|
transcription(options: TranscriptionOptions): Promise<string> {
|
||||||
throw new Error("Method not implemented.");
|
throw new Error("Method not implemented.");
|
||||||
}
|
}
|
||||||
toolAgentChat(options: AgentChatOptions): Promise<void> {
|
|
||||||
throw new Error("Method not implemented.");
|
async toolAgentChat(options: AgentChatOptions) {
|
||||||
|
const visionModel = isVisionModel(options.config.model);
|
||||||
|
const messages: AgentChatOptions["messages"] = [];
|
||||||
|
for (const v of options.messages) {
|
||||||
|
const content = visionModel
|
||||||
|
? await preProcessImageContent(v.content)
|
||||||
|
: getMessageTextContent(v);
|
||||||
|
messages.push({ role: v.role, content });
|
||||||
|
}
|
||||||
|
|
||||||
|
const modelConfig = {
|
||||||
|
...useAppConfig.getState().modelConfig,
|
||||||
|
...useChatStore.getState().currentSession().mask.modelConfig,
|
||||||
|
...{
|
||||||
|
model: options.config.model,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const accessStore = useAccessStore.getState();
|
||||||
|
let baseUrl = accessStore.anthropicUrl;
|
||||||
|
const requestPayload = {
|
||||||
|
chatSessionId: options.chatSessionId,
|
||||||
|
messages,
|
||||||
|
isAzure: false,
|
||||||
|
azureApiVersion: accessStore.azureApiVersion,
|
||||||
|
stream: options.config.stream,
|
||||||
|
model: modelConfig.model,
|
||||||
|
temperature: modelConfig.temperature,
|
||||||
|
presence_penalty: modelConfig.presence_penalty,
|
||||||
|
frequency_penalty: modelConfig.frequency_penalty,
|
||||||
|
top_p: modelConfig.top_p,
|
||||||
|
baseUrl: baseUrl,
|
||||||
|
maxIterations: options.agentConfig.maxIterations,
|
||||||
|
returnIntermediateSteps: options.agentConfig.returnIntermediateSteps,
|
||||||
|
useTools: options.agentConfig.useTools,
|
||||||
|
provider: ServiceProvider.Anthropic,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("[Request] anthropic payload: ", requestPayload);
|
||||||
|
|
||||||
|
const shouldStream = true;
|
||||||
|
const controller = new AbortController();
|
||||||
|
options.onController?.(controller);
|
||||||
|
|
||||||
|
try {
|
||||||
|
let path = "/api/langchain/tool/agent/";
|
||||||
|
const enableNodeJSPlugin = !!process.env.NEXT_PUBLIC_ENABLE_NODEJS_PLUGIN;
|
||||||
|
path = enableNodeJSPlugin ? path + "nodejs" : path + "edge";
|
||||||
|
const chatPayload = {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(requestPayload),
|
||||||
|
signal: controller.signal,
|
||||||
|
headers: getHeaders(false, true),
|
||||||
|
};
|
||||||
|
|
||||||
|
// make a fetch request
|
||||||
|
const requestTimeoutId = setTimeout(
|
||||||
|
() => controller.abort(),
|
||||||
|
REQUEST_TIMEOUT_MS,
|
||||||
|
);
|
||||||
|
// console.log("shouldStream", shouldStream);
|
||||||
|
|
||||||
|
if (shouldStream) {
|
||||||
|
let responseText = "";
|
||||||
|
let finished = false;
|
||||||
|
|
||||||
|
const finish = () => {
|
||||||
|
if (!finished) {
|
||||||
|
options.onFinish(responseText);
|
||||||
|
finished = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
controller.signal.onabort = finish;
|
||||||
|
|
||||||
|
fetchEventSource(path, {
|
||||||
|
...chatPayload,
|
||||||
|
async onopen(res) {
|
||||||
|
clearTimeout(requestTimeoutId);
|
||||||
|
const contentType = res.headers.get("content-type");
|
||||||
|
console.log(
|
||||||
|
"[OpenAI] request response content type: ",
|
||||||
|
contentType,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (contentType?.startsWith("text/plain")) {
|
||||||
|
responseText = await res.clone().text();
|
||||||
|
return finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!res.ok ||
|
||||||
|
!res.headers
|
||||||
|
.get("content-type")
|
||||||
|
?.startsWith(EventStreamContentType) ||
|
||||||
|
res.status !== 200
|
||||||
|
) {
|
||||||
|
const responseTexts = [responseText];
|
||||||
|
let extraInfo = await res.clone().text();
|
||||||
|
console.warn(`extraInfo: ${extraInfo}`);
|
||||||
|
|
||||||
|
if (res.status === 401) {
|
||||||
|
responseTexts.push(Locale.Error.Unauthorized);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extraInfo) {
|
||||||
|
responseTexts.push(extraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
responseText = responseTexts.join("\n\n");
|
||||||
|
|
||||||
|
return finish();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onmessage(msg) {
|
||||||
|
let response = JSON.parse(msg.data);
|
||||||
|
if (!response.isSuccess) {
|
||||||
|
console.error("[Request]", msg.data);
|
||||||
|
responseText = msg.data;
|
||||||
|
throw Error(response.message);
|
||||||
|
}
|
||||||
|
if (msg.data === "[DONE]" || finished) {
|
||||||
|
return finish();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (response && !response.isToolMessage) {
|
||||||
|
responseText += response.message;
|
||||||
|
options.onUpdate?.(responseText, response.message);
|
||||||
|
} else {
|
||||||
|
options.onToolUpdate?.(response.toolName!, response.message);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("[Request] parse error", response, msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onclose() {
|
||||||
|
finish();
|
||||||
|
},
|
||||||
|
onerror(e) {
|
||||||
|
options.onError?.(e);
|
||||||
|
throw e;
|
||||||
|
},
|
||||||
|
openWhenHidden: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const res = await fetch(path, chatPayload);
|
||||||
|
clearTimeout(requestTimeoutId);
|
||||||
|
|
||||||
|
const resJson = await res.json();
|
||||||
|
const message = this.extractMessage(resJson);
|
||||||
|
options.onFinish(message);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("[Request] failed to make a chat reqeust", e);
|
||||||
|
options.onError?.(e as Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createRAGStore(options: CreateRAGStoreOptions): Promise<string> {
|
createRAGStore(options: CreateRAGStoreOptions): Promise<string> {
|
||||||
throw new Error("Method not implemented.");
|
throw new Error("Method not implemented.");
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ import {
|
|||||||
isVisionModel,
|
isVisionModel,
|
||||||
isFirefox,
|
isFirefox,
|
||||||
isSupportRAGModel,
|
isSupportRAGModel,
|
||||||
|
isFunctionCallModel,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
|
|
||||||
import { uploadImage as uploadImageRemote } from "@/app/utils/chat";
|
import { uploadImage as uploadImageRemote } from "@/app/utils/chat";
|
||||||
@ -636,19 +637,17 @@ export function ChatActions(props: {
|
|||||||
text={Locale.Chat.InputActions.Masks}
|
text={Locale.Chat.InputActions.Masks}
|
||||||
icon={<MaskIcon />}
|
icon={<MaskIcon />}
|
||||||
/>
|
/>
|
||||||
{config.pluginConfig.enable &&
|
{config.pluginConfig.enable && isFunctionCallModel(currentModel) && (
|
||||||
/^gpt(?!.*03\d{2}$).*$/.test(currentModel) &&
|
<ChatAction
|
||||||
currentModel != "gpt-4-vision-preview" && (
|
onClick={switchUsePlugins}
|
||||||
<ChatAction
|
text={
|
||||||
onClick={switchUsePlugins}
|
usePlugins
|
||||||
text={
|
? Locale.Chat.InputActions.DisablePlugins
|
||||||
usePlugins
|
: Locale.Chat.InputActions.EnablePlugins
|
||||||
? Locale.Chat.InputActions.DisablePlugins
|
}
|
||||||
: Locale.Chat.InputActions.EnablePlugins
|
icon={usePlugins ? <EnablePluginIcon /> : <DisablePluginIcon />}
|
||||||
}
|
/>
|
||||||
icon={usePlugins ? <EnablePluginIcon /> : <DisablePluginIcon />}
|
)}
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<ChatAction
|
<ChatAction
|
||||||
onClick={() => setShowModelSelector(true)}
|
onClick={() => setShowModelSelector(true)}
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
import { trimTopic, getMessageTextContent } from "../utils";
|
import {
|
||||||
|
trimTopic,
|
||||||
|
getMessageTextContent,
|
||||||
|
isFunctionCallModel,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
import Locale, { getLang } from "../locales";
|
import Locale, { getLang } from "../locales";
|
||||||
import { showToast } from "../components/ui-lib";
|
import { showToast } from "../components/ui-lib";
|
||||||
@ -403,8 +407,7 @@ export const useChatStore = createPersistStore(
|
|||||||
config.pluginConfig.enable &&
|
config.pluginConfig.enable &&
|
||||||
session.mask.usePlugins &&
|
session.mask.usePlugins &&
|
||||||
(allPlugins.length > 0 || isEnableRAG) &&
|
(allPlugins.length > 0 || isEnableRAG) &&
|
||||||
modelConfig.model.startsWith("gpt") &&
|
isFunctionCallModel(modelConfig.model)
|
||||||
modelConfig.model != "gpt-4-vision-preview"
|
|
||||||
) {
|
) {
|
||||||
console.log("[ToolAgent] start");
|
console.log("[ToolAgent] start");
|
||||||
let pluginToolNames = allPlugins.map((m) => m.toolName);
|
let pluginToolNames = allPlugins.map((m) => m.toolName);
|
||||||
|
16
package.json
16
package.json
@ -23,12 +23,13 @@
|
|||||||
"@aws-sdk/s3-request-presigner": "^3.414.0",
|
"@aws-sdk/s3-request-presigner": "^3.414.0",
|
||||||
"@fortaine/fetch-event-source": "^3.0.6",
|
"@fortaine/fetch-event-source": "^3.0.6",
|
||||||
"@hello-pangea/dnd": "^16.5.0",
|
"@hello-pangea/dnd": "^16.5.0",
|
||||||
"@langchain/anthropic": "^0.2.11",
|
"@langchain/anthropic": "^0.2.14",
|
||||||
"@langchain/community": "0.2.22",
|
"@langchain/community": "0.2.25",
|
||||||
"@langchain/groq": "^0.0.15",
|
"@langchain/groq": "^0.0.16",
|
||||||
"@langchain/langgraph": "^0.0.31",
|
"@langchain/langgraph": "^0.0.33",
|
||||||
"@langchain/ollama": "^0.0.2",
|
"@langchain/ollama": "^0.0.4",
|
||||||
"@langchain/openai": "^0.2.5",
|
"@langchain/openai": "^0.2.6",
|
||||||
|
"langchain": "0.2.15",
|
||||||
"@next/third-parties": "^14.1.0",
|
"@next/third-parties": "^14.1.0",
|
||||||
"@pinecone-database/pinecone": "^2.2.0",
|
"@pinecone-database/pinecone": "^2.2.0",
|
||||||
"@qdrant/js-client-rest": "^1.8.2",
|
"@qdrant/js-client-rest": "^1.8.2",
|
||||||
@ -49,7 +50,6 @@
|
|||||||
"html-to-image": "^1.11.11",
|
"html-to-image": "^1.11.11",
|
||||||
"html-to-text": "^9.0.5",
|
"html-to-text": "^9.0.5",
|
||||||
"https-proxy-agent": "^7.0.2",
|
"https-proxy-agent": "^7.0.2",
|
||||||
"langchain": "0.1.37",
|
|
||||||
"mammoth": "^1.7.1",
|
"mammoth": "^1.7.1",
|
||||||
"markdown-to-txt": "^2.0.1",
|
"markdown-to-txt": "^2.0.1",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
@ -100,7 +100,7 @@
|
|||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"lint-staged/yaml": "^2.2.2",
|
"lint-staged/yaml": "^2.2.2",
|
||||||
"@langchain/core": "0.2.18"
|
"@langchain/core": "0.2.23"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.19"
|
"packageManager": "yarn@1.22.19"
|
||||||
}
|
}
|
||||||
|
190
yarn.lock
190
yarn.lock
@ -24,21 +24,6 @@
|
|||||||
node-fetch "^2.6.7"
|
node-fetch "^2.6.7"
|
||||||
web-streams-polyfill "^3.2.1"
|
web-streams-polyfill "^3.2.1"
|
||||||
|
|
||||||
"@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"
|
|
||||||
abort-controller "^3.0.0"
|
|
||||||
agentkeepalive "^4.2.1"
|
|
||||||
digest-fetch "^1.3.0"
|
|
||||||
form-data-encoder "1.7.2"
|
|
||||||
formdata-node "^4.3.2"
|
|
||||||
node-fetch "^2.6.7"
|
|
||||||
web-streams-polyfill "^3.2.1"
|
|
||||||
|
|
||||||
"@aws-crypto/crc32@5.2.0":
|
"@aws-crypto/crc32@5.2.0":
|
||||||
version "5.2.0"
|
version "5.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@aws-crypto/crc32/-/crc32-5.2.0.tgz#cfcc22570949c98c6689cfcbd2d693d36cdae2e1"
|
resolved "https://registry.yarnpkg.com/@aws-crypto/crc32/-/crc32-5.2.0.tgz#cfcc22570949c98c6689cfcbd2d693d36cdae2e1"
|
||||||
@ -2046,23 +2031,23 @@
|
|||||||
"@jridgewell/resolve-uri" "^3.1.0"
|
"@jridgewell/resolve-uri" "^3.1.0"
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.14"
|
"@jridgewell/sourcemap-codec" "^1.4.14"
|
||||||
|
|
||||||
"@langchain/anthropic@^0.2.11":
|
"@langchain/anthropic@^0.2.14":
|
||||||
version "0.2.12"
|
version "0.2.14"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/anthropic/-/anthropic-0.2.12.tgz#78b6e79030f6911eb89b3647a239a1c7fb34948d"
|
resolved "https://registry.yarnpkg.com/@langchain/anthropic/-/anthropic-0.2.14.tgz#3b4f56ed6a5185c55e5cf167173827e267aebd06"
|
||||||
integrity sha512-F74kgQiHHLMSc1CYB3wAPh6ou+ql8ExOqeOMe/NPwK8MuMqC6By/44lAtuV/hOSE/pUmQCNfJmnYwuwteXCXRA==
|
integrity sha512-qTFlsMej8SE0hz6IrqcQTkza/TGnlc7Tq/9W65TjQGLX51rGCYkprbLfpTi/LL9gahdB9VvB2Q5knUL0/N/xtQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@anthropic-ai/sdk" "^0.22.0"
|
"@anthropic-ai/sdk" "^0.22.0"
|
||||||
"@langchain/core" ">=0.2.16 <0.3.0"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
fast-xml-parser "^4.3.5"
|
fast-xml-parser "^4.4.1"
|
||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.4"
|
zod-to-json-schema "^3.22.4"
|
||||||
|
|
||||||
"@langchain/community@0.2.22":
|
"@langchain/community@0.2.25":
|
||||||
version "0.2.22"
|
version "0.2.25"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.2.22.tgz#e94dd8c1e516c3cefc64e2ceafb755994b89c2e9"
|
resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.2.25.tgz#4639cdf3b42f5c458eedf25a9ad7c03a7869b1c1"
|
||||||
integrity sha512-KxT6Pj0ovJkSgiVHKorIeH0Bi7QDwMiuCD8apLNKkgHz9NC8ZxzKt5LqpVApNbnPWkCwm9EZ3oBfYGaz+D3jMg==
|
integrity sha512-LrqbWyfgzclUumPYet8HcxMNoHE57M6BVku6vebtAz8BO10unPRtRkv7Kay7yGfGg0oZkipWKfp0CCtpK15Nag==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@langchain/core" ">=0.2.16 <0.3.0"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
"@langchain/openai" ">=0.1.0 <0.3.0"
|
"@langchain/openai" ">=0.1.0 <0.3.0"
|
||||||
binary-extensions "^2.2.0"
|
binary-extensions "^2.2.0"
|
||||||
expr-eval "^2.0.2"
|
expr-eval "^2.0.2"
|
||||||
@ -2074,31 +2059,16 @@
|
|||||||
zod "^3.22.3"
|
zod "^3.22.3"
|
||||||
zod-to-json-schema "^3.22.5"
|
zod-to-json-schema "^3.22.5"
|
||||||
|
|
||||||
"@langchain/community@~0.0.47":
|
"@langchain/core@0.2.23", "@langchain/core@>0.2.0 <0.3.0", "@langchain/core@>=0.2.11 <0.3.0", "@langchain/core@>=0.2.16 <0.3.0", "@langchain/core@>=0.2.20 <0.3.0", "@langchain/core@>=0.2.21 <0.3.0":
|
||||||
version "0.0.57"
|
version "0.2.23"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/community/-/community-0.0.57.tgz#9d77c5acb74a4a8ec01d2cefb71dcd4088701c44"
|
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.2.23.tgz#74a6feb0e476256a960db8966e9cf0471a0b9b3d"
|
||||||
integrity sha512-tib4UJNkyA4TPNsTNChiBtZmThVJBr7X/iooSmKeCr+yUEha2Yxly3A4OAO95Vlpj4Q+od8HAfCbZih/1XqAMw==
|
integrity sha512-elPg6WpAkxWEIGC9u38F2anbzqfYYEy32lJdsd9dtChcHSFmFLlXqa+SnpO3R772gUuJmcu+Pd+fCvmRFy029w==
|
||||||
dependencies:
|
|
||||||
"@langchain/core" "~0.1.60"
|
|
||||||
"@langchain/openai" "~0.0.28"
|
|
||||||
expr-eval "^2.0.2"
|
|
||||||
flat "^5.0.2"
|
|
||||||
langsmith "~0.1.1"
|
|
||||||
uuid "^9.0.0"
|
|
||||||
zod "^3.22.3"
|
|
||||||
zod-to-json-schema "^3.22.5"
|
|
||||||
|
|
||||||
"@langchain/core@0.2.18", "@langchain/core@>0.1.56 <0.3.0", "@langchain/core@>0.2.0 <0.3.0", "@langchain/core@>=0.2.11 <0.3.0", "@langchain/core@>=0.2.16 <0.3.0", "@langchain/core@>=0.2.17 <0.3.0", "@langchain/core@>=0.2.18 <0.3.0", "@langchain/core@~0.1.60":
|
|
||||||
version "0.2.18"
|
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/core/-/core-0.2.18.tgz#1ac4f307fa217ab3555c9634147a6c4ad9826092"
|
|
||||||
integrity sha512-ru542BwNcsnDfjTeDbIkFIchwa54ctHZR+kVrC8U9NPS9/36iM8p8ruprOV7Zccj/oxtLE5UpEhV+9MZhVcFlA==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
ansi-styles "^5.0.0"
|
ansi-styles "^5.0.0"
|
||||||
camelcase "6"
|
camelcase "6"
|
||||||
decamelize "1.2.0"
|
decamelize "1.2.0"
|
||||||
js-tiktoken "^1.0.12"
|
js-tiktoken "^1.0.12"
|
||||||
langsmith "~0.1.39"
|
langsmith "~0.1.39"
|
||||||
ml-distance "^4.0.0"
|
|
||||||
mustache "^4.2.0"
|
mustache "^4.2.0"
|
||||||
p-queue "^6.6.2"
|
p-queue "^6.6.2"
|
||||||
p-retry "4"
|
p-retry "4"
|
||||||
@ -2106,36 +2076,36 @@
|
|||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.3"
|
zod-to-json-schema "^3.22.3"
|
||||||
|
|
||||||
"@langchain/groq@^0.0.15":
|
"@langchain/groq@^0.0.16":
|
||||||
version "0.0.15"
|
version "0.0.16"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/groq/-/groq-0.0.15.tgz#336c2c36aa119a030f29c8fd614e9cc85abc4b07"
|
resolved "https://registry.yarnpkg.com/@langchain/groq/-/groq-0.0.16.tgz#97b5d444d33b2d632d4ff67ef78abf74269e8425"
|
||||||
integrity sha512-JN6dlPNHZEFKc8JjQzO+H7IqCpcE3s/1nYnb+sHxpc22Amr3yxXgp6CvanLhmD+R8Wj1AE1vG7AkzjM8MLtv+A==
|
integrity sha512-rwD57PzT54clE4WigMzTMmA9rIifXq82uQ9nqFHJ4hfDV38P2lbQ1/N21QE0+L8c9oKvdY+TVm0vlilxV4w22A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@langchain/core" ">=0.2.16 <0.3.0"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
"@langchain/openai" "~0.2.4"
|
"@langchain/openai" "~0.2.6"
|
||||||
groq-sdk "^0.3.2"
|
groq-sdk "^0.5.0"
|
||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.5"
|
zod-to-json-schema "^3.22.5"
|
||||||
|
|
||||||
"@langchain/langgraph@^0.0.31":
|
"@langchain/langgraph@^0.0.33":
|
||||||
version "0.0.31"
|
version "0.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.0.31.tgz#4585fc9b4e9ad9677e97fd8debcfec2ae43a5fb4"
|
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.0.33.tgz#556999d1711db1b7e0be0d82506fed736e79f873"
|
||||||
integrity sha512-f5QMSLy/RnLktsqnNm2mq8gp1xplHwQf87XIPVO0IYuumOJiafx5lE7ahPO+fVmCzAz6LxcsVocvD0JqxXR/2w==
|
integrity sha512-OCL/eGdIERmcKP7UgNoLyFM1nbA5VvBb7Pu85t1gE/jMMmmcJghvdVzx61YUaPs2seNpU9sVTHUKNTcAjD3Ctw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@langchain/core" ">=0.2.18 <0.3.0"
|
"@langchain/core" ">=0.2.20 <0.3.0"
|
||||||
uuid "^10.0.0"
|
uuid "^10.0.0"
|
||||||
zod "^3.23.8"
|
zod "^3.23.8"
|
||||||
|
|
||||||
"@langchain/ollama@^0.0.2":
|
"@langchain/ollama@^0.0.4":
|
||||||
version "0.0.2"
|
version "0.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/ollama/-/ollama-0.0.2.tgz#326fd2a3bceddfd95972ecccd18c44264f79daea"
|
resolved "https://registry.yarnpkg.com/@langchain/ollama/-/ollama-0.0.4.tgz#b727d03710a3ebbd5b7eb789199c0cb97dc09015"
|
||||||
integrity sha512-RMgEensnUeL9+4/5Z2v8E2bjEazyq0THQtYEXF9M4cd2DRwIwq9KJmQMLwOqIZO4vNVWJd5Vn4v17ZRnikGytg==
|
integrity sha512-laYaYFZsbu0Mjhm40CypXPV5gYvQjd16oBEoGnFFjmCUgCCu6gjETg3tgvgifo7w+dhmNPLUyqnjXA/BpWEH2Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@langchain/core" ">=0.2.17 <0.3.0"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
ollama "^0.5.6"
|
ollama "^0.5.6"
|
||||||
uuid "^10.0.0"
|
uuid "^10.0.0"
|
||||||
|
|
||||||
"@langchain/openai@>=0.1.0 <0.3.0", "@langchain/openai@^0.2.5", "@langchain/openai@~0.2.4":
|
"@langchain/openai@>=0.1.0 <0.3.0":
|
||||||
version "0.2.5"
|
version "0.2.5"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.2.5.tgz#e85b983986a7415ea743d4c854bb0674134334d4"
|
resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.2.5.tgz#e85b983986a7415ea743d4c854bb0674134334d4"
|
||||||
integrity sha512-gQXS5VBFyAco0jgSnUVan6fYVSIxlffmDaeDGpXrAmz2nQPgiN/h24KYOt2NOZ1zRheRzRuO/CfRagMhyVUaFA==
|
integrity sha512-gQXS5VBFyAco0jgSnUVan6fYVSIxlffmDaeDGpXrAmz2nQPgiN/h24KYOt2NOZ1zRheRzRuO/CfRagMhyVUaFA==
|
||||||
@ -2146,14 +2116,14 @@
|
|||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.3"
|
zod-to-json-schema "^3.22.3"
|
||||||
|
|
||||||
"@langchain/openai@~0.0.28":
|
"@langchain/openai@^0.2.6", "@langchain/openai@~0.2.6":
|
||||||
version "0.0.34"
|
version "0.2.6"
|
||||||
resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.0.34.tgz#36c9bca0721ab9f7e5d40927e7c0429cacbd5b56"
|
resolved "https://registry.yarnpkg.com/@langchain/openai/-/openai-0.2.6.tgz#644391f26a3ad89778c17484efc1a4e8bfc04ead"
|
||||||
integrity sha512-M+CW4oXle5fdoz2T2SwdOef8pl3/1XmUx1vjn2mXUVM/128aO0l23FMF0SNBsAbRV6P+p/TuzjodchJbi0Ht/A==
|
integrity sha512-LZgSzHOZPJGsZr2ZXJICqZo1GN0kUyP9/RN+T45g7HDdMRfS5Df7fJgY9w7EIfznT83Q0Ywhz+At/UvWMR3xhw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@langchain/core" ">0.1.56 <0.3.0"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
js-tiktoken "^1.0.12"
|
js-tiktoken "^1.0.12"
|
||||||
openai "^4.41.1"
|
openai "^4.55.0"
|
||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.3"
|
zod-to-json-schema "^3.22.3"
|
||||||
|
|
||||||
@ -3742,11 +3712,6 @@ balanced-match@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||||
|
|
||||||
base-64@^0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
|
|
||||||
integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==
|
|
||||||
|
|
||||||
base64-js@^1.3.1, base64-js@^1.5.1:
|
base64-js@^1.3.1, base64-js@^1.5.1:
|
||||||
version "1.5.1"
|
version "1.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||||
@ -4718,14 +4683,6 @@ diff@^5.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
|
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
|
||||||
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
|
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
|
||||||
|
|
||||||
digest-fetch@^1.3.0:
|
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661"
|
|
||||||
integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==
|
|
||||||
dependencies:
|
|
||||||
base-64 "^0.1.0"
|
|
||||||
md5 "^2.3.0"
|
|
||||||
|
|
||||||
dingbat-to-unicode@^1.0.1:
|
dingbat-to-unicode@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz#5091dd673241453e6b5865e26e5a4452cdef5c83"
|
resolved "https://registry.yarnpkg.com/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz#5091dd673241453e6b5865e26e5a4452cdef5c83"
|
||||||
@ -5419,7 +5376,7 @@ fast-xml-parser@4.2.5:
|
|||||||
dependencies:
|
dependencies:
|
||||||
strnum "^1.0.5"
|
strnum "^1.0.5"
|
||||||
|
|
||||||
fast-xml-parser@^4.3.5:
|
fast-xml-parser@^4.4.1:
|
||||||
version "4.4.1"
|
version "4.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz#86dbf3f18edf8739326447bcaac31b4ae7f6514f"
|
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz#86dbf3f18edf8739326447bcaac31b4ae7f6514f"
|
||||||
integrity sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==
|
integrity sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==
|
||||||
@ -5748,16 +5705,15 @@ graphemer@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
||||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||||
|
|
||||||
groq-sdk@^0.3.2:
|
groq-sdk@^0.5.0:
|
||||||
version "0.3.3"
|
version "0.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/groq-sdk/-/groq-sdk-0.3.3.tgz#88cecb4049fc899b97be7396ce087fa46a704258"
|
resolved "https://registry.yarnpkg.com/groq-sdk/-/groq-sdk-0.5.0.tgz#8eefea81c3709e815c96dffa941200e85a50cf19"
|
||||||
integrity sha512-wdOeZ2QymPjjP3tmFpUAnfMisoLbt7xF2MfpROeFAngcqWbfTyB9j9pMWSEAMF/E4gZx8f2Y+5zswO0q92CSxA==
|
integrity sha512-RVmhW7qZ+XZoy5fIuSdx/LGQJONpL8MHgZEW7dFwTdgkzStub2XQx6OKv28CHogijdwH41J+Npj/z2jBPu3vmw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "^18.11.18"
|
"@types/node" "^18.11.18"
|
||||||
"@types/node-fetch" "^2.6.4"
|
"@types/node-fetch" "^2.6.4"
|
||||||
abort-controller "^3.0.0"
|
abort-controller "^3.0.0"
|
||||||
agentkeepalive "^4.2.1"
|
agentkeepalive "^4.2.1"
|
||||||
digest-fetch "^1.3.0"
|
|
||||||
form-data-encoder "1.7.2"
|
form-data-encoder "1.7.2"
|
||||||
formdata-node "^4.3.2"
|
formdata-node "^4.3.2"
|
||||||
node-fetch "^2.6.7"
|
node-fetch "^2.6.7"
|
||||||
@ -6319,7 +6275,7 @@ jest-worker@^27.4.5:
|
|||||||
merge-stream "^2.0.0"
|
merge-stream "^2.0.0"
|
||||||
supports-color "^8.0.0"
|
supports-color "^8.0.0"
|
||||||
|
|
||||||
js-tiktoken@^1.0.12, js-tiktoken@^1.0.7:
|
js-tiktoken@^1.0.12:
|
||||||
version "1.0.12"
|
version "1.0.12"
|
||||||
resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.12.tgz#af0f5cf58e5e7318240d050c8413234019424211"
|
resolved "https://registry.yarnpkg.com/js-tiktoken/-/js-tiktoken-1.0.12.tgz#af0f5cf58e5e7318240d050c8413234019424211"
|
||||||
integrity sha512-L7wURW1fH9Qaext0VzaUDpFGVQgjkdE3Dgsy9/+yXyGEpBKnylTd0mU0bfbNkKDlXRb6TEsZkwuflu1B8uQbJQ==
|
integrity sha512-L7wURW1fH9Qaext0VzaUDpFGVQgjkdE3Dgsy9/+yXyGEpBKnylTd0mU0bfbNkKDlXRb6TEsZkwuflu1B8uQbJQ==
|
||||||
@ -6434,26 +6390,22 @@ kleur@^4.0.3:
|
|||||||
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780"
|
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780"
|
||||||
integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==
|
integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==
|
||||||
|
|
||||||
langchain@0.1.37:
|
langchain@0.2.15:
|
||||||
version "0.1.37"
|
version "0.2.15"
|
||||||
resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.1.37.tgz#15db8ca5c24afc39e61773cab69e216dfb38e1bb"
|
resolved "https://registry.yarnpkg.com/langchain/-/langchain-0.2.15.tgz#2147203d8fa56f48153a225ff9c74b1b93da6b18"
|
||||||
integrity sha512-rpaLEJtRrLYhAViEp7/aHfSkxbgSqHJ5n10tXv3o4kHP/wOin85RpTgewwvGjEaKc3797jOg+sLSk6a7e0UlMg==
|
integrity sha512-SW4YdRnNPNDRhu6vsxHhxwx+OhDcQsOuiQ/K5gzsUMXUkgbS+y8kG3Kjgs08MXgKAkT4IKW0f2/o1B+2n0Lubw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@anthropic-ai/sdk" "^0.9.1"
|
"@langchain/core" ">=0.2.21 <0.3.0"
|
||||||
"@langchain/community" "~0.0.47"
|
"@langchain/openai" ">=0.1.0 <0.3.0"
|
||||||
"@langchain/core" "~0.1.60"
|
|
||||||
"@langchain/openai" "~0.0.28"
|
|
||||||
"@langchain/textsplitters" "~0.0.0"
|
"@langchain/textsplitters" "~0.0.0"
|
||||||
binary-extensions "^2.2.0"
|
binary-extensions "^2.2.0"
|
||||||
js-tiktoken "^1.0.7"
|
js-tiktoken "^1.0.12"
|
||||||
js-yaml "^4.1.0"
|
js-yaml "^4.1.0"
|
||||||
jsonpointer "^5.0.1"
|
jsonpointer "^5.0.1"
|
||||||
langchainhub "~0.0.8"
|
langsmith "~0.1.40"
|
||||||
langsmith "~0.1.7"
|
|
||||||
ml-distance "^4.0.0"
|
|
||||||
openapi-types "^12.1.3"
|
openapi-types "^12.1.3"
|
||||||
p-retry "4"
|
p-retry "4"
|
||||||
uuid "^9.0.0"
|
uuid "^10.0.0"
|
||||||
yaml "^2.2.1"
|
yaml "^2.2.1"
|
||||||
zod "^3.22.4"
|
zod "^3.22.4"
|
||||||
zod-to-json-schema "^3.22.3"
|
zod-to-json-schema "^3.22.3"
|
||||||
@ -6485,21 +6437,22 @@ langchainhub@~0.0.8:
|
|||||||
resolved "https://registry.yarnpkg.com/langchainhub/-/langchainhub-0.0.11.tgz#2ce22def9c84699dcbd4fd4b78270d34bd2a9ae9"
|
resolved "https://registry.yarnpkg.com/langchainhub/-/langchainhub-0.0.11.tgz#2ce22def9c84699dcbd4fd4b78270d34bd2a9ae9"
|
||||||
integrity sha512-WnKI4g9kU2bHQP136orXr2bcRdgz9iiTBpTN0jWt9IlScUKnJBoD0aa2HOzHURQKeQDnt2JwqVmQ6Depf5uDLQ==
|
integrity sha512-WnKI4g9kU2bHQP136orXr2bcRdgz9iiTBpTN0jWt9IlScUKnJBoD0aa2HOzHURQKeQDnt2JwqVmQ6Depf5uDLQ==
|
||||||
|
|
||||||
langsmith@~0.1.1, langsmith@~0.1.7:
|
langsmith@~0.1.30, langsmith@~0.1.39:
|
||||||
version "0.1.39"
|
version "0.1.40"
|
||||||
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.39.tgz#cc99f1828a9c0f5ba24bec6b0121edc44e8d282d"
|
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.40.tgz#9708889386a5b9d0eb43dd3a9eba93513b57101d"
|
||||||
integrity sha512-K2/qbc96JhrZbSL74RbZ0DBOpTB9Mxicu8RQrZ88Xsp1bH2O3+y5EdcvC0g/1YzQWQhcQ4peknCA24c3VTNiNA==
|
integrity sha512-11E2WLbh/+41+Qc0w8fJJTC/iz91BA+zXRMX/Wz0KSstnfzIPBoiWa++Kp2X8yCIDNywWWLJhy/B8gYzm7VKig==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/uuid" "^9.0.1"
|
"@types/uuid" "^9.0.1"
|
||||||
commander "^10.0.1"
|
commander "^10.0.1"
|
||||||
p-queue "^6.6.2"
|
p-queue "^6.6.2"
|
||||||
p-retry "4"
|
p-retry "4"
|
||||||
|
semver "^7.6.3"
|
||||||
uuid "^9.0.0"
|
uuid "^9.0.0"
|
||||||
|
|
||||||
langsmith@~0.1.30, langsmith@~0.1.39:
|
langsmith@~0.1.40:
|
||||||
version "0.1.40"
|
version "0.1.41"
|
||||||
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.40.tgz#9708889386a5b9d0eb43dd3a9eba93513b57101d"
|
resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.1.41.tgz#8a496ee53e93bb1f7e11841201237286ceee8527"
|
||||||
integrity sha512-11E2WLbh/+41+Qc0w8fJJTC/iz91BA+zXRMX/Wz0KSstnfzIPBoiWa++Kp2X8yCIDNywWWLJhy/B8gYzm7VKig==
|
integrity sha512-8R7s/225Pxmv0ipMfd6sqmWVsfHLQivYlQZ0vx5K+ReoknummTenQlVK8gapk3kqRMnzkrouuRHMhWjMR6RgUA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/uuid" "^9.0.1"
|
"@types/uuid" "^9.0.1"
|
||||||
commander "^10.0.1"
|
commander "^10.0.1"
|
||||||
@ -7554,10 +7507,10 @@ onetime@^6.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mimic-fn "^4.0.0"
|
mimic-fn "^4.0.0"
|
||||||
|
|
||||||
openai@^4.41.1:
|
openai@^4.49.1:
|
||||||
version "4.52.7"
|
version "4.54.0"
|
||||||
resolved "https://registry.yarnpkg.com/openai/-/openai-4.52.7.tgz#e32b000142287a9e8eda8512ba28df33d11ec1f1"
|
resolved "https://registry.yarnpkg.com/openai/-/openai-4.54.0.tgz#eeb209c6892b997e524181b6ddb7e27bf4d09389"
|
||||||
integrity sha512-dgxA6UZHary6NXUHEDj5TWt8ogv0+ibH+b4pT5RrWMjiRZVylNwLcw/2ubDrX5n0oUmHX/ZgudMJeemxzOvz7A==
|
integrity sha512-e/12BdtTtj+tXs7iHm+Dm7H7WjEWnw7O52B2wSfCQ6lD5F6cvjzo7cANXy5TJ1Q3/qc8YRPT5wBTTFtP5sBp1g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "^18.11.18"
|
"@types/node" "^18.11.18"
|
||||||
"@types/node-fetch" "^2.6.4"
|
"@types/node-fetch" "^2.6.4"
|
||||||
@ -7566,12 +7519,11 @@ openai@^4.41.1:
|
|||||||
form-data-encoder "1.7.2"
|
form-data-encoder "1.7.2"
|
||||||
formdata-node "^4.3.2"
|
formdata-node "^4.3.2"
|
||||||
node-fetch "^2.6.7"
|
node-fetch "^2.6.7"
|
||||||
web-streams-polyfill "^3.2.1"
|
|
||||||
|
|
||||||
openai@^4.49.1:
|
openai@^4.55.0:
|
||||||
version "4.54.0"
|
version "4.55.4"
|
||||||
resolved "https://registry.yarnpkg.com/openai/-/openai-4.54.0.tgz#eeb209c6892b997e524181b6ddb7e27bf4d09389"
|
resolved "https://registry.yarnpkg.com/openai/-/openai-4.55.4.tgz#2f188e718e668f478f40c03012d92394e0c3d1b1"
|
||||||
integrity sha512-e/12BdtTtj+tXs7iHm+Dm7H7WjEWnw7O52B2wSfCQ6lD5F6cvjzo7cANXy5TJ1Q3/qc8YRPT5wBTTFtP5sBp1g==
|
integrity sha512-TEC75Y6U/OKIJp9fHao3zkTYfKLYGqXdD2TI+xN2Zd5W8KNKvv6E4/OBTOW7jg7fySfrBrhy5fYzBbyBcdHEtQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "^18.11.18"
|
"@types/node" "^18.11.18"
|
||||||
"@types/node-fetch" "^2.6.4"
|
"@types/node-fetch" "^2.6.4"
|
||||||
|
Loading…
Reference in New Issue
Block a user