diff --git a/README.md b/README.md index 116590328..c59b1e059 100644 --- a/README.md +++ b/README.md @@ -41,18 +41,18 @@ - [SerpAPI](https://js.langchain.com/docs/api/tools/classes/SerpAPI) - [BingSerpAPI](https://js.langchain.com/docs/api/tools/classes/BingSerpAPI) - DuckDuckGo - - 计算 - [Calculator](https://js.langchain.com/docs/api/tools_calculator/classes/Calculator) - - 网络请求 - [WebBrowser](https://js.langchain.com/docs/api/tools_webbrowser/classes/WebBrowser) - - 其它 - [Wiki](https://js.langchain.com/docs/api/tools/classes/WikipediaQueryRun) - DALL-E - DALL-E 插件需要配置 R2 存储,请参考 [Cloudflare R2 服务配置指南](./docs/cloudflare-r2-cn.md) 配置 - - ~只支持非 Cloudflare 环境的部署方式,在 Cloudflare 下该插件会失效 https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/issues/43~ + - StableDiffusion + - 本插件目前为测试版本,后续可能会有较大的变更,请谨慎使用 + - 使用本插件需要一定的专业知识,Stable Diffusion 本身的相关问题不在本项目的解答范围内,如果您确定要使用本插件请参考 [Stable Diffusion 插件配置指南](./docs/stable-diffusion-plugin-cn.md) 文档进行配置 + - StableDiffusion 插件需要配置 R2 存储,请参考 [Cloudflare R2 服务配置指南](./docs/cloudflare-r2-cn.md) 配置 diff --git a/app/api/langchain-tools/stable_diffusion_image_generator.ts b/app/api/langchain-tools/stable_diffusion_image_generator.ts new file mode 100644 index 000000000..86eee3fb4 --- /dev/null +++ b/app/api/langchain-tools/stable_diffusion_image_generator.ts @@ -0,0 +1,53 @@ +import { Tool } from "langchain/tools"; +import S3FileStorage from "../../utils/r2_file_storage"; + +export class StableDiffusionWrapper extends Tool { + name = "stable_diffusion_image_generator"; + + constructor() { + super(); + } + + /** @ignore */ + async _call(prompt: string) { + let url = process.env.STABLE_DIFFUSION_API_URL; + const data = { + prompt: prompt, + negative_prompt: + process.env.STABLE_DIFFUSION_NEGATIVE_PROMPT ?? + "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality", + seed: -1, + subseed: -1, + subseed_strength: 0, + batch_size: 1, + n_iter: 1, + steps: process.env.STABLE_DIFFUSION_STEPS ?? 20, + cfg_scale: process.env.STABLE_DIFFUSION_CFG_SCALE ?? 7, + width: process.env.STABLE_DIFFUSION_WIDTH ?? 720, + height: process.env.STABLE_DIFFUSION_HEIGHT ?? 720, + restore_faces: process.env.STABLE_DIFFUSION_RESTORE_FACES ?? false, + eta: 0, + sampler_index: process.env.STABLE_DIFFUSION_SAMPLER_INDEX ?? "Euler a", + }; + console.log(`[${this.name}]`, data); + const response = await fetch(`${url}/sdapi/v1/txt2img`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(data), + }); + const json = await response.json(); + let imageBase64 = json.images[0]; + if (!imageBase64) return "No image was generated"; + const buffer = Buffer.from(imageBase64, "base64"); + const filePath = await S3FileStorage.put(`${Date.now()}.png`, buffer); + console.log(`[${this.name}]`, filePath); + return filePath; + } + + description = `stable diffusion is an ai art generation model similar to dalle-2. + input requires english. + output will be the image link url. + use markdown to display images. like: ![img](/api/file/xxx.png)`; +} diff --git a/app/api/langchain/tool/agent/route.ts b/app/api/langchain/tool/agent/route.ts index b4e51e877..e8a9240dc 100644 --- a/app/api/langchain/tool/agent/route.ts +++ b/app/api/langchain/tool/agent/route.ts @@ -21,6 +21,7 @@ import { DynamicTool, Tool } from "langchain/tools"; import { DallEAPIWrapper } from "@/app/api/langchain-tools/dalle_image_generator"; import { BaiduSearch } from "@/app/api/langchain-tools/baidu_search"; import { GoogleSearch } from "@/app/api/langchain-tools/google_search"; +import { StableDiffusionWrapper } from "@/app/api/langchain-tools/stable_diffusion_image_generator"; const serverConfig = getServerSideConfig(); @@ -228,10 +229,13 @@ async function handle(req: NextRequest) { const webBrowserTool = new WebBrowser({ model, embeddings }); const calculatorTool = new Calculator(); const dallEAPITool = new DallEAPIWrapper(apiKey, baseUrl); + const stableDiffusionTool = new StableDiffusionWrapper(); if (useTools.includes("web-search")) tools.push(searchTool); if (useTools.includes(webBrowserTool.name)) tools.push(webBrowserTool); if (useTools.includes(calculatorTool.name)) tools.push(calculatorTool); if (useTools.includes(dallEAPITool.name)) tools.push(dallEAPITool); + if (useTools.includes(stableDiffusionTool.name)) + tools.push(stableDiffusionTool); useTools.forEach((toolName) => { if (toolName) { diff --git a/app/masks/cn.ts b/app/masks/cn.ts index ed507d734..a78f309cd 100644 --- a/app/masks/cn.ts +++ b/app/masks/cn.ts @@ -1,6 +1,35 @@ import { BuiltinMask } from "./typing"; export const CN_MASKS: BuiltinMask[] = [ + { + avatar: "1f3a8", + name: "Stable Diffusion", + context: [ + { + id: "SVx3ybvohJAKXDQ1KKQcs", + date: "", + role: "system", + content: + "Stable Diffusion is an AI art generation model similar to DALLE-2.\nHere are some prompts for generating art with Stable Diffusion.\n\nPrompt Example:\n\n- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting.\n- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth\n- pirate, deep focus, fantasy, matte, sharp focus\n- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful\n- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait\n- athena, greek goddess, claudia black, bronze greek armor, owl crown, d & d, fantasy, portrait, headshot, sharp focus\n- closeup portrait shot of a large strong female biomechanic woman in a scenic scifi environment, elegant, smooth, sharp focus, warframe\n- ultra realistic illustration of steve urkle as the hulk, elegant, smooth, sharp focus\n- portrait of beautiful happy young ana de armas, ethereal, realistic anime, clean lines, sharp lines, crisp lines, vibrant color scheme\n- A highly detailed and hyper realistic portrait of a gorgeous young ana de armas, lisa frank, butterflies, floral, sharp focus\n- lots of delicious tropical fruits with drops of moisture on table, floating colorful water, mysterious expression, in a modern and abstract setting, with bold and colorful abstract art, blurred background, bright lighting\n- 1girl, The most beautiful form of chaos, Fauvist design, Flowing colors, Vivid colors, dynamic angle, fantasy world\n- solo, sitting, close-up, girl in the hourglass, Sand is spilling out of the broken hourglass, flowing sand, huge hourglass art, hologram, particles, nebula, magic circle\n- geometric abstract background, 1girl, depth of field, zentangle, mandala, tangle, entangle, beautiful and aesthetic, dynamic angle, glowing skin, floating colorful sparkles the most beautiful form of chaos, elegant, a brutalist designed, vivid colours, romanticism\n\nFollow the structure of the example prompts. This means a very short description of the scene, followed by modifiers divided by commas to alter the mood, style, lighting, and more.\nIf the user input is in English, directly use the user input as a parameter to call the stable_diffusion_image_generator plugin. If the user input is not in English, generate an English prompt word based on the example and then call the stable_diffusion_image_generator plugin.", + }, + ], + modelConfig: { + model: "gpt-3.5-turbo", + temperature: 1, + top_p: 1, + max_tokens: 2000, + presence_penalty: 0, + frequency_penalty: 0, + sendMemory: false, + historyMessageCount: 0, + compressMessageLengthThreshold: 1000, + }, + lang: "cn", + builtin: false, + createdAt: 1697205441045, + usePlugins: true, + hideContext: true, + }, { avatar: "1f5bc-fe0f", name: "以文搜图", diff --git a/app/masks/en.ts b/app/masks/en.ts index ed130351f..fac348805 100644 --- a/app/masks/en.ts +++ b/app/masks/en.ts @@ -1,6 +1,35 @@ import { BuiltinMask } from "./typing"; export const EN_MASKS: BuiltinMask[] = [ + { + avatar: "1f3a8", + name: "Stable Diffusion", + context: [ + { + id: "SVx3ybvohJAKXDQ1KKQcs", + date: "", + role: "system", + content: + "Stable Diffusion is an AI art generation model similar to DALLE-2.\nHere are some prompts for generating art with Stable Diffusion.\n\nPrompt Example:\n\n- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting.\n- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth\n- pirate, deep focus, fantasy, matte, sharp focus\n- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful\n- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait\n- athena, greek goddess, claudia black, bronze greek armor, owl crown, d & d, fantasy, portrait, headshot, sharp focus\n- closeup portrait shot of a large strong female biomechanic woman in a scenic scifi environment, elegant, smooth, sharp focus, warframe\n- ultra realistic illustration of steve urkle as the hulk, elegant, smooth, sharp focus\n- portrait of beautiful happy young ana de armas, ethereal, realistic anime, clean lines, sharp lines, crisp lines, vibrant color scheme\n- A highly detailed and hyper realistic portrait of a gorgeous young ana de armas, lisa frank, butterflies, floral, sharp focus\n- lots of delicious tropical fruits with drops of moisture on table, floating colorful water, mysterious expression, in a modern and abstract setting, with bold and colorful abstract art, blurred background, bright lighting\n- 1girl, The most beautiful form of chaos, Fauvist design, Flowing colors, Vivid colors, dynamic angle, fantasy world\n- solo, sitting, close-up, girl in the hourglass, Sand is spilling out of the broken hourglass, flowing sand, huge hourglass art, hologram, particles, nebula, magic circle\n- geometric abstract background, 1girl, depth of field, zentangle, mandala, tangle, entangle, beautiful and aesthetic, dynamic angle, glowing skin, floating colorful sparkles the most beautiful form of chaos, elegant, a brutalist designed, vivid colours, romanticism\n\nFollow the structure of the example prompts. This means a very short description of the scene, followed by modifiers divided by commas to alter the mood, style, lighting, and more.\nIf the user input is in English, directly use the user input as a parameter to call the stable_diffusion_image_generator plugin. If the user input is not in English, generate an English prompt word based on the example and then call the stable_diffusion_image_generator plugin.", + }, + ], + modelConfig: { + model: "gpt-3.5-turbo", + temperature: 1, + top_p: 1, + max_tokens: 2000, + presence_penalty: 0, + frequency_penalty: 0, + sendMemory: false, + historyMessageCount: 0, + compressMessageLengthThreshold: 1000, + }, + lang: "en", + builtin: false, + createdAt: 1697205441045, + usePlugins: true, + hideContext: true, + }, { avatar: "1f47e", name: "GitHub Copilot", diff --git a/app/plugins/cn.ts b/app/plugins/cn.ts index 579027c53..201f71e95 100644 --- a/app/plugins/cn.ts +++ b/app/plugins/cn.ts @@ -48,4 +48,14 @@ export const CN_PLUGINS: BuiltinPlugin[] = [ createdAt: 1694703673000, enable: false, }, + { + name: "Stable Diffusion", + toolName: "stable_diffusion_image_generator", + lang: "cn", + description: + "Stable Diffusion 图像生成模型。使用本插件需要配置 Cloudflare R2 对象存储服务以及 stable-diffusion-webui 接口。", + builtin: true, + createdAt: 1688899480510, + enable: false, + }, ]; diff --git a/app/plugins/en.ts b/app/plugins/en.ts index 23bb803e9..af402ca9d 100644 --- a/app/plugins/en.ts +++ b/app/plugins/en.ts @@ -50,4 +50,14 @@ export const EN_PLUGINS: BuiltinPlugin[] = [ createdAt: 1694703673000, enable: false, }, + { + name: "Stable Diffusion", + toolName: "stable_diffusion_image_generator", + lang: "en", + description: + "Stable Diffusion text-to-image model. Using this plugin requires configuring Cloudflare R2 object storage service and stable-diffusion-webui API.", + builtin: true, + createdAt: 1688899480510, + enable: false, + }, ]; diff --git a/app/utils/r2_file_storage.ts b/app/utils/r2_file_storage.ts index e71df1c17..80d71d671 100644 --- a/app/utils/r2_file_storage.ts +++ b/app/utils/r2_file_storage.ts @@ -51,11 +51,16 @@ export default class S3FileStorage { console.log(signedUrl); - await fetch(signedUrl, { - method: "PUT", - body: data, - }); + try { + await fetch(signedUrl, { + method: "PUT", + body: data, + }); - return `/api/file/${fileName}`; + return `/api/file/${fileName}`; + } catch (e) { + console.error("[R2]", e); + throw e; + } } } diff --git a/docs/images/plugin/sd-plugin-example.png b/docs/images/plugin/sd-plugin-example.png new file mode 100644 index 000000000..1c0995565 Binary files /dev/null and b/docs/images/plugin/sd-plugin-example.png differ diff --git a/docs/images/plugin/sd-plugin-manager.png b/docs/images/plugin/sd-plugin-manager.png new file mode 100644 index 000000000..9d6a1bdcb Binary files /dev/null and b/docs/images/plugin/sd-plugin-manager.png differ diff --git a/docs/images/plugin/sd-plugin-mask.png b/docs/images/plugin/sd-plugin-mask.png new file mode 100644 index 000000000..17f0a689c Binary files /dev/null and b/docs/images/plugin/sd-plugin-mask.png differ diff --git a/docs/images/plugin/sd-web-ui.png b/docs/images/plugin/sd-web-ui.png new file mode 100644 index 000000000..b71498f0f Binary files /dev/null and b/docs/images/plugin/sd-web-ui.png differ diff --git a/docs/stable-diffusion-plugin-cn.md b/docs/stable-diffusion-plugin-cn.md new file mode 100644 index 000000000..d7515df4e --- /dev/null +++ b/docs/stable-diffusion-plugin-cn.md @@ -0,0 +1,79 @@ +# Stable Diffusion 插件配置指南 + +## 前置条件 + +1. 部署 [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 项目,并保证可以正常使用 (必须) + +2. 在 [Civitai](https://civitai.com/) 挑选喜欢的底座模型 (可选) + +3. 生成一张图片并记住相关的参数配置 (可选) + + ![sd-web-ui](./images/plugin/sd-web-ui.png) + +## 环境变量 + +- `STABLE_DIFFUSION_API_URL`(必填) + + stable-diffusion-webui 服务的 api 地址,示例:http://127.0.0.1:7860 + +- `STABLE_DIFFUSION_NEGATIVE_PROMPT`(可选) + + 反向提示词(Negative Prompt),默认值:`longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality` + +- `STABLE_DIFFUSION_STEPS`(可选) + + 采样迭代步数(Steps),默认值:`20` + +- `STABLE_DIFFUSION_CFG_SCALE`(可选) + + 提示词相关性(CFG Scale),默认值:`7` + +- `STABLE_DIFFUSION_WIDTH`(可选) + + 生成图像宽度,默认值:`720` + +- `STABLE_DIFFUSION_HEIGHT`(可选) + + 生成图像高度,默认值:`720` + +- `STABLE_DIFFUSION_SAMPLER_INDEX`(可选) + + 采样方法(Sampler),默认值:`Euler a` + +## 如何使用 + +由于 OpenAI 的函数描述输入字符数量有限,在描述中并不能很好的将 Stable Diffusion 的提示词规则告诉 GPT。 + +所以这里提供了一个 Stable Diffusion 面具用来间接告诉 GPT 该如何调用 Stable Diffusion 插件,详细的内容请查看该面具的提示内容,当前您也可以自行修改。 + +这里需要注意,R2 存储在中国网络环境下可能无法正常使用,请确保你的网络可以正常访问 R2 存储服务,否则将无法正常使用本插件。 + +1. 首先第一步根据上面的章节配置好插件的变量 + +2. 在插件中开启 StableDiffusion 插件 + + ![image-20231017123449909](./images/plugin/sd-plugin-manager.png) + +3. 在面具中找到 StableDiffusion 面具并进行对话 + + ![image-20231017123303383](./images/plugin/sd-plugin-mask.png) + +4. 使用愉快 + +## 示例 + +![image-20231017124240846](./images/plugin/sd-plugin-example.png) + +模型:[GhostMix - v2.0-BakedVAE | Stable Diffusion Checkpoint | Civitai](https://civitai.com/models/36520/ghostmix) + +环境变量: + +``` +STABLE_DIFFUSION_API_URL=http://127.0.0.1:7860 +STABLE_DIFFUSION_WIDTH=512 +STABLE_DIFFUSION_HEIGHT=768 +STABLE_DIFFUSION_NEGATIVE_PROMPT=(worst quality, low quality:2), monochrome, zombie,overexposure, watermark,text,bad anatomy,bad hand,extra hands,extra fingers,too many fingers,fused fingers,bad arm,distorted arm,extra arms,fused arms,extra legs,missing leg,disembodied leg,extra nipples, detached arm, liquid hand,inverted hand,disembodied limb, small breasts, loli, oversized head,extra body,completely nude, extra navel,easynegative,(hair between eyes),sketch, duplicate, ugly, huge eyes, text, logo, worst face, (bad and mutated hands:1.3), (blurry:2.0), horror, geometry, bad_prompt, (bad hands), (missing fingers), multiple limbs, bad anatomy, (interlocked fingers:1.2), Ugly Fingers, (extra digit and hands and fingers and legs and arms:1.4), ((2girl)), (deformed fingers:1.2), (long fingers:1.2),(bad-artist-anime), bad-artist, bad hand, extra legs ,(ng_deepnegative_v1_75t) +STABLE_DIFFUSION_STEPS=30 +STABLE_DIFFUSION_CFG_SCALE=6 +``` + diff --git a/yarn.lock b/yarn.lock index 56dd5190a..7257ad784 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2551,22 +2551,24 @@ integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*": - version "20.5.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.3.tgz#fa52c147f405d56b2f1dd8780d840aa87ddff629" - integrity sha512-ITI7rbWczR8a/S6qjAW7DMqxqFMjjTo61qZVWJ1ubPvbIQsL5D/TvwjYEalM8Kthpe3hTzOGrF2TGbAu2uyqeA== + version "20.8.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.5.tgz#13352ae1f80032171616910e8aba2e3e52e57d96" + integrity sha512-SPlobFgbidfIeOYlzXiEjSYeIJiOCthv+9tSQVpvk4PAdIIc+2SmjNVzWXk9t0Y7dl73Zdf+OgXKHX9XtkqUpw== + dependencies: + undici-types "~5.25.1" "@types/node@^18.11.18": - version "18.17.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.8.tgz#fd69eb04c25d50374245e8bd69ba29dd0eb7ff5e" - integrity sha512-Av/7MqX/iNKwT9Tr60V85NqMnsmh8ilfJoBlIVibkXfitk9Q22D9Y5mSpm+FvG5DET7EbVfB40bOiLzKgYFgPw== + version "18.18.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.5.tgz#afc0fd975df946d6e1add5bbf98264225b212244" + integrity sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A== "@types/node@^20.3.3": version "20.3.3" @@ -2632,9 +2634,9 @@ integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA== "@types/uuid@^9.0.1": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.2.tgz#ede1d1b1e451548d44919dc226253e32a6952c4b" - integrity sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ== + version "9.0.5" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.5.tgz#25a71eb73eba95ac0e559ff3dd018fc08294acf6" + integrity sha512-xfHdwa1FMJ082prjSJpoEI57GZITiQz10r3vEJCHa2khEFQjKy91aWKz6+zybzssCvXUwE1LQWgWVwZ4nYUvHQ== "@typescript-eslint/parser@^5.4.2 || ^6.0.0": version "6.4.0" @@ -4553,15 +4555,6 @@ form-data-encoder@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@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -5404,9 +5397,9 @@ langchainhub@~0.0.6: integrity sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w== langsmith@~0.0.31: - version "0.0.41" - resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.41.tgz#3cf5dc0b320748d8dfa65bcbec4a776d745b0003" - integrity sha512-QRJMrCg8IzQJmva+30SbbQznaX91R/5IIfNj0yy0EFhNzgEmJP+XYnTiS0Ph5Htv6Kb4mYhxP7x198ECupW98A== + version "0.0.42" + resolved "https://registry.yarnpkg.com/langsmith/-/langsmith-0.0.42.tgz#e20e3e261c87282ec5ba6342c1f4ee19f10b91a0" + integrity sha512-sFuN+e7E+pPBIRaRgFqZh/BRBWNHTZNAwi6uj4kydQawooCZYoJmM5snOkiQrhVSvAhgu6xFhLvmfvkPcKzD7w== dependencies: "@types/uuid" "^9.0.1" commander "^10.0.1" @@ -6216,9 +6209,9 @@ node-domexception@1.0.0, node-domexception@^1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7: - version "2.6.13" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.13.tgz#a20acbbec73c2e09f9007de5cda17104122e0010" - integrity sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA== + 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" @@ -6374,9 +6367,9 @@ open@^8.4.0: is-wsl "^2.2.0" openai@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.6.0.tgz#0335111cf71c608b68dbdca19f8ccbd9cfb0cd97" - integrity sha512-LuONkTgoe4D172raQCv+eEK5OdLGnY/M4JrUz/pxRGevZwqDqy3xhBbCeWX8QLCbFcnITYsu/VBJXZJ0rDAMpA== + version "4.12.1" + resolved "https://registry.yarnpkg.com/openai/-/openai-4.12.1.tgz#f1ef4283197cf2ef932abc55afeae8a2182d8fe6" + integrity sha512-EAoUwm4dtiWvFwBhOCK/VfF8sj1ZU8+aAIJnfT4NyeTfrt1DM/6Gdd6fOZWTjBYryTAqu9Vpb5+9Wu6JMtm/gA== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" @@ -7421,6 +7414,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.25.1: + version "5.25.3" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3" + integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA== + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -7560,9 +7558,9 @@ uuid@^8.3.2: integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== uvu@^0.5.0: version "0.5.6" @@ -7754,7 +7752,12 @@ yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yaml@^2.2.1, yaml@^2.2.2: +yaml@^2.2.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" + integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== + +yaml@^2.2.2: version "2.3.1" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== @@ -7775,9 +7778,9 @@ zod@3.21.4: integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== zod@^3.21.4: - version "3.22.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b" - integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg== + version "3.22.4" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" + integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== zustand@^4.3.8: version "4.3.8"