Skip to content

Commit

Permalink
fix missing multiagent code (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj authored Jan 17, 2025
1 parent eec237c commit f73d46b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-months-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

Fix missing copy of the multiagent code
7 changes: 7 additions & 0 deletions helpers/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,13 @@ export const installPythonTemplate = async ({
await copyRouterCode(root, tools ?? []);
}

// Copy multiagents overrides
if (template === "multiagent") {
await copy("**", path.join(root), {
cwd: path.join(compPath, "multiagent", "python"),
});
}

if (template === "multiagent" || template === "reflex") {
if (useCase) {
const sourcePath =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def get_refine_plan_prompt_kwargs(
# gather completed sub-tasks and response pairs
completed_outputs_str = ""
for sub_task_name, task_output in completed_sub_task.items():
task_str = f"{sub_task_name}:\n" f"\t{task_output!s}\n"
task_str = f"{sub_task_name}:\n\t{task_output!s}\n"
completed_outputs_str += task_str

# get a string for the remaining sub-tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def __init__(
self.query_engine_tool = query_engine_tool
self.code_interpreter_tool = code_interpreter_tool
self.document_generator_tool = document_generator_tool
assert (
query_engine_tool is not None
), "Query engine tool is not found. Try run generation script or upload a document file first."
assert query_engine_tool is not None, (
"Query engine tool is not found. Try run generation script or upload a document file first."
)
assert code_interpreter_tool is not None, "Code interpreter tool is required"
assert (
document_generator_tool is not None
), "Document generator tool is required"
assert document_generator_tool is not None, (
"Document generator tool is required"
)
self.tools = [
self.query_engine_tool,
self.code_interpreter_tool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def interpret(

if self.interpreter:
logger.info(
f"\n{'='*50}\n> Running following AI-generated code:\n{code}\n{'='*50}"
f"\n{'=' * 50}\n> Running following AI-generated code:\n{code}\n{'=' * 50}"
)
exec = self.interpreter.run_code(code)

Expand Down

0 comments on commit f73d46b

Please sign in to comment.