From ab07b4ac0b27ebb4f5be6de4d6c293a3e2b80ca2 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Tue, 28 May 2024 15:42:21 -0700 Subject: [PATCH 01/10] infra[patch]: Improve yarn format (#5578) * infra[patch]: Improve yarn format * chore: lint files * cr --- docs/core_docs/package.json | 2 +- .../.eslintrc.cjs | 1 + libs/create-langchain-integration/.prettierrc | 19 +++++++++++++++++++ .../helpers/git.ts | 16 ++++++++++++---- .../helpers/is-url.ts | 4 ++-- .../helpers/templates.ts | 2 +- .../create-langchain-integration/package.json | 14 ++++++++++++-- package.json | 8 ++++---- yarn.lock | 11 +++++++++-- 9 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 libs/create-langchain-integration/.prettierrc diff --git a/docs/core_docs/package.json b/docs/core_docs/package.json index fed7f9f20dea..3aa329c28673 100644 --- a/docs/core_docs/package.json +++ b/docs/core_docs/package.json @@ -64,7 +64,7 @@ "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", "glob": "^10.3.10", - "prettier": "^2.7.1", + "prettier": "^2.8.3", "rimraf": "^5.0.1", "supabase": "^1.148.6", "swc-loader": "^0.2.3", diff --git a/libs/create-langchain-integration/.eslintrc.cjs b/libs/create-langchain-integration/.eslintrc.cjs index b50f0621e268..f05896865da6 100644 --- a/libs/create-langchain-integration/.eslintrc.cjs +++ b/libs/create-langchain-integration/.eslintrc.cjs @@ -29,6 +29,7 @@ module.exports = { "no-process-env": 2, "no-instanceof/no-instanceof": 2, "@typescript-eslint/explicit-module-boundary-types": 0, + "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-shadow": 0, "@typescript-eslint/no-empty-interface": 0, diff --git a/libs/create-langchain-integration/.prettierrc b/libs/create-langchain-integration/.prettierrc new file mode 100644 index 000000000000..ba08ff04f677 --- /dev/null +++ b/libs/create-langchain-integration/.prettierrc @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "trailingComma": "es5", + "bracketSpacing": true, + "arrowParens": "always", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "endOfLine": "lf" +} diff --git a/libs/create-langchain-integration/helpers/git.ts b/libs/create-langchain-integration/helpers/git.ts index 416b381402ec..c0bafedb13f2 100644 --- a/libs/create-langchain-integration/helpers/git.ts +++ b/libs/create-langchain-integration/helpers/git.ts @@ -7,7 +7,9 @@ function isInGitRepository(): boolean { try { execSync("git rev-parse --is-inside-work-tree", { stdio: "ignore" }); return true; - } catch (_) {} + } catch (_) { + // no-op + } return false; } @@ -15,7 +17,9 @@ function isInMercurialRepository(): boolean { try { execSync("hg --cwd . root", { stdio: "ignore" }); return true; - } catch (_) {} + } catch (_) { + // no-op + } return false; } @@ -23,7 +27,9 @@ function isDefaultBranchSet(): boolean { try { execSync("git config init.defaultBranch", { stdio: "ignore" }); return true; - } catch (_) {} + } catch (_) { + // no-op + } return false; } @@ -54,7 +60,9 @@ export function tryGitInit(root: string): boolean { if (didInit) { try { fs.rmSync(path.join(root, ".git"), { recursive: true, force: true }); - } catch (_) {} + } catch (_) { + // no-op + } } return false; } diff --git a/libs/create-langchain-integration/helpers/is-url.ts b/libs/create-langchain-integration/helpers/is-url.ts index eb87b975252f..a84d26cf274b 100644 --- a/libs/create-langchain-integration/helpers/is-url.ts +++ b/libs/create-langchain-integration/helpers/is-url.ts @@ -1,7 +1,7 @@ export function isUrl(url: string): boolean { try { - new URL(url); - return true; + const newUrl = new URL(url); + return Boolean(newUrl); } catch (error) { return false; } diff --git a/libs/create-langchain-integration/helpers/templates.ts b/libs/create-langchain-integration/helpers/templates.ts index 2a3d0f8603f2..ce821f9f878f 100644 --- a/libs/create-langchain-integration/helpers/templates.ts +++ b/libs/create-langchain-integration/helpers/templates.ts @@ -2,7 +2,7 @@ import path from "path"; import fs from "fs/promises"; import os from "os"; -import { copy } from "./copy"; +import { copy } from "./copy.js"; /** * Install a internal template to a given `root` directory. diff --git a/libs/create-langchain-integration/package.json b/libs/create-langchain-integration/package.json index 431c608caf85..c8b3e57b2458 100644 --- a/libs/create-langchain-integration/package.json +++ b/libs/create-langchain-integration/package.json @@ -10,8 +10,11 @@ "scripts": { "dev": "ncc build ./index.ts -w -o dist/", "build": "ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register && cp ./template/.eslintrc.cjs ./template/.prettierrc ./template/.release-it.json ./dist/template", - "format": "prettier --write \"./\"", - "format:check": "prettier --check \"./\"" + "format": "prettier --config .prettierrc --write \"./helpers\"", + "format:check": "prettier --config .prettierrc --check \"./helpers\"", + "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js ./helpers", + "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js ./helpers", + "lint:fix": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --fix --ext .ts,.js ./helpers" }, "devDependencies": { "@types/prompts": "^2", @@ -20,6 +23,13 @@ "commander": "^2.20.0", "conf": "^10.2.0", "dotenv": "^16.3.1", + "eslint": "^8.33.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jest": "^27.6.0", + "eslint-plugin-no-instanceof": "^1.0.1", + "eslint-plugin-prettier": "^4.2.1", "fast-glob": "^3.3.2", "picocolors": "^1.0.0", "prettier": "^2.8.3", diff --git a/package.json b/package.json index 6f2fd9aab079..82c1d5abb96b 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,10 @@ "build": "turbo build --filter=\"!test-exports-*\"", "turbo:command": "turbo", "clean": "turbo clean", - "format": "turbo format", - "format:check": "turbo format:check", - "lint": "turbo lint", - "lint:fix": "turbo lint:fix", + "format": "turbo format --concurrency=50", + "format:check": "turbo format:check --concurrency=50", + "lint": "turbo lint --concurrency=50", + "lint:fix": "turbo lint:fix --concurrency=50", "test": "yarn test:unit && yarn test:exports:docker", "test:unit": "turbo test --filter=\"!test-exports-*\" --filter=!examples --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration", "test:unit:ci": "turbo test:ci", diff --git a/yarn.lock b/yarn.lock index 9afdba4f4310..dbc8d35a0e6f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19330,7 +19330,7 @@ __metadata: isomorphic-dompurify: ^2.9.0 json-loader: ^0.5.7 marked: ^12.0.2 - prettier: ^2.7.1 + prettier: ^2.8.3 process: ^0.11.10 react: ^17.0.2 react-dom: ^17.0.2 @@ -19468,6 +19468,13 @@ __metadata: commander: ^2.20.0 conf: ^10.2.0 dotenv: ^16.3.1 + eslint: ^8.33.0 + eslint-config-airbnb-base: ^15.0.0 + eslint-config-prettier: ^8.6.0 + eslint-plugin-import: ^2.27.5 + eslint-plugin-jest: ^27.6.0 + eslint-plugin-no-instanceof: ^1.0.1 + eslint-plugin-prettier: ^4.2.1 fast-glob: ^3.3.2 picocolors: ^1.0.0 prettier: ^2.8.3 @@ -31849,7 +31856,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.6.2, prettier@npm:^2.7.1": +"prettier@npm:^2.6.2": version: 2.8.8 resolution: "prettier@npm:2.8.8" bin: From c3ce775dc6597b471b2e6ad8a8dac004a7c44426 Mon Sep 17 00:00:00 2001 From: LukeCali-949 <76727497+LukeCali-949@users.noreply.github.com> Date: Tue, 28 May 2024 18:29:14 -0500 Subject: [PATCH 02/10] Fixed Typo on Build Simple LLM application page (#5566) typo --- docs/core_docs/docs/tutorials/llm_chain.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core_docs/docs/tutorials/llm_chain.ipynb b/docs/core_docs/docs/tutorials/llm_chain.ipynb index 0573af656bb8..fe7534afd0ce 100644 --- a/docs/core_docs/docs/tutorials/llm_chain.ipynb +++ b/docs/core_docs/docs/tutorials/llm_chain.ipynb @@ -312,7 +312,7 @@ "id": "fedf6f13", "metadata": {}, "source": [ - "Next, we can create the PromptTemplate. This will be a combination of the `systemTemplate` as well as a simpler template for where the put the text" + "Next, we can create the PromptTemplate. This will be a combination of the `systemTemplate` as well as a simpler template for where to put the text" ] }, { From 4b4f611b6365b931003706b160890cc7d6b8d300 Mon Sep 17 00:00:00 2001 From: Allen Firstenberg Date: Tue, 28 May 2024 19:49:46 -0400 Subject: [PATCH 03/10] google-common [patch], google-* [tests]: Fix streaming false (#5571) * Fix for issue #5475 - no tools_call in message. Natively support non-streaming mode. * Test for structuredOutput (see #5475). Fixes for other tests. * Fixes for tests. * Formatting. --- .../langchain-google-common/src/connection.ts | 3 +- .../src/tests/chat_models.int.test.ts | 18 +++++-- .../src/tests/chat_models.int.test.ts | 48 +++++++++++++++++-- .../src/tests/chat_models.int.test.ts | 21 ++++++-- 4 files changed, 76 insertions(+), 14 deletions(-) diff --git a/libs/langchain-google-common/src/connection.ts b/libs/langchain-google-common/src/connection.ts index a5abcb5b322d..212bfa886b8f 100644 --- a/libs/langchain-google-common/src/connection.ts +++ b/libs/langchain-google-common/src/connection.ts @@ -254,8 +254,7 @@ export abstract class AbstractGoogleLLMConnection< AuthOptions > { async buildUrlMethodGemini(): Promise { - // Vertex AI only handles streamedGenerateContent - return "streamGenerateContent"; + return this.streaming ? "streamGenerateContent" : "generateContent"; } async buildUrlMethod(): Promise { diff --git a/libs/langchain-google-gauth/src/tests/chat_models.int.test.ts b/libs/langchain-google-gauth/src/tests/chat_models.int.test.ts index 3cd874afce83..83146ac72e00 100644 --- a/libs/langchain-google-gauth/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-gauth/src/tests/chat_models.int.test.ts @@ -8,7 +8,7 @@ import { BaseMessageChunk, BaseMessageLike, HumanMessage, - MessageContentComplex, + // MessageContentComplex, SystemMessage, ToolMessage, } from "@langchain/core/messages"; @@ -31,12 +31,22 @@ describe("GAuth Chat", () => { const aiMessage = res as AIMessageChunk; expect(aiMessage.content).toBeDefined(); + + expect(typeof aiMessage.content).toBe("string"); + const text = aiMessage.content as string; + expect(text).toMatch(/(1 + 1 (equals|is|=) )?2.? ?/); + + /* expect(aiMessage.content.length).toBeGreaterThan(0); expect(aiMessage.content[0]).toBeDefined(); - const content = aiMessage.content[0] as MessageContentComplex; - expect(typeof content).toBe("string"); - expect(content).toBe("2"); + expect(content).toHaveProperty("type"); + expect(content.type).toEqual("text"); + + const textContent = content as MessageContentText; + expect(textContent.text).toBeDefined(); + expect(textContent.text).toEqual("2"); + */ } catch (e) { console.error(e); throw e; diff --git a/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts b/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts index 1218565bb046..0f43cadc95aa 100644 --- a/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts @@ -1,4 +1,6 @@ import { test } from "@jest/globals"; +// eslint-disable-next-line import/no-extraneous-dependencies +import { z } from "zod"; import { BaseLanguageModelInput } from "@langchain/core/language_models/base"; import { ChatPromptValue } from "@langchain/core/prompt_values"; import { @@ -7,10 +9,11 @@ import { BaseMessage, BaseMessageChunk, HumanMessage, - MessageContentComplex, - MessageContentText, + // MessageContentComplex, + // MessageContentText, SystemMessage, } from "@langchain/core/messages"; +import { ConsoleCallbackHandler } from "@langchain/core/tracers/console"; import { ChatVertexAI } from "../chat_models.js"; import { VertexAI } from "../llms.js"; @@ -29,9 +32,14 @@ describe("GAuth Chat", () => { const aiMessage = res as AIMessageChunk; expect(aiMessage.content).toBeDefined(); + + expect(typeof aiMessage.content).toBe("string"); + const text = aiMessage.content as string; + expect(text).toMatch(/(1 + 1 (equals|is|=) )?2.? ?/); + + /* expect(aiMessage.content.length).toBeGreaterThan(0); expect(aiMessage.content[0]).toBeDefined(); - const content = aiMessage.content[0] as MessageContentComplex; expect(content).toHaveProperty("type"); expect(content.type).toEqual("text"); @@ -39,6 +47,7 @@ describe("GAuth Chat", () => { const textContent = content as MessageContentText; expect(textContent.text).toBeDefined(); expect(textContent.text).toEqual("2"); + */ } catch (e) { console.error(e); throw e; @@ -62,6 +71,12 @@ describe("GAuth Chat", () => { const aiMessage = res as AIMessageChunk; expect(aiMessage.content).toBeDefined(); + + expect(typeof aiMessage.content).toBe("string"); + const text = aiMessage.content as string; + expect(["H", "T"]).toContainEqual(text); + + /* expect(aiMessage.content.length).toBeGreaterThan(0); expect(aiMessage.content[0]).toBeDefined(); @@ -72,6 +87,7 @@ describe("GAuth Chat", () => { const textContent = content as MessageContentText; expect(textContent.text).toBeDefined(); expect(["H", "T"]).toContainEqual(textContent.text); + */ } catch (e) { console.error(e); throw e; @@ -109,4 +125,30 @@ describe("GAuth Chat", () => { throw e; } }); + + test("structuredOutput", async () => { + const handler = new ConsoleCallbackHandler(); + + const calculatorSchema = z.object({ + operation: z + .enum(["add", "subtract", "multiply", "divide"]) + .describe("The type of operation to execute"), + number1: z.number().describe("The first number to operate on."), + number2: z.number().describe("The second number to operate on."), + }); + + const model = new ChatVertexAI({ + temperature: 0.7, + model: "gemini-1.0-pro", + callbacks: [handler], + }).withStructuredOutput(calculatorSchema); + + const response = await model.invoke("What is 1628253239 times 81623836?"); + expect(response).toHaveProperty("operation"); + expect(response.operation).toEqual("multiply"); + expect(response).toHaveProperty("number1"); + expect(response.number1).toEqual(1628253239); + expect(response).toHaveProperty("number2"); + expect(response.number2).toEqual(81623836); + }); }); diff --git a/libs/langchain-google-webauth/src/tests/chat_models.int.test.ts b/libs/langchain-google-webauth/src/tests/chat_models.int.test.ts index 01af8639f2cd..fac8c6fed811 100644 --- a/libs/langchain-google-webauth/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-webauth/src/tests/chat_models.int.test.ts @@ -6,8 +6,8 @@ import { BaseMessageChunk, BaseMessageLike, HumanMessage, - MessageContentComplex, - MessageContentText, + // MessageContentComplex, + // MessageContentText, SystemMessage, ToolMessage, } from "@langchain/core/messages"; @@ -253,9 +253,14 @@ describe("Google Webauth Chat", () => { const aiMessage = res as AIMessageChunk; expect(aiMessage.content).toBeDefined(); + + expect(typeof aiMessage.content).toBe("string"); + const text = aiMessage.content as string; + expect(text).toMatch(/(1 + 1 (equals|is|=) )?2.? ?/); + + /* expect(aiMessage.content.length).toBeGreaterThan(0); expect(aiMessage.content[0]).toBeDefined(); - const content = aiMessage.content[0] as MessageContentComplex; expect(content).toHaveProperty("type"); expect(content.type).toEqual("text"); @@ -263,6 +268,7 @@ describe("Google Webauth Chat", () => { const textContent = content as MessageContentText; expect(textContent.text).toBeDefined(); expect(textContent.text).toEqual("2"); + */ } catch (e) { console.error(e); throw e; @@ -286,6 +292,12 @@ describe("Google Webauth Chat", () => { const aiMessage = res as AIMessageChunk; expect(aiMessage.content).toBeDefined(); + + expect(typeof aiMessage.content).toBe("string"); + const text = aiMessage.content as string; + expect(["H", "T"]).toContainEqual(text); + + /* expect(aiMessage.content.length).toBeGreaterThan(0); expect(aiMessage.content[0]).toBeDefined(); @@ -296,6 +308,7 @@ describe("Google Webauth Chat", () => { const textContent = content as MessageContentText; expect(textContent.text).toBeDefined(); expect(["H", "T"]).toContainEqual(textContent.text); + */ } catch (e) { console.error(e); throw e; @@ -361,8 +374,6 @@ describe("Google Webauth Chat", () => { }); const result = await model.invoke("Run a test on the cobalt project"); expect(result).toHaveProperty("content"); - expect(Array.isArray(result.content)).toBeTruthy(); - expect(result.content).toHaveLength(0); const args = result?.lc_kwargs?.additional_kwargs; expect(args).toBeDefined(); expect(args).toHaveProperty("tool_calls"); From a320c933e6fba69d724f666549405114d194986e Mon Sep 17 00:00:00 2001 From: Crazy Urus Date: Wed, 29 May 2024 08:09:31 +0800 Subject: [PATCH 04/10] fix: moonshot did not return usage cause error (#5551) --- libs/langchain-community/src/chat_models/moonshot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain-community/src/chat_models/moonshot.ts b/libs/langchain-community/src/chat_models/moonshot.ts index 1ad88ae2d90d..1fb032f2c4ab 100644 --- a/libs/langchain-community/src/chat_models/moonshot.ts +++ b/libs/langchain-community/src/chat_models/moonshot.ts @@ -355,7 +355,7 @@ export class ChatMoonshot extends BaseChatModel implements ChatMoonshotParams { prompt_tokens = 0, completion_tokens = 0, total_tokens = 0, - } = data.usage; + } = data.usage ?? {}; const { text } = data.output; From 3747819c2ff3c79e5e777596f9025e7362b4427c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Fern=C3=A1ndez?= Date: Wed, 29 May 2024 02:12:30 +0200 Subject: [PATCH 05/10] google-common[patch]: Zod to Gemini params conversion when the schema contains arrays of items (#5553) * Fix: [libs/langchain-google-common] already existing utils test * Fix: [lib/langchain-google-common] Add failing test for arrays containing additional properties * Fix: [lib/langchain-google-common] Fix failing test * Update int test * lint --------- Co-authored-by: jacoblee93 --- .../src/tests/utils.test.ts | 37 ++++++++++++++++++- libs/langchain-google-common/src/types.ts | 1 + .../src/utils/zod_to_gemini_parameters.ts | 3 ++ .../src/tests/chat_models.int.test.ts | 8 ++-- 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/libs/langchain-google-common/src/tests/utils.test.ts b/libs/langchain-google-common/src/tests/utils.test.ts index b2d6bcf0b56f..84f12dca4dd0 100644 --- a/libs/langchain-google-common/src/tests/utils.test.ts +++ b/libs/langchain-google-common/src/tests/utils.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { expect, test } from "@jest/globals"; import { z } from "zod"; import { zodToGeminiParameters } from "../utils/zod_to_gemini_parameters.js"; @@ -18,7 +19,7 @@ test("zodToGeminiParameters can convert zod schema to gemini schema", () => { expect(convertedSchema.type).toBe("object"); expect(convertedSchema.description).toBe("A simple calculator tool"); - expect(convertedSchema).not.toContain("additionalProperties"); + expect((convertedSchema as any).additionalProperties).toBeUndefined(); expect(convertedSchema.properties).toEqual({ operation: { type: "string", @@ -45,3 +46,37 @@ test("zodToGeminiParameters can convert zod schema to gemini schema", () => { "childObject", ]); }); + +test("zodToGeminiParameters removes additional properties from arrays", () => { + const zodSchema = z + .object({ + people: z + .object({ + name: z.string().describe("The name of a person"), + }) + .array() + .describe("person elements"), + }) + .describe("A list of people"); + + const convertedSchema = zodToGeminiParameters(zodSchema); + expect(convertedSchema.type).toBe("object"); + expect(convertedSchema.description).toBe("A list of people"); + expect((convertedSchema as any).additionalProperties).toBeUndefined(); + + const peopleSchema = convertedSchema?.properties?.people; + expect(peopleSchema).not.toBeUndefined(); + + if (peopleSchema !== undefined) { + expect(peopleSchema.type).toBe("array"); + expect((peopleSchema as any).additionalProperties).toBeUndefined(); + expect(peopleSchema.description).toBe("person elements"); + } + + const arrayItemsSchema = peopleSchema?.items; + expect(arrayItemsSchema).not.toBeUndefined(); + if (arrayItemsSchema !== undefined) { + expect(arrayItemsSchema.type).toBe("object"); + expect((arrayItemsSchema as any).additionalProperties).toBeUndefined(); + } +}); diff --git a/libs/langchain-google-common/src/types.ts b/libs/langchain-google-common/src/types.ts index 3c10ee4fd41a..896db07e2757 100644 --- a/libs/langchain-google-common/src/types.ts +++ b/libs/langchain-google-common/src/types.ts @@ -295,6 +295,7 @@ export type GeminiJsonSchema = Record & { }; export interface GeminiJsonSchemaDirty extends GeminiJsonSchema { + items?: GeminiJsonSchemaDirty; properties?: Record; additionalProperties?: boolean; } diff --git a/libs/langchain-google-common/src/utils/zod_to_gemini_parameters.ts b/libs/langchain-google-common/src/utils/zod_to_gemini_parameters.ts index d8dc969c0c4b..039d4e0d7ea9 100644 --- a/libs/langchain-google-common/src/utils/zod_to_gemini_parameters.ts +++ b/libs/langchain-google-common/src/utils/zod_to_gemini_parameters.ts @@ -19,6 +19,9 @@ function removeAdditionalProperties( const keys = Object.keys(updatedSchema.properties); removeProperties(updatedSchema.properties, keys, 0); } + if (Object.hasOwn(updatedSchema, "items") && updatedSchema.items) { + updatedSchema.items = removeAdditionalProperties(updatedSchema.items); + } return updatedSchema; } diff --git a/libs/langchain-google-vertexai-web/src/tests/chat_models.int.test.ts b/libs/langchain-google-vertexai-web/src/tests/chat_models.int.test.ts index a9a870ebacb9..e737d61d0bdf 100644 --- a/libs/langchain-google-vertexai-web/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-vertexai-web/src/tests/chat_models.int.test.ts @@ -18,7 +18,9 @@ import { ChatVertexAI } from "../chat_models.js"; class WeatherTool extends StructuredTool { schema = z.object({ - location: z.string().describe("The name of city to get the weather for."), + locations: z + .array(z.object({ name: z.string() })) + .describe("The name of cities to get the weather for."), }); description = @@ -28,7 +30,7 @@ class WeatherTool extends StructuredTool { async _call(input: z.infer) { console.log(`WeatherTool called with input: ${input}`); - return `The weather in ${input.location} is 25°C`; + return `The weather in ${JSON.stringify(input.locations)} is 25°C`; } } @@ -128,7 +130,7 @@ describe("Google APIKey Chat", () => { test("Tool call", async () => { const chat = new ChatVertexAI().bindTools([new WeatherTool()]); - const res = await chat.invoke("What is the weather in SF"); + const res = await chat.invoke("What is the weather in SF and LA"); console.log(res); expect(res.tool_calls?.length).toEqual(1); expect(res.tool_calls?.[0].args).toEqual( From 402d73537fa113d688333261558e3b75d0b3033d Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Tue, 28 May 2024 17:15:07 -0700 Subject: [PATCH 06/10] google-common[patch]: Release 0.0.17 (#5588) --- libs/langchain-google-common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain-google-common/package.json b/libs/langchain-google-common/package.json index d8c2c1ae9d90..010c12f27706 100644 --- a/libs/langchain-google-common/package.json +++ b/libs/langchain-google-common/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/google-common", - "version": "0.0.16", + "version": "0.0.17", "description": "Core types and classes for Google services.", "type": "module", "engines": { From 4ab397c3f61b5f8d55eed88bea628c3a7914504f Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Tue, 28 May 2024 17:19:51 -0700 Subject: [PATCH 07/10] google-*[patch]: Release 0.0.17 (#5589) --- libs/langchain-google-gauth/package.json | 4 ++-- libs/langchain-google-vertexai-web/package.json | 4 ++-- libs/langchain-google-vertexai/package.json | 4 ++-- libs/langchain-google-webauth/package.json | 4 ++-- yarn.lock | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libs/langchain-google-gauth/package.json b/libs/langchain-google-gauth/package.json index 6eda3cb5da18..57b9db09a991 100644 --- a/libs/langchain-google-gauth/package.json +++ b/libs/langchain-google-gauth/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/google-gauth", - "version": "0.0.16", + "version": "0.0.17", "description": "Google auth based authentication support for Google services", "type": "module", "engines": { @@ -41,7 +41,7 @@ "license": "MIT", "dependencies": { "@langchain/core": ">0.1.56 <0.3.0", - "@langchain/google-common": "~0.0.15", + "@langchain/google-common": "~0.0.17", "google-auth-library": "^8.9.0" }, "devDependencies": { diff --git a/libs/langchain-google-vertexai-web/package.json b/libs/langchain-google-vertexai-web/package.json index 2f354049df79..e9fbc31eb2d6 100644 --- a/libs/langchain-google-vertexai-web/package.json +++ b/libs/langchain-google-vertexai-web/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/google-vertexai-web", - "version": "0.0.15", + "version": "0.0.17", "description": "LangChain.js support for Google Vertex AI Web", "type": "module", "engines": { @@ -41,7 +41,7 @@ "license": "MIT", "dependencies": { "@langchain/core": ">0.1.56 <0.3.0", - "@langchain/google-webauth": "~0.0.15" + "@langchain/google-webauth": "~0.0.17" }, "devDependencies": { "@jest/globals": "^29.5.0", diff --git a/libs/langchain-google-vertexai/package.json b/libs/langchain-google-vertexai/package.json index 739d397557f3..ecfb06fdd0d5 100644 --- a/libs/langchain-google-vertexai/package.json +++ b/libs/langchain-google-vertexai/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/google-vertexai", - "version": "0.0.16", + "version": "0.0.17", "description": "LangChain.js support for Google Vertex AI", "type": "module", "engines": { @@ -41,7 +41,7 @@ "license": "MIT", "dependencies": { "@langchain/core": ">0.1.56 <0.3.0", - "@langchain/google-gauth": "~0.0.16" + "@langchain/google-gauth": "~0.0.17" }, "devDependencies": { "@jest/globals": "^29.5.0", diff --git a/libs/langchain-google-webauth/package.json b/libs/langchain-google-webauth/package.json index 48a16aeaa543..360b34bc224b 100644 --- a/libs/langchain-google-webauth/package.json +++ b/libs/langchain-google-webauth/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/google-webauth", - "version": "0.0.15", + "version": "0.0.17", "description": "Web-based authentication support for Google services", "type": "module", "engines": { @@ -41,7 +41,7 @@ "license": "MIT", "dependencies": { "@langchain/core": ">0.1.56 <0.3.0", - "@langchain/google-common": "~0.0.15", + "@langchain/google-common": "~0.0.17", "web-auth-library": "^1.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index dbc8d35a0e6f..70619a0649d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9669,7 +9669,7 @@ __metadata: languageName: unknown linkType: soft -"@langchain/google-common@workspace:*, @langchain/google-common@workspace:libs/langchain-google-common, @langchain/google-common@~0.0.15": +"@langchain/google-common@workspace:*, @langchain/google-common@workspace:libs/langchain-google-common, @langchain/google-common@~0.0.17": version: 0.0.0-use.local resolution: "@langchain/google-common@workspace:libs/langchain-google-common" dependencies: @@ -9702,13 +9702,13 @@ __metadata: languageName: unknown linkType: soft -"@langchain/google-gauth@workspace:libs/langchain-google-gauth, @langchain/google-gauth@~0.0.16": +"@langchain/google-gauth@workspace:libs/langchain-google-gauth, @langchain/google-gauth@~0.0.17": version: 0.0.0-use.local resolution: "@langchain/google-gauth@workspace:libs/langchain-google-gauth" dependencies: "@jest/globals": ^29.5.0 "@langchain/core": ">0.1.56 <0.3.0" - "@langchain/google-common": ~0.0.15 + "@langchain/google-common": ~0.0.17 "@langchain/scripts": ~0.0.14 "@swc/core": ^1.3.90 "@swc/jest": ^0.2.29 @@ -9775,7 +9775,7 @@ __metadata: dependencies: "@jest/globals": ^29.5.0 "@langchain/core": ">0.1.56 <0.3.0" - "@langchain/google-webauth": ~0.0.15 + "@langchain/google-webauth": ~0.0.17 "@langchain/scripts": ~0.0.14 "@swc/core": ^1.3.90 "@swc/jest": ^0.2.29 @@ -9807,7 +9807,7 @@ __metadata: dependencies: "@jest/globals": ^29.5.0 "@langchain/core": ">0.1.56 <0.3.0" - "@langchain/google-gauth": ~0.0.16 + "@langchain/google-gauth": ~0.0.17 "@langchain/scripts": ~0.0.14 "@swc/core": ^1.3.90 "@swc/jest": ^0.2.29 @@ -9832,13 +9832,13 @@ __metadata: languageName: unknown linkType: soft -"@langchain/google-webauth@workspace:libs/langchain-google-webauth, @langchain/google-webauth@~0.0.15": +"@langchain/google-webauth@workspace:libs/langchain-google-webauth, @langchain/google-webauth@~0.0.17": version: 0.0.0-use.local resolution: "@langchain/google-webauth@workspace:libs/langchain-google-webauth" dependencies: "@jest/globals": ^29.5.0 "@langchain/core": ">0.1.56 <0.3.0" - "@langchain/google-common": ~0.0.15 + "@langchain/google-common": ~0.0.17 "@langchain/scripts": ~0.0.14 "@swc/core": ^1.3.90 "@swc/jest": ^0.2.29 From 079931ff8e62ddbb3e7ab86f642fc549a16960b6 Mon Sep 17 00:00:00 2001 From: Darren Govoni Date: Tue, 28 May 2024 20:25:02 -0400 Subject: [PATCH 08/10] langchain[patch]: Support for sqljs (#5560) * Support for sqljs Added support for sqljs, the browser transpile of sqlite * Format --------- Co-authored-by: jacoblee93 --- langchain/src/util/sql_utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langchain/src/util/sql_utils.ts b/langchain/src/util/sql_utils.ts index 39e73d036aaa..f08dc9a47048 100644 --- a/langchain/src/util/sql_utils.ts +++ b/langchain/src/util/sql_utils.ts @@ -139,7 +139,10 @@ export const getTableAndColumnsName = async ( return formatToSqlTable(rep); } - if (appDataSource.options.type === "sqlite") { + if ( + appDataSource.options.type === "sqlite" || + appDataSource.options.type === "sqljs" + ) { sql = "SELECT \n" + " m.name AS table_name,\n" + From ff47bd284de8cb9d47ac6b0712275578fbb2fdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= <88107904+fahreddinozcan@users.noreply.github.com> Date: Wed, 29 May 2024 02:26:12 +0200 Subject: [PATCH 09/10] community[patch]: Upstash Vector Store Namespace Feature (#5557) * feat: Upstash Vector Namespace feature * add: Upstash Vector Namespace Tests * docs: Upstash Vector namespace * fmt --- .../integrations/vectorstores/upstash.mdx | 7 ++ examples/package.json | 2 +- .../vector_stores/upstash/namespaces.ts | 50 ++++++++ libs/langchain-community/package.json | 4 +- .../vectorstores/tests/upstash.int.test.ts | 114 ++++++++++++++++++ .../src/vectorstores/upstash.ts | 24 ++-- yarn.lock | 14 +-- 7 files changed, 198 insertions(+), 17 deletions(-) create mode 100644 examples/src/indexes/vector_stores/upstash/namespaces.ts diff --git a/docs/core_docs/docs/integrations/vectorstores/upstash.mdx b/docs/core_docs/docs/integrations/vectorstores/upstash.mdx index 9f42a68713df..878209f30e54 100644 --- a/docs/core_docs/docs/integrations/vectorstores/upstash.mdx +++ b/docs/core_docs/docs/integrations/vectorstores/upstash.mdx @@ -3,6 +3,7 @@ import CreateClientExample from "@examples/indexes/vector_stores/upstash/create_ import IndexQueryExample from "@examples/indexes/vector_stores/upstash/index_and_query_docs.ts"; import DeleteExample from "@examples/indexes/vector_stores/upstash/delete_docs.ts"; import UpstashEmbeddingsExample from "@examples/indexes/vector_stores/upstash/upstash_embeddings.ts"; +import NamespaceExample from "@examples/indexes/vector_stores/upstash/namespaces.ts"; import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; # Upstash Vector @@ -42,6 +43,12 @@ You can index the LangChain documents with any model of your choice, and perform {IndexQueryExample} +## Namespaces + +You can use namespaces to partition your data in the index. Namespaces are useful when you want to query over huge amount of data, and you want to partition the data to make the queries faster. When you use namespaces, there won't be post-filtering on the results which will make the query results more precise. + +{NamespaceExample} + ## Upstash embeddings It's possible to use the embeddings service of Upstash, which is based on the embedding model of choice when creating the vector database. You don't need to create the embeddings manually, as the Upstash Vector service will handle this for you. diff --git a/examples/package.json b/examples/package.json index 8bcdc09fa375..c95c98fa8c93 100644 --- a/examples/package.json +++ b/examples/package.json @@ -67,7 +67,7 @@ "@supabase/supabase-js": "^2.10.0", "@tensorflow/tfjs-backend-cpu": "^4.4.0", "@upstash/redis": "^1.20.6", - "@upstash/vector": "^1.0.7", + "@upstash/vector": "^1.1.1", "@vercel/kv": "^0.2.3", "@xata.io/client": "^0.28.0", "@zilliz/milvus2-sdk-node": "^2.2.7", diff --git a/examples/src/indexes/vector_stores/upstash/namespaces.ts b/examples/src/indexes/vector_stores/upstash/namespaces.ts new file mode 100644 index 000000000000..ef20fb5bd893 --- /dev/null +++ b/examples/src/indexes/vector_stores/upstash/namespaces.ts @@ -0,0 +1,50 @@ +import { Index } from "@upstash/vector"; +import { OpenAIEmbeddings } from "@langchain/openai"; +import { Document } from "@langchain/core/documents"; +import { UpstashVectorStore } from "@langchain/community/vectorstores/upstash"; + +const index = new Index({ + url: process.env.UPSTASH_VECTOR_REST_URL as string, + token: process.env.UPSTASH_VECTOR_REST_TOKEN as string, +}); + +const embeddings = new OpenAIEmbeddings({}); + +const UpstashVector = new UpstashVectorStore(embeddings, { + index, + namespace: "test-namespace", +}); + +// Creating the docs to be indexed. +const id = new Date().getTime(); +const documents = [ + new Document({ + metadata: { name: id }, + pageContent: "Vector databases are great!", + }), +]; + +// Creating embeddings from the provided documents, and adding them to target namespace in Upstash Vector database. +await UpstashVector.addDocuments(documents); + +// Waiting vectors to be indexed in the vector store. +// eslint-disable-next-line no-promise-executor-return +await new Promise((resolve) => setTimeout(resolve, 1000)); + +const queryResult = await UpstashVector.similaritySearchWithScore( + "Vector database", + 1 +); + +console.log(queryResult); +/** +[ + [ + Document { + pageContent: 'Vector databases are great!', + metadata: [Object] + }, + 0.9016147 + ], +] + */ diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index e0a0f940e0c1..7c6d7e8d67b1 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -127,7 +127,7 @@ "@typescript-eslint/parser": "^5.58.0", "@upstash/ratelimit": "^1.1.3", "@upstash/redis": "^1.20.6", - "@upstash/vector": "^1.0.7", + "@upstash/vector": "^1.1.1", "@vercel/kv": "^0.2.3", "@vercel/postgres": "^0.5.0", "@writerai/writer-sdk": "^0.40.2", @@ -266,7 +266,7 @@ "@tensorflow/tfjs-core": "*", "@upstash/ratelimit": "^1.1.3", "@upstash/redis": "^1.20.6", - "@upstash/vector": "^1.0.7", + "@upstash/vector": "^1.1.1", "@vercel/kv": "^0.2.3", "@vercel/postgres": "^0.5.0", "@writerai/writer-sdk": "^0.40.2", diff --git a/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts b/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts index a1ed8d8c4400..076501cb8398 100644 --- a/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts +++ b/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts @@ -172,4 +172,118 @@ describe("UpstashVectorStore", () => { expect(results3).toHaveLength(2); }); + + test("Should upsert the documents to target namespace", async () => { + index = new Index({ + url: process.env.UPSTASH_VECTOR_REST_URL, + token: process.env.UPSTASH_VECTOR_REST_TOKEN, + }); + + await index.reset(); + + embeddings = new SyntheticEmbeddings({ + vectorSize: 384, + }); + + const storeNamespace1 = new UpstashVectorStore(embeddings, { + index, + namespace: "namespace-1", + }); + const storeNamespace2 = new UpstashVectorStore(embeddings, { + index, + namespace: "namespace-2", + }); + + await storeNamespace1.addDocuments([ + { + pageContent: "namespace-test-original", + metadata: { namespace: "namespace-1" }, + }, + ]); + + // Sleeping for a second to make sure that all the indexing operations are finished. + await sleep(1000); + + const resultsNamespace2 = await storeNamespace2.similaritySearchWithScore( + "namespace-test-original", + 1, + "namespace = 'namespace-1'" + ); + expect(resultsNamespace2).toHaveLength(0); + + const resultsNamespace1 = await storeNamespace1.similaritySearchWithScore( + "namespace-test-original", + 1, + "namespace = 'namespace-1'" + ); + expect(resultsNamespace1).toHaveLength(1); + + expect([resultsNamespace1[0][0]]).toEqual([ + new Document({ + metadata: { namespace: "namespace-1" }, + pageContent: "namespace-test-original", + }), + ]); + }); + + test("Should delete the documents from target namespace", async () => { + index = new Index({ + url: process.env.UPSTASH_VECTOR_REST_URL, + token: process.env.UPSTASH_VECTOR_REST_TOKEN, + }); + + await index.reset(); + + embeddings = new SyntheticEmbeddings({ + vectorSize: 384, + }); + + const storeNamespace1 = new UpstashVectorStore(embeddings, { + index, + namespace: "namespace-1", + }); + const storeNamespace2 = new UpstashVectorStore(embeddings, { + index, + namespace: "namespace-2", + }); + + const idNamespace1 = await storeNamespace1.addDocuments([ + { + pageContent: "namespace-test-original", + metadata: { namespace: "namespace-test" }, + }, + ]); + await storeNamespace2.addDocuments([ + { + pageContent: "namespace-test-original", + metadata: { namespace: "namespace-test" }, + }, + ]); + + // Sleeping for a second to make sure that all the indexing operations are finished. + await sleep(1000); + + await storeNamespace1.delete({ ids: idNamespace1 }); + + const resultsNamespace1 = await storeNamespace1.similaritySearchWithScore( + "namespace-test-original", + 1, + "namespace = 'namespace-test'" + ); + expect(resultsNamespace1).toHaveLength(0); + + const resultsNamespace2 = await storeNamespace2.similaritySearchWithScore( + "namespace-test-original", + 1, + "namespace = 'namespace-test'" + ); + expect(resultsNamespace2).toHaveLength(1); + + expect([resultsNamespace2[0][0]]).toEqual([ + new Document({ + metadata: { namespace: "namespace-test" }, + pageContent: "namespace-test-original", + }), + ]); + }); }); diff --git a/libs/langchain-community/src/vectorstores/upstash.ts b/libs/langchain-community/src/vectorstores/upstash.ts index 37ac287b6d24..f1e59d556ae7 100644 --- a/libs/langchain-community/src/vectorstores/upstash.ts +++ b/libs/langchain-community/src/vectorstores/upstash.ts @@ -17,6 +17,7 @@ import { export interface UpstashVectorLibArgs extends AsyncCallerParams { index: UpstashIndex; filter?: string; + namespace?: string; } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -56,6 +57,8 @@ export class UpstashVectorStore extends VectorStore { filter?: this["FilterType"]; + namespace?: string; + _vectorstoreType(): string { return "upstash"; } @@ -68,11 +71,12 @@ export class UpstashVectorStore extends VectorStore { this.useUpstashEmbeddings = true; } - const { index, ...asyncCallerArgs } = args; + const { index, namespace, ...asyncCallerArgs } = args; this.index = index; this.caller = new AsyncCaller(asyncCallerArgs); this.filter = args.filter; + this.namespace = namespace; } /** @@ -127,10 +131,12 @@ export class UpstashVectorStore extends VectorStore { }; }); + const namespace = this.index.namespace(this.namespace ?? ""); + const vectorChunks = chunkArray(upstashVectors, CONCURRENT_UPSERT_LIMIT); const batchRequests = vectorChunks.map((chunk) => - this.caller.call(async () => this.index.upsert(chunk)) + this.caller.call(async () => namespace.upsert(chunk)) ); await Promise.all(batchRequests); @@ -166,13 +172,14 @@ export class UpstashVectorStore extends VectorStore { }; }); + const namespace = this.index.namespace(this.namespace ?? ""); const vectorChunks = chunkArray( upstashVectorsWithData, CONCURRENT_UPSERT_LIMIT ); const batchRequests = vectorChunks.map((chunk) => - this.caller.call(async () => this.index.upsert(chunk)) + this.caller.call(async () => namespace.upsert(chunk)) ); await Promise.all(batchRequests); @@ -187,10 +194,11 @@ export class UpstashVectorStore extends VectorStore { * @returns Promise that resolves when the specified documents have been deleted from the database. */ async delete(params: UpstashDeleteParams): Promise { + const namespace = this.index.namespace(this.namespace ?? ""); if (params.deleteAll) { - await this.index.reset(); + await namespace.reset(); } else if (params.ids) { - await this.index.delete(params.ids); + await namespace.delete(params.ids); } } @@ -202,8 +210,10 @@ export class UpstashVectorStore extends VectorStore { ) { let queryResult: QueryResult[] = []; + const namespace = this.index.namespace(this.namespace ?? ""); + if (typeof query === "string") { - queryResult = await this.index.query({ + queryResult = await namespace.query({ data: query, topK: k, includeMetadata: true, @@ -211,7 +221,7 @@ export class UpstashVectorStore extends VectorStore { ...options, }); } else { - queryResult = await this.index.query({ + queryResult = await namespace.query({ vector: query, topK: k, includeMetadata: true, diff --git a/yarn.lock b/yarn.lock index 70619a0649d7..893c185426d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9140,7 +9140,7 @@ __metadata: "@typescript-eslint/parser": ^5.58.0 "@upstash/ratelimit": ^1.1.3 "@upstash/redis": ^1.20.6 - "@upstash/vector": ^1.0.7 + "@upstash/vector": ^1.1.1 "@vercel/kv": ^0.2.3 "@vercel/postgres": ^0.5.0 "@writerai/writer-sdk": ^0.40.2 @@ -9287,7 +9287,7 @@ __metadata: "@tensorflow/tfjs-core": "*" "@upstash/ratelimit": ^1.1.3 "@upstash/redis": ^1.20.6 - "@upstash/vector": ^1.0.7 + "@upstash/vector": ^1.1.1 "@vercel/kv": ^0.2.3 "@vercel/postgres": ^0.5.0 "@writerai/writer-sdk": ^0.40.2 @@ -16131,10 +16131,10 @@ __metadata: languageName: node linkType: hard -"@upstash/vector@npm:^1.0.7": - version: 1.0.7 - resolution: "@upstash/vector@npm:1.0.7" - checksum: 38d6ef4fd8cd970e3b83e39cf90e0f57622ac032afc409fa6782911ec2452d19decb0184c5a8f7849b8fb06c865c9397f142633a31cea49e82dd6fc4b43e8484 +"@upstash/vector@npm:^1.1.1": + version: 1.1.1 + resolution: "@upstash/vector@npm:1.1.1" + checksum: 2eeaa655b46d9182dfdb5e12ff58654e820df18e7b03e8cfff2795cbdb370cc7652a198638f36e8f29dab3e6a67004cda693b62e0885dc87472a08f908ffe0e6 languageName: node linkType: hard @@ -22533,7 +22533,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^5.51.0 "@typescript-eslint/parser": ^5.51.0 "@upstash/redis": ^1.20.6 - "@upstash/vector": ^1.0.7 + "@upstash/vector": ^1.1.1 "@vercel/kv": ^0.2.3 "@xata.io/client": ^0.28.0 "@zilliz/milvus2-sdk-node": ^2.2.7 From 0cc732e78cf934064e3ceea0ec72dc6f8e6850d3 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Tue, 28 May 2024 18:01:14 -0700 Subject: [PATCH 10/10] infra[patch]: Set fail-fast strategy to false (#5590) --- .../workflows/{build-examples.yml => examples.yml} | 2 ++ .github/workflows/test-exports.yml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) rename .github/workflows/{build-examples.yml => examples.yml} (97%) diff --git a/.github/workflows/build-examples.yml b/.github/workflows/examples.yml similarity index 97% rename from .github/workflows/build-examples.yml rename to .github/workflows/examples.yml index c406e8382db7..867f87228b99 100644 --- a/.github/workflows/build-examples.yml +++ b/.github/workflows/examples.yml @@ -30,6 +30,8 @@ jobs: build: name: Build runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js 18.x diff --git a/.github/workflows/test-exports.yml b/.github/workflows/test-exports.yml index 71876bf63993..22c46d2acb8e 100644 --- a/.github/workflows/test-exports.yml +++ b/.github/workflows/test-exports.yml @@ -24,6 +24,8 @@ env: jobs: exports-esbuild: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -43,6 +45,8 @@ jobs: exports-esm: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -62,6 +66,8 @@ jobs: exports-cjs: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -81,6 +87,8 @@ jobs: exports-cf: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -100,6 +108,8 @@ jobs: exports-vercel: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -119,6 +129,8 @@ jobs: exports-vite: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }} @@ -138,6 +150,8 @@ jobs: exports-tsc: runs-on: ubuntu-latest + strategy: + fail-fast: false steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ env.NODE_VERSION }}