mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
renaming workflows and activities
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
|
||||
|
||||
from workflows.tool_workflow import ToolWorkflow
|
||||
from workflows.agent_goal_workflow import AgentGoalWorkflow
|
||||
|
||||
|
||||
async def main():
|
||||
@@ -10,10 +10,10 @@ async def main():
|
||||
|
||||
workflow_id = "agent-workflow"
|
||||
|
||||
handle = client.get_workflow_handle_for(ToolWorkflow.run, workflow_id)
|
||||
handle = client.get_workflow_handle_for(AgentGoalWorkflow.run, workflow_id)
|
||||
|
||||
# Sends a signal to the workflow
|
||||
await handle.signal(ToolWorkflow.end_chat)
|
||||
await handle.signal(AgentGoalWorkflow.end_chat)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
|
||||
from shared.config import get_temporal_client
|
||||
from workflows.tool_workflow import ToolWorkflow
|
||||
from workflows.agent_goal_workflow import AgentGoalWorkflow
|
||||
|
||||
|
||||
async def main():
|
||||
@@ -12,7 +12,7 @@ async def main():
|
||||
handle = client.get_workflow_handle(workflow_id)
|
||||
|
||||
# Queries the workflow for the conversation history
|
||||
history = await handle.query(ToolWorkflow.get_conversation_history)
|
||||
history = await handle.query(AgentGoalWorkflow.get_conversation_history)
|
||||
|
||||
print("Conversation History")
|
||||
print(history)
|
||||
|
||||
@@ -5,7 +5,7 @@ import concurrent.futures
|
||||
from temporalio.worker import Worker
|
||||
|
||||
from activities.tool_activities import ToolActivities, dynamic_tool_activity
|
||||
from workflows.tool_workflow import ToolWorkflow
|
||||
from workflows.agent_goal_workflow import AgentGoalWorkflow
|
||||
|
||||
from shared.config import get_temporal_client, TEMPORAL_TASK_QUEUE
|
||||
|
||||
@@ -21,10 +21,10 @@ async def main():
|
||||
worker = Worker(
|
||||
client,
|
||||
task_queue=TEMPORAL_TASK_QUEUE,
|
||||
workflows=[ToolWorkflow],
|
||||
workflows=[AgentGoalWorkflow],
|
||||
activities=[
|
||||
activities.prompt_llm,
|
||||
activities.validate_llm_prompt,
|
||||
activities.agent_validatePrompt,
|
||||
activities.agent_toolPlanner,
|
||||
dynamic_tool_activity,
|
||||
],
|
||||
activity_executor=activity_executor,
|
||||
|
||||
Reference in New Issue
Block a user