Skip to content

Commit 560dad9

Browse files
committed
reuse python streaming for multiagent
1 parent bae2ddb commit 560dad9

24 files changed

+15
-633
lines changed

helpers/python.ts

+15-12
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,12 @@ export const installPythonTemplate = async ({
364364
| "modelConfig"
365365
>) => {
366366
console.log("\nInitializing Python project with template:", template, "\n");
367-
const templatePath = path.join(templatesDir, "types", template, framework);
367+
let templatePath;
368+
if (template === "extractor") {
369+
templatePath = path.join(templatesDir, "types", "extractor", framework);
370+
} else {
371+
templatePath = path.join(templatesDir, "types", "streaming", framework);
372+
}
368373
await copy("**", root, {
369374
parents: true,
370375
cwd: templatePath,
@@ -402,17 +407,7 @@ export const installPythonTemplate = async ({
402407
});
403408
}
404409

405-
// Copy tools for multiagent template
406-
// TODO: Remove this once we support selecting tools for multiagent template
407-
if (template === "multiagent") {
408-
// templates / components / engines / python / agent / tools;
409-
await copy("**", path.join(root, "app", "engine", "tools"), {
410-
cwd: path.join(compPath, "engines", "python", "agent", "tools"),
411-
});
412-
}
413-
414-
if (template === "streaming") {
415-
// For the streaming template only:
410+
if (template === "streaming" || template === "multiagent") {
416411
// Select and copy engine code based on data sources and tools
417412
let engine;
418413
if (dataSources.length > 0 && (!tools || tools.length === 0)) {
@@ -427,6 +422,14 @@ export const installPythonTemplate = async ({
427422
});
428423
}
429424

425+
if (template === "multiagent") {
426+
// Copy multi-agent code
427+
await copy("**", path.join(root), {
428+
parents: true,
429+
cwd: path.join(compPath, "multiagent", "python"),
430+
});
431+
}
432+
430433
console.log("Adding additional dependencies");
431434

432435
const addOnDependencies = getAdditionalDependencies(

templates/types/multiagent/fastapi/app/api/__init__.py

Whitespace-only changes.

templates/types/multiagent/fastapi/app/api/routers/__init__.py

Whitespace-only changes.

templates/types/multiagent/fastapi/app/api/routers/chat.py

-39
This file was deleted.

templates/types/multiagent/fastapi/app/api/routers/chat_config.py

-48
This file was deleted.

0 commit comments

Comments
 (0)