Skip to content

Commit 5937dc0

Browse files
authored
Merge pull request #204 from scaleapi/jason/fix-manifest
Fixing manfiest.yaml
2 parents 51c3fac + f9afca1 commit 5937dc0

File tree

4 files changed

+49
-28
lines changed

4 files changed

+49
-28
lines changed

src/agentex/lib/cli/templates/default/manifest.yaml.j2

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ agent:
8686

8787
# Optional: Set Environment variables for running your agent locally as well
8888
# as for deployment later on
89-
# env:
89+
env: {}
9090
# OPENAI_API_KEY: "<YOUR_OPENAI_API_KEY_HERE>"
9191
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
9292
# OPENAI_ORG_ID: "<YOUR_OPENAI_ORG_ID_HERE>"
@@ -100,13 +100,12 @@ deployment:
100100
repository: "" # Update with your container registry
101101
tag: "latest" # Default tag, should be versioned in production
102102

103+
imagePullSecrets: [] # Update with your image pull secret names
104+
# - name: my-registry-secret
105+
103106
# Global deployment settings that apply to all clusters
104-
# These can be overridden in cluster-specific files (deploy/*.yaml)
107+
# These can be overridden in cluster-specific environments (environments.yaml)
105108
global:
106-
agent:
107-
name: "{{ agent_name }}"
108-
description: "{{ description }}"
109-
110109
# Default replica count
111110
replicaCount: 1
112111

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,56 @@
11
from agentex.lib.sdk.fastacp.fastacp import FastACP
22
from agentex.lib.types.fastacp import AsyncACPConfig
33
from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
4+
from agentex.lib.utils.logging import make_logger
5+
from agentex.types.text_content import TextContent
6+
from agentex.lib import adk
7+
8+
9+
logger = make_logger(__name__)
410

511

612
# Create an ACP server
13+
# This sets up the core server that will handle task creation, events, and cancellation
14+
# The `type="base"` configuration is the default configuration for the ACP server
715
acp = FastACP.create(
816
acp_type="async",
9-
config=AsyncACPConfig(type="base")
17+
config=AsyncACPConfig(
18+
type="base",
19+
),
1020
)
1121

1222

23+
# This handler is called first whenever a new task is created.
24+
# It's a good place to initialize any state or resources needed for the task.
1325
@acp.on_task_event_send
1426
async def handle_task_event_send(params: SendEventParams):
15-
# For this tutorial, we print the parameters sent to the handler
16-
# so you can see where and how messages within a task are handled
17-
print(f"Hello world! I just received this message: {params}")
27+
# For this tutorial, we log the parameters sent to the handler
28+
# so you can see where and how messages within a long running task are handled
29+
logger.info(f"Received task event send rpc: {params}")
30+
31+
# 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.
32+
await adk.messages.create(task_id=params.task.id, content=params.event.content)
33+
34+
# 2. Send a simple response message.
35+
# In future tutorials, this is where we'll add more sophisticated response logic.
36+
await adk.messages.create(
37+
task_id=params.task.id,
38+
content=TextContent(
39+
author="agent",
40+
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.",
41+
),
42+
)
1843

1944
@acp.on_task_cancel
2045
async def handle_task_canceled(params: CancelTaskParams):
2146
# For this tutorial, we print the parameters sent to the handler
2247
# so you can see where and how task cancellation is handled
23-
print(f"Hello world! Task canceled: {params.task.id}")
48+
logger.info(f"Received task cancel rpc: {params}")
2449

2550
@acp.on_task_create
2651
async def handle_task_create(params: CreateTaskParams):
27-
# For this tutorial, we print the parameters sent to the handler
52+
# For this tutorial, we log the parameters sent to the handler
2853
# so you can see where and how task creation is handled
29-
print(f"Hello world! Task created: {params.task.id}")
54+
55+
# Here is where you can initialize any state or resources needed for the task.
56+
logger.info(f"Received task create rpc: {params}")

src/agentex/lib/cli/templates/sync/manifest.yaml.j2

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ agent:
7474
# Optional: Credentials mapping
7575
# Maps Kubernetes secrets to environment variables
7676
# Common credentials include:
77-
# credentials:
77+
credentials: [] # Update with your credentials
7878
# - env_var_name: OPENAI_API_KEY
7979
# secret_name: openai-api-key
8080
# secret_key: api-key
8181

8282
# Optional: Set Environment variables for running your agent locally as well
8383
# as for deployment later on
84-
# env:
84+
env: {} # Update with your environment variables
8585
# OPENAI_API_KEY: "<YOUR_OPENAI_API_KEY_HERE>"
8686
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
8787
# OPENAI_ORG_ID: "<YOUR_OPENAI_ORG_ID_HERE>"
@@ -95,14 +95,13 @@ deployment:
9595
image:
9696
repository: "" # Update with your container registry
9797
tag: "latest" # Default tag, should be versioned in production
98+
99+
imagePullSecrets: [] # Update with your image pull secret names
100+
# - name: my-registry-secret
98101

99102
# Global deployment settings that apply to all clusters
100-
# These can be overridden in cluster-specific files (deploy/*.yaml)
103+
# These can be overridden in cluster-specific environments (environments.yaml)
101104
global:
102-
agent:
103-
name: "{{ agent_name }}"
104-
description: "{{ description }}"
105-
106105
# Default replica count
107106
replicaCount: 1
108107

src/agentex/lib/cli/templates/temporal/manifest.yaml.j2

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ agent:
106106

107107
# Optional: Set Environment variables for running your agent locally as well
108108
# as for deployment later on
109-
# env:
109+
env: {}
110110
# OPENAI_API_KEY: "<YOUR_OPENAI_API_KEY_HERE>"
111111
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
112112
# OPENAI_ORG_ID: "<YOUR_OPENAI_ORG_ID_HERE>"
@@ -121,16 +121,12 @@ deployment:
121121
repository: "" # Update with your container registry
122122
tag: "latest" # Default tag, should be versioned in production
123123

124-
imagePullSecrets:
125-
- name: my-registry-secret # Update with your image pull secret name
124+
imagePullSecrets: [] # Update with your image pull secret name
125+
# - name: my-registry-secret
126126

127127
# Global deployment settings that apply to all clusters
128-
# These can be overridden using --override-file with custom configuration files
128+
# These can be overridden in cluster-specific environments (environments.yaml)
129129
global:
130-
agent:
131-
name: "{{ agent_name }}"
132-
description: "{{ description }}"
133-
134130
# Default replica count
135131
replicaCount: 1
136132

0 commit comments

Comments
 (0)