Skip to content

Commit 85268d6

Browse files
committed
Merge branch 'main' into stas/trace-agentex-source
2 parents db16b17 + b272739 commit 85268d6

File tree

184 files changed

+1425
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+1425
-1099
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.4.18"
2+
".": "0.4.20"
33
}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.4.20 (2025-10-01)
4+
5+
Full Changelog: [v0.4.19...v0.4.20](https://github.com/scaleapi/agentex-python/compare/v0.4.19...v0.4.20)
6+
7+
## 0.4.19 (2025-10-01)
8+
9+
Full Changelog: [v0.4.18...v0.4.19](https://github.com/scaleapi/agentex-python/compare/v0.4.18...v0.4.19)
10+
11+
### Features
12+
13+
* Adds helm config to Agent Environment ([#125](https://github.com/scaleapi/agentex-python/issues/125)) ([e4b39b5](https://github.com/scaleapi/agentex-python/commit/e4b39b5f319452bbc6650a7ef41b3a3179bb3b93))
14+
315
## 0.4.18 (2025-09-29)
416

517
Full Changelog: [v0.4.17...v0.4.18](https://github.com/scaleapi/agentex-python/compare/v0.4.17...v0.4.18)

examples/launch-tutorials.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ run_tutorial() {
118118
print_colored $GREEN "🚀 Executing: cd .. && uv run agentex agents run --manifest examples/$manifest_path"
119119
print_colored $YELLOW "💡 Press Ctrl+C to stop the tutorial"
120120
echo ""
121-
121+
122122
# Run the tutorial directly (need to go to parent dir where uv project is)
123-
(cd .. && uv run agentex agents run --manifest "examples/$manifest_path")
123+
# Load .env file if it exists and pass variables to the subshell
124+
if [[ -f "../.env" ]]; then
125+
(cd .. && set -a && source .env && set +a && uv run agentex agents run --manifest "examples/$manifest_path")
126+
else
127+
(cd .. && uv run agentex agents run --manifest "examples/$manifest_path")
128+
fi
124129

125130
local exit_code=$?
126131
if [[ $exit_code -eq 0 ]]; then

examples/tutorials/00_sync/000_hello_acp/dev.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@
9393
"outputs": [],
9494
"source": [
9595
"# Test streaming response\n",
96-
"from agentex.types.task_message_update import StreamTaskMessageDelta, StreamTaskMessageFull\n",
9796
"from agentex.types.text_delta import TextDelta\n",
98-
"\n",
97+
"from agentex.types.task_message_update import StreamTaskMessageFull, StreamTaskMessageDelta\n",
9998
"\n",
10099
"# The result object of message/send will be a TaskMessageUpdate which is a union of the following types:\n",
101100
"# - StreamTaskMessageStart: \n",

examples/tutorials/00_sync/000_hello_acp/project/acp.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from typing import AsyncGenerator, Union
2-
from agentex.lib.sdk.fastacp.fastacp import FastACP
3-
from agentex.lib.types.acp import SendMessageParams
1+
from typing import Union, AsyncGenerator
42

5-
from agentex.types.task_message_update import TaskMessageUpdate
3+
from agentex.lib.types.acp import SendMessageParams
4+
from agentex.lib.utils.logging import make_logger
65
from agentex.types.task_message import TaskMessageContent
6+
from agentex.lib.sdk.fastacp.fastacp import FastACP
7+
from agentex.types.task_message_update import TaskMessageUpdate
78
from agentex.types.task_message_content import TextContent
8-
from agentex.lib.utils.logging import make_logger
99

1010
logger = make_logger(__name__)
1111

@@ -21,8 +21,15 @@ async def handle_message_send(
2121
params: SendMessageParams
2222
) -> Union[TaskMessageContent, AsyncGenerator[TaskMessageUpdate, None]]:
2323
"""Default message handler with streaming support"""
24+
# Extract content safely from the message
25+
message_text = ""
26+
if hasattr(params.content, 'content'):
27+
content_val = getattr(params.content, 'content', '')
28+
if isinstance(content_val, str):
29+
message_text = content_val
30+
2431
return TextContent(
2532
author="agent",
26-
content=f"Hello! I've received your message. Here's a generic response, but in future tutorials we'll see how you can get me to intelligently respond to your message. This is what I heard you say: {params.content.content}",
33+
content=f"Hello! I've received your message. Here's a generic response, but in future tutorials we'll see how you can get me to intelligently respond to your message. This is what I heard you say: {message_text}",
2734
)
2835

examples/tutorials/00_sync/010_multiturn/dev.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@
9393
"outputs": [],
9494
"source": [
9595
"# Test streaming response\n",
96-
"from agentex.types.task_message_update import StreamTaskMessageDelta, StreamTaskMessageFull\n",
9796
"from agentex.types.text_delta import TextDelta\n",
98-
"\n",
97+
"from agentex.types.task_message_update import StreamTaskMessageFull, StreamTaskMessageDelta\n",
9998
"\n",
10099
"# The result object of message/send will be a TaskMessageUpdate which is a union of the following types:\n",
101100
"# - StreamTaskMessageStart: \n",

examples/tutorials/00_sync/010_multiturn/project/acp.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
2-
from typing import AsyncGenerator, Union
2+
from typing import Union, AsyncGenerator
33

44
from agentex.lib import adk
5-
from agentex.lib.sdk.fastacp.fastacp import FastACP
65
from agentex.lib.types.acp import SendMessageParams
7-
from agentex.lib.types.llm_messages import AssistantMessage, LLMConfig, SystemMessage, UserMessage
8-
from agentex.types.task_message_update import TaskMessageUpdate
96
from agentex.types.task_message import TaskMessageContent
10-
from agentex.types.task_message_content import TextContent
117
from agentex.lib.utils.model_utils import BaseModel
8+
from agentex.lib.types.llm_messages import LLMConfig, UserMessage, SystemMessage, AssistantMessage
9+
from agentex.lib.sdk.fastacp.fastacp import FastACP
10+
from agentex.types.task_message_update import TaskMessageUpdate
11+
from agentex.types.task_message_content import TextContent
1212

1313
# Create an ACP server
1414
acp = FastACP.create(
@@ -33,11 +33,11 @@ async def handle_message_send(
3333
# 0. Validate the message.
3434
#########################################################
3535

36-
if params.content.type != "text":
37-
raise ValueError(f"Expected text message, got {params.content.type}")
36+
if not hasattr(params.content, 'type') or params.content.type != "text":
37+
raise ValueError(f"Expected text message, got {getattr(params.content, 'type', 'unknown')}")
3838

39-
if params.content.author != "user":
40-
raise ValueError(f"Expected user message, got {params.content.author}")
39+
if not hasattr(params.content, 'author') or params.content.author != "user":
40+
raise ValueError(f"Expected user message, got {getattr(params.content, 'author', 'unknown')}")
4141

4242
if not os.environ.get("OPENAI_API_KEY"):
4343
return TextContent(
@@ -74,9 +74,9 @@ async def handle_message_send(
7474
llm_messages = [
7575
SystemMessage(content=state.system_prompt),
7676
*[
77-
UserMessage(content=message.content.content) if message.content.author == "user" else AssistantMessage(content=message.content.content)
77+
UserMessage(content=getattr(message.content, 'content', '')) if getattr(message.content, 'author', None) == "user" else AssistantMessage(content=getattr(message.content, 'content', ''))
7878
for message in task_messages
79-
if message.content.type == "text"
79+
if getattr(message.content, 'type', None) == "text"
8080
]
8181
]
8282

examples/tutorials/00_sync/020_streaming/dev.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@
9393
"outputs": [],
9494
"source": [
9595
"# Test streaming response\n",
96-
"from agentex.types.task_message_update import StreamTaskMessageDelta, StreamTaskMessageFull\n",
9796
"from agentex.types.text_delta import TextDelta\n",
98-
"\n",
97+
"from agentex.types.task_message_update import StreamTaskMessageFull, StreamTaskMessageDelta\n",
9998
"\n",
10099
"# The result object of message/send will be a TaskMessageUpdate which is a union of the following types:\n",
101100
"# - StreamTaskMessageStart: \n",

examples/tutorials/00_sync/020_streaming/project/acp.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import os
2-
from typing import AsyncGenerator, Union
2+
from typing import Union, AsyncGenerator
33

44
from agentex.lib import adk
5-
from agentex.lib.sdk.fastacp.fastacp import FastACP
65
from agentex.lib.types.acp import SendMessageParams
7-
from agentex.lib.types.llm_messages import AssistantMessage, LLMConfig, SystemMessage, UserMessage
8-
from agentex.types.task_message_update import StreamTaskMessageDelta, StreamTaskMessageDone, StreamTaskMessageFull, TaskMessageUpdate
9-
from agentex.types.task_message_delta import TextDelta
106
from agentex.lib.utils.model_utils import BaseModel
11-
from agentex.types.task_message_content import TaskMessageContent, TextContent
7+
from agentex.lib.types.llm_messages import LLMConfig, UserMessage, SystemMessage, AssistantMessage
8+
from agentex.lib.sdk.fastacp.fastacp import FastACP
9+
from agentex.types.task_message_delta import TextDelta
10+
from agentex.types.task_message_update import (
11+
TaskMessageUpdate,
12+
StreamTaskMessageDone,
13+
StreamTaskMessageFull,
14+
StreamTaskMessageDelta,
15+
)
16+
from agentex.types.task_message_content import TextContent, TaskMessageContent
1217

1318
# Create an ACP server
1419
acp = FastACP.create(
@@ -36,11 +41,11 @@ async def handle_message_send(
3641
if not params.content:
3742
return
3843

39-
if params.content.type != "text":
40-
raise ValueError(f"Expected text message, got {params.content.type}")
44+
if not hasattr(params.content, 'type') or params.content.type != "text":
45+
raise ValueError(f"Expected text message, got {getattr(params.content, 'type', 'unknown')}")
4146

42-
if params.content.author != "user":
43-
raise ValueError(f"Expected user message, got {params.content.author}")
47+
if not hasattr(params.content, 'author') or params.content.author != "user":
48+
raise ValueError(f"Expected user message, got {getattr(params.content, 'author', 'unknown')}")
4449

4550
if not os.environ.get("OPENAI_API_KEY"):
4651
yield StreamTaskMessageFull(
@@ -67,9 +72,9 @@ async def handle_message_send(
6772
llm_messages = [
6873
SystemMessage(content=state.system_prompt),
6974
*[
70-
UserMessage(content=message.content.content) if message.content.author == "user" else AssistantMessage(content=message.content.content)
75+
UserMessage(content=getattr(message.content, 'content', '')) if getattr(message.content, 'author', None) == "user" else AssistantMessage(content=getattr(message.content, 'content', ''))
7176
for message in task_messages
72-
if message.content and message.content.type == "text"
77+
if message.content and getattr(message.content, 'type', None) == "text"
7378
]
7479
]
7580

@@ -92,7 +97,7 @@ async def handle_message_send(
9297
yield StreamTaskMessageDelta(
9398
type="delta",
9499
index=message_index,
95-
delta=TextDelta(text_delta=chunk.choices[0].delta.content or ""),
100+
delta=TextDelta(type="text", text_delta=chunk.choices[0].delta.content or ""),
96101
)
97102

98103
yield StreamTaskMessageDone(

examples/tutorials/10_agentic/00_base/000_hello_acp/project/acp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import json
2+
23
from agentex.lib import adk
3-
from agentex.lib.sdk.fastacp.fastacp import FastACP
4+
from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
45
from agentex.lib.types.fastacp import AgenticACPConfig
5-
from agentex.lib.types.acp import CancelTaskParams, CreateTaskParams, SendEventParams
6-
7-
from agentex.types.text_content import TextContent
86
from agentex.lib.utils.logging import make_logger
7+
from agentex.types.text_content import TextContent
8+
from agentex.lib.sdk.fastacp.fastacp import FastACP
99

1010
logger = make_logger(__name__)
1111

0 commit comments

Comments
 (0)