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

Add support for Azure, OpenAI, Palm, Anthropic, Cohere, Replicate Models - using litellm #37

Closed
wants to merge 96 commits into from

Conversation

ishaan-jaff
Copy link

This PR adds support for models from all the above mentioned providers using https://github.com/BerriAI/litellm/

Here's a sample of how it's used:

from litellm import completion, acompletion

## set ENV variables
# ENV variables can be set in .env file, too. Example in .env.example
os.environ["OPENAI_API_KEY"] = "openai key"
os.environ["COHERE_API_KEY"] = "cohere key"

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# async openai
response = acompletion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion("command-nightly", messages)

# anthropic call
response = completion(model="claude-instant-1", messages=messages)

Identify the garage door by name
Improve README.md
Fix default password in vpn-server
Add a feature to send emails from Jarvis
Avoid creating api/logs directory when running on limited mode
Moves iOS related operations to a dedicated module
Enable optional strict word match in word_match.py on top of regex
Remove phrase being split on 'also' and make it a single command
Fix a bug in windows brightness where increase and decrease were swapped
Remove duplicate function arguments in listener.py
Add potential future work
Remove looping in garage module when device is chosen
Send an email when vehicle is unlocked remotely
Include timezone in vehicle's guardian mode response
Create a dedicated module for functions that only uses builtins
Change module names to make better sense
Update gmail-connector to the latest version
Set to limited mode by default for Linux
Update install.sh
Write processes.yaml file regardless of limited mode state
Remove CHANGELOG from pypi and link it to github
Add more classifiers for pypi
Remove forcing limited mode for linux systems
Fix a bug in surveillance mode session check
Restrict alarm and reminder features in limited mode
Add an option to set voice and quality for speech synthesis
Delete docker container spun up for speech synthesis when stopped
Block ALSA errors in Linux OS during start up
Simplify models.py and update install.sh
Initiate speech synthesis even in limited mode
Include local changes when asked for Jarvis' version
Add distributor info for linux systems
Rename automation.yaml instead of removing if invalid
Allow an option to brute force non-limited mode
Fix release notes hyperlink in pypi
Update README.md
Add one click copy to emailOTP.html (Unsupported in emails)
Implement a better way to get audio IO devices info
Add a condition check for weather location to avoid crash
Remove the usage of `time.perf_counter()`
Optimize globally accessible variables
Restructure the usage of `smart_devices.yaml` file
Update README.md and requirements.txt
Check for existing app before launching `Home`
Fix method fetching current app on TV
Iterate over a loop to power on and launch home for RokuTVs
Improve type hints
More clear logging and inline comments
Move background tasks from thread to process as `called_by_offline` flag should not be set in main process
Running it as a thread will raise `RuntimeError` as `runAndWait()` will not be called
Remove unsafe code in `pluralize` function
Run `wifi_connector` as a process to let `socket` sleep
Add an option to set hours to ignore in background tasks
Upgrade `PyAudio` for `macOS`
More consistent logging
Get CSS and JS required for night mode in robinhood.html via URL
Ignore speaker.run when called by offline
Update README.md
Override logging filter to add process name
Create process mapping file along with the components handled
Use timed wait to optimize CPU utilization on long-running processes
Custom keyword mapping being overwritten
Writing frequently used functions in yaml file
Weather breaking when phrase is available but not place
Remove redundant regex when getting capitalized
Change some HTTP requests methods from POST to GET calls
Add an option to disable background tasks on demand
Make `yaml` files in fileio directory to be available via API calls
Update README.md
Fix native audio conversion in tts_stt.py
Get plain text information for `stock-monitor` GET requests
Setup email verification service using one time passcodes
Create custom email template for stock monitor OTP
Set Jarvis API version to match main module
dormant-user and others added 22 commits May 5, 2023 00:04
Remove giant if else condition to looping
Reduce latency on weather response
Replace ``PreparedRequest`` with ``OrderedDict``
Combine both conversations and keywords in lookup
Extend custom units for system vitals
Use ordered dict to retain keywords order
Create a dedicated builtin override section
Fix a bug on extracting enum object value
Remove password protection on secure-send
Set main process' name to JARVIS
Some more minor bug fixes and improvements
Release production ready version
Remove todo for NLTK since compute time is high
Use OpenAI api for unmatched phrases
Remove the usage of return flag in conditions
Update version_locked_requirements.txt
Release beta version to test
Fix bug on meanings for words
Restrict certain tasks on offline commands
Add exception handler for connection error
Reorder keywords_base.py
Set keywords to be read only during startup
Remove API endpoint for conversation words
Remove redundancy in getting weather information
Reduce top level variable declarations
Create function mapping dict in place of globals
Reuse stock report for robinhood summarization
Update all object level calls to dict calls for keywords
Increase response time for wake word detection
Remove unused indicator sounds
Avoid writing on screen when called by offline
Set retry mode for put listener status
Create a new feature for custom conditions (on hold)
Override timeout and phrase limit in recognizer settings
Remove redundancy in weather alert trigger
Set weather alert trigger via background tasks
Keep weather alert time format consistent
Add an option to manually enable the listener
Add automation and smart devices to files.py
Cleanup keywords_handler.py
Rename timeout and phrase_limit to more sensible ones
Auto store LG tv's client key in smart_devices.yaml
Allow restart via ``automation.yaml``
Log vehicle auth expiration
Fix missing hosted device information in logs
Add inline comments
Instantiate vehicle objects
Better way to distinguish smart devices
Reduce redundancy and re-use variables
Add more keywords for secure send
Update CORS allowance for headers
Update README.md and type hints
Bump version
Set log file names to match the process names
Add low and high threshold for weather alerts
Update README.md and bump sub-version
Remove unwanted ticker gathering methods
Release version 3.2
Fix some random start up errors and delays
Create an option to get stock tickers as a dict
Update docs page for API endpoint
Release v3.3
Upgrade version locked dependencies
Update keywords for events/holidays
Override defaults in listener function
Update standalone speaker module to get voice by name
Fix no response in failed face detection
Fix one more random startup error
Fix secret access via offline communicator
@ishaan-jaff
Copy link
Author

@thevickypedia can you take a look at this PR? Happy to add more comments/ info in the readme if the initial commit looks good😊

@thevickypedia
Copy link
Collaborator

@ishaan-jaff Thanks for raising a PR. I would like to run an extensive test the library.
As you may have already noticed, my package is a natural language solution and mostly related to home-automation and serving as a personal-assistant rather than an AI. So it has little to no use for ML/DL libraries.
Nevertheless, I'll go through your library and analyze the use-case scenarios before I can integrate it.

@thevickypedia thevickypedia added the enhancement New feature or request label Aug 8, 2023
@thevickypedia thevickypedia marked this pull request as draft August 9, 2023 19:27
@DawoodTouseef
Copy link

DawoodTouseef commented Sep 17, 2023

It's best to integrate with open ai it answer the user request generating it instead of using the specfic command which you given it in jarvis/modules/conditions/conversation.py instead of that we can integrate it with open ai

@dormant-user
Copy link
Member

I'm revisiting this PR after a long time. I did research about all the OpenAI solutions
Unfortunately all the APIs are behind a payment firewall (one way or the other), and I'm totally against paying for a feature solely to integrate with Jarvis which is free otherwise
So I decided to create my own private AI with ollama2, I'm still in the initial stages of customizing the model
I'll have the feature integrated in the near future, so I'm closing this PR now
Thanks again for raising a thoughtful PR

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

Successfully merging this pull request may close these issues.

None yet

4 participants