Add link understanding tool support (#1637)
* Add * Fix --------- Co-authored-by: Richard <dasilva333@DESKTOP-74E3GJO.localdomain>
This commit is contained in:
@@ -158,6 +158,11 @@ const FIELD_LABELS: Record<string, string> = {
|
||||
"tools.media.video.attachments": "Video Understanding Attachment Policy",
|
||||
"tools.media.video.models": "Video Understanding Models",
|
||||
"tools.media.video.scope": "Video Understanding Scope",
|
||||
"tools.links.enabled": "Enable Link Understanding",
|
||||
"tools.links.maxLinks": "Link Understanding Max Links",
|
||||
"tools.links.timeoutSeconds": "Link Understanding Timeout (sec)",
|
||||
"tools.links.models": "Link Understanding Models",
|
||||
"tools.links.scope": "Link Understanding Scope",
|
||||
"tools.profile": "Tool Profile",
|
||||
"agents.list[].tools.profile": "Agent Tool Profile",
|
||||
"tools.byProvider": "Tool Policy by Provider",
|
||||
|
||||
@@ -102,6 +102,30 @@ export type MediaUnderstandingConfig = {
|
||||
models?: MediaUnderstandingModelConfig[];
|
||||
};
|
||||
|
||||
export type LinkModelConfig = {
|
||||
/** Use a CLI command for link processing. */
|
||||
type?: "cli";
|
||||
/** CLI binary (required when type=cli). */
|
||||
command: string;
|
||||
/** CLI args (template-enabled). */
|
||||
args?: string[];
|
||||
/** Optional timeout override (seconds) for this model entry. */
|
||||
timeoutSeconds?: number;
|
||||
};
|
||||
|
||||
export type LinkToolsConfig = {
|
||||
/** Enable link understanding when models are configured. */
|
||||
enabled?: boolean;
|
||||
/** Optional scope gating for understanding. */
|
||||
scope?: MediaUnderstandingScopeConfig;
|
||||
/** Max number of links to process per message. */
|
||||
maxLinks?: number;
|
||||
/** Default timeout (seconds). */
|
||||
timeoutSeconds?: number;
|
||||
/** Ordered model list (fallbacks in order). */
|
||||
models?: LinkModelConfig[];
|
||||
};
|
||||
|
||||
export type MediaToolsConfig = {
|
||||
/** Shared model list applied across image/audio/video. */
|
||||
models?: MediaUnderstandingModelConfig[];
|
||||
@@ -347,6 +371,7 @@ export type ToolsConfig = {
|
||||
};
|
||||
};
|
||||
media?: MediaToolsConfig;
|
||||
links?: LinkToolsConfig;
|
||||
/** Message tool configuration. */
|
||||
message?: {
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
GroupChatSchema,
|
||||
HumanDelaySchema,
|
||||
IdentitySchema,
|
||||
ToolsLinksSchema,
|
||||
ToolsMediaSchema,
|
||||
} from "./zod-schema.core.js";
|
||||
|
||||
@@ -428,6 +429,7 @@ export const ToolsSchema = z
|
||||
byProvider: z.record(z.string(), ToolPolicyWithProfileSchema).optional(),
|
||||
web: ToolsWebSchema,
|
||||
media: ToolsMediaSchema,
|
||||
links: ToolsLinksSchema,
|
||||
message: z
|
||||
.object({
|
||||
allowCrossContextSend: z.boolean().optional(),
|
||||
|
||||
@@ -454,6 +454,26 @@ export const ToolsMediaSchema = z
|
||||
.strict()
|
||||
.optional();
|
||||
|
||||
export const LinkModelSchema = z
|
||||
.object({
|
||||
type: z.literal("cli").optional(),
|
||||
command: z.string().min(1),
|
||||
args: z.array(z.string()).optional(),
|
||||
timeoutSeconds: z.number().int().positive().optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
export const ToolsLinksSchema = z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
scope: MediaUnderstandingScopeSchema,
|
||||
maxLinks: z.number().int().positive().optional(),
|
||||
timeoutSeconds: z.number().int().positive().optional(),
|
||||
models: z.array(LinkModelSchema).optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional();
|
||||
|
||||
export const NativeCommandsSettingSchema = z.union([z.boolean(), z.literal("auto")]);
|
||||
|
||||
export const ProviderCommandsSchema = z
|
||||
|
||||
Reference in New Issue
Block a user