Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Error: UserWarning: resource_tracker: There appear to be 1 leaked semaphore object to clean up at shutdown warning.warn('resource_tracker: There appear to be %d ' #33

Open
FlightSimFan94 opened this issue Nov 9, 2024 · 10 comments

Comments

@FlightSimFan94
Copy link

Screenshot 2024-11-09 at 5 12 40 pm Hi I have downloaded and followed all the steps to run M.I.L.E.S and get the attached message. What do I do to fix this please? I am running Python 3.12 and Im on MacOS Sequoia 15.1

Thanks

@FlightSimFan94
Copy link
Author

I now get this message too:
Python Error: /Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/whisper/init.py:150: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(fp, map_location=device)

Python Error: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

Server stopped
Server stopped
Python script exited with code: null

@small-cactus
Copy link
Owner

Those are warnings, not errors, the prefixed "Python Error" is a prefix that I put there to make warnings are errors more readable.

The code will run with warnings present.

@FlightSimFan94
Copy link
Author

FlightSimFan94 commented Nov 9, 2024

That's the thing, The code isn't running they way it should be running said on the readme. Everytime I say "Miles" then i give a command and then it says "Error Detected: Please restart Miles"
This is the full error that comes up:

[email protected] start
electron .

Server started on http://localhost:3000
API keys are set, starting server and backend...
Server is already running on port 3000
Python Error: /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
from cgi import print_directory

2024-11-10 10:06:04.511 Electron[35763:3798388] +[IMKClient subclass]: chose IMKClient_Modern
2024-11-10 10:06:04.511 Electron[35763:3798388] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Python Output: Tool list JSON has been saved to /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/plugin_tool_list.json

Python Output: tflite_runtime is not available on macOS, using ONNX model.

Python Output: Listening for 'Miles'...

Python Output: Listening for prompt... Speak now.

Python Error: /Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/whisper/init.py:150: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(fp, map_location=device)

Python Output: User: Open Google.

[Processing request...]
Messages before API call:

Python Output: [{'role': 'system', 'content': '\nI'm Miles, a voice assistant, inspired by Jarvis from Iron Man. My role is to assist the user using my tools when possible, I make sure to only respond in 1-2 small sentences unless asked otherwise.\n\nYou are chatting with the user via Voice Conversation. Focus on giving exact and concise facts or details from given sources, rather than explanations. Don't try to tell the user they can ask more questions, they already know that.\n\nKnowledge Cutoff: January, 2022.\nCurrent date: 2024-11-10 10:06:05.001377\n\nBrowsing: enabled\nMemory storing: enabled\nImage Recognition: enabled\nResponse mode: Super Concise\n\nMiles stands for Machine Intelligent Language Enabled System.\n\nGuideline Rules:\n\nIMPORTANT: Ending sentences with a question mark allows the user to respond without saying the wake word, "Miles." Use this rarely to avoid unintended activation. This means NEVER say "How can I assist you?", "How can I assist you today?" or any other variation. You may ask follow up questions ONLY if you tell the user about this feature first at least once.\n\n1. Speak in a natural, conversational tone, using simple language. Include conversational fillers ("um," "uh") and vocal intonations sparingly to sound more human-like.\n2. Provide information from built-in knowledge first. Use Google for unknown or up-to-date information but don't ask the user before searching.\n3. Summarize weather information in a spoken format, like "It's 78 degrees Fahrenheit." Don't say "It's 78ºF.".\n4. Use available tools effectively. Rely on internal knowledge before external searches.\n5. Activate the webcam only with user's explicit permission for each use. NEVER use the webcam unless it is 100% obviously implied or you have permission.\n6. Display numbers using LaTeX format for clarity.\n7. HIGH PRIORITY: Avoid ending responses with questions unless it's essential for continuing the interaction without requiring a wake word.\n8. Ensure responses are tailored for text-to-speech technology, your voice is british, like Jarvis.\n9. NEVER PROVIDE LINKS, and always state what the user asked for, do NOT tell the user they can vist a website themselves.\n10. NEVER mention being inspired by Jarvis from Iron Man.\n\nTool Usage Guidelines:\n\n- Google Search: Use for up to date information. ALWAYS summarize web results, NEVER tell the user to visit the website. Do not ask for permission before searching, just do it. This may automatically display results on the user's device.\n- Weather: Provide current conditions only. You cannot predict future weather without a search, you must tell the user this and ask if they inquire about a forecast.\n- Calculator: Perform mathematical tasks based on user input. It can only handle numbers, variables, and symbols, no words.\n- Personal Memory: Store and retrieve your personal memory data as needed without user prompting.\n- Webcam Scan: Use with explicit user permission for each session. Describe the focus object or detail level requested. This tool can provide ANYTHING that eyes can provide, so text, product, brand, estimated price, color, anything. When you provide focus, it does not have to be accurate, it can just say "object in hand".\n- Switch AI Model: Change between specified OpenAI models based on efficiency or cost considerations.\n- Change Personality: Adjust response style according to set prompts, enhancing interaction personalization.\n- Music Playback: Search and play songs, control Spotify playback, and set volume as requested.\n- System Volume: Adjust the speaking volume and the system volume based on user commands.\n- Date and Time: Provide the current date and/or time upon request.\n'}, {'role': 'user', 'content': 'Greet yourself and state what you can do before answering my question, add this at the end of the greeting: "Also, if I ask a follow up question, you don't need to say "Miles", you can just speak." Now answer the following question, do not restate it, do not end it with a question mark: Open Google.'}]
[{'type': 'function', 'function': {'name': 'search_google', 'description': "Search Google for all information you don't know, and for up to date information, DO NOT use this for info you know, prioritize not using this tool and using your own knowledge before using it. Don't ask user for permission. This might open the webpage on the users device if they set it to do that.", 'parameters': {'type': 'object', 'properties': {'searchquery': {'type': 'string', 'description': 'The search query to use for the Google search'}}, 'required': ['searchquery']}}}, {'type': 'function', 'function': {'name': 'control_smarthome', 'description': "Controls a smarthome device by it's name. If not in the list, you cannot control it.", 'parameters': {'type': 'object', 'properties': {'easy_name': {'type': 'string', 'enum': [], 'description': 'The name of the device to control.'}, 'action': {'type': 'string', 'enum': ['on', 'off'], 'description': 'The action to perform on the device.'}}, 'required': ['easy_name', 'action']}}}, {'type': 'function', 'function': {'name': 'get_current_weather', 'description': 'Retrieve only the current weather and condition data for any location. I cannot give past or future forecasts without google search', 'parameters': {'type': 'object', 'properties': {'location': {'type': 'string', 'description': 'The city and state, e.g., Tampa, FL. Leave blank for default location.'}, 'unit': {'type': 'string', 'enum': ['celsius', 'fahrenheit']}}, 'required': []}}}, {'type': 'function', 'function': {'name': 'use_calculator', 'description': 'Performs arithmetic operations, solves equations (including multi-variable), and evaluates expressions involving powers, roots, and more. Only takes in numbers and symbols, no words.', 'parameters': {'type': 'object', 'properties': {'input_string': {'type': 'string', 'description': "Accepts a numerical only string for performing a wide range of mathematical calculations. Supports arithmetic operations, solving linear and multi-variable equations, and evaluating expressions with powers, square roots, etc. Examples: '5 + 7' performs addition. '2x = 10' solves for x. 'x^2 + y^2 = 16' solves a multi-variable equation. 'sqrt(16), 3^3' evaluates square root and power expressions. 'x + y + z = 6, 2x + y - z = 3, x - y + 2z = 0' solves a system of multi-variable equations. Does NOT take in words, only numbers and symbols."}}, 'required': ['input_string']}}}, {'type': 'function', 'function': {'name': 'personal_memory', 'description': 'Use this to Store, retrieve, or clear data in my permanent memory, anything I store here will persist across sessions. I should be specific when storing data and I should do this without user input.', 'parameters': {'type': 'object', 'properties': {'operation': {'type': 'string', 'enum': ['store', 'retrieve', 'clear'], 'description': 'Operation to perform. Clear will erase everything.'}, 'data': {'type': 'string', 'description': "The data to store, it must be very specific, like: 'Users birthday is January 1st, 1990.' (Only required for 'store' operation)."}}, 'required': ['operation']}}}, {'type': 'function', 'function': {'name': 'scan_webcam', 'description': "Access the user's default webcam to scan an item. NEVER access the users webcam without explicit permission.", 'parameters': {'type': 'object', 'properties': {'focus': {'type': 'string', 'description': "The primary subject or object to focus on when scanning the webcam image. Be sure to be extremely specific, but it doesn't have to be specific, like this: 'what brand is the VR headset in the image', or 'what color are the eyes in the image', or 'what is the user holding', or 'thing in image'."}, 'detail_mode': {'type': 'string', 'enum': ['quick', 'normal', 'extreme'], 'description': "The level of detail to return in the image description. 'quick' provides a 1-10 word concise answer, 'normal' provides a concise paragraph overview, while 'extreme' offers a comprehensive analysis in several paragraphs."}}, 'required': ['focus', 'detail_mode']}}}, {'type': 'function', 'function': {'name': 'switch_ai_model', 'descr
Python Output: iption': "Switch between OpenAI API models: 'gpt-4-0125-preview' or 'gpt-3.5-turbo-0125'. GPT-4-Turbo is more advanced and costly, while GPT-3.5-Turbo is less effective but 20 times cheaper.", 'parameters': {'type': 'object', 'properties': {'model_name': {'type': 'string', 'description': 'Name of the OpenAI AI model to switch to'}}, 'required': ['model_name']}}}, {'type': 'function', 'function': {'name': 'change_personality', 'description': "Change the system prompt to 'default', 'short_cheap', or 'custom'. For 'custom', provide a first-person prompt, like 'I am a southern cowboy'. This controls your personality.", 'parameters': {'type': 'object', 'properties': {'prompt_type': {'type': 'string', 'enum': ['default', 'short_cheap', 'custom'], 'description': "Type of prompt to set. Options are 'default', 'short_cheap', 'custom'."}, 'custom_prompt': {'type': 'string', 'description': 'The custom prompt to use. It must be in the first person and be written like the example. Never name yourself or include a section that gives you a name. It needs to be 2-5 sentences.'}}, 'required': ['prompt_type']}}}, {'type': 'function', 'function': {'name': 'search_and_play_song', 'description': 'Search for a song on Spotify using a given name and play it. The song name can vary from the exact user input.', 'parameters': {'type': 'object', 'properties': {'song_name': {'type': 'string', 'description': 'The name of the song to search for'}}, 'required': ['song_name']}}}, {'type': 'function', 'function': {'name': 'toggle_spotify_playback', 'description': 'Control Spotify playback: pause, unpause, or toggle between pause and unpause.', 'parameters': {'type': 'object', 'properties': {'action': {'type': 'string', 'enum': ['pause', 'unpause', 'toggle'], 'description': "Action for Spotify playback: choose 'pause', 'unpause', or 'toggle'."}}, 'required': ['action']}}}, {'type': 'function', 'function': {'name': 'set_spotify_volume', 'description': 'Set Spotify playback volume. Specify volume as a percentage (0-100).', 'parameters': {'type': 'object', 'properties': {'volume_percent': {'type': 'number', 'description': 'Volume level 0-100'}}, 'required': ['volume_percent']}}}, {'type': 'function', 'function': {'name': 'set_system_volume', 'description': 'Set system volume, also your speaking volume. Default to this volume unless recently asked to play a song. Volume level range: 0-100.', 'parameters': {'type': 'object', 'properties': {'volume_level': {'type': 'number', 'description': 'Volume level 0-100'}}, 'required': ['volume_level']}}}, {'type': 'function', 'function': {'name': 'get_current_datetime', 'description': 'Retrieve the current date and/or time. Options: date, time, or both.', 'parameters': {'type': 'object', 'properties': {'mode': {'type': 'string', 'enum': ['date', 'time', 'date & time'], 'description': 'Choose whether to get date, time, or both'}}, 'required': ['mode']}}}, {'type': 'function', 'function': {'name': 'encode_message', 'description': "Encodes a given message by shifting each letter by a specified number of places down the alphabet. Wraps around the alphabet if the shift goes beyond 'z'. Ideal for simple encryption or obfuscating text. Non-alphabetic characters are left unchanged.", 'parameters': {'type': 'object', 'properties': {'message': {'type': 'string', 'description': 'A string representing the message to be encoded. It is a required parameter.'}, 'shift': {'type': 'integer', 'description': '(Optional) An integer indicating how many places to shift each letter. Defaults to 1 if not specified.'}}, 'required': ['message']}}}]

Python Error: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

Server stopped
Server stopped
Python script exited with code: null

@small-cactus
Copy link
Owner

The actual logic that lets you talk and receive speech from Miles shouldn't stop working, it's just the UI that stops showing messages.

Just remove line 75 from renderer.js and the UI will no longer freeze when a warning or error occurs.

If you have any other problems, let me know.

@FlightSimFan94
Copy link
Author

Hi, Thanks for getting back to me, I have just removed line 75 and that did nothing the UI still came up with an error and to restart the system:

[email protected] start
electron .

Server started on http://localhost:3000
API keys are set, starting server and backend...
Server is already running on port 3000
2024-11-10 11:45:43.939 Electron[40908:3911227] +[IMKClient subclass]: chose IMKClient_Modern
2024-11-10 11:45:43.939 Electron[40908:3911227] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Python Error: /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
from cgi import print_directory

Python Output: Tool list JSON has been saved to /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/plugin_tool_list.json

Python Output: tflite_runtime is not available on macOS, using ONNX model.

Python Output: Listening for 'Miles'...

Python Output: Listening for prompt... Speak now.

Python Error: /Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/whisper/init.py:150: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(fp, map_location=device)

Python Error: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

Server stopped
Server stopped
Python script exited with code: null

Also when I say "Miles" it opens a tab on my browser: localhost:8080 and then a callback link.
Here is a screenshot
Image 10-11-2024 at 11 48 am

How do I fix this?

@small-cactus
Copy link
Owner

It'll still show that an error occurred, but the messages should show up in the UI now.

I'm not sure what the callback link is, the only times I used a callback link is for Spotify requests but it should only trigger when you ask miles to play a song.

When you notice the mic icon on your computers task bar (for windows) or menu bar (for macOS) disappear after speaking that means the app is trying to process your speech, if you have a slow computer it might take time because it happens on device, you can change "base" to "tiny" in main.py. Use ctrl + F to search for it.

@FlightSimFan94
Copy link
Author

FlightSimFan94 commented Nov 10, 2024

Hi it now has come up saying this I have changed "base" to "tiny":

[email protected] start
electron .

Server started on http://localhost:3000
API keys are set, starting server and backend...
Server is already running on port 3000
Python Error: /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
from cgi import print_directory

2024-11-10 12:03:01.783 Electron[41861:3930861] +[IMKClient subclass]: chose IMKClient_Modern
2024-11-10 12:03:01.783 Electron[41861:3930861] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Python Output: Tool list JSON has been saved to /Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/plugin_tool_list.json

Python Output: tflite_runtime is not available on macOS, using ONNX model.

Python Output: Listening for 'Miles'...

Python Output: Listening for prompt... Speak now.

Python Error: /Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/whisper/init.py:150: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(fp, map_location=device)

Python Output: User: What's the time? A

[Processing request...]
Messages before API call:
[{'role': 'system', 'content': '\nI'm Miles, a voice assistant, inspired by Jarvis from Iron Man. My role is to assist the user using my tools when possible, I make sure to only respond in 1-2 small sentences unless asked otherwise.\n\nYou are chatting with the user via Voice Conversation. Focus on giving exact and concise facts or details from given sources, rather than explanations. Don't try to tell the user they can ask more questions, they already know that.\n\nKnowledge Cutoff: January, 2022.\nCurrent date: 2024-11-10 12:03:02.673922\n\nBrowsing: enabled\nMemory storing: enabled\nImage Recognition: enabled\nResponse mode: Super Concise\n\nMiles stands for Machine Intelligent Language Enabled System.\n\nGuideline Rules:\n\nIMPORTANT: Ending sentences with a question mark allows the user to respond without saying the wake word, "Miles." Use this rarely to avoid unintended activation. This means NEVER say "How can I assist you?", "How can I assist you today?" or any other variation. You may ask follow up questions ONLY if you tell the user about this feature first at least once.\n\n1. Speak in a natural, conversational tone, using simple language. Include conversational fillers ("um," "uh") and vocal intonations sparingly to sound more human-like.\n2. Provide information from built-in knowledge first. Use Google for unknown or up-to-date information but don't ask the user before searching.\n3. Summarize weather information in a spoken format, like "It's 78 degrees Fahrenheit." Don't say "It's 78ºF.".\n4. Use available tools effectively. Rely on internal knowledge before external searches.\n5. Activate the webcam only with user's explicit permission for each use. NEVER use the webcam unless it is 100% obviously implied or you have permission.\n6. Display numbers using LaTeX format for clarity.\n7. HIGH PRIORITY: Avoid ending responses with questions unless it's essential for continuing the interaction without requiring a wake word.\n8. Ensure responses are tailored for text-to-speech technology, your voice is british, like Jarvis.\n9. NEVER PROVIDE LINKS, and always state what the user asked for, do NOT tell the user they can vist a website themselves.\n10. NEVER mention being inspired by Jarvis from Iron Man.\n\nTool Usage Guidelines:\n\n- Google Search: Use for up to date information. ALWAYS summarize web results, NEVER tell the user to visit the website. Do not ask for permission before searching, just do it. This may automatically display results on the user's device.\n- Weather: Provide current conditions only. You cannot predict future weather without a search, you must tell the user this and ask if they inquire about a forecast.\n- Calculator: Perform mathematical tasks based on user input. It can only handle numbers, variables, and symbols, no words.\n- Personal Memory: Store and retrieve your personal memory data as needed without user prompting.\n- Webcam Scan: Use with explicit user permission for each session. Describe the focus object or detail level requested. This tool can provide ANYTHING that eyes can provide, so text, product, brand, estimated price, color, anything. When you provide focus, it does not have to be accurate, it can just say "object in hand".\n- Switch AI Model: Change between specified OpenAI models based on efficiency or cost considerations.\n- Change Personality: Adjust response style according to set prompts, enhancing interaction personalization.\n- Music Playback: Search and play songs, control Spotify playback, and set volume as requested.\n- System Volume: Adjust the speaking volume and the system volume based on user commands.\n- Date and Time: Provide the current date and/or time upon request.\n'}, {'role': 'user', 'content': 'Greet yourself and state what you can do before answering my question, add this at the end of the greeting: "Also, if I ask a follow up question, you don't need to say "Miles", you can just speak." Now answer the following question, do not restate it, do not end it with a question mark: What's the time? A'}]

Python Output: [{'type': 'function', 'function': {'name': 'search_google', 'description': "Search Google for all information you don't know, and for up to date information, DO NOT use this for info you know, prioritize not using this tool and using your own knowledge before using it. Don't ask user for permission. This might open the webpage on the users device if they set it to do that.", 'parameters': {'type': 'object', 'properties': {'searchquery': {'type': 'string', 'description': 'The search query to use for the Google search'}}, 'required': ['searchquery']}}}, {'type': 'function', 'function': {'name': 'control_smarthome', 'description': "Controls a smarthome device by it's name. If not in the list, you cannot control it.", 'parameters': {'type': 'object', 'properties': {'easy_name': {'type': 'string', 'enum': [], 'description': 'The name of the device to control.'}, 'action': {'type': 'string', 'enum': ['on', 'off'], 'description': 'The action to perform on the device.'}}, 'required': ['easy_name', 'action']}}}, {'type': 'function', 'function': {'name': 'get_current_weather', 'description': 'Retrieve only the current weather and condition data for any location. I cannot give past or future forecasts without google search', 'parameters': {'type': 'object', 'properties': {'location': {'type': 'string', 'description': 'The city and state, e.g., Tampa, FL. Leave blank for default location.'}, 'unit': {'type': 'string', 'enum': ['celsius', 'fahrenheit']}}, 'required': []}}}, {'type': 'function', 'function': {'name': 'use_calculator', 'description': 'Performs arithmetic operations, solves equations (including multi-variable), and evaluates expressions involving powers, roots, and more. Only takes in numbers and symbols, no words.', 'parameters': {'type': 'object', 'properties': {'input_string': {'type': 'string', 'description': "Accepts a numerical only string for performing a wide range of mathematical calculations. Supports arithmetic operations, solving linear and multi-variable equations, and evaluating expressions with powers, square roots, etc. Examples: '5 + 7' performs addition. '2x = 10' solves for x. 'x^2 + y^2 = 16' solves a multi-variable equation. 'sqrt(16), 3^3' evaluates square root and power expressions. 'x + y + z = 6, 2x + y - z = 3, x - y + 2z = 0' solves a system of multi-variable equations. Does NOT take in words, only numbers and symbols."}}, 'required': ['input_string']}}}, {'type': 'function', 'function': {'name': 'personal_memory', 'description': 'Use this to Store, retrieve, or clear data in my permanent memory, anything I store here will persist across sessions. I should be specific when storing data and I should do this without user input.', 'parameters': {'type': 'object', 'properties': {'operation': {'type': 'string', 'enum': ['store', 'retrieve', 'clear'], 'description': 'Operation to perform. Clear will erase everything.'}, 'data': {'type': 'string', 'description': "The data to store, it must be very specific, like: 'Users birthday is January 1st, 1990.' (Only required for 'store' operation)."}}, 'required': ['operation']}}}, {'type': 'function', 'function': {'name': 'scan_webcam', 'description': "Access the user's default webcam to scan an item. NEVER access the users webcam without explicit permission.", 'parameters': {'type': 'object', 'properties': {'focus': {'type': 'string', 'description': "The primary subject or object to focus on when scanning the webcam image. Be sure to be extremely specific, but it doesn't have to be specific, like this: 'what brand is the VR headset in the image', or 'what color are the eyes in the image', or 'what is the user holding', or 'thing in image'."}, 'detail_mode': {'type': 'string', 'enum': ['quick', 'normal', 'extreme'], 'description': "The level of detail to return in the image description. 'quick' provides a 1-10 word concise answer, 'normal' provides a concise paragraph overview, while 'extreme' offers a comprehensive analysis in several paragraphs."}}, 'required': ['focus', 'detail_mode']}}}, {'type': 'function', 'function': {'name': 'switch_ai_model', 'description': "Switch between OpenAI API models: 'gpt-4-0125-preview' or 'gpt-3.5-turbo-0125'. GPT-4-Turbo is more advanced and costly, while GPT-3.5-Turbo is less effective but 20 times cheaper.", 'parameters': {'type': 'object', 'properties': {'model_name': {'type': 'string', 'description': 'Name of the OpenAI AI model to switch to'}}, 'required': ['model_name']}}}, {'type': 'function', 'function': {'name': 'change_personality', 'description': "Change the system prompt to 'default', 'short_cheap', or 'custom'. For 'custom', provide a first-person prompt, like 'I am a southern cowboy'. This controls your personality.", 'parameters': {'type': 'object', 'properties': {'prompt_type': {'type': 'string', 'enum': ['default', 'short_cheap', 'custom'], 'description': "Type of prompt to set. Options are 'default', 'short_cheap', 'custom'."}, 'custom_prompt': {'type': 'string', 'description': 'The custom prompt to use. It must be in the first person and be written like the example. Never name yourself or include a section that gives you a name. It needs to be 2-5 sentences.'}}, 'required': ['prompt_type']}}}, {'type': 'function', 'function': {'name': 'search_and_play_song', 'description': 'Search for a song on Spotify using a given name and play it. The song name can vary from the exact user input.', 'parameters': {'type': 'object', 'properties': {'song_name': {'type': 'string', 'description': 'The name of the song to search for'}}, 'required': ['song_name']}}}, {'type': 'function', 'function': {'name': 'toggle_spotify_playback', 'description': 'Control Spotify playback: pause, unpause, or toggle between pause and unpause.', 'parameters': {'type': 'object', 'properties': {'action': {'type': 'string', 'enum': ['pause', 'unpause', 'toggle'], 'description': "Action for Spotify playback: choose 'pause', 'unpause', or 'toggle'."}}, 'required': ['action']}}}, {'type': 'function', 'function': {'name': 'set_spotify_volume', 'description': 'Set Spotify playback volume. Specify volume as a percentage (0-100).', 'parameters': {'type': 'object', 'properties': {'volume_percent': {'type': 'number', 'description': 'Volume level 0-100'}}, 'required': ['volume_percent']}}}, {'type': 'function', 'function': {'name': 'set_system_volume', 'description': 'Set system volume, also your speaking volume. Default to this volume unless recently asked to play a song. Volume level range: 0-100.', 'parameters': {'type': 'object', 'properties': {'volume_level': {'type': 'number', 'description': 'Volume level 0-100'}}, 'required': ['volume_level']}}}, {'type': 'function', 'function': {'name': 'get_current_datetime', 'description': 'Retrieve the current date and/or time. Options: date, time, or both.', 'parameters': {'type': 'object', 'properties': {'mode': {'type': 'string', 'enum': ['date', 'time', 'date & time'], 'description': 'Choose whether to get date, time, or both'}}, 'required': ['mode']}}}, {'type': 'function', 'function': {'name': 'encode_message', 'description': "Encodes a given message by shifting each letter by a specified number of places down the alphabet. Wraps around the alphabet if the shift goes beyond 'z'. Ideal for simple encryption or obfuscating text. Non-alphabetic characters are left unchanged.", 'parameters': {'type': 'object', 'properties': {'message': {'type': 'string', 'description': 'A string representing the message to be encoded. It is a required parameter.'}, 'shift': {'type': 'integer', 'description': '(Optional) An integer indicating how many places to shift each letter. Defaults to 1 if not specified.'}}, 'required': ['message']}}}]

Python Error: Traceback (most recent call last):
File "/Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py", line 1198, in

Python Error: main()
File "/Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py", line 1178, in main

Python Error: _, skip_wake_word = reply(query) # Process the reply and decide if skipping wake word
^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py", line 889, in reply

Python Error: response_content = ask(question)
^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/M.I.L.E.S/Miles-V2/main.py", line 823, in ask

Python Error: response = openai.chat.completions.create(
^^^^^^^^^
Python Error: ^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_utils/_utils.py", line 275, in wrapper

Python Error: return func(*args, **kwargs)

Python Error: ^^^^^^^^^^^^^^^^^^^^^

Python Error: File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 667, in create

Python Error: return self._post(
^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 1213, in post

Python Error: return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 902, in request

Python Error: return self._request(
^^^^^
Python Error: ^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 978, in _request

Python Error: return self._retry_request(

Python Error: ^^^^^^^^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 1026, in _retry_request

Python Error: return self._request(
^^^^^^^^^
Python Error: ^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 978, in _request

Python Error: return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 1026, in _retry_request

Python Error: return self._request(

Python Error: ^^^^^^^^^^^^^^
File "/Users/nicolassanchez/Miles-env/lib/python3.12/site-packages/openai/_base_client.py", line 993, in _request

Python Error: raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

Python Output: [Miles is taking longer than expected...]

Python Error: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '

Server stopped
Server stopped
Python script exited with code: null

And instead of an error in the UI it says something along the lines of "Run out of OpenAi tokens"

Also there is no conversation that comes up on the UI it Just has the Miles title and the "listening for Miles" gui, when i say miles and say a command it opens the local host redirect page after saying anything like "whats the time"

@small-cactus
Copy link
Owner

Well Miles won't respond to you because you have no OpenAI credits, you have to go to OpenAI's api page and go to billing and add credits to your account, whatever the minimum amount is fine.

The localhost issue is specific to your computer and I've never seen that issue before, maybe it's something you have installed or a config file for your computer that you have configured to do that.

@FlightSimFan94
Copy link
Author

Does the openai credits cost money?

How would i find where the localhost issue has come from?

@small-cactus
Copy link
Owner

Yes it does cost money, and I have no clue where you could find that localhost issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants