Skip to content

Commit b7a1963

Browse files
committed
Migration details
1 parent a8de930 commit b7a1963

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,61 @@
66
![Python](https://img.shields.io/badge/Python-3.10.14-blue)
77
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
88

9+
10+
<a href="https://colab.research.google.com/github/WecoAI/weco-python/blob/main/examples/cookbook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" width=110 height=20/></a>
11+
<a target="_blank" href="https://lightning.ai/new?repo_url=https%3A%2F%2Fgithub.com%2FWecoAI%2Fweco-python%2Fblob%2Fmain%2Fexamples%2Fcookbook.ipynb"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open in Studio" width=100 height=20/></a>
12+
913
# $f$(👷‍♂️)
1014

1115
## IMPORTANT
1216

1317
This package has been deprecated. Please move to our new package - [aifn](https://github.com/WecoAI/aifn-python)!
1418

15-
<a href="https://colab.research.google.com/github/WecoAI/weco-python/blob/main/examples/cookbook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" width=110 height=20/></a>
16-
<a target="_blank" href="https://lightning.ai/new?repo_url=https%3A%2F%2Fgithub.com%2FWecoAI%2Fweco-python%2Fblob%2Fmain%2Fexamples%2Fcookbook.ipynb"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open in Studio" width=100 height=20/></a>
19+
### From `weco` to `aifn`
20+
21+
When migrating, here's what you need to know:
22+
23+
#### Package
24+
- **`weco`**: Install using
25+
```bash
26+
pip install weco
27+
```
28+
- **`aifn`**: Install using
29+
```bash
30+
pip install aifn
31+
```
32+
33+
---
34+
35+
#### Building AI Functions
36+
- **`weco`**: Use the `build` method to create a function:
37+
```python
38+
from weco import build
39+
function_name: str, function_version: int, function_description: str = build("identify objects in an image")
40+
```
41+
- **`aifn`**: Use the `build` method to create a function with type `AIFunction`:
42+
```python
43+
from aifn import build
44+
object_identifier: AIFunction = build("identify objects in an image")
45+
```
46+
47+
---
48+
49+
#### Calling AI Functions
50+
- **`weco`**: Query an AI function using the `query` method:
51+
```python
52+
from weco import query
53+
response = query(
54+
fn_name="BusinessIdeaAnalyzer-XYZ123",
55+
text_input="A subscription service for personalized, AI-generated bedtime stories for children."
56+
)
57+
output = response["output"]
58+
```
59+
- **`aifn`**: Query an AI function by creating an `AIFunction` object:
60+
```python
61+
from aifn import AIFunction
62+
idea_analyzer = AIFunction("BusinessIdeaAnalyzer-XYZ123")
63+
output = idea_analyzer("A subscription service for personalized, AI-generated bedtime stories for children.").output
1764

1865
A client facing API for interacting with the [Weco AI](https://www.weco.ai/) function builder [service](https://www.aifunction.com)!
1966

0 commit comments

Comments
 (0)