File tree Expand file tree Collapse file tree
x-pack/packages/kbn-langchain
server/language_models/chat_vertex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,9 @@ import { PassThrough } from 'stream';
99import { loggerMock } from '@kbn/logging-mocks' ;
1010import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock' ;
1111
12+ import { BaseMessage , HumanMessage , SystemMessage } from '@langchain/core/messages' ;
1213import { ActionsClientChatVertexAI } from './chat_vertex' ;
13- import { BaseMessage } from '@langchain/core/messages' ;
1414import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager' ;
15- import { getLangChainMessage } from '@kbn/elastic-assistant-plugin/server/lib/langchain/helpers' ;
1615
1716const connectorId = 'mock-connector-id' ;
1817
@@ -56,11 +55,8 @@ const mockStreamExecute = jest.fn().mockImplementation(() => {
5655} ) ;
5756
5857const 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
6662const callOptions = {
Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments