fix: improve type checking for graphConfig in createRun function

This commit is contained in:
Danny Avila 2025-09-03 23:40:33 -04:00
parent 4464b333e9
commit 3f1224e23e
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -153,7 +153,7 @@ export async function createRun({
edges: agents[0].edges,
};
if (agentInputs.length > 1 || ('edges' in graphConfig && graphConfig.edges.length > 0)) {
if (agentInputs.length > 1 || ((graphConfig as MultiAgentGraphConfig).edges?.length ?? 0) > 0) {
(graphConfig as unknown as MultiAgentGraphConfig).type = 'multi-agent';
} else {
(graphConfig as StandardGraphConfig).type = 'standard';