forked from phoenix/litellm-mirror
Update README.md
This commit is contained in:
parent
5d86b3f709
commit
3e9967b614
1 changed files with 3 additions and 5 deletions
|
@ -25,11 +25,6 @@ pip install litellm
|
||||||
```python
|
```python
|
||||||
from litellm import completion
|
from litellm import completion
|
||||||
|
|
||||||
## 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"}]
|
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||||
|
|
||||||
# openai call
|
# openai call
|
||||||
|
@ -41,6 +36,9 @@ response = completion("command-nightly", messages)
|
||||||
# azure openai call
|
# azure openai call
|
||||||
response = completion("chatgpt-test", messages, azure=True)
|
response = completion("chatgpt-test", messages, azure=True)
|
||||||
|
|
||||||
|
# hugging face call
|
||||||
|
response = completion(model="stabilityai/stablecode-completion-alpha-3b-4k", messages=messages, hugging_face=True)
|
||||||
|
|
||||||
# openrouter call
|
# openrouter call
|
||||||
response = completion("google/palm-2-codechat-bison", messages)
|
response = completion("google/palm-2-codechat-bison", messages)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue