You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+119-4Lines changed: 119 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,132 @@ Official SDK from [WorkflowAI](https://workflowai.com) for Python.
11
11
12
12
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.
13
13
14
-
## Installation
14
+
## Key Features
15
15
16
-
`workflowai` requires a python >= 3.9.
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
+
18
+
-**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.
19
+
20
+
-**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).
21
+
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
+
24
+
-**Type-safe**: Leverages Python's type system to catch errors at development time rather than runtime, ensuring more reliable AI applications.
25
+
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
+
28
+
-**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).
29
+
30
+
-**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.
31
+
32
+
-**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.
33
+
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
+
36
+
-**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.
37
+
38
+
## Get Started
39
+
40
+
`workflowai` requires Python 3.9 or higher.
17
41
18
42
```sh
19
43
pip install workflowai
20
44
```
21
45
22
-
## Get Started
46
+
Here's a simple example of a WorkflowAI agent that extracts structured flight information from email content:
47
+
48
+
49
+
```python
50
+
import asyncio
51
+
from datetime import datetime
52
+
from enum import Enum
53
+
54
+
from pydantic import BaseModel, Field
55
+
56
+
import workflowai
57
+
from workflowai import Model
58
+
59
+
60
+
classEmailInput(BaseModel):
61
+
email_content: str
62
+
63
+
classFlightInfo(BaseModel):
64
+
classStatus(str, Enum):
65
+
"""Possible statuses for a flight booking."""
66
+
CONFIRMED="Confirmed"
67
+
PENDING="Pending"
68
+
CANCELLED="Cancelled"
69
+
DELAYED="Delayed"
70
+
COMPLETED="Completed"
71
+
72
+
passenger: str
73
+
airline: str
74
+
flight_number: str
75
+
from_airport: str= Field(description="Three-letter IATA airport code for departure")
76
+
to_airport: str= Field(description="Three-letter IATA airport code for arrival")
> **Ready to run!** This example works straight out of the box - no tweaking needed.
136
+
137
+
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.
23
138
24
-
Follow the steps in our [Getting Started Guide](https://docs.workflowai.com/python-sdk/get-started).
0 commit comments