forked from phoenix/litellm-mirror
Update README.md
This commit is contained in:
parent
947770457d
commit
34c75b8c0c
1 changed files with 14 additions and 17 deletions
|
@ -40,25 +40,22 @@ curl http://0.0.0.0:8000/v1/chat/completions \
|
|||
}'
|
||||
```
|
||||
|
||||
### replace openai base
|
||||
### Replace openai base
|
||||
```python
|
||||
import openai
|
||||
openai.api_base = "http://0.0.0.0:8000"
|
||||
|
||||
# call cohere
|
||||
openai.api_key = "my-cohere-key" # this gets passed as a header
|
||||
# cohere call
|
||||
response = openai.ChatCompletion.create(
|
||||
model="command-nightly",
|
||||
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||
api_key = "your-cohere-api-key"
|
||||
)
|
||||
|
||||
response = openai.ChatCompletion.create(model="command-nightly", messages=[{"role":"user", "content":"Hey!"}])
|
||||
|
||||
# call bedrock
|
||||
# bedrock call
|
||||
response = openai.ChatCompletion.create(
|
||||
model = "bedrock/anthropic.claude-instant-v1",
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hey!"
|
||||
}
|
||||
],
|
||||
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||
aws_access_key_id="",
|
||||
aws_secret_access_key="",
|
||||
aws_region_name="us-west-2",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue