-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add description to the parenting chatbot and create public app (#…
…88) * feat: Add description to the parenting chatbot and create public app * chore: Change title and text * feat: Create new streamlit apps
- Loading branch information
Showing
6 changed files
with
144 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Streamlit app for the Generative AI prototypes.""" | ||
|
||
import os | ||
|
||
import openai | ||
import streamlit as st | ||
|
||
from dotenv import load_dotenv | ||
|
||
from genai.streamlit_pages import eyfs_dm_kb | ||
|
||
|
||
load_dotenv() | ||
|
||
|
||
def auth_openai() -> None: | ||
"""Authenticate with OpenAI.""" | ||
try: | ||
openai.api_key = os.environ["OPENAI_API_KEY"] | ||
except Exception: | ||
openai.api_key = st.secrets["OPENAI_API_KEY"] | ||
|
||
|
||
def main() -> None: | ||
"""Run the app.""" | ||
auth_openai() | ||
eyfs_dm_kb(sidebar=False) | ||
|
||
|
||
main() |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Streamlit app for the Generative AI prototypes.""" | ||
|
||
import os | ||
|
||
import openai | ||
import streamlit as st | ||
|
||
from dotenv import load_dotenv | ||
|
||
from genai.streamlit_pages import eli3 | ||
|
||
|
||
load_dotenv() | ||
|
||
|
||
def auth_openai() -> None: | ||
"""Authenticate with OpenAI.""" | ||
try: | ||
openai.api_key = os.environ["OPENAI_API_KEY"] | ||
except Exception: | ||
openai.api_key = st.secrets["OPENAI_API_KEY"] | ||
|
||
|
||
def main() -> None: | ||
"""Run the app.""" | ||
auth_openai() | ||
eli3(sidebar=False) | ||
|
||
|
||
main() |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Streamlit app for the Generative AI prototypes.""" | ||
|
||
import os | ||
|
||
import openai | ||
import streamlit as st | ||
|
||
from dotenv import load_dotenv | ||
|
||
from genai.streamlit_pages import parenting_chatbot | ||
|
||
|
||
load_dotenv() | ||
|
||
|
||
def auth_openai() -> None: | ||
"""Authenticate with OpenAI.""" | ||
try: | ||
openai.api_key = os.environ["OPENAI_API_KEY"] | ||
except Exception: | ||
openai.api_key = st.secrets["OPENAI_API_KEY"] | ||
|
||
|
||
def s3_creds() -> None: | ||
"""Get s3 creds.""" | ||
try: | ||
aws_key = os.environ["AWS_ACCESS_KEY_ID"] | ||
aws_secret = os.environ["AWS_SECRET_ACCESS_KEY"] | ||
s3_path = os.environ["S3_BUCKET"] | ||
except Exception: | ||
aws_key = st.secrets["AWS_ACCESS_KEY_ID"] | ||
aws_secret = st.secrets["AWS_SECRET_ACCESS_KEY"] | ||
s3_path = st.secrets["S3_BUCKET"] | ||
|
||
return aws_key, aws_secret, s3_path | ||
|
||
|
||
def main() -> None: | ||
"""Run the app.""" | ||
auth_openai() | ||
aws_key, aws_secret, s3_path = s3_creds() | ||
parenting_chatbot(aws_key, aws_secret, s3_path, sidebar=False) | ||
|
||
|
||
main() |
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
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