mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 22:18:09 +01:00
no parent workflow needed, all in main wf loop
This commit is contained in:
@@ -7,7 +7,6 @@ from temporalio.worker import Worker
|
||||
|
||||
from activities.tool_activities import ToolActivities, dynamic_tool_activity
|
||||
from workflows.tool_workflow import ToolWorkflow
|
||||
from workflows.parent_workflow import ParentWorkflow
|
||||
|
||||
|
||||
async def main():
|
||||
@@ -20,7 +19,7 @@ async def main():
|
||||
worker = Worker(
|
||||
client,
|
||||
task_queue="ollama-task-queue",
|
||||
workflows=[ToolWorkflow, ParentWorkflow],
|
||||
workflows=[ToolWorkflow],
|
||||
activities=[
|
||||
activities.prompt_llm,
|
||||
activities.parse_tool_data,
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
from temporalio import workflow
|
||||
from .tool_workflow import ToolWorkflow, CombinedInput, ToolWorkflowParams
|
||||
|
||||
|
||||
@workflow.defn
|
||||
class ParentWorkflow:
|
||||
@workflow.run
|
||||
async def run(self, some_input: dict) -> dict:
|
||||
combined_input = CombinedInput(
|
||||
tool_params=ToolWorkflowParams(None, None), tools_data=some_input
|
||||
)
|
||||
child = workflow.start_child_workflow(ToolWorkflow.run, combined_input)
|
||||
result = await child
|
||||
return result
|
||||
Reference in New Issue
Block a user