Skip to content

Commit b9e35ed

Browse files
committed
Paramaterize OpenAI agents with context type in test
1 parent 9bfcb56 commit b9e35ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/contrib/openai_agents/test_openai.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class TestHelloModel(StaticTestModel):
114114
class HelloWorldAgent:
115115
@workflow.run
116116
async def run(self, prompt: str) -> str:
117-
agent = Agent(
117+
agent = Agent[None](
118118
name="Assistant",
119119
instructions="You only respond in haikus.",
120120
)
@@ -358,7 +358,7 @@ class TestNexusWeatherModel(StaticTestModel):
358358
class ToolsWorkflow:
359359
@workflow.run
360360
async def run(self, question: str) -> str:
361-
agent: Agent = Agent(
361+
agent = Agent[str](
362362
name="Tools Workflow",
363363
instructions="You are a helpful agent.",
364364
tools=[
@@ -390,7 +390,7 @@ async def run(self, question: str) -> str:
390390
class NexusToolsWorkflow:
391391
@workflow.run
392392
async def run(self, question: str) -> str:
393-
agent = Agent(
393+
agent = Agent[str](
394394
name="Nexus Tools Workflow",
395395
instructions="You are a helpful agent.",
396396
tools=[
@@ -747,25 +747,25 @@ async def test_research_workflow(client: Client, use_local_model: bool):
747747

748748

749749
def orchestrator_agent() -> Agent:
750-
spanish_agent = Agent(
750+
spanish_agent = Agent[None](
751751
name="spanish_agent",
752752
instructions="You translate the user's message to Spanish",
753753
handoff_description="An english to spanish translator",
754754
)
755755

756-
french_agent = Agent(
756+
french_agent = Agent[None](
757757
name="french_agent",
758758
instructions="You translate the user's message to French",
759759
handoff_description="An english to french translator",
760760
)
761761

762-
italian_agent = Agent(
762+
italian_agent = Agent[None](
763763
name="italian_agent",
764764
instructions="You translate the user's message to Italian",
765765
handoff_description="An english to italian translator",
766766
)
767767

768-
orchestrator_agent = Agent(
768+
orchestrator_agent = Agent[None](
769769
name="orchestrator_agent",
770770
instructions=(
771771
"You are a translation agent. You use the tools given to you to translate."

0 commit comments

Comments
 (0)