We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b61cba5 commit f7916dfCopy full SHA for f7916df
1 file changed
packages/ai-native/src/node/base-language-model.ts
@@ -41,11 +41,14 @@ export abstract class BaseLanguageModel {
41
): Promise<any> {
42
const provider = this.initializeProvider(options);
43
const clientId = options.clientId;
44
- if (!clientId) {
45
- throw new Error('clientId is required');
+
+ let allFunctions: ToolRequest[] = [];
46
+ // 如果没有传入 clientId,则不使用工具
47
+ if (clientId) {
48
+ const registry = this.toolInvocationRegistryManager.getRegistry(clientId);
49
+ allFunctions = options.noTool ? [] : registry.getAllFunctions();
50
}
- const registry = this.toolInvocationRegistryManager.getRegistry(clientId);
- const allFunctions = options.noTool ? [] : registry.getAllFunctions();
51
52
return this.handleStreamingRequest(
53
provider,
54
request,
0 commit comments