diff --git a/src/agentex/lib/cli/templates/default/manifest.yaml.j2 b/src/agentex/lib/cli/templates/default/manifest.yaml.j2 index 7a9a74d7..18406097 100644 --- a/src/agentex/lib/cli/templates/default/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/default/manifest.yaml.j2 @@ -86,7 +86,7 @@ agent: # Optional: Set Environment variables for running your agent locally as well # as for deployment later on - # env: + env: {} # OPENAI_API_KEY: "" # OPENAI_BASE_URL: "" # OPENAI_ORG_ID: "" @@ -100,13 +100,12 @@ deployment: repository: "" # Update with your container registry tag: "latest" # Default tag, should be versioned in production + imagePullSecrets: [] # Update with your image pull secret names + # - name: my-registry-secret + # Global deployment settings that apply to all clusters - # These can be overridden in cluster-specific files (deploy/*.yaml) + # These can be overridden in cluster-specific environments (environments.yaml) global: - agent: - name: "{{ agent_name }}" - description: "{{ description }}" - # Default replica count replicaCount: 1 diff --git a/src/agentex/lib/cli/templates/default/project/acp.py.j2 b/src/agentex/lib/cli/templates/default/project/acp.py.j2 index fa81c383..5478b51b 100644 --- a/src/agentex/lib/cli/templates/default/project/acp.py.j2 +++ b/src/agentex/lib/cli/templates/default/project/acp.py.j2 @@ -1,29 +1,56 @@ from agentex.lib.sdk.fastacp.fastacp import FastACP from agentex.lib.types.fastacp import AsyncACPConfig from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams +from agentex.lib.utils.logging import make_logger +from agentex.types.text_content import TextContent +from agentex.lib import adk + + +logger = make_logger(__name__) # Create an ACP server +# This sets up the core server that will handle task creation, events, and cancellation +# The `type="base"` configuration is the default configuration for the ACP server acp = FastACP.create( acp_type="async", - config=AsyncACPConfig(type="base") + config=AsyncACPConfig( + type="base", + ), ) +# This handler is called first whenever a new task is created. +# It's a good place to initialize any state or resources needed for the task. @acp.on_task_event_send async def handle_task_event_send(params: SendEventParams): - # For this tutorial, we print the parameters sent to the handler - # so you can see where and how messages within a task are handled - print(f"Hello world! I just received this message: {params}") + # For this tutorial, we log the parameters sent to the handler + # so you can see where and how messages within a long running task are handled + logger.info(f"Received task event send rpc: {params}") + + # 1. Echo back the client's message to show it in the UI. This is not done by default so the agent developer has full control over what is shown to the user. + await adk.messages.create(task_id=params.task.id, content=params.event.content) + + # 2. Send a simple response message. + # In future tutorials, this is where we'll add more sophisticated response logic. + await adk.messages.create( + task_id=params.task.id, + content=TextContent( + author="agent", + content=f"Hello! I've received your message. I can't respond right now, but in future tutorials we'll see how you can get me to intelligently respond to your message.", + ), + ) @acp.on_task_cancel async def handle_task_canceled(params: CancelTaskParams): # For this tutorial, we print the parameters sent to the handler # so you can see where and how task cancellation is handled - print(f"Hello world! Task canceled: {params.task.id}") + logger.info(f"Received task cancel rpc: {params}") @acp.on_task_create async def handle_task_create(params: CreateTaskParams): - # For this tutorial, we print the parameters sent to the handler + # For this tutorial, we log the parameters sent to the handler # so you can see where and how task creation is handled - print(f"Hello world! Task created: {params.task.id}") + + # Here is where you can initialize any state or resources needed for the task. + logger.info(f"Received task create rpc: {params}") diff --git a/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 b/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 index 213849ab..b006c617 100644 --- a/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/sync/manifest.yaml.j2 @@ -74,14 +74,14 @@ agent: # Optional: Credentials mapping # Maps Kubernetes secrets to environment variables # Common credentials include: - # credentials: + credentials: [] # Update with your credentials # - env_var_name: OPENAI_API_KEY # secret_name: openai-api-key # secret_key: api-key # Optional: Set Environment variables for running your agent locally as well # as for deployment later on - # env: + env: {} # Update with your environment variables # OPENAI_API_KEY: "" # OPENAI_BASE_URL: "" # OPENAI_ORG_ID: "" @@ -95,14 +95,13 @@ deployment: image: repository: "" # Update with your container registry tag: "latest" # Default tag, should be versioned in production + + imagePullSecrets: [] # Update with your image pull secret names + # - name: my-registry-secret # Global deployment settings that apply to all clusters - # These can be overridden in cluster-specific files (deploy/*.yaml) + # These can be overridden in cluster-specific environments (environments.yaml) global: - agent: - name: "{{ agent_name }}" - description: "{{ description }}" - # Default replica count replicaCount: 1 diff --git a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 index a1142f5c..a6433ce7 100644 --- a/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 +++ b/src/agentex/lib/cli/templates/temporal/manifest.yaml.j2 @@ -106,7 +106,7 @@ agent: # Optional: Set Environment variables for running your agent locally as well # as for deployment later on - # env: + env: {} # OPENAI_API_KEY: "" # OPENAI_BASE_URL: "" # OPENAI_ORG_ID: "" @@ -121,16 +121,12 @@ deployment: repository: "" # Update with your container registry tag: "latest" # Default tag, should be versioned in production - imagePullSecrets: - - name: my-registry-secret # Update with your image pull secret name + imagePullSecrets: [] # Update with your image pull secret name + # - name: my-registry-secret # Global deployment settings that apply to all clusters - # These can be overridden using --override-file with custom configuration files + # These can be overridden in cluster-specific environments (environments.yaml) global: - agent: - name: "{{ agent_name }}" - description: "{{ description }}" - # Default replica count replicaCount: 1