-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
# convertanything | ||
# convertanything | ||
|
||
`convertanything` is a simple way to convert any unstructured texts into pydantic models in Python with the use of language models. See the [examples notebook](examples.ipynb) for more details. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install convertanything | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
from convertanything import convertanything | ||
from pydantic import BaseModel | ||
from typing import List | ||
|
||
class Person(BaseModel): | ||
name: str | ||
age: int | ||
email: str | ||
interests: List[str] | ||
|
||
response = await convertanything( | ||
input_string="Hi my name is John Doe, I am 30 years old, my email is [email protected] . I like to go fishing.", | ||
model=Person, | ||
api_key="Your OpenAI API Key", | ||
) | ||
print(response) | ||
``` |