Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -21
src/streamlit_app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from pydantic import BaseModel, Field
|
| 3 |
from typing import List, Literal, Dict, Optional
|
| 4 |
-
from agency_swarm import Agent, Agency, set_openai_key,
|
| 5 |
|
| 6 |
|
| 7 |
class AnalyzeProjectRequirement(BaseTool):
|
|
@@ -67,7 +67,7 @@ class AnalyzeProjectRequirement(BaseTool):
|
|
| 67 |
|
| 68 |
def init_session_state()-> None:
|
| 69 |
"""Initiate session state variable"""
|
| 70 |
-
if "messages"
|
| 71 |
st.session_state.message=[]
|
| 72 |
if "api_key" not in st.session_state:
|
| 73 |
st.session_state.api_key= None
|
|
@@ -78,22 +78,6 @@ def main() -> None:
|
|
| 78 |
|
| 79 |
st.title("Greg.ai Services- Innovate Build, and Lighten up the future with AI")
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
st.header("API Configuration")
|
| 85 |
-
openai_api_key= st.text_input(
|
| 86 |
-
"OpenAI API Key",
|
| 87 |
-
type= "password",
|
| 88 |
-
help= "Enter your OpenAI Key that starts with sk-xxxxxxxxx"
|
| 89 |
-
)
|
| 90 |
-
|
| 91 |
-
if openai_api_key:
|
| 92 |
-
st.session_state_api_key= openai_api_key
|
| 93 |
-
st.success("API Key accepted")
|
| 94 |
-
else:
|
| 95 |
-
st.warning("⚠️ API Key not found, please enter your key to proceed")
|
| 96 |
-
st.markdown("[Get your API key here](https://platform.openai.com/api-keys)")
|
| 97 |
-
return
|
| 98 |
-
|
| 99 |
-
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from pydantic import BaseModel, Field
|
| 3 |
from typing import List, Literal, Dict, Optional
|
| 4 |
+
from agency_swarm import Agent, Agency, set_openai_key, basetool
|
| 5 |
|
| 6 |
|
| 7 |
class AnalyzeProjectRequirement(BaseTool):
|
|
|
|
| 67 |
|
| 68 |
def init_session_state()-> None:
|
| 69 |
"""Initiate session state variable"""
|
| 70 |
+
if "messages" not in st.session_state:
|
| 71 |
st.session_state.message=[]
|
| 72 |
if "api_key" not in st.session_state:
|
| 73 |
st.session_state.api_key= None
|
|
|
|
| 78 |
|
| 79 |
st.title("Greg.ai Services- Innovate Build, and Lighten up the future with AI")
|
| 80 |
|
| 81 |
+
|
| 82 |
+
if __name__ == "__main__":
|
| 83 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|