Update README.md

This commit is contained in:
Krish Dholakia 2023-10-25 14:04:48 -07:00 • committed by GitHub
parent aec4de68a7
commit ae27d2e55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,30 +35,15 @@ curl http://0.0.0.0:8000/v1/chat/completions \
}'
```
### Replace openai base
```python
import openai
openai.api_base = "http://0.0.0.0:8000"
# cohere call
response = openai.ChatCompletion.create(
model="command-nightly",
messages=[{"role":"user", "content":"Say this is a test!"}],
api_key = "your-cohere-api-key"
)
# bedrock call
response = openai.ChatCompletion.create(
model = "bedrock/anthropic.claude-instant-v1",
messages=[{"role":"user", "content":"Say this is a test!"}],
aws_access_key_id="",
aws_secret_access_key="",
aws_region_name="us-west-2",
)
print(response)
```
```shell
curl http://0.0.0.0:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-instant-1",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
```
### Running Locally
```shell