Spaces:
Sleeping
Sleeping
agent configured: log 1
Browse files- src/streamlit_app.py +139 -1
src/streamlit_app.py
CHANGED
|
@@ -101,4 +101,142 @@ def main() -> None:
|
|
| 101 |
|
| 102 |
# Initialize agents with the provided API key
|
| 103 |
set_openai_key(st.session_state.api_key)
|
| 104 |
-
api_headers = {"Authorization": f"Bearer {st.session_state.api_key}"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
# Initialize agents with the provided API key
|
| 103 |
set_openai_key(st.session_state.api_key)
|
| 104 |
+
api_headers = {"Authorization": f"Bearer {st.session_state.api_key}"}
|
| 105 |
+
|
| 106 |
+
# Project Form
|
| 107 |
+
with st.form("Project Form"):
|
| 108 |
+
st.subheader("Project Details")
|
| 109 |
+
|
| 110 |
+
project_name = st.text_input("Project Name")
|
| 111 |
+
project_description = st.text_area(
|
| 112 |
+
"Project Description",
|
| 113 |
+
help = "Describe the project, it's goals and any specific requirements"
|
| 114 |
+
)
|
| 115 |
+
|
| 116 |
+
col1, col2 = st.columns(2)
|
| 117 |
+
|
| 118 |
+
with col1:
|
| 119 |
+
project_type = st.selectbox(
|
| 120 |
+
"Project Type",
|
| 121 |
+
["Web Application", "Mobile App", "API Development",
|
| 122 |
+
"Data Analytics", "AI/ML Solution", "Other"]
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
timeline = st.selectbox(
|
| 126 |
+
"Expected Timelines",
|
| 127 |
+
["1-2 months", "3-4 months", "5-6 months", "6+ months"]
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
with col2:
|
| 131 |
+
budget_range = st.selectbox(
|
| 132 |
+
"Budget Range",
|
| 133 |
+
["$10k-$25k", "$25k-$50k", "$50k-$100k", "$100k+"]
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
priority = st.selectbox(
|
| 137 |
+
"Project Priority",
|
| 138 |
+
["High", "Medium", "Low"]
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
tech_requirements = st.text_area(
|
| 142 |
+
"Technical Requirements (Optional)",
|
| 143 |
+
help = "Any specific technical requirments or preferences"
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
special_consideration = st.text_area(
|
| 147 |
+
"Special Consideration (Optional)",
|
| 148 |
+
help = "Any additional information or special requirements"
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
submitted = st.form_submit_button("Analyze Project")
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
if submitted and project_name and project_description:
|
| 155 |
+
try:
|
| 156 |
+
# Setup the openai
|
| 157 |
+
set_openai_key(st.session_state.api_key)
|
| 158 |
+
|
| 159 |
+
# Create the agent
|
| 160 |
+
ceo = Agent(
|
| 161 |
+
name = "Project Director",
|
| 162 |
+
description = "",
|
| 163 |
+
instruction = """
|
| 164 |
+
|
| 165 |
+
""",
|
| 166 |
+
tools = [AnalyzeProjectRequirements],
|
| 167 |
+
api_headers = api_headers,
|
| 168 |
+
temperature = 0.7,
|
| 169 |
+
max_prompt_tokens = 25000
|
| 170 |
+
)
|
| 171 |
+
|
| 172 |
+
cto = Agent(
|
| 173 |
+
name = "Technical Architect",
|
| 174 |
+
description = "",
|
| 175 |
+
instruction = """
|
| 176 |
+
|
| 177 |
+
""",
|
| 178 |
+
tools = [CreateTechnicalSpecification],
|
| 179 |
+
api_headers = api_headers,
|
| 180 |
+
temperature = 0.5,
|
| 181 |
+
max_prompt_tokens = 25000
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
product_manager = Agent(
|
| 185 |
+
name = "Product Manager",
|
| 186 |
+
description = "",
|
| 187 |
+
instruction = """
|
| 188 |
+
|
| 189 |
+
""",
|
| 190 |
+
api_headers = api_headers,
|
| 191 |
+
temperature = 0.4,
|
| 192 |
+
max_prompt_tokens = 25000
|
| 193 |
+
)
|
| 194 |
+
|
| 195 |
+
developer = Agent(
|
| 196 |
+
name = "Lead Developer",
|
| 197 |
+
description = "",
|
| 198 |
+
instruction = """
|
| 199 |
+
|
| 200 |
+
""",
|
| 201 |
+
api_headers = api_headers,
|
| 202 |
+
temperature = 0.3,
|
| 203 |
+
max_prompt_tokens = 25000
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
client_manager = Agent(
|
| 207 |
+
name = "Client Success Manager",
|
| 208 |
+
description = "",
|
| 209 |
+
instruction = """
|
| 210 |
+
|
| 211 |
+
""",
|
| 212 |
+
api_headers = api_headers,
|
| 213 |
+
temperature = 0.6,
|
| 214 |
+
max_prompt_tokens = 25000
|
| 215 |
+
)
|
| 216 |
+
|
| 217 |
+
agency = Agency(
|
| 218 |
+
[
|
| 219 |
+
ceo, cto, product_manager, developer, client_manager,
|
| 220 |
+
[ceo, cto],
|
| 221 |
+
[ceo, product_manager],
|
| 222 |
+
[ceo, developer],
|
| 223 |
+
[ceo, client_manager],
|
| 224 |
+
[cto, developer],
|
| 225 |
+
[product_manager, developer],
|
| 226 |
+
[product_manager, client_manager]
|
| 227 |
+
],
|
| 228 |
+
async_mode = "threading",
|
| 229 |
+
shared_files = "shared_files"
|
| 230 |
+
)
|
| 231 |
+
|
| 232 |
+
# Prepare Project info
|
| 233 |
+
project_info = {
|
| 234 |
+
"name" : project_name,
|
| 235 |
+
"description": project_description,
|
| 236 |
+
"type": project_type,
|
| 237 |
+
"timeline": timeline,
|
| 238 |
+
"budget": budget_range,
|
| 239 |
+
"priority": priority,
|
| 240 |
+
"technical_requirements": tech_requirements,
|
| 241 |
+
"special_consideration": special_consideration
|
| 242 |
+
}
|