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
11 changes: 1 addition & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ jobs:
run: poetry install --all-extras

- name: Run all example scripts
run: |
# Find all Python files in examples directory
find examples -name "*.py" -type f | while read -r script; do
echo "Running example: $script"
poetry run python "$script"
if [ $? -ne 0 ]; then
echo "Error: Failed to run $script"
exit 1
fi
done
run: ARGS="-vv" make test.examples
env:
WORKFLOWAI_API_KEY: ${{ secrets.WORKFLOWAI_TEST_API_KEY }}

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ test:
.PHONY: lock
lock:
poetry lock --no-update

test.examples:
poetry run pytest examples -n=5 ${ARGS}
2 changes: 2 additions & 0 deletions examples/17_multi_model_consensus_with_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import asyncio

import pytest
from pydantic import BaseModel, Field

import workflowai
Expand Down Expand Up @@ -131,6 +132,7 @@ async def combine_responses(responses_input: CombinerInput) -> CombinedOutput:
...


@pytest.mark.xfail(reason="Example is flaky")
async def main():
# Example: Scientific explanation
print("\nExample: Scientific Concept")
Expand Down
4 changes: 3 additions & 1 deletion examples/workflows/agent_delegation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import asyncio
from typing import Optional

import pytest
from pydantic import BaseModel, Field

import workflowai
Expand Down Expand Up @@ -118,7 +119,7 @@ async def delegate_task(agent_input: DelegateInput) -> DelegateOutput:

@workflowai.agent(
id="orchestrator",
model=Model.GPT_4O_LATEST,
model=Model.GEMINI_2_0_FLASH_LATEST,
tools=[delegate_task],
)
async def orchestrator_agent(agent_input: OrchestratorInput) -> OrchestratorOutput:
Expand Down Expand Up @@ -148,6 +149,7 @@ async def orchestrator_agent(agent_input: OrchestratorInput) -> OrchestratorOutp
...


@pytest.mark.xfail(reason="Example is flaky")
async def main():
# Example: Software architecture task
print("\nExample: Software Architecture Design")
Expand Down
38 changes: 36 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ruff = "^0.9.6"
freezegun = "^1.5.1"
pre-commit = "^4.0.1"
pytest-httpx = "^0.35.0"
pytest-xdist = "^3.1.0"
python-dotenv = "^1.0.1"
typer = "^0.15.1"
rich = "^13.7.1"
Expand Down