Skip to content

Commit 62d0fba

Browse files
committed
fix circular dep
1 parent 28b44b0 commit 62d0fba

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

x-pack/packages/kbn-langchain/server/language_models/chat_vertex/chat_vertex.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import { PassThrough } from 'stream';
99
import { loggerMock } from '@kbn/logging-mocks';
1010
import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock';
1111

12+
import { BaseMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';
1213
import { ActionsClientChatVertexAI } from './chat_vertex';
13-
import { BaseMessage } from '@langchain/core/messages';
1414
import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
15-
import { getLangChainMessage } from '@kbn/elastic-assistant-plugin/server/lib/langchain/helpers';
1615

1716
const connectorId = 'mock-connector-id';
1817

@@ -56,11 +55,8 @@ const mockStreamExecute = jest.fn().mockImplementation(() => {
5655
});
5756

5857
const callMessages = [
59-
getLangChainMessage({
60-
role: 'system',
61-
content: 'Answer the following questions truthfully and as best you can.',
62-
}),
63-
getLangChainMessage({ role: 'user', content: 'Question: Do you know my name?\n\n' }),
58+
new SystemMessage('Answer the following questions truthfully and as best you can.'),
59+
new HumanMessage('Question: Do you know my name?\n\n'),
6460
] as unknown as BaseMessage[];
6561

6662
const callOptions = {

x-pack/packages/kbn-langchain/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@kbn/actions-plugin",
2020
"@kbn/logging-mocks",
2121
"@kbn/utility-types",
22-
"@kbn/tooling-log",
23-
"@kbn/elastic-assistant-plugin"
22+
"@kbn/tooling-log"
2423
]
2524
}

0 commit comments

Comments
 (0)