Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
"""

import os
from agentex.types import TextContentParam, TextDelta, TextContent
from agentex.types.agent_rpc_params import ParamsSendMessageRequest
from agentex.types.task_message_update import StreamTaskMessageDelta, StreamTaskMessageFull

import pytest
from agentex import Agentex

from agentex import Agentex
from agentex.types import TextDelta, TextContent, TextContentParam
from agentex.types.agent_rpc_params import ParamsSendMessageRequest
from agentex.types.task_message_update import StreamTaskMessageFull, StreamTaskMessageDelta

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/00_sync/010_multiturn/project/acp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from typing import Union, AsyncGenerator

from agentex.lib import adk
from agentex.types import TextContent
from agentex.lib.types.acp import SendMessageParams
from agentex.lib.utils.model_utils import BaseModel
from agentex.lib.types.llm_messages import LLMConfig, UserMessage, SystemMessage, AssistantMessage
from agentex.lib.sdk.fastacp.fastacp import FastACP
from agentex.types.task_message_update import TaskMessageUpdate
from agentex.types.task_message_content import TaskMessageContent
from agentex.types import TextContent

# Create an ACP server
acp = FastACP.create(
Expand Down
14 changes: 5 additions & 9 deletions examples/tutorials/00_sync/010_multiturn/tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
- AGENT_NAME: Name of the agent to test (default: s010-multiturn)
"""

import enum
import os

from agentex.lib.sdk.fastacp.base.base_acp_server import uuid
from agentex.lib.types.acp import SendMessageParams

from test_utils.sync import collect_streaming_response, validate_text_in_string

from agentex.types import TaskMessageContentParam, TextContent, TextContentParam, task_list_params
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest, ParamsSendMessageRequest
import pytest
from agentex import Agentex
from test_utils.sync import validate_text_in_string, collect_streaming_response

from agentex import Agentex
from agentex.types import TextContent, TextContentParam
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest, ParamsSendMessageRequest
from agentex.lib.sdk.fastacp.base.base_acp_server import uuid

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down
7 changes: 4 additions & 3 deletions examples/tutorials/00_sync/020_streaming/tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
"""

import os

import pytest
from test_utils.sync import collect_streaming_response

from agentex import Agentex
from agentex.lib.sdk.fastacp.base.base_acp_server import uuid
from agentex.types import TextContent, TextContentParam
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest, ParamsSendMessageRequest
from test_utils.sync import collect_streaming_response, validate_text_in_string

from agentex.lib.sdk.fastacp.base.base_acp_server import uuid

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
"""

import os
from agentex.types import TaskMessage
import uuid
import asyncio

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
poll_messages,
stream_agent_response,
send_event_and_poll_yielding,
)

import uuid
import asyncio
from agentex import AsyncAgentex
from agentex.types import TaskMessage
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam

Expand Down Expand Up @@ -64,7 +65,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and polling for the response."""
# Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down Expand Up @@ -103,7 +104,7 @@ class TestStreamingEvents:
"""Test streaming event sending."""

@pytest.mark.asyncio
async def test_send_event_and_stream(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_stream(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and streaming the response."""
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
task = task_response.result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
- AGENT_NAME: Name of the agent to test (default: ab010-multiturn)
"""

from typing import List
import os
import uuid
from agentex._utils import is_iterable
from agentex.types import TaskMessage, TextContent
from agentex.types.task import Task
import asyncio
from typing import List

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
send_event_and_poll_yielding,
)
import asyncio

from agentex import AsyncAgentex
from agentex.types import TextContent
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam

# Configuration from environment variables
Expand Down Expand Up @@ -65,7 +65,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and polling for the response."""
# TODO: Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
- AGENT_NAME: Name of the agent to test (default: ab020-streaming)
"""

from typing import List
import os
import uuid
from agentex.types import TaskMessage, TextContent
from agentex.types.task import Task
import asyncio
from typing import List

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
send_event_and_poll_yielding,
)
import asyncio
from agentex.types.text_content_param import TextContentParam

from agentex import AsyncAgentex
from agentex.types import TaskMessage, TextContent
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down Expand Up @@ -65,7 +65,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and polling for the response."""
# Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@
"""

import os
import uuid

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
stream_agent_response,
validate_text_in_response,
)

from agentex import AsyncAgentex

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down Expand Up @@ -60,7 +55,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and polling for the response."""
# TODO: Create a task for this conversation
# task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down Expand Up @@ -88,7 +83,7 @@ class TestStreamingEvents:
"""Test streaming event sending."""

