# Invoke the model and print the response
result = co.chat(message="Write a LinkedIn post about starting a career in tech:",
                 model="<YOUR ENDPOINT NAME>") # On SageMaker, you create a model name that you'll pass here. 

print(result)
```

### Reranking

You can use this code to invoke Cohere's Rerank v4.0 model on Amazon SageMaker:

```python PYTHON 
import cohere

co = cohere.SagemakerClient(
    aws_region="us-east-1",
    aws_access_key="...",
    aws_secret_key="...",
    aws_session_token="...",
)