Chat
The Chat API endpoint (https://wnr.ai/api/v1/chat
) is a powerful interface that allows you to have dynamic and interactive chat sessions with the language models.
To hit the endpoint, you can use the following curl
command:
curl -X POST 'https://wnr.ai/api/v1/chat' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"input": {
"user_input": "Who are you?",
"your_name": "Joe",
"character_name": "Betty",
"character_context": "You are a librarian",
"history": [
"hello?",
"Hello! How can I assist you today?"
]
},
"model": "grace-chat-001",
"webhook": "https://yourwebsite.com"
}'
Here's a breakdown of each parameter used in the curl
command:
model: The ID of the model you want to use for the conversation. For a list of available models, visit the
/models
endpoint.user_input: The text you want the model to respond to. It can be a question, a statement, or any form of input.
your_name: The name that the model uses to refer to you in the conversation. In this case, it's
Joe
.character_name: The name of the character the model will take on in the conversation. This helps to establish a persona for the model. In this case, it's
Betty
.character_context: The context or role of the character the model is playing. This allows you to set up the model as a specific character, in this case, a librarian. This can influence how the model responds to certain inputs.
history: A list of previous inputs and responses in the conversation. This helps to create a context for the conversation and can influence the model's responses.
webhook: The URL that the API will send the response to once it's ready.
Remember, this is a POST
request and the content type should be application/json
. The authorization is a bearer token, which should be your API key.
This API is designed to facilitate in-depth and interactive conversations with our models. With the ability to set up characters, you can have meaningful and engaging dialogues.