-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from axelpey/readme_new_examples
New examples
- Loading branch information
Showing
4 changed files
with
26 additions
and
10 deletions.
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 |
---|---|---|
|
@@ -15,7 +15,19 @@ | |
app = NaturalFrontend( | ||
app, | ||
openai_api_key=creds["key"], | ||
options=NaturalFrontendOptions(frontend_endpoint=""), | ||
options=NaturalFrontendOptions( | ||
frontend_endpoint="frontend", | ||
personas=[ | ||
{ | ||
"persona": "Twitter Lover Reader", | ||
"description": "User that loves reading posts on a Twitter-like platform", | ||
}, | ||
{ | ||
"persona": "Administrator", | ||
"description": "User that can see and change all posts and users", | ||
}, | ||
], | ||
), | ||
) | ||
|
||
|
||
|
@@ -35,13 +47,17 @@ class Post(BaseModel): | |
|
||
# Initial data | ||
users = [ | ||
User(id=1, email="[email protected]", name="User One"), | ||
User(id=2, email="[email protected]", name="User Two"), | ||
User(id=1, email="[email protected]", name="Axel Peytavin"), | ||
User(id=2, email="[email protected]", name="Pierre"), | ||
User(id=3, email="[email protected]", name="Michelle"), | ||
] | ||
posts = [ | ||
Post(id=1, title="Post 1", content="Content of post 1", owner_id=1), | ||
Post(id=2, title="Post 2", content="Content of post 2", owner_id=1), | ||
Post(id=3, title="Post 3", content="Content of post 3", owner_id=2), | ||
Post(id=1, title="I love my dog", content="I love my dog a lot", owner_id=1), | ||
Post(id=2, title="I love my cat", content="He's so cute", owner_id=1), | ||
Post( | ||
id=3, title="Who left the door open?", content="I'm freezing here", owner_id=2 | ||
), | ||
Post(id=4, title="I'm so happy", content="I just got a new job", owner_id=3), | ||
] | ||
|
||
|
||
|
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 @@ | ||
from natural_frontend.natural_frontend import NaturalFrontend # noqa | ||
from natural_frontend.natural_frontend import NaturalFrontend # noqa |
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
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,6 +1,6 @@ | ||
[project] | ||
name = "natural-frontend" | ||
version = "0.0.4" | ||
version = "0.0.5" | ||
authors = [ | ||
{ name="Axel Peytavin", email="[email protected]" }, | ||
{ name="Pierre Collignon", email="[email protected]" }, | ||
|