@aigne/core 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +9 -7
- package/README.zh.md +9 -7
- package/lib/cjs/agents/agent.d.ts +129 -6
- package/lib/cjs/agents/agent.js +112 -20
- package/lib/cjs/agents/ai-agent.d.ts +3 -2
- package/lib/cjs/agents/ai-agent.js +12 -9
- package/lib/{esm/models → cjs/agents}/chat-model.d.ts +24 -13
- package/lib/cjs/{models → agents}/chat-model.js +48 -7
- package/lib/cjs/agents/guide-rail-agent.d.ts +62 -0
- package/lib/cjs/agents/guide-rail-agent.js +14 -0
- package/lib/cjs/agents/mcp-agent.js +9 -9
- package/lib/cjs/agents/team-agent.js +1 -1
- package/lib/cjs/aigne/aigne.d.ts +3 -2
- package/lib/cjs/aigne/aigne.js +2 -2
- package/lib/cjs/aigne/context.d.ts +2 -1
- package/lib/cjs/aigne/context.js +8 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/loader/agent-yaml.d.ts +1 -1
- package/lib/cjs/loader/index.d.ts +18 -11
- package/lib/cjs/loader/index.js +8 -27
- package/lib/cjs/memory/retriever.d.ts +2 -2
- package/lib/cjs/prompt/prompt-builder.d.ts +3 -3
- package/lib/cjs/prompt/template.d.ts +3 -3
- package/lib/cjs/prompt/template.js +1 -1
- package/lib/cjs/utils/json-schema.js +1 -1
- package/lib/cjs/utils/logger.d.ts +33 -8
- package/lib/cjs/utils/logger.js +63 -5
- package/lib/cjs/utils/model-utils.d.ts +1 -1
- package/lib/cjs/utils/stream-utils.d.ts +3 -2
- package/lib/cjs/utils/stream-utils.js +50 -26
- package/lib/cjs/utils/type-utils.d.ts +5 -0
- package/lib/dts/agents/agent.d.ts +129 -6
- package/lib/dts/agents/ai-agent.d.ts +3 -2
- package/lib/{cjs/models → dts/agents}/chat-model.d.ts +24 -13
- package/lib/dts/agents/guide-rail-agent.d.ts +62 -0
- package/lib/dts/aigne/aigne.d.ts +3 -2
- package/lib/dts/aigne/context.d.ts +2 -1
- package/lib/dts/index.d.ts +1 -1
- package/lib/dts/loader/agent-yaml.d.ts +1 -1
- package/lib/dts/loader/index.d.ts +18 -11
- package/lib/dts/memory/retriever.d.ts +2 -2
- package/lib/dts/prompt/prompt-builder.d.ts +3 -3
- package/lib/dts/prompt/template.d.ts +3 -3
- package/lib/dts/utils/logger.d.ts +33 -8
- package/lib/dts/utils/model-utils.d.ts +1 -1
- package/lib/dts/utils/stream-utils.d.ts +3 -2
- package/lib/dts/utils/type-utils.d.ts +5 -0
- package/lib/esm/agents/agent.d.ts +129 -6
- package/lib/esm/agents/agent.js +112 -20
- package/lib/esm/agents/ai-agent.d.ts +3 -2
- package/lib/esm/agents/ai-agent.js +12 -9
- package/lib/{dts/models → esm/agents}/chat-model.d.ts +24 -13
- package/lib/esm/{models → agents}/chat-model.js +48 -7
- package/lib/esm/agents/guide-rail-agent.d.ts +62 -0
- package/lib/esm/agents/guide-rail-agent.js +11 -0
- package/lib/esm/agents/mcp-agent.js +9 -9
- package/lib/esm/agents/team-agent.js +2 -2
- package/lib/esm/aigne/aigne.d.ts +3 -2
- package/lib/esm/aigne/aigne.js +2 -2
- package/lib/esm/aigne/context.d.ts +2 -1
- package/lib/esm/aigne/context.js +9 -2
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/loader/agent-yaml.d.ts +1 -1
- package/lib/esm/loader/index.d.ts +18 -11
- package/lib/esm/loader/index.js +8 -27
- package/lib/esm/memory/retriever.d.ts +2 -2
- package/lib/esm/prompt/prompt-builder.d.ts +3 -3
- package/lib/esm/prompt/template.d.ts +3 -3
- package/lib/esm/prompt/template.js +1 -1
- package/lib/esm/utils/json-schema.js +1 -1
- package/lib/esm/utils/logger.d.ts +33 -8
- package/lib/esm/utils/logger.js +61 -4
- package/lib/esm/utils/model-utils.d.ts +1 -1
- package/lib/esm/utils/stream-utils.d.ts +3 -2
- package/lib/esm/utils/stream-utils.js +48 -25
- package/lib/esm/utils/type-utils.d.ts +5 -0
- package/package.json +1 -20
- package/lib/cjs/client/client.d.ts +0 -97
- package/lib/cjs/client/client.js +0 -87
- package/lib/cjs/client/index.d.ts +0 -1
- package/lib/cjs/client/index.js +0 -17
- package/lib/cjs/models/bedrock-chat-model.d.ts +0 -79
- package/lib/cjs/models/bedrock-chat-model.js +0 -303
- package/lib/cjs/models/claude-chat-model.d.ts +0 -114
- package/lib/cjs/models/claude-chat-model.js +0 -317
- package/lib/cjs/models/deepseek-chat-model.d.ts +0 -23
- package/lib/cjs/models/deepseek-chat-model.js +0 -35
- package/lib/cjs/models/gemini-chat-model.d.ts +0 -23
- package/lib/cjs/models/gemini-chat-model.js +0 -35
- package/lib/cjs/models/ollama-chat-model.d.ts +0 -22
- package/lib/cjs/models/ollama-chat-model.js +0 -34
- package/lib/cjs/models/open-router-chat-model.d.ts +0 -22
- package/lib/cjs/models/open-router-chat-model.js +0 -34
- package/lib/cjs/models/openai-chat-model.d.ts +0 -166
- package/lib/cjs/models/openai-chat-model.js +0 -415
- package/lib/cjs/models/xai-chat-model.d.ts +0 -21
- package/lib/cjs/models/xai-chat-model.js +0 -33
- package/lib/cjs/server/error.d.ts +0 -15
- package/lib/cjs/server/error.js +0 -22
- package/lib/cjs/server/index.d.ts +0 -2
- package/lib/cjs/server/index.js +0 -18
- package/lib/cjs/server/server.d.ts +0 -135
- package/lib/cjs/server/server.js +0 -188
- package/lib/dts/client/client.d.ts +0 -97
- package/lib/dts/client/index.d.ts +0 -1
- package/lib/dts/models/bedrock-chat-model.d.ts +0 -79
- package/lib/dts/models/claude-chat-model.d.ts +0 -114
- package/lib/dts/models/deepseek-chat-model.d.ts +0 -23
- package/lib/dts/models/gemini-chat-model.d.ts +0 -23
- package/lib/dts/models/ollama-chat-model.d.ts +0 -22
- package/lib/dts/models/open-router-chat-model.d.ts +0 -22
- package/lib/dts/models/openai-chat-model.d.ts +0 -166
- package/lib/dts/models/xai-chat-model.d.ts +0 -21
- package/lib/dts/server/error.d.ts +0 -15
- package/lib/dts/server/index.d.ts +0 -2
- package/lib/dts/server/server.d.ts +0 -135
- package/lib/esm/client/client.d.ts +0 -97
- package/lib/esm/client/client.js +0 -83
- package/lib/esm/client/index.d.ts +0 -1
- package/lib/esm/client/index.js +0 -1
- package/lib/esm/models/bedrock-chat-model.d.ts +0 -79
- package/lib/esm/models/bedrock-chat-model.js +0 -298
- package/lib/esm/models/claude-chat-model.d.ts +0 -114
- package/lib/esm/models/claude-chat-model.js +0 -310
- package/lib/esm/models/deepseek-chat-model.d.ts +0 -23
- package/lib/esm/models/deepseek-chat-model.js +0 -31
- package/lib/esm/models/gemini-chat-model.d.ts +0 -23
- package/lib/esm/models/gemini-chat-model.js +0 -31
- package/lib/esm/models/ollama-chat-model.d.ts +0 -22
- package/lib/esm/models/ollama-chat-model.js +0 -30
- package/lib/esm/models/open-router-chat-model.d.ts +0 -22
- package/lib/esm/models/open-router-chat-model.js +0 -30
- package/lib/esm/models/openai-chat-model.d.ts +0 -166
- package/lib/esm/models/openai-chat-model.js +0 -405
- package/lib/esm/models/xai-chat-model.d.ts +0 -21
- package/lib/esm/models/xai-chat-model.js +0 -29
- package/lib/esm/server/error.d.ts +0 -15
- package/lib/esm/server/error.js +0 -18
- package/lib/esm/server/index.d.ts +0 -2
- package/lib/esm/server/index.js +0 -2
- package/lib/esm/server/server.d.ts +0 -135
- package/lib/esm/server/server.js +0 -181
package/lib/cjs/server/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./error.js"), exports);
|
|
18
|
-
__exportStar(require("./server.js"), exports);
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { AIGNE } from "../aigne/aigne.js";
|
|
4
|
-
/**
|
|
5
|
-
* Schema for validating agent invocation payloads.
|
|
6
|
-
* Defines the expected structure for requests to invoke an agent.
|
|
7
|
-
*
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export declare const invokePayloadSchema: z.ZodObject<{
|
|
11
|
-
agent: z.ZodString;
|
|
12
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
13
|
-
options: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
14
|
-
streaming: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
streaming?: boolean | null | undefined;
|
|
17
|
-
}, {
|
|
18
|
-
streaming?: boolean | null | undefined;
|
|
19
|
-
}>>>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
agent: string;
|
|
22
|
-
input: Record<string, unknown>;
|
|
23
|
-
options?: {
|
|
24
|
-
streaming?: boolean | null | undefined;
|
|
25
|
-
} | null | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
agent: string;
|
|
28
|
-
input: Record<string, unknown>;
|
|
29
|
-
options?: {
|
|
30
|
-
streaming?: boolean | null | undefined;
|
|
31
|
-
} | null | undefined;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Configuration options for the AIGNEServer.
|
|
35
|
-
* These options control various aspects of server behavior including
|
|
36
|
-
* request parsing, payload limits, and response handling.
|
|
37
|
-
*/
|
|
38
|
-
export interface AIGNEServerOptions {
|
|
39
|
-
/**
|
|
40
|
-
* Maximum body size for incoming HTTP requests.
|
|
41
|
-
* This controls the upper limit of request payload size when parsing raw HTTP requests.
|
|
42
|
-
* Only used when working with Node.js IncomingMessage objects that don't already have
|
|
43
|
-
* a pre-parsed body property (e.g., when not using Express middleware).
|
|
44
|
-
*
|
|
45
|
-
* @default "4mb"
|
|
46
|
-
*/
|
|
47
|
-
maximumBodySize?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* AIGNEServer provides HTTP API access to AIGNE capabilities.
|
|
51
|
-
* It handles requests to invoke agents, manages response streaming,
|
|
52
|
-
* and supports multiple HTTP server frameworks including Node.js http,
|
|
53
|
-
* Express, and Fetch API compatible environments.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* Here's a simple example of how to use AIGNEServer with express:
|
|
57
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-express}
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* Here's an example of how to use AIGNEServer with Hono:
|
|
61
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-hono}
|
|
62
|
-
*/
|
|
63
|
-
export declare class AIGNEServer {
|
|
64
|
-
engine: AIGNE;
|
|
65
|
-
options?: AIGNEServerOptions | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a new AIGNEServer instance.
|
|
68
|
-
*
|
|
69
|
-
* @param engine - The AIGNE engine instance that will process agent invocations
|
|
70
|
-
* @param options - Configuration options for the server
|
|
71
|
-
*/
|
|
72
|
-
constructor(engine: AIGNE, options?: AIGNEServerOptions | undefined);
|
|
73
|
-
/**
|
|
74
|
-
* Invokes an agent with the provided input and returns a standard web Response.
|
|
75
|
-
* This method serves as the primary API endpoint for agent invocation.
|
|
76
|
-
*
|
|
77
|
-
* The request can be provided in various formats to support different integration scenarios:
|
|
78
|
-
* - As a pre-parsed JavaScript object
|
|
79
|
-
* - As a Fetch API Request instance (for modern web frameworks)
|
|
80
|
-
* - As a Node.js IncomingMessage (for Express, Fastify, etc.)
|
|
81
|
-
*
|
|
82
|
-
* @param request - The agent invocation request in any supported format
|
|
83
|
-
* @returns A web standard Response object that can be returned directly in frameworks
|
|
84
|
-
* like Hono, Next.js, or any Fetch API compatible environment
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* Here's a simple example of how to use AIGNEServer with Hono:
|
|
88
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-hono}
|
|
89
|
-
*/
|
|
90
|
-
invoke(request: Record<string, unknown> | Request | IncomingMessage): Promise<Response>;
|
|
91
|
-
/**
|
|
92
|
-
* Invokes an agent with the provided input and streams the response to a Node.js ServerResponse.
|
|
93
|
-
* This overload is specifically designed for Node.js HTTP server environments.
|
|
94
|
-
*
|
|
95
|
-
* The method handles both regular JSON responses and streaming Server-Sent Events (SSE)
|
|
96
|
-
* responses based on the options specified in the request.
|
|
97
|
-
*
|
|
98
|
-
* @param request - The agent invocation request in any supported format
|
|
99
|
-
* @param response - The Node.js ServerResponse object to write the response to
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* Here's a simple example of how to use AIGNEServer with express:
|
|
103
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-express}
|
|
104
|
-
*/
|
|
105
|
-
invoke(request: Record<string, unknown> | Request | IncomingMessage, response: ServerResponse): Promise<void>;
|
|
106
|
-
/**
|
|
107
|
-
* Internal method that handles the core logic of processing an agent invocation request.
|
|
108
|
-
* Validates the request payload, finds the requested agent, and processes the invocation
|
|
109
|
-
* with either streaming or non-streaming response handling.
|
|
110
|
-
*
|
|
111
|
-
* @param request - The parsed or raw request to process
|
|
112
|
-
* @returns A standard Response object with the invocation result
|
|
113
|
-
* @private
|
|
114
|
-
*/
|
|
115
|
-
_invoke(request: Record<string, unknown> | Request | IncomingMessage): Promise<Response>;
|
|
116
|
-
/**
|
|
117
|
-
* Prepares and normalizes the input from various request types.
|
|
118
|
-
* Handles different request formats (Node.js IncomingMessage, Fetch API Request,
|
|
119
|
-
* or already parsed object) and extracts the JSON payload.
|
|
120
|
-
*
|
|
121
|
-
* @param request - The request object in any supported format
|
|
122
|
-
* @returns The normalized payload as a JavaScript object
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
_prepareInput(request: Record<string, unknown> | Request | IncomingMessage): Promise<Record<string, unknown>>;
|
|
126
|
-
/**
|
|
127
|
-
* Writes a web standard Response object to a Node.js ServerResponse.
|
|
128
|
-
* Handles streaming responses and error conditions appropriately.
|
|
129
|
-
*
|
|
130
|
-
* @param response - The web standard Response object to write
|
|
131
|
-
* @param res - The Node.js ServerResponse to write to
|
|
132
|
-
* @private
|
|
133
|
-
*/
|
|
134
|
-
_writeResponse(response: Response, res: ServerResponse): Promise<void>;
|
|
135
|
-
}
|
package/lib/cjs/server/server.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AIGNEServer = exports.invokePayloadSchema = void 0;
|
|
7
|
-
const node_http_1 = require("node:http");
|
|
8
|
-
const content_type_1 = __importDefault(require("content-type"));
|
|
9
|
-
const raw_body_1 = __importDefault(require("raw-body"));
|
|
10
|
-
const zod_1 = require("zod");
|
|
11
|
-
const event_stream_js_1 = require("../utils/event-stream.js");
|
|
12
|
-
const stream_utils_js_1 = require("../utils/stream-utils.js");
|
|
13
|
-
const type_utils_js_1 = require("../utils/type-utils.js");
|
|
14
|
-
const error_js_1 = require("./error.js");
|
|
15
|
-
/**
|
|
16
|
-
* Default maximum allowed size for request bodies when parsing raw HTTP requests.
|
|
17
|
-
* This limits the amount of data that can be uploaded to protect against denial of service attacks.
|
|
18
|
-
* Can be overridden via AIGNEServerOptions.
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
const DEFAULT_MAXIMUM_BODY_SIZE = "4mb";
|
|
22
|
-
/**
|
|
23
|
-
* Schema for validating agent invocation payloads.
|
|
24
|
-
* Defines the expected structure for requests to invoke an agent.
|
|
25
|
-
*
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
exports.invokePayloadSchema = zod_1.z.object({
|
|
29
|
-
agent: zod_1.z.string(),
|
|
30
|
-
input: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
31
|
-
options: zod_1.z
|
|
32
|
-
.object({
|
|
33
|
-
streaming: zod_1.z.boolean().nullish(),
|
|
34
|
-
})
|
|
35
|
-
.nullish(),
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* AIGNEServer provides HTTP API access to AIGNE capabilities.
|
|
39
|
-
* It handles requests to invoke agents, manages response streaming,
|
|
40
|
-
* and supports multiple HTTP server frameworks including Node.js http,
|
|
41
|
-
* Express, and Fetch API compatible environments.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* Here's a simple example of how to use AIGNEServer with express:
|
|
45
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-express}
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* Here's an example of how to use AIGNEServer with Hono:
|
|
49
|
-
* {@includeCode ../../test/server/server.test.ts#example-aigne-server-hono}
|
|
50
|
-
*/
|
|
51
|
-
class AIGNEServer {
|
|
52
|
-
engine;
|
|
53
|
-
options;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new AIGNEServer instance.
|
|
56
|
-
*
|
|
57
|
-
* @param engine - The AIGNE engine instance that will process agent invocations
|
|
58
|
-
* @param options - Configuration options for the server
|
|
59
|
-
*/
|
|
60
|
-
constructor(engine, options) {
|
|
61
|
-
this.engine = engine;
|
|
62
|
-
this.options = options;
|
|
63
|
-
}
|
|
64
|
-
async invoke(request, response) {
|
|
65
|
-
const result = await this._invoke(request);
|
|
66
|
-
if (response instanceof node_http_1.ServerResponse) {
|
|
67
|
-
await this._writeResponse(result, response);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Internal method that handles the core logic of processing an agent invocation request.
|
|
74
|
-
* Validates the request payload, finds the requested agent, and processes the invocation
|
|
75
|
-
* with either streaming or non-streaming response handling.
|
|
76
|
-
*
|
|
77
|
-
* @param request - The parsed or raw request to process
|
|
78
|
-
* @returns A standard Response object with the invocation result
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
async _invoke(request) {
|
|
82
|
-
const { engine } = this;
|
|
83
|
-
try {
|
|
84
|
-
const payload = await this._prepareInput(request);
|
|
85
|
-
const { agent: agentName, input, options, } = (0, type_utils_js_1.tryOrThrow)(() => (0, type_utils_js_1.checkArguments)(`Invoke agent ${payload.agent}`, exports.invokePayloadSchema, payload), (error) => new error_js_1.ServerError(400, error.message));
|
|
86
|
-
const agent = engine.agents[agentName];
|
|
87
|
-
if (!agent)
|
|
88
|
-
throw new error_js_1.ServerError(404, `Agent ${agentName} not found`);
|
|
89
|
-
if (!options?.streaming) {
|
|
90
|
-
const result = await engine.invoke(agent, input);
|
|
91
|
-
return new Response(JSON.stringify(result), {
|
|
92
|
-
headers: { "Content-Type": "application/json" },
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const stream = await engine.invoke(agent, input, { streaming: true });
|
|
96
|
-
return new Response(new event_stream_js_1.AgentResponseStreamSSE(stream), {
|
|
97
|
-
headers: {
|
|
98
|
-
"Content-Type": "text/event-stream",
|
|
99
|
-
"Cache-Control": "no-cache",
|
|
100
|
-
"X-Accel-Buffering": "no",
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
return new Response(JSON.stringify({ error: { message: error.message } }), {
|
|
106
|
-
status: error instanceof error_js_1.ServerError ? error.status : 500,
|
|
107
|
-
headers: { "Content-Type": "application/json" },
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Prepares and normalizes the input from various request types.
|
|
113
|
-
* Handles different request formats (Node.js IncomingMessage, Fetch API Request,
|
|
114
|
-
* or already parsed object) and extracts the JSON payload.
|
|
115
|
-
*
|
|
116
|
-
* @param request - The request object in any supported format
|
|
117
|
-
* @returns The normalized payload as a JavaScript object
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
async _prepareInput(request) {
|
|
121
|
-
const contentTypeError = new error_js_1.ServerError(415, "Unsupported Media Type: Content-Type must be application/json");
|
|
122
|
-
if (request instanceof node_http_1.IncomingMessage) {
|
|
123
|
-
// Support for express with json() middleware
|
|
124
|
-
if ("body" in request && typeof request.body === "object") {
|
|
125
|
-
if (!(0, type_utils_js_1.isRecord)(request.body))
|
|
126
|
-
throw contentTypeError;
|
|
127
|
-
return request.body;
|
|
128
|
-
}
|
|
129
|
-
// Support vanilla nodejs http server
|
|
130
|
-
const maximumBodySize = this.options?.maximumBodySize || DEFAULT_MAXIMUM_BODY_SIZE;
|
|
131
|
-
const ct = request.headers["content-type"];
|
|
132
|
-
if (!ct || !ct.includes("application/json"))
|
|
133
|
-
throw contentTypeError;
|
|
134
|
-
const parsedCt = content_type_1.default.parse(ct);
|
|
135
|
-
const raw = await (0, raw_body_1.default)(request, {
|
|
136
|
-
limit: maximumBodySize,
|
|
137
|
-
encoding: parsedCt.parameters.charset ?? "utf-8",
|
|
138
|
-
});
|
|
139
|
-
return (0, type_utils_js_1.tryOrThrow)(() => JSON.parse(raw.toString()), (error) => new error_js_1.ServerError(400, `Parse request body to json error: ${error.message}`));
|
|
140
|
-
}
|
|
141
|
-
if (request instanceof Request) {
|
|
142
|
-
if (!request.headers.get("content-type")?.includes("application/json")) {
|
|
143
|
-
throw contentTypeError;
|
|
144
|
-
}
|
|
145
|
-
return await request.json();
|
|
146
|
-
}
|
|
147
|
-
if (!(0, type_utils_js_1.isRecord)(request))
|
|
148
|
-
throw contentTypeError;
|
|
149
|
-
return request;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Writes a web standard Response object to a Node.js ServerResponse.
|
|
153
|
-
* Handles streaming responses and error conditions appropriately.
|
|
154
|
-
*
|
|
155
|
-
* @param response - The web standard Response object to write
|
|
156
|
-
* @param res - The Node.js ServerResponse to write to
|
|
157
|
-
* @private
|
|
158
|
-
*/
|
|
159
|
-
async _writeResponse(response, res) {
|
|
160
|
-
try {
|
|
161
|
-
res.writeHead(response.status, response.headers.toJSON());
|
|
162
|
-
res.flushHeaders();
|
|
163
|
-
if (!response.body)
|
|
164
|
-
throw new Error("Response body is empty");
|
|
165
|
-
for await (const chunk of (0, stream_utils_js_1.readableStreamToAsyncIterator)(response.body)) {
|
|
166
|
-
res.write(chunk);
|
|
167
|
-
// Support for express with compression middleware
|
|
168
|
-
if ("flush" in res && typeof res.flush === "function") {
|
|
169
|
-
res.flush();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
174
|
-
if (!res.headersSent) {
|
|
175
|
-
res.writeHead(error instanceof error_js_1.ServerError ? error.status : 500, {
|
|
176
|
-
"Content-Type": "application/json",
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
if (res.writable) {
|
|
180
|
-
res.write(JSON.stringify({ error: { message: error.message } }));
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
res.end();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
exports.AIGNEServer = AIGNEServer;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client module used to interact with the AIGNE framework.
|
|
3
|
-
*/
|
|
4
|
-
import type { AgentInvokeOptions, AgentResponse, AgentResponseStream, Message } from "../agents/agent.js";
|
|
5
|
-
/**
|
|
6
|
-
* Configuration options for the AIGNEClient.
|
|
7
|
-
*/
|
|
8
|
-
export interface AIGNEClientOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The URL of the AIGNE server to connect to.
|
|
11
|
-
* This should point to the base endpoint where the AIGNEServer is hosted.
|
|
12
|
-
*/
|
|
13
|
-
url: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Options for invoking an agent through the AIGNEClient.
|
|
17
|
-
* Extends the standard AgentInvokeOptions with client-specific options.
|
|
18
|
-
*/
|
|
19
|
-
export interface AIGNEClientInvokeOptions extends AgentInvokeOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Additional fetch API options to customize the HTTP request.
|
|
22
|
-
* These options will be merged with the default options used by the client.
|
|
23
|
-
*/
|
|
24
|
-
fetchOptions?: Partial<RequestInit>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Client for interacting with a remote AIGNE server.
|
|
28
|
-
* AIGNEClient provides a client-side interface that matches the AIGNE API,
|
|
29
|
-
* allowing applications to invoke agents and receive responses from a remote AIGNE instance.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* Here's a simple example of how to use AIGNEClient:
|
|
33
|
-
* {@includeCode ../../test/client/client.test.ts#example-aigne-client-simple}
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* Here's an example of how to use AIGNEClient with streaming response:
|
|
37
|
-
* {@includeCode ../../test/client/client.test.ts#example-aigne-client-streaming}
|
|
38
|
-
*/
|
|
39
|
-
export declare class AIGNEClient {
|
|
40
|
-
options: AIGNEClientOptions;
|
|
41
|
-
/**
|
|
42
|
-
* Creates a new AIGNEClient instance.
|
|
43
|
-
*
|
|
44
|
-
* @param options - Configuration options for connecting to the AIGNE server
|
|
45
|
-
*/
|
|
46
|
-
constructor(options: AIGNEClientOptions);
|
|
47
|
-
/**
|
|
48
|
-
* Invokes an agent in non-streaming mode and returns the complete response.
|
|
49
|
-
*
|
|
50
|
-
* @param agent - Name of the agent to invoke
|
|
51
|
-
* @param input - Input message for the agent
|
|
52
|
-
* @param options - Options with streaming mode explicitly set to false or omitted
|
|
53
|
-
* @returns The complete agent response
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* Here's a simple example of how to use AIGNEClient:
|
|
57
|
-
* {@includeCode ../../test/client/client.test.ts#example-aigne-client-simple}
|
|
58
|
-
*/
|
|
59
|
-
invoke<I extends Message, O extends Message>(agent: string, input: I, options?: AIGNEClientInvokeOptions & {
|
|
60
|
-
streaming?: false;
|
|
61
|
-
}): Promise<O>;
|
|
62
|
-
/**
|
|
63
|
-
* Invokes an agent with streaming mode enabled and returns a stream of response chunks.
|
|
64
|
-
*
|
|
65
|
-
* @param agent - Name of the agent to invoke
|
|
66
|
-
* @param input - Input message for the agent
|
|
67
|
-
* @param options - Options with streaming mode explicitly set to true
|
|
68
|
-
* @returns A stream of agent response chunks
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* Here's an example of how to use AIGNEClient with streaming response:
|
|
72
|
-
* {@includeCode ../../test/client/client.test.ts#example-aigne-client-streaming}
|
|
73
|
-
*/
|
|
74
|
-
invoke<I extends Message, O extends Message>(agent: string, input: I, options: AIGNEClientInvokeOptions & {
|
|
75
|
-
streaming: true;
|
|
76
|
-
}): Promise<AgentResponseStream<O>>;
|
|
77
|
-
/**
|
|
78
|
-
* Invokes an agent with the given input and options.
|
|
79
|
-
*
|
|
80
|
-
* @param agent - Name of the agent to invoke
|
|
81
|
-
* @param input - Input message for the agent
|
|
82
|
-
* @param options - Options for the invocation
|
|
83
|
-
* @returns Either a complete response or a response stream depending on the streaming option
|
|
84
|
-
*/
|
|
85
|
-
invoke<I extends Message, O extends Message>(agent: string, input: I, options?: AIGNEClientInvokeOptions): Promise<AgentResponse<O>>;
|
|
86
|
-
/**
|
|
87
|
-
* Enhanced fetch method that handles error responses from the AIGNE server.
|
|
88
|
-
* This method wraps the standard fetch API to provide better error handling and reporting.
|
|
89
|
-
*
|
|
90
|
-
* @param args - Standard fetch API arguments (url and options)
|
|
91
|
-
* @returns A Response object if the request was successful
|
|
92
|
-
* @throws Error with detailed information if the request failed
|
|
93
|
-
*
|
|
94
|
-
* @private
|
|
95
|
-
*/
|
|
96
|
-
fetch(...args: Parameters<typeof globalThis.fetch>): Promise<Response>;
|
|
97
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client.js";
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { AgentResponse } from "../agents/agent.js";
|
|
4
|
-
import { ChatModel, type ChatModelInput, type ChatModelOptions, type ChatModelOutput } from "./chat-model.js";
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export declare function extractLastJsonObject(text: string): string | null;
|
|
9
|
-
export interface BedrockChatModelOptions {
|
|
10
|
-
accessKeyId?: string;
|
|
11
|
-
secretAccessKey?: string;
|
|
12
|
-
region?: string;
|
|
13
|
-
model?: string;
|
|
14
|
-
modelOptions?: ChatModelOptions;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export declare const bedrockChatModelOptionsSchema: z.ZodObject<{
|
|
20
|
-
region: z.ZodOptional<z.ZodString>;
|
|
21
|
-
model: z.ZodOptional<z.ZodString>;
|
|
22
|
-
modelOptions: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
model: z.ZodOptional<z.ZodString>;
|
|
24
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
parallelToolCalls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
parallelToolCalls: boolean;
|
|
31
|
-
model?: string | undefined;
|
|
32
|
-
temperature?: number | undefined;
|
|
33
|
-
topP?: number | undefined;
|
|
34
|
-
frequencyPenalty?: number | undefined;
|
|
35
|
-
presencePenalty?: number | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
model?: string | undefined;
|
|
38
|
-
temperature?: number | undefined;
|
|
39
|
-
topP?: number | undefined;
|
|
40
|
-
frequencyPenalty?: number | undefined;
|
|
41
|
-
presencePenalty?: number | undefined;
|
|
42
|
-
parallelToolCalls?: boolean | undefined;
|
|
43
|
-
}>>;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
modelOptions?: {
|
|
46
|
-
parallelToolCalls: boolean;
|
|
47
|
-
model?: string | undefined;
|
|
48
|
-
temperature?: number | undefined;
|
|
49
|
-
topP?: number | undefined;
|
|
50
|
-
frequencyPenalty?: number | undefined;
|
|
51
|
-
presencePenalty?: number | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
model?: string | undefined;
|
|
54
|
-
region?: string | undefined;
|
|
55
|
-
}, {
|
|
56
|
-
modelOptions?: {
|
|
57
|
-
model?: string | undefined;
|
|
58
|
-
temperature?: number | undefined;
|
|
59
|
-
topP?: number | undefined;
|
|
60
|
-
frequencyPenalty?: number | undefined;
|
|
61
|
-
presencePenalty?: number | undefined;
|
|
62
|
-
parallelToolCalls?: boolean | undefined;
|
|
63
|
-
} | undefined;
|
|
64
|
-
model?: string | undefined;
|
|
65
|
-
region?: string | undefined;
|
|
66
|
-
}>;
|
|
67
|
-
export declare class BedrockChatModel extends ChatModel {
|
|
68
|
-
options?: BedrockChatModelOptions | undefined;
|
|
69
|
-
constructor(options?: BedrockChatModelOptions | undefined);
|
|
70
|
-
/**
|
|
71
|
-
* @hidden
|
|
72
|
-
*/
|
|
73
|
-
protected _client?: BedrockRuntimeClient;
|
|
74
|
-
get client(): BedrockRuntimeClient;
|
|
75
|
-
get modelOptions(): ChatModelOptions | undefined;
|
|
76
|
-
process(input: ChatModelInput): Promise<AgentResponse<ChatModelOutput>>;
|
|
77
|
-
private extractResultFromStream;
|
|
78
|
-
private requestStructuredOutput;
|
|
79
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { AgentProcessResult } from "../agents/agent.js";
|
|
4
|
-
import { type PromiseOrValue } from "../utils/type-utils.js";
|
|
5
|
-
import { ChatModel, type ChatModelInput, type ChatModelOptions, type ChatModelOutput } from "./chat-model.js";
|
|
6
|
-
/**
|
|
7
|
-
* Configuration options for Claude Chat Model
|
|
8
|
-
*/
|
|
9
|
-
export interface ClaudeChatModelOptions {
|
|
10
|
-
/**
|
|
11
|
-
* API key for Anthropic's Claude API
|
|
12
|
-
*
|
|
13
|
-
* If not provided, will look for ANTHROPIC_API_KEY or CLAUDE_API_KEY in environment variables
|
|
14
|
-
*/
|
|
15
|
-
apiKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Claude model to use
|
|
18
|
-
*
|
|
19
|
-
* Defaults to 'claude-3-7-sonnet-latest'
|
|
20
|
-
*/
|
|
21
|
-
model?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Additional model options to control behavior
|
|
24
|
-
*/
|
|
25
|
-
modelOptions?: ChatModelOptions;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
export declare const claudeChatModelOptionsSchema: z.ZodObject<{
|
|
31
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
32
|
-
model: z.ZodOptional<z.ZodString>;
|
|
33
|
-
modelOptions: z.ZodOptional<z.ZodObject<{
|
|
34
|
-
model: z.ZodOptional<z.ZodString>;
|
|
35
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
|
37
|
-
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
parallelToolCalls: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
parallelToolCalls: boolean;
|
|
42
|
-
model?: string | undefined;
|
|
43
|
-
temperature?: number | undefined;
|
|
44
|
-
topP?: number | undefined;
|
|
45
|
-
frequencyPenalty?: number | undefined;
|
|
46
|
-
presencePenalty?: number | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
model?: string | undefined;
|
|
49
|
-
temperature?: number | undefined;
|
|
50
|
-
topP?: number | undefined;
|
|
51
|
-
frequencyPenalty?: number | undefined;
|
|
52
|
-
presencePenalty?: number | undefined;
|
|
53
|
-
parallelToolCalls?: boolean | undefined;
|
|
54
|
-
}>>;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
modelOptions?: {
|
|
57
|
-
parallelToolCalls: boolean;
|
|
58
|
-
model?: string | undefined;
|
|
59
|
-
temperature?: number | undefined;
|
|
60
|
-
topP?: number | undefined;
|
|
61
|
-
frequencyPenalty?: number | undefined;
|
|
62
|
-
presencePenalty?: number | undefined;
|
|
63
|
-
} | undefined;
|
|
64
|
-
model?: string | undefined;
|
|
65
|
-
apiKey?: string | undefined;
|
|
66
|
-
}, {
|
|
67
|
-
modelOptions?: {
|
|
68
|
-
model?: string | undefined;
|
|
69
|
-
temperature?: number | undefined;
|
|
70
|
-
topP?: number | undefined;
|
|
71
|
-
frequencyPenalty?: number | undefined;
|
|
72
|
-
presencePenalty?: number | undefined;
|
|
73
|
-
parallelToolCalls?: boolean | undefined;
|
|
74
|
-
} | undefined;
|
|
75
|
-
model?: string | undefined;
|
|
76
|
-
apiKey?: string | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* Implementation of the ChatModel interface for Anthropic's Claude API
|
|
80
|
-
*
|
|
81
|
-
* This model provides access to Claude's capabilities including:
|
|
82
|
-
* - Text generation
|
|
83
|
-
* - Tool use
|
|
84
|
-
* - JSON structured output
|
|
85
|
-
*
|
|
86
|
-
* Default model: 'claude-3-7-sonnet-latest'
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* Here's how to create and use a Claude chat model:
|
|
90
|
-
* {@includeCode ../../test/models/claude-chat-model.test.ts#example-claude-chat-model}
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* Here's an example with streaming response:
|
|
94
|
-
* {@includeCode ../../test/models/claude-chat-model.test.ts#example-claude-chat-model-streaming-async-generator}
|
|
95
|
-
*/
|
|
96
|
-
export declare class ClaudeChatModel extends ChatModel {
|
|
97
|
-
options?: ClaudeChatModelOptions | undefined;
|
|
98
|
-
constructor(options?: ClaudeChatModelOptions | undefined);
|
|
99
|
-
/**
|
|
100
|
-
* @hidden
|
|
101
|
-
*/
|
|
102
|
-
protected _client?: Anthropic;
|
|
103
|
-
get client(): Anthropic;
|
|
104
|
-
get modelOptions(): ChatModelOptions | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Process the input using Claude's chat model
|
|
107
|
-
* @param input - The input to process
|
|
108
|
-
* @returns The processed output from the model
|
|
109
|
-
*/
|
|
110
|
-
process(input: ChatModelInput): PromiseOrValue<AgentProcessResult<ChatModelOutput>>;
|
|
111
|
-
private _process;
|
|
112
|
-
private extractResultFromClaudeStream;
|
|
113
|
-
private requestStructuredOutput;
|
|
114
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OpenAIChatModel, type OpenAIChatModelOptions } from "./openai-chat-model.js";
|
|
2
|
-
/**
|
|
3
|
-
* Implementation of the ChatModel interface for DeepSeek's API
|
|
4
|
-
*
|
|
5
|
-
* This model uses OpenAI-compatible API format to interact with DeepSeek's models,
|
|
6
|
-
* but with specific configuration and capabilities for DeepSeek.
|
|
7
|
-
*
|
|
8
|
-
* Default model: 'deepseek-chat'
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* Here's how to create and use a DeepSeek chat model:
|
|
12
|
-
* {@includeCode ../../test/models/deepseek-chat-model.test.ts#example-deepseek-chat-model}
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* Here's an example with streaming response:
|
|
16
|
-
* {@includeCode ../../test/models/deepseek-chat-model.test.ts#example-deepseek-chat-model-streaming}
|
|
17
|
-
*/
|
|
18
|
-
export declare class DeepSeekChatModel extends OpenAIChatModel {
|
|
19
|
-
constructor(options?: OpenAIChatModelOptions);
|
|
20
|
-
protected apiKeyEnvName: string;
|
|
21
|
-
protected supportsNativeStructuredOutputs: boolean;
|
|
22
|
-
protected supportsToolsEmptyParameters: boolean;
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OpenAIChatModel, type OpenAIChatModelOptions } from "./openai-chat-model.js";
|
|
2
|
-
/**
|
|
3
|
-
* Implementation of the ChatModel interface for Google's Gemini API
|
|
4
|
-
*
|
|
5
|
-
* This model uses OpenAI-compatible API format to interact with Google's Gemini models,
|
|
6
|
-
* providing access to models like Gemini 1.5 and Gemini 2.0.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* Here's how to create and use a Gemini chat model:
|
|
10
|
-
* {@includeCode ../../test/models/gemini-chat-model.test.ts#example-gemini-chat-model}
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* Here's an example with streaming response:
|
|
14
|
-
* {@includeCode ../../test/models/gemini-chat-model.test.ts#example-gemini-chat-model-streaming}
|
|
15
|
-
*/
|
|
16
|
-
export declare class GeminiChatModel extends OpenAIChatModel {
|
|
17
|
-
constructor(options?: OpenAIChatModelOptions);
|
|
18
|
-
protected apiKeyEnvName: string;
|
|
19
|
-
protected supportsEndWithSystemMessage: boolean;
|
|
20
|
-
protected supportsToolsUseWithJsonSchema: boolean;
|
|
21
|
-
protected supportsParallelToolCalls: boolean;
|
|
22
|
-
protected supportsToolStreaming: boolean;
|
|
23
|
-
}
|