@aigne/core 1.65.0-beta → 1.65.0-beta.1
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 +12 -0
- package/lib/cjs/agents/video-model.d.ts +8 -0
- 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/video-model.d.ts +8 -0
- package/lib/dts/loader/function-agent.d.ts +2 -0
- package/lib/esm/agents/video-model.d.ts +8 -0
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **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))
|
|
14
|
+
|
|
3
15
|
## [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
16
|
|
|
5
17
|
|
|
@@ -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,6 +27,10 @@ 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;
|
|
@@ -33,15 +38,18 @@ export declare const videoModelInputSchema: z.ZodObject<{
|
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
40
|
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
39
46
|
outputFileType?: "local" | "file" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
45
53
|
outputFileType?: "local" | "file" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
@@ -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
|
+
}
|
|
@@ -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,6 +27,10 @@ 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;
|
|
@@ -33,15 +38,18 @@ export declare const videoModelInputSchema: z.ZodObject<{
|
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
40
|
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
39
46
|
outputFileType?: "local" | "file" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
45
53
|
outputFileType?: "local" | "file" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
@@ -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,6 +27,10 @@ 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;
|
|
@@ -33,15 +38,18 @@ export declare const videoModelInputSchema: z.ZodObject<{
|
|
|
33
38
|
size: z.ZodOptional<z.ZodString>;
|
|
34
39
|
seconds: z.ZodOptional<z.ZodString>;
|
|
35
40
|
outputFileType: z.ZodOptional<z.ZodEnum<["local", "file"]>>;
|
|
41
|
+
modelOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
42
|
}, "strip", z.ZodTypeAny, {
|
|
37
43
|
prompt: string;
|
|
38
44
|
model?: string | undefined;
|
|
45
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
39
46
|
outputFileType?: "local" | "file" | undefined;
|
|
40
47
|
size?: string | undefined;
|
|
41
48
|
seconds?: string | undefined;
|
|
42
49
|
}, {
|
|
43
50
|
prompt: string;
|
|
44
51
|
model?: string | undefined;
|
|
52
|
+
modelOptions?: Record<string, unknown> | undefined;
|
|
45
53
|
outputFileType?: "local" | "file" | undefined;
|
|
46
54
|
size?: string | undefined;
|
|
47
55
|
seconds?: string | undefined;
|
|
@@ -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
|
]));
|