Skip to content

Commit 7eeb8ac

Browse files
committed
Add demo video to README and update example script
1 parent 1e1fe81 commit 7eeb8ac

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,27 @@ Official SDK from [WorkflowAI](https://workflowai.com) for Python.
1010

1111
This SDK is designed for Python teams who prefer code-first development. It provides greater control through direct code integration while still leveraging the full power of the WorkflowAI platform, complementing the web-app experience.
1212

13+
![DEMO](./examples/assets/hello-agent.mp4)
14+
1315
## Key Features
1416

1517
- **Model-agnostic**: Works with all major AI models including OpenAI, Anthropic, Claude, Google/Gemini, Mistral, Deepseek, with a unified interface that makes switching between providers seamless. [View all supported models](https://github.com/WorkflowAI/python-sdk/blob/main/workflowai/core/domain/model.py).
1618

1719
- **Open-source and flexible deployment**: WorkflowAI is fully open-source with flexible deployment options. Run it self-hosted on your own infrastructure for maximum data control, or use the managed [WorkflowAI Cloud](https://docs.workflowai.com/workflowai-cloud/introduction) service for hassle-free updates and automatic scaling.
1820

19-
- **Observability integrated**: Built-in monitoring and logging capabilities that provide insights into your AI workflows, making debugging and optimization straightforward. Learn more about [observability features](https://docs.workflowai.com/concepts/runs).
20-
21-
- **Cost tracking**: Automatically calculates and tracks the cost of each AI model run, providing transparency and helping you manage your AI budget effectively. Learn more about [cost tracking](https://docs.workflowai.com/python-sdk/agent#cost-latency).
21+
- **Structured output**: Uses Pydantic models to validate and structure AI responses. WorkflowAI ensures your AI responses always match your defined structure, simplifying integrations, reducing parsing errors, and making your data reliable and ready for use. Learn more about [structured input and output](https://docs.workflowai.com/python-sdk/agent#schema-input-output).
2222

23-
- **Type-safe**: Leverages Python's type system to catch errors at development time rather than runtime, ensuring more reliable AI applications.
23+
```python
24+
class TagOutput(BaseModel):
25+
positive_tags: list[str] = Field(
26+
default_factory=list
27+
)
28+
negative_tags: list[str] = Field(
29+
default_factory=list
30+
)
31+
```
2432

25-
- **Structured output**: Uses Pydantic models to validate and structure AI responses. WorkflowAI ensures your AI responses always match your defined structure, simplifying integrations, reducing parsing errors, and making your data reliable and ready for use. Learn more about [structured input and output](https://docs.workflowai.com/python-sdk/agent#schema-input-output).
33+
- **Observability integrated**: Built-in monitoring and logging capabilities that provide insights into your AI workflows, making debugging and optimization straightforward. Learn more about [observability features](https://docs.workflowai.com/concepts/runs).
2634

2735
- **Streaming supported**: Enables real-time streaming of AI responses for low latency applications, with immediate validation of partial outputs. Learn more about [streaming capabilities](https://docs.workflowai.com/python-sdk/agent#streaming).
2836

@@ -38,7 +46,7 @@ This SDK is designed for Python teams who prefer code-first development. It prov
3846

3947
- **Caching support**: To save money and improve latency, WorkflowAI supports caching. When enabled, identical requests return cached results instead of making new API calls to AI providers. Learn more about [caching capabilities](https://docs.workflowai.com/python-sdk/agent#cache).
4048

41-
49+
- **Cost tracking**: Automatically calculates and tracks the cost of each AI model run, providing transparency and helping you manage your AI budget effectively. Learn more about [cost tracking](https://docs.workflowai.com/python-sdk/agent#cost-latency).
4250

4351
## Get Started
4452

examples/01_basic_agent.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
class CityInput(BaseModel):
2121
"""Input model for the city-to-capital agent."""
2222

23-
city: str = Field(
24-
description="The name of the city for which to find the country's capital",
25-
examples=["Paris", "New York", "Tokyo"],
26-
)
23+
# For simple input fields like 'city', descriptions and examples add token overhead
24+
# without providing additional context that a modern LLM wouldn't already understand.
25+
# Input fields never need examples since an actual value will be provided at runtime.
26+
city: str = Field()
2727

2828

2929
class CapitalOutput(BaseModel):
3030
"""Output model containing information about the capital city."""
3131

32+
# Fields like country, capital, etc. are self-explanatory to LLMs
33+
# Omitting descriptions and examples for these would reduce token usage
3234
country: str = Field(
3335
description="The country where the input city is located",
3436
examples=["France", "United States", "Japan"],
@@ -45,7 +47,7 @@ class CapitalOutput(BaseModel):
4547

4648
@workflowai.agent(
4749
id="city-to-capital",
48-
model=Model.CLAUDE_3_5_SONNET_LATEST,
50+
model=Model.CLAUDE_3_7_SONNET_LATEST,
4951
)
5052
async def get_capital_info(city_input: CityInput) -> Run[CapitalOutput]:
5153
"""

examples/assets/hello-agent.mp4

21.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)