File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import {
23
23
mergeMessageRuns ,
24
24
SystemMessage
25
25
} from '@langchain/core/messages' ;
26
- import { CompiledStateGraph } from '@langchain/langgraph' ;
27
26
import { UUID } from '@lumino/coreutils' ;
28
27
29
28
import { DEFAULT_CHAT_SYSTEM_PROMPT } from './default-prompts' ;
@@ -65,7 +64,7 @@ export class ChatHandler extends AbstractChatModel {
65
64
} ) ;
66
65
}
67
66
68
- get agent ( ) : CompiledStateGraph < any , any > | null {
67
+ get agent ( ) : AIChatModel | null {
69
68
return this . _providerRegistry . currentAgent ;
70
69
}
71
70
@@ -216,7 +215,7 @@ export class ChatHandler extends AbstractChatModel {
216
215
}
217
216
218
217
private async _sendAgentMessage (
219
- agent : CompiledStateGraph < any , any > ,
218
+ agent : AIChatModel ,
220
219
messages : BaseMessage [ ] ,
221
220
sender : IUser
222
221
) : Promise < boolean > {
Original file line number Diff line number Diff line change @@ -159,12 +159,14 @@ export class AIProviderRegistry implements IAIProviderRegistry {
159
159
/**
160
160
* Get the current agent.
161
161
*/
162
- get currentAgent ( ) : CompiledStateGraph < any , any > | null {
162
+ get currentAgent ( ) : AIChatModel | null {
163
163
const agent = Private . getAgent ( ) ;
164
164
if ( agent === null ) {
165
165
return null ;
166
166
}
167
- return agent ;
167
+ return {
168
+ stream : ( input : any , options ?: any ) => agent . stream ( input , options )
169
+ } ;
168
170
}
169
171
170
172
/**
Original file line number Diff line number Diff line change 1
- import { CompiledStateGraph } from '@langchain/langgraph' ;
2
1
import { BaseChatModel } from '@langchain/core/language_models/chat_models' ;
3
2
import { ReadonlyPartialJSONObject , Token } from '@lumino/coreutils' ;
4
3
import { ISignal } from '@lumino/signaling' ;
@@ -103,7 +102,7 @@ export interface IAIProviderRegistry {
103
102
/**
104
103
* Get the current agent.
105
104
*/
106
- readonly currentAgent : CompiledStateGraph < any , any > | null ;
105
+ readonly currentAgent : AIChatModel | null ;
107
106
/**
108
107
* Getter/setter for the chat system prompt.
109
108
*/
You can’t perform that action at this time.
0 commit comments