@aigne/core 1.65.0-beta → 1.65.0-beta.2
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 +19 -0
- package/lib/cjs/agents/image-model.d.ts +3 -3
- package/lib/cjs/agents/model.d.ts +2 -2
- package/lib/cjs/agents/model.js +4 -1
- package/lib/cjs/agents/video-model.d.ts +11 -3
- package/lib/cjs/agents/video-model.js +1 -0
- package/lib/cjs/loader/agent-yaml.js +2 -1
- package/lib/cjs/loader/function-agent.d.ts +2 -0
- package/lib/cjs/loader/function-agent.js +7 -0
- package/lib/dts/agents/image-model.d.ts +3 -3
- package/lib/dts/agents/model.d.ts +2 -2
- package/lib/dts/agents/video-model.d.ts +11 -3
- package/lib/dts/loader/function-agent.d.ts +2 -0
- package/lib/esm/agents/image-model.d.ts +3 -3
- package/lib/esm/agents/model.d.ts +2 -2
- package/lib/esm/agents/model.js +4 -1
- package/lib/esm/agents/video-model.d.ts +11 -3
- package/lib/esm/agents/video-model.js +1 -0
- package/lib/esm/loader/agent-yaml.js +2 -1
- package/lib/esm/loader/function-agent.d.ts +2 -0
- package/lib/esm/loader/function-agent.js +4 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.65.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.0-beta.1...core-v1.65.0-beta.2) (2025-10-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **core:** added support for URL file type handling, expanding the range of supported file formats ([#671](https://github.com/AIGNE-io/aigne-framework/issues/671)) ([fea4519](https://github.com/AIGNE-io/aigne-framework/commit/fea45197e87cf7b19499c48b41626062824d1355))
|
|
9
|
+
|
|
10
|
+
## [1.65.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.65.0-beta...core-v1.65.0-beta.1) (2025-10-26)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* support define function agent by yaml ([#668](https://github.com/AIGNE-io/aigne-framework/issues/668)) ([2fde8cc](https://github.com/AIGNE-io/aigne-framework/commit/2fde8cc44b213fc2d4c20d91c3c8a8b3c2eb140e))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **models:** aigne hub video params ([#665](https://github.com/AIGNE-io/aigne-framework/issues/665)) ([d00f836](https://github.com/AIGNE-io/aigne-framework/commit/d00f8368422d8e3707b974e1aff06714731ebb28))
|
|
21
|
+
|
|
3
22
|
## [1.65.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/core-v1.64.1-beta...core-v1.65.0-beta) (2025-10-24)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -85,7 +85,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
85
85
|
mimeType?: string | undefined;
|
|
86
86
|
}>]>, "many">>;
|
|
87
87
|
n: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
88
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
89
89
|
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
90
90
|
}, "strip", z.ZodTypeAny, {
|
|
91
91
|
prompt: string;
|
|
@@ -106,7 +106,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
106
106
|
filename?: string | undefined;
|
|
107
107
|
mimeType?: string | undefined;
|
|
108
108
|
})[] | undefined;
|
|
109
|
-
outputFileType?: "local" | "file" | undefined;
|
|
109
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
110
110
|
n?: number | undefined;
|
|
111
111
|
}, {
|
|
112
112
|
prompt: string;
|
|
@@ -127,7 +127,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
127
127
|
filename?: string | undefined;
|
|
128
128
|
mimeType?: string | undefined;
|
|
129
129
|
})[] | undefined;
|
|
130
|
-
outputFileType?: "local" | "file" | undefined;
|
|
130
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
131
131
|
n?: number | undefined;
|
|
132
132
|
}>;
|
|
133
133
|
export interface ImageModelOutput extends Message {
|
|
@@ -8,8 +8,8 @@ export declare abstract class Model<I extends Message = any, O extends Message =
|
|
|
8
8
|
static getMimeType(filename: string): Promise<string | undefined>;
|
|
9
9
|
downloadFile(url: string): Promise<Response>;
|
|
10
10
|
}
|
|
11
|
-
export type FileType = "local" | "file";
|
|
12
|
-
export declare const fileTypeSchema: z.ZodEnum<["local", "file"]>;
|
|
11
|
+
export type FileType = "local" | "file" | "url";
|
|
12
|
+
export declare const fileTypeSchema: z.ZodEnum<["local", "file", "url"]>;
|
|
13
13
|
export interface FileContentBase {
|
|
14
14
|
filename?: string;
|
|
15
15
|
mimeType?: string;
|
package/lib/cjs/agents/model.js
CHANGED
|
@@ -86,6 +86,9 @@ class Model extends agent_js_1.Agent {
|
|
|
86
86
|
}
|
|
87
87
|
return { ...common, type: "file", data: base64, mimeType };
|
|
88
88
|
}
|
|
89
|
+
default: {
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
static async getFileExtension(type) {
|
|
@@ -106,7 +109,7 @@ class Model extends agent_js_1.Agent {
|
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
exports.Model = Model;
|
|
109
|
-
exports.fileTypeSchema = zod_1.z.enum(["local", "file"]);
|
|
112
|
+
exports.fileTypeSchema = zod_1.z.enum(["local", "file", "url"]);
|
|
110
113
|
exports.fileContentBaseSchema = zod_1.z.object({
|
|
111
114
|
filename: (0, schema_js_1.optionalize)(zod_1.z.string()),
|
|
112
115
|
mimeType: (0, schema_js_1.optionalize)(zod_1.z.string()),
|
|
@@ -5,6 +5,7 @@ import { type ChatModelOutputUsage } from "./chat-model.js";
|
|
|
5
5
|
import { type FileType, type FileUnionContent, Model } from "./model.js";
|
|
6
6
|
export interface VideoModelOptions<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Omit<AgentOptions<I, O>, "model"> {
|
|
7
7
|
model?: string;
|
|
8
|
+
modelOptions?: Omit<VideoModelInputOptions, "model">;
|
|
8
9
|
}
|
|
9
10
|
export declare abstract class VideoModel<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Model<I, O> {
|
|
10
11
|
options?: VideoModelOptions<I, O> | undefined;
|
|
@@ -26,23 +27,30 @@ export interface VideoModelInput extends Message {
|
|
|
26
27
|
size?: string;
|
|
27
28
|
seconds?: string;
|
|
28
29
|
outputFileType?: FileType;
|
|
30
|
+
modelOptions?: VideoModelInputOptions;
|
|
31
|
+
}
|
|
32
|
+
export interface VideoModelInputOptions extends Record<string, unknown> {
|
|
33
|
+
model?: string;
|
|
29
34
|
}
|
|
30
35
|
export declare const videoModelInputSchema: z.ZodObject<{
|
|
31
36
|
prompt: z.ZodString;
|
|
32
37
|
model: z.ZodOptional<z.ZodString>;
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
40
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
39
|
-
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
46
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
45
|
-
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
53
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
48
56
|
}>;
|
|
@@ -55,6 +55,7 @@ exports.videoModelInputSchema = zod_1.z.object({
|
|
|
55
55
|
size: zod_1.z.string().optional().describe("Size/resolution of the video"),
|
|
56
56
|
seconds: zod_1.z.string().optional().describe("Duration of the video in seconds"),
|
|
57
57
|
outputFileType: model_js_1.fileTypeSchema.optional(),
|
|
58
|
+
modelOptions: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
58
59
|
});
|
|
59
60
|
exports.videoModelOutputSchema = zod_1.z.object({
|
|
60
61
|
videos: zod_1.z.array(model_js_1.fileUnionContentSchema),
|
|
@@ -10,6 +10,7 @@ const ai_agent_js_1 = require("../agents/ai-agent.js");
|
|
|
10
10
|
const chat_model_js_1 = require("../agents/chat-model.js");
|
|
11
11
|
const team_agent_js_1 = require("../agents/team-agent.js");
|
|
12
12
|
const type_utils_js_1 = require("../utils/type-utils.js");
|
|
13
|
+
const function_agent_js_1 = require("./function-agent.js");
|
|
13
14
|
const schema_js_1 = require("./schema.js");
|
|
14
15
|
async function parseAgentFile(path, data) {
|
|
15
16
|
const agentSchema = zod_1.z.lazy(() => {
|
|
@@ -166,7 +167,7 @@ async function parseAgentFile(path, data) {
|
|
|
166
167
|
zod_1.z
|
|
167
168
|
.object({
|
|
168
169
|
type: zod_1.z.literal("function"),
|
|
169
|
-
process: zod_1.z.custom(),
|
|
170
|
+
process: zod_1.z.preprocess((v) => (typeof v === "string" ? (0, function_agent_js_1.codeToFunctionAgentFn)(v) : v), zod_1.z.custom()),
|
|
170
171
|
})
|
|
171
172
|
.extend(baseAgentSchema.shape),
|
|
172
173
|
]));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.codeToFunctionAgentFn = codeToFunctionAgentFn;
|
|
4
|
+
function codeToFunctionAgentFn(code) {
|
|
5
|
+
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
|
|
6
|
+
return new AsyncFunction("input", "options", code);
|
|
7
|
+
}
|
|
@@ -85,7 +85,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
85
85
|
mimeType?: string | undefined;
|
|
86
86
|
}>]>, "many">>;
|
|
87
87
|
n: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
88
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
89
89
|
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
90
90
|
}, "strip", z.ZodTypeAny, {
|
|
91
91
|
prompt: string;
|
|
@@ -106,7 +106,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
106
106
|
filename?: string | undefined;
|
|
107
107
|
mimeType?: string | undefined;
|
|
108
108
|
})[] | undefined;
|
|
109
|
-
outputFileType?: "local" | "file" | undefined;
|
|
109
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
110
110
|
n?: number | undefined;
|
|
111
111
|
}, {
|
|
112
112
|
prompt: string;
|
|
@@ -127,7 +127,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
127
127
|
filename?: string | undefined;
|
|
128
128
|
mimeType?: string | undefined;
|
|
129
129
|
})[] | undefined;
|
|
130
|
-
outputFileType?: "local" | "file" | undefined;
|
|
130
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
131
131
|
n?: number | undefined;
|
|
132
132
|
}>;
|
|
133
133
|
export interface ImageModelOutput extends Message {
|
|
@@ -8,8 +8,8 @@ export declare abstract class Model<I extends Message = any, O extends Message =
|
|
|
8
8
|
static getMimeType(filename: string): Promise<string | undefined>;
|
|
9
9
|
downloadFile(url: string): Promise<Response>;
|
|
10
10
|
}
|
|
11
|
-
export type FileType = "local" | "file";
|
|
12
|
-
export declare const fileTypeSchema: z.ZodEnum<["local", "file"]>;
|
|
11
|
+
export type FileType = "local" | "file" | "url";
|
|
12
|
+
export declare const fileTypeSchema: z.ZodEnum<["local", "file", "url"]>;
|
|
13
13
|
export interface FileContentBase {
|
|
14
14
|
filename?: string;
|
|
15
15
|
mimeType?: string;
|
|
@@ -5,6 +5,7 @@ import { type ChatModelOutputUsage } from "./chat-model.js";
|
|
|
5
5
|
import { type FileType, type FileUnionContent, Model } from "./model.js";
|
|
6
6
|
export interface VideoModelOptions<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Omit<AgentOptions<I, O>, "model"> {
|
|
7
7
|
model?: string;
|
|
8
|
+
modelOptions?: Omit<VideoModelInputOptions, "model">;
|
|
8
9
|
}
|
|
9
10
|
export declare abstract class VideoModel<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Model<I, O> {
|
|
10
11
|
options?: VideoModelOptions<I, O> | undefined;
|
|
@@ -26,23 +27,30 @@ export interface VideoModelInput extends Message {
|
|
|
26
27
|
size?: string;
|
|
27
28
|
seconds?: string;
|
|
28
29
|
outputFileType?: FileType;
|
|
30
|
+
modelOptions?: VideoModelInputOptions;
|
|
31
|
+
}
|
|
32
|
+
export interface VideoModelInputOptions extends Record<string, unknown> {
|
|
33
|
+
model?: string;
|
|
29
34
|
}
|
|
30
35
|
export declare const videoModelInputSchema: z.ZodObject<{
|
|
31
36
|
prompt: z.ZodString;
|
|
32
37
|
model: z.ZodOptional<z.ZodString>;
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
40
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
39
|
-
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
46
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
45
|
-
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
53
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
48
56
|
}>;
|
|
@@ -85,7 +85,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
85
85
|
mimeType?: string | undefined;
|
|
86
86
|
}>]>, "many">>;
|
|
87
87
|
n: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
88
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
89
89
|
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
90
90
|
}, "strip", z.ZodTypeAny, {
|
|
91
91
|
prompt: string;
|
|
@@ -106,7 +106,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
106
106
|
filename?: string | undefined;
|
|
107
107
|
mimeType?: string | undefined;
|
|
108
108
|
})[] | undefined;
|
|
109
|
-
outputFileType?: "local" | "file" | undefined;
|
|
109
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
110
110
|
n?: number | undefined;
|
|
111
111
|
}, {
|
|
112
112
|
prompt: string;
|
|
@@ -127,7 +127,7 @@ export declare const imageModelInputSchema: z.ZodObject<{
|
|
|
127
127
|
filename?: string | undefined;
|
|
128
128
|
mimeType?: string | undefined;
|
|
129
129
|
})[] | undefined;
|
|
130
|
-
outputFileType?: "local" | "file" | undefined;
|
|
130
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
131
131
|
n?: number | undefined;
|
|
132
132
|
}>;
|
|
133
133
|
export interface ImageModelOutput extends Message {
|
|
@@ -8,8 +8,8 @@ export declare abstract class Model<I extends Message = any, O extends Message =
|
|
|
8
8
|
static getMimeType(filename: string): Promise<string | undefined>;
|
|
9
9
|
downloadFile(url: string): Promise<Response>;
|
|
10
10
|
}
|
|
11
|
-
export type FileType = "local" | "file";
|
|
12
|
-
export declare const fileTypeSchema: z.ZodEnum<["local", "file"]>;
|
|
11
|
+
export type FileType = "local" | "file" | "url";
|
|
12
|
+
export declare const fileTypeSchema: z.ZodEnum<["local", "file", "url"]>;
|
|
13
13
|
export interface FileContentBase {
|
|
14
14
|
filename?: string;
|
|
15
15
|
mimeType?: string;
|
package/lib/esm/agents/model.js
CHANGED
|
@@ -50,6 +50,9 @@ export class Model extends Agent {
|
|
|
50
50
|
}
|
|
51
51
|
return { ...common, type: "file", data: base64, mimeType };
|
|
52
52
|
}
|
|
53
|
+
default: {
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
static async getFileExtension(type) {
|
|
@@ -69,7 +72,7 @@ export class Model extends Agent {
|
|
|
69
72
|
return response;
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
|
-
export const fileTypeSchema = z.enum(["local", "file"]);
|
|
75
|
+
export const fileTypeSchema = z.enum(["local", "file", "url"]);
|
|
73
76
|
export const fileContentBaseSchema = z.object({
|
|
74
77
|
filename: optionalize(z.string()),
|
|
75
78
|
mimeType: optionalize(z.string()),
|
|
@@ -5,6 +5,7 @@ import { type ChatModelOutputUsage } from "./chat-model.js";
|
|
|
5
5
|
import { type FileType, type FileUnionContent, Model } from "./model.js";
|
|
6
6
|
export interface VideoModelOptions<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Omit<AgentOptions<I, O>, "model"> {
|
|
7
7
|
model?: string;
|
|
8
|
+
modelOptions?: Omit<VideoModelInputOptions, "model">;
|
|
8
9
|
}
|
|
9
10
|
export declare abstract class VideoModel<I extends VideoModelInput = VideoModelInput, O extends VideoModelOutput = VideoModelOutput> extends Model<I, O> {
|
|
10
11
|
options?: VideoModelOptions<I, O> | undefined;
|
|
@@ -26,23 +27,30 @@ export interface VideoModelInput extends Message {
|
|
|
26
27
|
size?: string;
|
|
27
28
|
seconds?: string;
|
|
28
29
|
outputFileType?: FileType;
|
|
30
|
+
modelOptions?: VideoModelInputOptions;
|
|
31
|
+
}
|
|
32
|
+
export interface VideoModelInputOptions extends Record<string, unknown> {
|
|
33
|
+
model?: string;
|
|
29
34
|
}
|
|
30
35
|
export declare const videoModelInputSchema: z.ZodObject<{
|
|
31
36
|
prompt: z.ZodString;
|
|
32
37
|
model: z.ZodOptional<z.ZodString>;
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
|
-
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
40
|
+
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file", "url"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
39
|
-
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
46
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
45
|
-
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
53
|
+
outputFileType?: "local" | "file" | "url" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
48
56
|
}>;
|
|
@@ -51,6 +51,7 @@ export const videoModelInputSchema = z.object({
|
|
|
51
51
|
size: z.string().optional().describe("Size/resolution of the video"),
|
|
52
52
|
seconds: z.string().optional().describe("Duration of the video in seconds"),
|
|
53
53
|
outputFileType: fileTypeSchema.optional(),
|
|
54
|
+
modelOptions: z.record(z.unknown()).optional(),
|
|
54
55
|
});
|
|
55
56
|
export const videoModelOutputSchema = z.object({
|
|
56
57
|
videos: z.array(fileUnionContentSchema),
|
|
@@ -6,6 +6,7 @@ import { AIAgentToolChoice } from "../agents/ai-agent.js";
|
|
|
6
6
|
import { roleSchema } from "../agents/chat-model.js";
|
|
7
7
|
import { ProcessMode } from "../agents/team-agent.js";
|
|
8
8
|
import { tryOrThrow } from "../utils/type-utils.js";
|
|
9
|
+
import { codeToFunctionAgentFn } from "./function-agent.js";
|
|
9
10
|
import { camelizeSchema, chatModelSchema, defaultInputSchema, imageModelSchema, inputOutputSchema, optionalize, } from "./schema.js";
|
|
10
11
|
export async function parseAgentFile(path, data) {
|
|
11
12
|
const agentSchema = z.lazy(() => {
|
|
@@ -162,7 +163,7 @@ export async function parseAgentFile(path, data) {
|
|
|
162
163
|
z
|
|
163
164
|
.object({
|
|
164
165
|
type: z.literal("function"),
|
|
165
|
-
process: z.custom(),
|
|
166
|
+
process: z.preprocess((v) => (typeof v === "string" ? codeToFunctionAgentFn(v) : v), z.custom()),
|
|
166
167
|
})
|
|
167
168
|
.extend(baseAgentSchema.shape),
|
|
168
169
|
]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/core",
|
|
3
|
-
"version": "1.65.0-beta",
|
|
3
|
+
"version": "1.65.0-beta.2",
|
|
4
4
|
"description": "The functional core of agentic AI",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"zod-from-json-schema": "^0.0.5",
|
|
93
93
|
"zod-to-json-schema": "^3.24.6",
|
|
94
94
|
"@aigne/afs": "^1.1.1-beta",
|
|
95
|
-
"@aigne/
|
|
96
|
-
"@aigne/
|
|
95
|
+
"@aigne/platform-helpers": "^0.6.3",
|
|
96
|
+
"@aigne/observability-api": "^0.11.3"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@types/bun": "^1.2.22",
|