Skip to content

Commit 02afaae

Browse files
committed
Incorporate openai_swarm into tests.
1 parent 6a1a386 commit 02afaae

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

tests/fixtures/frameworks/openai_swarm/entrypoint_max.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ def agent_name(self, messages: list[str] = []):
2626
functions=[],
2727
)
2828

29+
@agentstack.agent
30+
def second_agent_name(self, messages: list[str] = []):
31+
agent_config = agentstack.get_agent('second_agent_name')
32+
return Agent(
33+
name=agent_config.name,
34+
model=agent_config.model,
35+
instructions="\n".join([agent_config.prompt, *messages, ]),
36+
functions=[],
37+
)
38+
2939
@agentstack.task
3040
def task_name(self):
3141
task_config = agentstack.get_task('task_name')
@@ -35,6 +45,15 @@ def task_name(self):
3545
agent = getattr(self, task_config.agent)
3646
return agent(messages)
3747

48+
@agentstack.task
49+
def task_name_two(self):
50+
task_config = agentstack.get_task('task_name_two')
51+
messages = [
52+
task_config.prompt,
53+
]
54+
agent = getattr(self, task_config.agent)
55+
return agent(messages)
56+
3857
def run(self, inputs: list[str]):
3958
app = Swarm()
4059
response = app.run(

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# `TEST_FRAMEWORK` section to `setenv`.
44

55
# Developers
6-
# run just 3.12 tests with `tox -epy312-crewai,py312-langgraph,report`
6+
# run just 3.12 tests with `tox -epy312-crewai,py312-langgraph,py312-openai_swarm,report`
77
# TODO I have not found a way to alias this, yet.
88

99
# Coverage
1010
# codecov is configured to run on all frameworks and then be combined at the end.
1111

1212
[tox]
13-
envlist = py{310,311,312}-{crewai,langgraph}
13+
envlist = py{310,311,312}-{crewai,langgraph,openai_swarm}
1414

1515
[gh-actions]
1616
# converts python versions to tox envlist values for github actions
@@ -24,6 +24,7 @@ extras =
2424
# framework specific dependencies
2525
crewai: crewai # installs agentstack[crewai]
2626
langgraph: langgraph
27+
openai_swarm: openai_swarm
2728
deps =
2829
pytest
2930
parameterized
@@ -39,6 +40,7 @@ setenv =
3940
# environment variables to determine active framework inside tests
4041
crewai: TEST_FRAMEWORK = crewai
4142
langgraph: TEST_FRAMEWORK = langgraph
43+
openai_swarm: TEST_FRAMEWORK = openai_swarm
4244

4345
[testenv:report]
4446
deps = coverage

0 commit comments

Comments
 (0)