acecalisto3 commited on
Commit
2ea07e9
·
verified ·
1 Parent(s): 2b9f396

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -461,7 +461,7 @@ with tabs[0]:
461
  st.subheader("From Text")
462
  agent_name = st.text_input("Enter agent name:")
463
  text_input = st.text_area("Enter skills (one per line):")
464
- persona_prompt_option = st.selectbox("Choose a persona prompt", ["None", "Expert Developer"])
465
  persona_prompt = None
466
  if persona_prompt_option == "Expert Developer":
467
  persona_prompt = create_persona_from_text("Expert Developer")
@@ -484,7 +484,7 @@ with tabs[1]:
484
 
485
  # --- Workspace ---
486
  st.subheader("Workspace")
487
- project_name = st.selectbox("Select a project", list(st.session_state.workspace_projects.keys()), key="project_select")
488
  if project_name:
489
  st.session_state.current_project = project_name
490
  for file in st.session_state.workspace_projects[project_name]['files']:
@@ -492,10 +492,10 @@ with tabs[1]:
492
 
493
  # --- Chat with AI Agents ---
494
  st.subheader("Chat with AI Agents")
495
- selected_agent_or_cluster = st.selectbox("Select an AI agent or cluster", st.session_state.available_agents + st.session_state.available_clusters)
496
  agent_chat_input = st.text_area("Enter your message:")
497
  chat_model_options = ["text-davinci-003", "gpt-3.5-turbo"] # Add more chat models as needed
498
- selected_chat_model = st.selectbox("Select a chat model", chat_model_options)
499
  if st.button("Send"):
500
  st.session_state.selected_chat_model = selected_chat_model
501
  if selected_agent_or_cluster in st.session_state.available_agents:
@@ -533,16 +533,16 @@ with tabs[2]:
533
  st.header("Workspace Chat App")
534
 
535
  # --- Project Selection ---
536
- project_name = st.selectbox("Select a project", list(st.session_state.workspace_projects.keys()), key="project_select2")
537
  if project_name:
538
  st.session_state.current_project = project_name
539
 
540
  # --- Chat with AI Agents ---
541
  st.subheader("Chat with AI Agents")
542
- selected_agent_or_cluster = st.selectbox("Select an AI agent or cluster", st.session_state.available_agents + st.session_state.available_clusters)
543
  agent_chat_input = st.text_area("Enter your message:")
544
  chat_model_options = ["text-davinci-003", "gpt-3.5-turbo"] # Add more chat models as needed
545
- selected_chat_model = st.selectbox("Select a chat model", chat_model_options)
546
  if st.button("Send"):
547
  st.session_state.selected_chat_model = selected_chat_model
548
  if selected_agent_or_cluster in st.session_state.available_agents:
@@ -603,8 +603,8 @@ with tabs[2]:
603
 
604
  st.write("Code Translation:")
605
  code_to_translate = st.text_area("Enter code to translate:")
606
- source_language = st.selectbox("Source Language", ["Python", "JavaScript", "C++"])
607
- target_language = st.selectbox("Target Language", ["Python", "JavaScript", "C++"])
608
  if st.button("Translate"):
609
  translated_code = translate_code(code_to_translate, source_language, target_language)
610
  st.write(translated_code)
@@ -612,7 +612,7 @@ with tabs[2]:
612
  st.write("Code Generation:")
613
  code_idea = st.text_input("Enter your code idea:")
614
  code_model_options = ["bigcode/starcoder", "google/flan-t5-xl"] # Add more code models as needed
615
- selected_code_model = st.selectbox("Select a code generation model", code_model_options)
616
  if st.button("Generate"):
617
  st.session_state.selected_code_model = selected_code_model
618
  generated_code = generate_code(code_idea)
@@ -627,7 +627,7 @@ with tabs[2]:
627
  st.write(f"Project built successfully! Build directory: {build_dir}")
628
 
629
  st.write("Select a deployment target:")
630
- deployment_target = st.selectbox("Deployment Target", ["Local", "Hugging Face Spaces"])
631
  if deployment_target == "Hugging Face Spaces":
