Skip to content

Commit ebd5d41

Browse files
committed
fix: ci
1 parent 4b919cb commit ebd5d41

File tree

10 files changed

+46
-14
lines changed

10 files changed

+46
-14
lines changed

core/langchain-decorator/src/decorator/GraphNode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { GraphNodeInfoUtil } from '../util/GraphNodeInfoUtil';
1313
import { AnnotationRoot, StateDefinition, UpdateType } from '@langchain/langgraph';
1414
import { ConfigurableModel } from 'langchain/chat_models/universal';
1515
import { ToolNode } from '@langchain/langgraph/prebuilt';
16+
import { BaseChatOpenAI } from '@langchain/openai';
1617

1718
export function GraphNode<S extends StateDefinition = StateDefinition>(params: IGraphNodeMetadata) {
1819
return (constructor: EggProtoImplClass<IGraphNode<S> | TeggToolNode>) => {
@@ -32,7 +33,7 @@ export interface IGraphNode<S extends StateDefinition = StateDefinition, T = any
3233
// execute(state: T extends AbstractStateGraph<infer S> ? GraphStateType<S> : never): Promise<GraphUpdateType<T> extends object ? GraphUpdateType<T> & Record<string, any> : GraphUpdateType<T>>;
3334
execute(state: AnnotationRoot<S>['State']): Promise<UpdateType<S> & Record<string, any>> | Promise<ToolNode<T>>;
3435

35-
build?: (tools: Parameters<ConfigurableModel['bindTools']>['0']) => Promise<ConfigurableModel>;
36+
build?: (tools: Parameters<ConfigurableModel['bindTools']>['0']) => Promise<ReturnType<ConfigurableModel['bindTools']> | ReturnType<BaseChatOpenAI<any>['bindTools']>>;
3637
}
3738

3839
export class TeggToolNode implements IGraphNode {

core/langchain-decorator/test/fixtures/modules/langgraph/Graph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Annotation, MemorySaver } from '@langchain/langgraph';
33
import { ChatOpenAI } from '@langchain/openai';
44
import { z } from 'zod';
55
import { Inject, SingletonProto } from '@eggjs/core-decorator';
6-
import { BaseMessage } from '@langchain/core/dist/messages/base';
6+
import { BaseMessage } from '@langchain/core/messages';
77
import { AccessLevel, ToolArgs } from '@eggjs/tegg-types';
88
import { ToolArgsSchema } from '@eggjs/controller-decorator';
9-
import { AIMessage } from '@langchain/core/dist/messages/ai';
9+
import { AIMessage } from '@langchain/core/messages';
1010

1111
export enum FooGraphNodeName {
1212
START = '__start__',
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"module": "nodenext",
5+
"moduleResolution": "nodenext",
6+
"baseUrl": "./"
7+
},
8+
"exclude": [
9+
"dist",
10+
"node_modules",
11+
"test"
12+
]
13+
}

core/langchain-decorator/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"exclude": [
1010
"dist",
11-
"node_modules",
12-
"test"
11+
"node_modules"
1312
]
1413
}

core/mcp-client/test/HttpMCPClient.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import assert from 'node:assert/strict';
22
import { randomUUID } from 'node:crypto';
3-
import { HttpMCPClient } from '../src/HttpMCPClient';
4-
import { startSSEServer, stopSSEServer } from './fixtures/sse-mcp-server/http';
5-
import { startStreamableServer, stopStreamableServer } from './fixtures/streamable-mcp-server/http';
63
const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
74

85
describe('test/HttpMCPClient.test.ts', () => {
96
if (majorVersion < 18) {
107
return;
118
}
9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
10+
const { HttpMCPClient } = require('../src/HttpMCPClient');
11+
// eslint-disable-next-line @typescript-eslint/no-var-requires
12+
const { startSSEServer, stopSSEServer } = require('./fixtures/sse-mcp-server/http');
13+
// eslint-disable-next-line @typescript-eslint/no-var-requires
14+
const { startStreamableServer, stopStreamableServer } = require('./fixtures/streamable-mcp-server/http');
1215
it('should work', async () => {
1316
await startStreamableServer();
1417
const client = new HttpMCPClient({
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"module": "nodenext",
5+
"moduleResolution": "nodenext",
6+
"baseUrl": "./"
7+
},
8+
"exclude": [
9+
"dist",
10+
"node_modules",
11+
"test"
12+
]
13+
}

plugin/langchain/test/llm.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import mm from 'egg-mock';
22
import path from 'path';
33
import assert from 'assert';
4-
import { startSSEServer, stopSSEServer } from './fixtures/sse-mcp-server/http';
54

65

76
describe('plugin/langchain/test/llm.test.ts', () => {
87
if (parseInt(process.version.slice(1, 3)) > 17) {
8+
// eslint-disable-next-line @typescript-eslint/no-var-requires
9+
const { startSSEServer, stopSSEServer } = require('./fixtures/sse-mcp-server/http');
910
// eslint-disable-next-line @typescript-eslint/no-var-requires
1011
const { ChatOpenAIModel } = require('../lib/ChatOpenAI');
1112
// eslint-disable-next-line @typescript-eslint/no-var-requires

plugin/mcp-client/lib/EggHttpStaticMCPClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import assert from 'node:assert';
5151
});
5252
},
5353
})
54-
export class EggVipStaticMCPClient extends EggHttpMCPClient {
54+
export class EggHttpStaticMCPClient extends EggHttpMCPClient {
5555
constructor(
5656
@Inject() moduleConfig: ModuleConfig,
5757
@Inject() logger: Logger,
@@ -73,7 +73,7 @@ export class EggVipStaticMCPClient extends EggHttpMCPClient {
7373
transportType: mcpServerSubConfig.transportType as any,
7474
url: mcpServerSubConfig.url,
7575
logger,
76-
fetch: FetchFactory.fetch,
76+
fetch: FetchFactory && FetchFactory.fetch,
7777
});
7878
}
7979

plugin/mcp-client/lib/HttpMCPClientFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class HttpMCPClientFactory {
2626
const httpMCPClient = new EggHttpMCPClient({
2727
clientName: clientInfo.name,
2828
clientVersion: clientInfo.version,
29-
fetch: this.FetchFactory.fetch,
29+
fetch: this.FetchFactory && this.FetchFactory.fetch,
3030
...options as HttpClientOptions,
3131
logger: this.logger,
3232
});

plugin/mcp-client/test/mcpclient.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import mm from 'egg-mock';
22
import path from 'path';
33
import assert from 'assert';
4-
import { startSSEServer, stopSSEServer } from './fixtures/sse-mcp-server/http';
5-
import { startStreamableServer, stopStreamableServer } from './fixtures/streamable-mcp-server/http';
64

75
describe('plugin/mcp-client/test/mcpclient.test.ts', () => {
86
if (parseInt(process.version.slice(1, 3)) > 17) {
7+
// eslint-disable-next-line @typescript-eslint/no-var-requires
8+
const { startSSEServer, stopSSEServer } = require('./fixtures/sse-mcp-server/http');
9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
10+
const { startStreamableServer, stopStreamableServer } = require('./fixtures/streamable-mcp-server/http');
911
let app;
1012

1113
before(async () => {

0 commit comments

Comments
 (0)