diff --git a/examples/tutorials/00_sync/000_hello_acp/Dockerfile b/examples/tutorials/00_sync/000_hello_acp/Dockerfile index a52ed5a3..2c42e6ff 100644 --- a/examples/tutorials/00_sync/000_hello_acp/Dockerfile +++ b/examples/tutorials/00_sync/000_hello_acp/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 000_hello_acp/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/00_sync/010_multiturn/Dockerfile b/examples/tutorials/00_sync/010_multiturn/Dockerfile index 286729a5..3609992b 100644 --- a/examples/tutorials/00_sync/010_multiturn/Dockerfile +++ b/examples/tutorials/00_sync/010_multiturn/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 010_multiturn/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/00_sync/020_streaming/Dockerfile b/examples/tutorials/00_sync/020_streaming/Dockerfile index 5412a6c9..586e6308 100644 --- a/examples/tutorials/00_sync/020_streaming/Dockerfile +++ b/examples/tutorials/00_sync/020_streaming/Dockerfile @@ -32,10 +32,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 020_streaming/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/000_hello_acp/Dockerfile b/examples/tutorials/10_agentic/00_base/000_hello_acp/Dockerfile index a52ed5a3..2c42e6ff 100644 --- a/examples/tutorials/10_agentic/00_base/000_hello_acp/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/000_hello_acp/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 000_hello_acp/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/010_multiturn/Dockerfile b/examples/tutorials/10_agentic/00_base/010_multiturn/Dockerfile index 286729a5..3609992b 100644 --- a/examples/tutorials/10_agentic/00_base/010_multiturn/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/010_multiturn/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 010_multiturn/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/020_streaming/Dockerfile b/examples/tutorials/10_agentic/00_base/020_streaming/Dockerfile index 11256786..03424e58 100644 --- a/examples/tutorials/10_agentic/00_base/020_streaming/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/020_streaming/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 020_streaming/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/030_tracing/Dockerfile b/examples/tutorials/10_agentic/00_base/030_tracing/Dockerfile index 90b2567e..5592c5ef 100644 --- a/examples/tutorials/10_agentic/00_base/030_tracing/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/030_tracing/Dockerfile @@ -33,10 +33,9 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 030_tracing/project /app/project -WORKDIR /app/project # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/040_other_sdks/Dockerfile b/examples/tutorials/10_agentic/00_base/040_other_sdks/Dockerfile index a062d1a6..f22f269a 100644 --- a/examples/tutorials/10_agentic/00_base/040_other_sdks/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/040_other_sdks/Dockerfile @@ -33,10 +33,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 040_other_sdks/project /app/project -WORKDIR /app/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/00_base/080_batch_events/Dockerfile b/examples/tutorials/10_agentic/00_base/080_batch_events/Dockerfile index 381edd98..e006a25d 100644 --- a/examples/tutorials/10_agentic/00_base/080_batch_events/Dockerfile +++ b/examples/tutorials/10_agentic/00_base/080_batch_events/Dockerfile @@ -23,20 +23,18 @@ RUN uv pip install --system --upgrade pip setuptools wheel ENV UV_HTTP_TIMEOUT=1000 # Copy just the requirements file to optimize caching -COPY 10_agentic/00_base/080_batch_events/requirements.txt /app/10_agentic/00_base/080_batch_events/requirements.txt +COPY 080_batch_events/requirements.txt /app/requirements.txt -WORKDIR /app/10_agentic/00_base/080_batch_events +WORKDIR /app/ # Install the required Python packages RUN uv pip install --system -r requirements.txt # Copy the project code -COPY 10_agentic/00_base/080_batch_events/project /app/10_agentic/00_base/080_batch_events/project - -WORKDIR /app/10_agentic/00_base/080_batch_events/project +COPY 080_batch_events/project /app/project # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/10_temporal/000_hello_acp/Dockerfile b/examples/tutorials/10_agentic/10_temporal/000_hello_acp/Dockerfile index 6ab0d71f..248e41cc 100644 --- a/examples/tutorials/10_agentic/10_temporal/000_hello_acp/Dockerfile +++ b/examples/tutorials/10_agentic/10_temporal/000_hello_acp/Dockerfile @@ -39,10 +39,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 000_hello_acp/project /app/project -WORKDIR /app/project - # Run the ACP server using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/10_temporal/010_agent_chat/Dockerfile b/examples/tutorials/10_agentic/10_temporal/010_agent_chat/Dockerfile index 7f09bb09..eda1cf62 100644 --- a/examples/tutorials/10_agentic/10_temporal/010_agent_chat/Dockerfile +++ b/examples/tutorials/10_agentic/10_temporal/010_agent_chat/Dockerfile @@ -39,10 +39,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY 010_agent_chat/project /app/project -WORKDIR /app/project - # Run the ACP server using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/examples/tutorials/10_agentic/10_temporal/020_state_machine/Dockerfile b/examples/tutorials/10_agentic/10_temporal/020_state_machine/Dockerfile index a3e77cd3..4ec36c2b 100644 --- a/examples/tutorials/10_agentic/10_temporal/020_state_machine/Dockerfile +++ b/examples/tutorials/10_agentic/10_temporal/020_state_machine/Dockerfile @@ -29,20 +29,18 @@ RUN uv pip install --system --upgrade pip setuptools wheel ENV UV_HTTP_TIMEOUT=1000 # Copy just the requirements file to optimize caching -COPY 10_agentic/10_temporal/020_state_machine/requirements.txt /app/10_agentic/10_temporal/020_state_machine/requirements.txt +COPY 020_state_machine/requirements.txt /app/requirements.txt -WORKDIR /app/10_agentic/10_temporal/020_state_machine +WORKDIR /app/ # Install the required Python packages RUN uv pip install --system -r requirements.txt # Copy the project code -COPY 10_agentic/10_temporal/020_state_machine/project /app/10_agentic/10_temporal/020_state_machine/project - -WORKDIR /app/10_agentic/10_temporal/020_state_machine/project +COPY 020_state_machine/project /app/project # Run the ACP server using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 index 4ecd355a..6d010891 100644 --- a/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/default/Dockerfile-uv.j2 @@ -33,10 +33,8 @@ RUN uv pip install --system . # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/default/Dockerfile.j2 b/src/agentex/lib/cli/templates/default/Dockerfile.j2 index 017f2d14..0395caf7 100644 --- a/src/agentex/lib/cli/templates/default/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/default/Dockerfile.j2 @@ -35,10 +35,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 index 4ecd355a..6d010891 100644 --- a/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/sync/Dockerfile-uv.j2 @@ -33,10 +33,8 @@ RUN uv pip install --system . # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project - # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/sync/Dockerfile.j2 b/src/agentex/lib/cli/templates/sync/Dockerfile.j2 index 017f2d14..4d9f41d4 100644 --- a/src/agentex/lib/cli/templates/sync/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/sync/Dockerfile.j2 @@ -35,10 +35,9 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project # Set environment variables ENV PYTHONPATH=/app # Run the agent using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 b/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 index ebeef683..ab9642de 100644 --- a/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 +++ b/src/agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 @@ -39,10 +39,8 @@ RUN uv pip install --system . # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project - # Run the ACP server using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 b/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 index 1b4e2e18..4c1798c4 100644 --- a/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 +++ b/src/agentex/lib/cli/templates/temporal/Dockerfile.j2 @@ -41,10 +41,8 @@ RUN uv pip install --system -r requirements.txt # Copy the project code COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project -WORKDIR /app/{{ project_path_from_build_root }}/project - # Run the ACP server using uvicorn -CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"] # When we deploy the worker, we will replace the CMD with the following # CMD ["python", "-m", "run_worker"] \ No newline at end of file diff --git a/src/agentex/lib/cli/templates/temporal/project/run_worker.py.j2 b/src/agentex/lib/cli/templates/temporal/project/run_worker.py.j2 index 9f00dac6..47a2a5d9 100644 --- a/src/agentex/lib/cli/templates/temporal/project/run_worker.py.j2 +++ b/src/agentex/lib/cli/templates/temporal/project/run_worker.py.j2 @@ -6,7 +6,7 @@ from agentex.lib.utils.logging import make_logger from agentex.lib.utils.debug import setup_debug_if_enabled from agentex.lib.environment_variables import EnvironmentVariables -from workflow import {{ workflow_class }} +from project.workflow import {{ workflow_class }} environment_variables = EnvironmentVariables.refresh() diff --git a/src/agentex/lib/core/temporal/services/temporal_task_service.py b/src/agentex/lib/core/temporal/services/temporal_task_service.py index 0671af0e..2a47db80 100644 --- a/src/agentex/lib/core/temporal/services/temporal_task_service.py +++ b/src/agentex/lib/core/temporal/services/temporal_task_service.py @@ -1,3 +1,4 @@ +from typing import Any from agentex.lib.core.clients.temporal.temporal_client import TemporalClient from agentex.lib.core.clients.temporal.types import WorkflowState from agentex.lib.core.temporal.types.workflow import SignalName @@ -22,7 +23,7 @@ def __init__( self._temporal_client = temporal_client self._env_vars = env_vars - async def submit_task(self, agent: Agent, task: Task) -> str: + async def submit_task(self, agent: Agent, task: Task, params: dict[str, Any] | None) -> str: """ Submit a task to the async runtime for execution. @@ -33,7 +34,7 @@ async def submit_task(self, agent: Agent, task: Task) -> str: arg=CreateTaskParams( agent=agent, task=task, - params=None, + params=params, ), id=task.id, task_queue=self._env_vars.WORKFLOW_TASK_QUEUE, diff --git a/src/agentex/lib/sdk/fastacp/impl/temporal_acp.py b/src/agentex/lib/sdk/fastacp/impl/temporal_acp.py index f2ec2a73..2e88ef69 100644 --- a/src/agentex/lib/sdk/fastacp/impl/temporal_acp.py +++ b/src/agentex/lib/sdk/fastacp/impl/temporal_acp.py @@ -71,7 +71,7 @@ def _setup_handlers(self): async def handle_task_create(params: CreateTaskParams) -> None: """Default create task handler - logs the task""" logger.info(f"TemporalACP received task create rpc call for task {params.task.id}") - await self._temporal_task_service.submit_task(agent=params.agent, task=params.task) + await self._temporal_task_service.submit_task(agent=params.agent, task=params.task, params=params.params) @self.on_task_event_send async def handle_event_send(params: SendEventParams) -> None: