Skip to content

Commit

Permalink
Merge pull request #67 from PavanTeja2005/main
Browse files Browse the repository at this point in the history
Robust main_assisstant and bug fixes
  • Loading branch information
suryanshsk authored Oct 7, 2024
2 parents deb9fb4 + 67800f2 commit 926c1b1
Show file tree
Hide file tree
Showing 17 changed files with 429 additions and 152 deletions.
Binary file removed __pycache__/gemini_info.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/jokes.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/news_info.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/open_app.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/reminderr.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/song_data.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/text_to_speech.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/voice_recognition.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/weather_info.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/website_data.cpython-312.pyc
Binary file not shown.
Binary file removed __pycache__/wikipedia_info.cpython-312.pyc
Binary file not shown.
28 changes: 27 additions & 1 deletion gemini_info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import google.generativeai as genai

# Configure the API key
genai.configure(api_key="API_KEY") # Replace with your actual API key
genai.configure(api_key="API_Key") # Replace with your actual API key

# Set up the model configuration
generation_config = {
Expand Down Expand Up @@ -45,4 +45,30 @@ def get_gemini_response(prompt):
return f"Error: {e}"


if __name__ == "__main__":
q = """
I have a list of tools that can perform specific actions. Based on the user query, select the appropriate tool from the list and extract the necessary inputs. Please respond in the following JSON format:
{{
"tool": "<tool_name>",
"inputs": {{
"input1": "<value1>",
"input2": "<value2>",
...
}}
}}
Here is the list of tools:
1. "just_print": Requires general response if none of the following tools fits best.
2. "set_reminder": Requires "time" (strictly in ISO format . that is,'date+T+time', including both date and time) and "message".
3. "search_wikipedia": Requires "search_query".
4. "get_weather": Requires "city_name".
5. "tell_joke": Requires no inputs.
6. "play_music": Requires "song_name".
7. "open_website": Requires "website_name".
If the tool requires no inputs, leave the "inputs" field empty.
Query: "Heyy.... How is weather in hyderabad"
"""
print(get_gemini_response(q))
3 changes: 2 additions & 1 deletion jokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ def joke_voice_assistant():
else:
print("Oops! That's not on the list, try again later")

joke_voice_assistant()
if __name__ == "__main__":
joke_voice_assistant()
Loading

0 comments on commit 926c1b1

Please sign in to comment.