Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
24cea34
Update langchain
elastic-renovate-prod[bot] Sep 10, 2025
cbe4c89
Merge branch 'main' into renovate/main-langchain
elasticmachine Sep 10, 2025
57a982e
fix types
patrykkopycinski Sep 11, 2025
7603bba
fix types
patrykkopycinski Sep 11, 2025
e5f9701
fix yarn.lock
patrykkopycinski Sep 11, 2025
f738bd9
resolve zod
patrykkopycinski Sep 12, 2025
af56329
fix
patrykkopycinski Sep 12, 2025
cf01d0f
test
patrykkopycinski Sep 12, 2025
15b4145
fix
patrykkopycinski Sep 12, 2025
bfa6da3
fix
patrykkopycinski Sep 12, 2025
4356165
test
patrykkopycinski Sep 13, 2025
4a643ae
Merge branch 'main' of github.com:elastic/kibana into renovate/main-l…
patrykkopycinski Oct 8, 2025
614fba9
Merge branch 'main' of github.com:elastic/kibana into renovate/main-l…
patrykkopycinski Oct 8, 2025
1ecb5be
cleanup
patrykkopycinski Oct 8, 2025
a2a2d9e
cleanup
patrykkopycinski Oct 8, 2025
a113dd8
revert openai
patrykkopycinski Oct 8, 2025
82d4f48
fix yarn.lock
patrykkopycinski Oct 8, 2025
a5b4416
update tests
patrykkopycinski Oct 9, 2025
e37581a
cleanup
patrykkopycinski Oct 9, 2025
b87cab0
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 9, 2025
8695be9
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 10, 2025
b24c361
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 10, 2025
1d2fa51
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 10, 2025
518fdd2
cleanup
patrykkopycinski Oct 10, 2025
bfc4fb9
Merge branch 'renovate/main-langchain' of github.com:elastic/kibana i…
patrykkopycinski Oct 10, 2025
d9e4f40
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 10, 2025
8c151c2
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 10, 2025
6d0f594
test
patrykkopycinski Oct 12, 2025
c514530
Merge branch 'renovate/main-langchain' of github.com:elastic/kibana i…
patrykkopycinski Oct 12, 2025
d863c3a
test
patrykkopycinski Oct 12, 2025
26c4c7d
test
patrykkopycinski Oct 12, 2025
62295b9
revert
patrykkopycinski Oct 12, 2025
75285ef
cleanup
patrykkopycinski Oct 12, 2025
f03323e
cleanup
patrykkopycinski Oct 12, 2025
f962227
Merge branch 'main' of github.com:elastic/kibana into renovate/main-l…
patrykkopycinski Oct 22, 2025
7a43891
update tests
patrykkopycinski Oct 22, 2025
510f887
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 24, 2025
44133fa
Merge branch 'main' into renovate/main-langchain
patrykkopycinski Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/security/dependencies_diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function getDependenciesDiff() {

async function main() {
// Skipping PRs from Renovate
if (process.env.GIT_BRANCH?.startsWith('renovate')) {
if (process.env.GIT_BRANCH?.startsWith('elastic:renovate')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elena-shostak would you mind to verify it? When I was testing it the branch on buildkite was elastic:renovate/main-langchain instead of renovate/main-langchain, so the check was run on this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked, you are right, thanks for fixing!

As for the dependency health check, I've also raised a PR to properly skip renovate PRs #235066

return;
}

Expand Down
51 changes: 26 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,26 @@
"resolutions": {
"**/@babel/parser": "7.24.7",
"**/@hello-pangea/dnd": "18.0.1",
"**/@langchain/core": "^0.3.57",
"**/@langchain/google-common": "^0.1.8",
"**/@langchain/core": "^0.3.78",
"**/@langchain/google-common": "^0.2.18",
"**/@types/node": "22.15.3",
"**/@typescript-eslint/utils": "8.16.0",
"**/chokidar": "^3.5.3",
"**/d3-scale/**/d3-color": "npm:@elastic/[email protected]",
"**/globule/minimatch": "^3.1.2",
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-fetch/node-fetch": "^2.6.7",
"**/langchain": "^0.3.15",
"**/langchain": "^0.3.35",
"**/remark-parse/trim": "1.0.1",
"**/sharp": "0.32.6",
"**/typescript": "5.4.5",
"**/util": "^0.12.5",
"**/yauzl": "^3.2.0",
"@aws-sdk/client-bedrock-agent-runtime": "^3.744.0",
"@aws-sdk/client-bedrock-runtime": "^3.744.0",
"@aws-sdk/client-kendra": "3.744.0",
"@aws-sdk/credential-provider-node": "3.744.0",
"**/zod": "^3.25.76",
"@aws-sdk/client-bedrock-agent-runtime": "^3.879.0",
"@aws-sdk/client-bedrock-runtime": "^3.879.0",
"@aws-sdk/client-kendra": "3.879.0",
"@aws-sdk/credential-provider-node": "3.879.0",
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0",
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.0",
Expand All @@ -111,7 +112,7 @@
"@apidevtools/json-schema-ref-parser": "^14.1.1",
"@appland/sql-parser": "^1.5.1",
"@arizeai/openinference-semantic-conventions": "^1.1.0",
"@aws-sdk/client-bedrock-runtime": "^3.744.0",
"@aws-sdk/client-bedrock-runtime": "^3.879.0",
"@babel/runtime": "^7.24.7",
"@dagrejs/dagre": "^1.1.5",
"@dnd-kit/core": "^6.3.1",
Expand Down Expand Up @@ -152,7 +153,7 @@
"@formatjs/intl": "^2.10.2",
"@formatjs/intl-utils": "^3.8.4",
"@formatjs/ts-transformer": "^3.13.14",
"@google/generative-ai": "^0.21.0",
"@google/generative-ai": "^0.24.1",
"@grpc/grpc-js": "^1.13.4",
"@hapi/accept": "^6.0.3",
"@hapi/boom": "^10.0.1",
Expand Down Expand Up @@ -1138,15 +1139,15 @@
"@kbn/xstate-utils": "link:src/platform/packages/shared/kbn-xstate-utils",
"@kbn/zod": "link:src/platform/packages/shared/kbn-zod",
"@kbn/zod-helpers": "link:src/platform/packages/shared/kbn-zod-helpers",
"@langchain/aws": "^0.1.3",
"@langchain/community": "^0.3.29",
"@langchain/core": "^0.3.57",
"@langchain/google-common": "^0.1.8",
"@langchain/google-genai": "^0.1.8",
"@langchain/google-vertexai": "^0.1.8",
"@langchain/langgraph": "^0.2.45",
"@langchain/langgraph-checkpoint": "~0.0.17",
"@langchain/openai": "^0.4.4",
"@langchain/aws": "^0.1.15",
"@langchain/community": "^0.3.57",
"@langchain/core": "^0.3.78",
"@langchain/google-common": "^0.2.18",
"@langchain/google-genai": "^0.2.18",
"@langchain/google-vertexai": "^0.2.18",
"@langchain/langgraph": "^0.4.9",
"@langchain/langgraph-checkpoint": "~0.1.1",
"@langchain/openai": "^0.6.14",
"@launchdarkly/node-server-sdk": "^9.10.2",
"@launchdarkly/openfeature-node-server": "^1.1.0",
"@loaders.gl/core": "^3.4.7",
Expand Down Expand Up @@ -1178,9 +1179,9 @@
"@opentelemetry/semantic-conventions": "^1.37.0",
"@reduxjs/toolkit": "1.9.7",
"@slack/webhook": "^7.0.6",
"@smithy/eventstream-codec": "^4.0.1",
"@smithy/eventstream-serde-node": "^4.0.1",
"@smithy/middleware-stack": "^4.0.1",
"@smithy/eventstream-codec": "^4.0.5",
"@smithy/eventstream-serde-node": "^4.0.5",
"@smithy/middleware-stack": "^4.0.5",
"@smithy/node-http-handler": "^4.0.1",
"@smithy/types": "^4.1.0",
"@smithy/util-utf8": "^4.0.0",
Expand Down Expand Up @@ -1292,8 +1293,8 @@
"jsonwebtoken": "^9.0.2",
"jsts": "^1.6.2",
"kea": "^2.6.0",
"langchain": "^0.3.15",
"langsmith": "^0.3.7",
"langchain": "^0.3.35",
"langsmith": "^0.3.72",
"launchdarkly-js-client-sdk": "^3.9.0",
"liquidjs": "^10.21.1",
"load-json-file": "^6.2.0",
Expand Down Expand Up @@ -1424,8 +1425,8 @@
"yaml": "^2.5.1",
"yauzl": "^3.2.0",
"yazl": "^3.3.1",
"zod": "^3.22.3",
"zod-to-json-schema": "^3.23.0"
"zod": "^3.25.76",
"zod-to-json-schema": "^3.24.6"
},
"devDependencies": {
"@apidevtools/swagger-parser": "^12.0.0",
Expand Down
14 changes: 14 additions & 0 deletions src/platform/packages/shared/kbn-test/src/jest/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ module.exports = (request, options) => {
});
}

if (request === 'zod' || request === 'zod/v3') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after zod@v4 we can remove it, but because they released 2 versions of lib jest couldn't resolve .cjs properly

return resolve.sync('zod/v3/index.cjs', {
basedir: options.basedir,
extensions: options.extensions,
});
}

if (request.startsWith('zod/v4/')) {
return resolve.sync(`${request}/index.cjs`, {
basedir: options.basedir,
extensions: options.extensions,
});
}

if (request === `elastic-apm-node`) {
return APM_AGENT_MOCK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,22 +581,48 @@ describe('InferenceChatModel', () => {
const response = createStreamResponse([
{
tool_calls: [
{ toolCallId: 'my-tool-call-id', index: 0, function: { name: '', arguments: '' } },
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes required due to langchain-ai/langchainjs#8433

toolCallId: 'my-tool-call-id',
index: 0,
function: { name: 'myfunction', arguments: '' },
},
],
},
{
tool_calls: [{ toolCallId: '', index: 0, function: { name: 'myfun', arguments: '' } }],
tool_calls: [
{
toolCallId: 'my-tool-call-id',
index: 0,
function: { name: 'myfunction', arguments: '' },
},
],
},
{
tool_calls: [
{ toolCallId: '', index: 0, function: { name: 'ction', arguments: ' { "' } },
{
toolCallId: 'my-tool-call-id',
index: 0,
function: { name: 'myfunction', arguments: ' { "' },
},
],
},
{
tool_calls: [{ toolCallId: '', index: 0, function: { name: '', arguments: 'arg1": ' } }],
tool_calls: [
{
toolCallId: 'my-tool-call-id',
index: 0,
function: { name: 'myfunction', arguments: 'arg1": ' },
},
],
},
{
tool_calls: [{ toolCallId: '', index: 0, function: { name: '', arguments: '42 }' } }],
tool_calls: [
{
toolCallId: 'my-tool-call-id',
index: 0,
function: { name: 'myfunction', arguments: '42 }' },
},
],
},
]);
chatComplete.mockReturnValue(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import type { z } from '@kbn/zod';
import type { ZodSchema } from '@kbn/zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
import {
BaseChatModel,
Expand All @@ -14,14 +14,15 @@ import {
type BindToolsInput,
type LangSmithParams,
} from '@langchain/core/language_models/chat_models';
import type { InteropZodType } from '@langchain/core/utils/types';
import type {
BaseLanguageModelInput,
StructuredOutputMethodOptions,
ToolDefinition,
} from '@langchain/core/language_models/base';
import type { BaseMessage, AIMessageChunk } from '@langchain/core/messages';
import type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
import { isZodSchema } from '@langchain/core/utils/types';
import { isInteropZodSchema } from '@langchain/core/utils/types';
import type { ChatResult, ChatGeneration } from '@langchain/core/outputs';
import { ChatGenerationChunk } from '@langchain/core/outputs';
import { OutputParserException } from '@langchain/core/output_parsers';
Expand Down Expand Up @@ -304,34 +305,37 @@ export class InferenceChatModel extends BaseChatModel<InferenceChatModelCallOpti
}

withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(
outputSchema: z.ZodType<RunOutput> | Record<string, any>,
outputSchema: InteropZodType<RunOutput> | Record<string, any>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated types to align with langchain changes

config?: StructuredOutputMethodOptions<false>
): Runnable<BaseLanguageModelInput, RunOutput>;
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(
outputSchema: z.ZodType<RunOutput> | Record<string, any>,
outputSchema: InteropZodType<RunOutput> | Record<string, any>,
config?: StructuredOutputMethodOptions<true>
): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(
outputSchema: z.ZodType<RunOutput> | Record<string, any>,
outputSchema: InteropZodType<RunOutput> | Record<string, any>,
config?: StructuredOutputMethodOptions<boolean>
):
| Runnable<BaseLanguageModelInput, RunOutput>
| Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }> {
const schema: z.ZodType<RunOutput> | Record<string, any> = outputSchema;
const schema: InteropZodType<RunOutput> | Record<string, any> = outputSchema;
const name = config?.name;
const description = schema.description ?? 'A function available to call.';
const description =
'description' in schema && typeof schema.description === 'string'
? schema.description
: 'A function available to call.';
const includeRaw = config?.includeRaw;

let functionName = name ?? 'extract';
let tools: ToolDefinition[];
if (isZodSchema(schema)) {
if (isInteropZodSchema(schema)) {
tools = [
{
type: 'function',
function: {
name: functionName,
description,
parameters: zodToJsonSchema(schema),
parameters: zodToJsonSchema(schema as unknown as ZodSchema),
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
* 2.0.
*/

import { ActionsClientBedrockChatModel } from './language_models/bedrock_chat';
import { ActionsClientChatOpenAI } from './language_models/chat_openai';
import { ActionsClientLlm } from './language_models/llm';
import { ActionsClientSimpleChatModel } from './language_models/simple_chat_model';
import { ActionsClientGeminiChatModel } from './language_models/gemini_chat';
import { ActionsClientChatVertexAI } from './language_models/chat_vertex';
import { ActionsClientChatBedrockConverse } from './language_models/chat_bedrock_converse';
import { parseBedrockStream } from './utils/bedrock';
Expand All @@ -20,11 +17,8 @@ export {
parseBedrockStream,
parseGeminiResponse,
getDefaultArguments,
ActionsClientBedrockChatModel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these models are not used anymore

ActionsClientChatOpenAI,
ActionsClientChatVertexAI,
ActionsClientGeminiChatModel,
ActionsClientLlm,
ActionsClientSimpleChatModel,
ActionsClientChatBedrockConverse,
};

This file was deleted.

Loading