Skip to content

Commit e1cc8ae

Browse files
committed
more fixs
1 parent a350f6c commit e1cc8ae

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

examples/tutorials/00_sync/000_hello_acp/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ COPY 00_sync/000_hello_acp/tests /app/000_hello_acp/tests
3838
# Copy shared test utilities
3939
COPY test_utils /app/test_utils
4040

41-
# Install the required Python packages with dev dependencies (includes pytest)
42-
RUN uv pip install --system .[dev] pytest-asyncio httpx
41+
# Install the required Python packages with dev dependencies
42+
RUN uv pip install --system .[dev]
4343

4444
# Set environment variables
4545
ENV PYTHONPATH=/app
4646

4747
# Set test environment variables
48-
ENV AGENT_NAME=s000-hello-acp
48+
ENV AGENT_NAME=000-hello-acp
4949

5050
# Run the agent using uvicorn
5151
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/000_hello_acp/pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s000-hello-acp"
6+
name = "000-hello-acp"
77
version = "0.1.0"
88
description = "An AgentEx agent that just says hello and acknowledges the user's message"
99
readme = "README.md"
1010
requires-python = ">=3.12"
1111
dependencies = [
1212
"agentex-sdk",
1313
"scale-gp",
14-
"pytest",
15-
"pytest-xdist"
1614
]
1715

1816
[project.optional-dependencies]
1917
dev = [
2018
"pytest",
19+
"pytest-asyncio",
20+
"pytest-xdist",
21+
"httpx",
2122
"black",
2223
"isort",
2324
"flake8",

examples/tutorials/00_sync/010_multiturn/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ COPY 00_sync/010_multiturn/tests /app/010_multiturn/tests
3737
# Copy shared test utilities
3838
COPY test_utils /app/test_utils
3939

40-
# Install the required Python packages with dev dependencies (includes pytest)
41-
RUN uv pip install --system .[dev] pytest-asyncio httpx
40+
# Install the required Python packages with dev dependencies
41+
RUN uv pip install --system .[dev]
4242

4343
WORKDIR /app/010_multiturn
4444
# Set environment variables
4545
ENV PYTHONPATH=/app
4646

4747
# Set test environment variables
48-
ENV AGENT_NAME=s010-multiturn
48+
ENV AGENT_NAME=010-multiturn
4949

5050
# Run the agent using uvicorn
5151
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/010_multiturn/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s010-multiturn"
6+
name = "010-multiturn"
77
version = "0.1.0"
88
description = "An AgentEx agent"
99
readme = "README.md"
@@ -16,6 +16,8 @@ dependencies = [
1616
[project.optional-dependencies]
1717
dev = [
1818
"pytest",
19+
"pytest-asyncio",
20+
"httpx",
1921
"black",
2022
"isort",
2123
"flake8",

examples/tutorials/00_sync/020_streaming/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ COPY 00_sync/020_streaming/tests /app/020_streaming/tests
3737
# Copy shared test utilities
3838
COPY test_utils /app/test_utils
3939

40-
# Install the required Python packages with dev dependencies (includes pytest)
41-
RUN uv pip install --system .[dev] pytest-asyncio httpx
40+
# Install the required Python packages with dev dependencies
41+
RUN uv pip install --system .[dev]
4242

4343
# Set environment variables
4444
ENV PYTHONPATH=/app
4545

4646
# Set test environment variables
47-
ENV AGENT_NAME=s020-streaming
47+
ENV AGENT_NAME=020-streaming
4848

4949
# Run the agent using uvicorn
5050
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/020_streaming/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s020-streaming"
6+
name = "020-streaming"
77
version = "0.1.0"
88
description = "An AgentEx agent that does multiturn streaming chat"
99
readme = "README.md"
@@ -16,6 +16,8 @@ dependencies = [
1616
[project.optional-dependencies]
1717
dev = [
1818
"pytest",
19+
"pytest-asyncio",
20+
"httpx",
1921
"black",
2022
"isort",
2123
"flake8",

examples/tutorials/test_utils/async_utils.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,19 @@ async def poll_messages(
126126
if yield_updates:
127127
# For streaming: track content changes
128128
content_str = message.content.content if message.content and hasattr(message.content, 'content') else ""
129-
content_hash = hash(content_str + str(message.streaming_status))
129+
# Ensure content_str is always a string to avoid concatenation errors
130+
if isinstance(content_str, list):
131+
# If it's a list, convert to string representation
132+
content_str = str(content_str)
133+
elif content_str is None:
134+
content_str = ""
135+
elif not isinstance(content_str, str):
136+
# Handle any other non-string types
137+
content_str = str(content_str)
138+
139+
# Ensure streaming_status is also properly converted to string
140+
streaming_status_str = str(message.streaming_status) if message.streaming_status is not None else ""
141+
content_hash = hash(content_str + streaming_status_str)
130142
is_updated = message.id in message_content_hashes and message_content_hashes[message.id] != content_hash
131143

132144
if is_new_message or is_updated:

0 commit comments

Comments
 (0)