Update README.md

This commit is contained in:
Ishaan Jaff 2023-10-23 12:42:24 -07:00 committed by GitHub
parent 947770457d
commit 34c75b8c0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",