632
  hf_token = st.text_input("Enter your Hugging Face token:")
633
  repo_name = st.text_input("Enter your Hugging Face Space repository name:")
 
461
  st.subheader("From Text")
462
  agent_name = st.text_input("Enter agent name:")
463
  text_input = st.text_area("Enter skills (one per line):")
464
+ persona_prompt_option = st.selectboxED("Choose a persona prompt", ["None", "Expert Developer"])
465
  persona_prompt = None
466
  if persona_prompt_option == "Expert Developer":
467
  persona_prompt = create_persona_from_text("Expert Developer")
 
484
 
485
  # --- Workspace ---
486
  st.subheader("Workspace")
487
+ project_name = st.selectboxSP("Select a project", list(st.session_state.workspace_projects.keys()), key="project_select")
488
  if project_name:
489
  st.session_state.current_project = project_name
490
  for file in st.session_state.workspace_projects[project_name]['files']:
 
492
 
493
  # --- Chat with AI Agents ---
494
  st.subheader("Chat with AI Agents")
495
+ selected_agent_or_cluster = st.selectboxSA("Select an AI agent or cluster", st.session_state.available_agents + st.session_state.available_clusters)
496
  agent_chat_input = st.text_area("Enter your message:")
497
  chat_model_options = ["text-davinci-003", "gpt-3.5-turbo"] # Add more chat models as needed
498
+ selected_chat_model = st.selectboxSCM("Select a chat model", chat_model_options)
499
  if st.button("Send"):
500
  st.session_state.selected_chat_model = selected_chat_model
501
  if selected_agent_or_cluster in st.session_state.available_agents:
 
533
  st.header("Workspace Chat App")
534
 
535
  # --- Project Selection ---
536
+ project_name = st.selectboxSP2("Select a project", list(st.session_state.workspace_projects.keys()), key="project_select2")
537
  if project_name:
538
  st.session_state.current_project = project_name
539
 
540
  # --- Chat with AI Agents ---
541
  st.subheader("Chat with AI Agents")
542
+ selected_agent_or_cluster = st.selectboxSA2("Select an AI agent or cluster", st.session_state.available_agents + st.session_state.available_clusters)
543
  agent_chat_input = st.text_area("Enter your message:")
544
  chat_model_options = ["text-davinci-003", "gpt-3.5-turbo"] # Add more chat models as needed
545
+ selected_chat_model = st.selectboxSCM2("Select a chat model", chat_model_options)
546
  if st.button("Send"):
547
  st.session_state.selected_chat_model = selected_chat_model
548
  if selected_agent_or_cluster in st.session_state.available_agents:
 
603
 
604
  st.write("Code Translation:")
605
  code_to_translate = st.text_area("Enter code to translate:")
606
+ source_language = st.selectboxSL("Source Language", ["Python", "JavaScript", "C++"])
607
+ target_language = st.selectboxTL("Target Language", ["Python", "JavaScript", "C++"])
608
  if st.button("Translate"):
609
  translated_code = translate_code(code_to_translate, source_language, target_language)
610
  st.write(translated_code)
 
612
  st.write("Code Generation:")
613
  code_idea = st.text_input("Enter your code idea:")
614
  code_model_options = ["bigcode/starcoder", "google/flan-t5-xl"] # Add more code models as needed
615
+ selected_code_model = st.selectboxGM("Select a code generation model", code_model_options)
616
  if st.button("Generate"):
617
  st.session_state.selected_code_model = selected_code_model
618
  generated_code = generate_code(code_idea)
 
627
  st.write(f"Project built successfully! Build directory: {build_dir}")
628
 
629
  st.write("Select a deployment target:")
630
+ deployment_target = st.selectboxDP2HF("Deployment Target", ["Local", "Hugging Face Spaces"])
631
  if deployment_target == "Hugging Face Spaces":
632
  hf_token = st.text_input("Enter your Hugging Face token:")
633
  repo_name = st.text_input("Enter your Hugging Face Space repository name:")