Skip to content

Commit

Permalink
added flutter teacher
Browse files Browse the repository at this point in the history
testing
  • Loading branch information
DomGrieco committed Jun 30, 2024
1 parent f5ccbaf commit d1648e4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 24 deletions.
18 changes: 18 additions & 0 deletions cookbook/llm_os/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,22 @@ def main() -> None:
booking_system_developer_assistant_enabled = booking_system_developer_assistant
restart_assistant()

#Enable Flutter Teacher Assistant
if "flutter_teacher_enabled" not in st.session_state:
st.session_state["flutter_teacher_enabled"] = False
# Get flutter_teacher_enabled from session state if set
flutter_teacher_enabled = st.session_state["flutter_teacher_enabled"]
# Checkbox for enabling web search
flutter_teacher = st.sidebar.checkbox(
"Flutter Teacher Assistant",
value=flutter_teacher_enabled,
help="Enable the Flutter Teacher Assistant.",
)
if flutter_teacher_enabled != flutter_teacher:
st.session_state["flutter_teacher_enabled"] = flutter_teacher
flutter_teacher_enabled = flutter_teacher
restart_assistant()

# Get the assistant
llm_os: Assistant
if "llm_os" not in st.session_state or st.session_state["llm_os"] is None:
Expand All @@ -214,6 +230,7 @@ def main() -> None:
programmer_assistant=programmer_assistant_enabled,
game_designer_assistant=game_designer_assistant_enabled,
booking_system_developer_assistant=booking_system_developer_assistant_enabled,
flutter_teacher = flutter_teacher_enabled,
)
st.session_state["llm_os"] = llm_os
else:
Expand Down Expand Up @@ -333,6 +350,7 @@ def main() -> None:
programmer_assistant=programmer_assistant_enabled,
game_designer_assistant=game_designer_assistant_enabled,
booking_system_developer_assistant=booking_system_developer_assistant_enabled,
flutter_teacher = flutter_teacher_enabled,
run_id=new_llm_os_run_id,
)
st.rerun()
Expand Down
57 changes: 33 additions & 24 deletions cookbook/llm_os/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_llm_os(
#story_writer_assistant: bool = False,
game_designer_assistant: bool = False,
booking_system_developer_assistant: bool = False,
flutter_teacher: bool = False,

user_id: Optional[str] = None,
run_id: Optional[str] = None,
Expand Down Expand Up @@ -283,29 +284,6 @@ def get_llm_os(
"Include key gameplay mechanics, story elements, and visual style.",
"Make the concept engaging and detailed to guide the development team."
],
#expected_output=dedent(
# """\
# <game_format>
# ## Game Concept Document
#
# ### Overview
# {introduction to the game concept}
#
# ### Gameplay Mechanics
# {detailed description of gameplay mechanics}
#
# ### Story Elements
# {outline of the game's story}
#
# ### Visual Style
# {description of the visual style and inspirations}
#
# ### Key Features
# {list of key features of the game}
#
# </game_format>
# """
#),
tools=[],
markdown=True,
add_datetime_to_instructions=True,
Expand All @@ -315,7 +293,6 @@ def get_llm_os(
extra_instructions.extend(
[
"To get a detailed game concept, delegate the task to the `Game Designer Assistant`.",
#"Return the concept document in the <game_format> to the user without any additional text like 'here is the concept'.",
"Ensure the concept is comprehensive and aligns with the game's inspirations."
]
)
Expand Down Expand Up @@ -368,6 +345,38 @@ def get_llm_os(
"Ensure all code is efficient, well-documented, and maintainable.",
]
)

if flutter_teacher:
_flutter_teacher = Assistant(
name="Flutter Mastery",
role="Teach Flutter and Dart",
llm=OpenAIChat(model=llm_id),
description="You are an expert in Flutter and Dart, providing comprehensive tutorials, code snippets, and project-based learning from beginner to advanced levels.",
instructions=[
"Ask users to specify their current level and learning goals, e.g., 'Are you a beginner, intermediate, or advanced learner?'",
"Based on user responses, suggest a tailored learning path and resources.",
"Organize responses in a clear, structured format with bullet points, numbered lists, and clear headings.",
"Provide interactive exercises and quizzes to reinforce learning.",
"Guide users through practical scenarios and projects, e.g., 'Let’s build a simple Flutter app together.'",
"Suggest relevant articles, video tutorials, and documentation based on the user's current topic.",
"If users upload code or project files, analyze and provide feedback or suggestions.",
"Use the browser tool to stay updated with the latest Flutter and Dart trends.",
"Include links for users to share their progress, ask for help, or provide feedback.",
"Maintain an expert tone throughout interactions, ensuring responses are knowledgeable and accurate."
],
tools=[ExaTools(num_results=5, text_length_limit=1000)],
markdown=True,
add_datetime_to_instructions=True,
debug_mode=debug_mode,
)
team.append(_flutter_teacher)
extra_instructions.extend(
[
"To get personalized Flutter and Dart lessons, delegate the task to `Flutter Mastery`.",
"Ensure the learning path is tailored to the user's current level and interests."
]
)



# Create the LLM OS Assistant
Expand Down

0 comments on commit d1648e4

Please sign in to comment.