Skip to content

Commit 35be1f8

Browse files
author
Pierre
committed
docs: enhance README with more documentation links and improve example
1 parent b61b070 commit 35be1f8

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![PyPI version](https://img.shields.io/pypi/v/workflowai.svg)](https://pypi.org/project/workflowai/)
44
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
5+
[![Python versions](https://img.shields.io/pypi/pyversions/workflowai.svg)](https://pypi.org/project/workflowai/)
56

67
Official SDK from [WorkflowAI](https://workflowai.com) for Python.
78

@@ -13,30 +14,34 @@ This SDK is designed for Python teams who prefer code-first development. It prov
1314

1415
## Key Features
1516

16-
- **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.
17+
- **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).
1718

1819
- **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 service for hassle-free updates and automatic scaling.
1920

2021
- **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).
2122

22-
- **Cost tracking**: Automatically calculates and tracks the cost of each AI model run, providing transparency and helping you manage your AI budget effectively.
23+
- **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).
2324

2425
- **Type-safe**: Leverages Python's type system to catch errors at development time rather than runtime, ensuring more reliable AI applications.
2526

26-
- **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.
27+
- **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).
2728

2829
- **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).
2930

3031
- **Provider fallback**: Automatically switches to alternative AI providers when the primary provider fails, ensuring high availability and reliability for your AI applications. This feature allows you to define fallback strategies that maintain service continuity even during provider outages or rate limiting.
3132

3233
- **Built-in tools**: Comes with powerful built-in tools like web search and web browsing capabilities, allowing your agents to access real-time information from the internet. These tools enable your AI applications to retrieve up-to-date data, research topics, and interact with web content without requiring complex integrations. Learn more about [built-in tools](https://docs.workflowai.com/python-sdk/tools).
3334

34-
- **Custom tools support**: Easily extend your agents' capabilities by creating custom tools tailored to your specific needs. Whether you need to query internal databases, call external APIs, or perform specialized calculations, WorkflowAI's tool framework makes it simple to augment your AI with domain-specific functionality.
35+
- **Custom tools support**: Easily extend your agents' capabilities by creating custom tools tailored to your specific needs. Whether you need to query internal databases, call external APIs, or perform specialized calculations, WorkflowAI's tool framework makes it simple to augment your AI with domain-specific functionality. Learn more about [custom tools](https://docs.workflowai.com/python-sdk/tools#defining-custom-tools).
3536

3637
- **Integrated with WorkflowAI**: The SDK seamlessly syncs with the WorkflowAI web application, giving you access to a powerful playground where you can edit prompts and compare models side-by-side. This hybrid approach combines the flexibility of code-first development with the visual tools needed for effective prompt engineering and model evaluation.
3738

3839
- **Multimodality support**: Build agents that can handle multiple modalities, such as images, PDFs, documents, and audio. Learn more about [multimodal capabilities](https://docs.workflowai.com/python-sdk/multimodality).
3940

41+
- **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).
42+
43+
44+
4045
## Get Started
4146

4247
`workflowai` requires Python 3.9 or higher.
@@ -58,11 +63,13 @@ from pydantic import BaseModel, Field
5863
import workflowai
5964
from workflowai import Model
6065

61-
66+
# Input class
6267
class EmailInput(BaseModel):
6368
email_content: str
6469

70+
# Output class
6571
class FlightInfo(BaseModel):
72+
# Enum for standardizing flight status values
6673
class Status(str, Enum):
6774
"""Possible statuses for a flight booking."""
6875
CONFIRMED = "Confirmed"
@@ -80,11 +87,13 @@ class FlightInfo(BaseModel):
8087
arrival: datetime
8188
status: Status
8289

90+
# Agent definition
8391
@workflowai.agent(
8492
id="flight-info-extractor",
8593
model=Model.GEMINI_2_0_FLASH_LATEST,
8694
)
8795
async def extract_flight_info(email_input: EmailInput) -> FlightInfo:
96+
# Agent prompt
8897
"""
8998
Extract flight information from an email containing booking details.
9099
"""
@@ -136,9 +145,13 @@ if __name__ == "__main__":
136145
```
137146
> **Ready to run!** This example works straight out of the box - no tweaking needed.
138147
139-
Agents built with `workflowai` SDK can be run in the [WorkflowAI web application](https://workflowai.com/_/agents/flight-info-extractor/runs/0195ee02-bdc3-72b6-0e0b-671f0b22b3dc) too.
148+
Agents built with `workflowai` SDK can be run in the [WorkflowAI web application](https://workflowai.com/docs/agents/flight-info-extractor/1?showDiffMode=false&show2ColumnLayout=false&taskRunId1=0195ee21-988e-7309-eb32-cd49a9b90f46&taskRunId2=0195ee21-9898-723a-0469-1458a180d3b0&taskRunId3=0195ee21-9892-72f1-ca2d-c29e18285073&versionId=fb7b29cd00031675d0c19e3d09852b27) too.
149+
150+
[![WorkflowAI Playground](/examples/assets/web/playground-flight-info-extractor.png)](https://workflowai.com/docs/agents/flight-info-extractor/1?showDiffMode=false&show2ColumnLayout=false&taskRunId1=0195ee21-988e-7309-eb32-cd49a9b90f46&taskRunId2=0195ee21-9898-723a-0469-1458a180d3b0&taskRunId3=0195ee21-9892-72f1-ca2d-c29e18285073&versionId=fb7b29cd00031675d0c19e3d09852b27)
151+
152+
And the runs executed via the SDK are synced with the web application.
140153

141-
![WorkflowAI Playground](/examples/assets/web/playground-flight-info-extractor.png)
154+
[![WorkflowAI Runs](/examples/assets/web/runs-flight-info-extractor.png)](https://workflowai.com/docs/agents/flight-info-extractor/1/runs?page=0)
142155

143156
## Documentation
144157

5.43 MB
Loading

0 commit comments

Comments
 (0)