feat(workflow): add per-agent vision configuration
This commit is contained in:
@@ -38,6 +38,8 @@ export type WorkflowNodeData = {
|
||||
llmResourceId?: string;
|
||||
asrResourceId?: string;
|
||||
ttsResourceId?: string;
|
||||
visionEnabled?: boolean;
|
||||
visionModelResourceId?: string;
|
||||
enableInterrupt?: boolean;
|
||||
turnConfig?: TurnConfig;
|
||||
toolId?: string;
|
||||
@@ -140,6 +142,8 @@ export type WorkflowGraph = {
|
||||
defaultLlmResourceId: string;
|
||||
defaultAsrResourceId: string;
|
||||
defaultTtsResourceId: string;
|
||||
visionEnabled: boolean;
|
||||
visionModelResourceId: string;
|
||||
toolIds: string[];
|
||||
knowledgeBaseId: string;
|
||||
knowledgeMode: "automatic" | "on_demand";
|
||||
@@ -172,6 +176,8 @@ export function defaultGraph(): WorkflowGraph {
|
||||
defaultLlmResourceId: "",
|
||||
defaultAsrResourceId: "",
|
||||
defaultTtsResourceId: "",
|
||||
visionEnabled: false,
|
||||
visionModelResourceId: "",
|
||||
toolIds: [],
|
||||
knowledgeBaseId: "",
|
||||
knowledgeMode: "automatic",
|
||||
@@ -234,3 +240,14 @@ export function defaultGraph(): WorkflowGraph {
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
/** The camera stays connected when at least one effective Agent can use it. */
|
||||
export function workflowUsesVision(graph: WorkflowGraph): boolean {
|
||||
return graph.nodes.some((node) => {
|
||||
if (node.type !== "agent") return false;
|
||||
const inheritsGlobal = node.data.inheritGlobalConfig !== false;
|
||||
return inheritsGlobal
|
||||
? graph.settings.visionEnabled
|
||||
: Boolean(node.data.visionEnabled);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user