File tree Expand file tree Collapse file tree 4 files changed +572
-0
lines changed
libs/langchain/src/agents/middleware Expand file tree Collapse file tree 4 files changed +572
-0
lines changed Original file line number Diff line number Diff line change @@ -46,5 +46,9 @@ export {
4646 toolRetryMiddleware ,
4747 type ToolRetryMiddlewareConfig ,
4848} from "./toolRetry.js" ;
49+ export {
50+ toolEmulatorMiddleware ,
51+ type ToolEmulatorOptions ,
52+ } from "./toolEmulator.js" ;
4953export { type AgentMiddleware } from "./types.js" ;
5054export { countTokensApproximately } from "./utils.js" ;
Original file line number Diff line number Diff line change 1+ import { AIMessage } from "@langchain/core/messages" ;
2+
3+ export const ChatOpenAI = class MockChatOpenAI {
4+ lc_kwargs : Record < string , unknown > ;
5+
6+ constructor ( params ?: Record < string , unknown > ) {
7+ this . lc_kwargs = params || { } ;
8+ }
9+
10+ async invoke ( ) {
11+ return new AIMessage ( {
12+ content : "Emulated response for openai" ,
13+ } ) ;
14+ }
15+
16+ getName ( ) {
17+ return "ChatOpenAI" ;
18+ }
19+
20+ get _modelType ( ) {
21+ return "base_chat_model" ;
22+ }
23+
24+ get lc_runnable ( ) {
25+ return true ;
26+ }
27+ } ;
You can’t perform that action at this time.
0 commit comments