@pytest.mark.asyncio
async def test_send_event_and_stream(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_stream(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and streaming the response."""
# TODO: Create a task for this conversation
# task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,21 @@
- AGENT_NAME: Name of the agent to test (default: ab040-other-sdks)
"""

from curses import ALL_MOUSE_EVENTS
from typing import List
import os
import uuid
from agentex.types import TaskMessage, TextContent
from agentex.types.task import Task
import asyncio

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
send_event_and_poll_yielding,
)
import asyncio

from agentex import AsyncAgentex
from agentex.types import TaskMessage, TextContent
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam
from datetime import datetime

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down Expand Up @@ -76,7 +74,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling with MCP tools."""

@pytest.mark.asyncio
async def test_send_event_and_poll_simple_query(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll_simple_query(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending a simple event and polling for the response (no tool use)."""
# Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@
"""

import os
import re
import uuid
from agentex.types import TaskMessage
import asyncio

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
validate_text_in_response,
send_event_and_poll_yielding,
)
import asyncio

from agentex import AsyncAgentex
from agentex.types import TaskMessage
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam
from agentex.types.task_message_content import TextContent
import re

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down Expand Up @@ -65,7 +66,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending a single event and polling for the response."""
# Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@

import os
import uuid

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
send_event_and_poll_yielding,
)
from agentex.types.text_content_param import TextContentParam

from agentex import AsyncAgentex
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam

# Configuration from environment variables
AGENTEX_API_BASE_URL = os.environ.get("AGENTEX_API_BASE_URL", "http://localhost:5003")
Expand Down Expand Up @@ -61,7 +62,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_multi_agent_workflow_complete(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_multi_agent_workflow_complete(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test the complete multi-agent workflow with all agents using polling that yields messages."""
# Create a task for the orchestrator
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down Expand Up @@ -145,7 +146,7 @@ class TestStreamingEvents:
"""Test streaming event sending."""

@pytest.mark.asyncio
async def test_multi_agent_workflow_streaming(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_multi_agent_workflow_streaming(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test the multi-agent workflow with streaming responses and early exit."""
# Create a task for the orchestrator
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
"""

import os
from agentex.types import TaskMessage
import uuid
import asyncio

import pytest
import pytest_asyncio
from agentex import AsyncAgentex
from test_utils.agentic import (
send_event_and_poll_yielding,
stream_agent_response,
poll_messages,
stream_agent_response,
send_event_and_poll_yielding,
)

import uuid
import asyncio
from agentex import AsyncAgentex
from agentex.types import TaskMessage
from agentex.types.agent_rpc_params import ParamsCreateTaskRequest
from agentex.types.text_content_param import TextContentParam

Expand Down Expand Up @@ -64,7 +65,7 @@ class TestNonStreamingEvents:
"""Test non-streaming event sending and polling."""

@pytest.mark.asyncio
async def test_send_event_and_poll(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_poll(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and polling for the response."""
# Create a task for this conversation
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
Expand Down Expand Up @@ -103,7 +104,7 @@ class TestStreamingEvents:
"""Test streaming event sending."""

@pytest.mark.asyncio
async def test_send_event_and_stream(self, client: AsyncAgentex, agent_name: str, agent_id: str):
async def test_send_event_and_stream(self, client: AsyncAgentex, _agent_name: str, agent_id: str):
"""Test sending an event and streaming the response."""
task_response = await client.agents.create_task(agent_id, params=ParamsCreateTaskRequest(name=uuid.uuid1().hex))
task = task_response.result
Expand Down
Loading