Recommendations

Completions Recommendations Chat

Returns a response for the chat conversation.

POST
/recommendations.chat.completions
AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

max_tokens?integer

The maximum number of tokens that can be generated in the chat completion.

Formatint32
messagesarray<chat-completions-request-message>

A list of messages comprising the conversation so far.

Items1 <= items
stop_sequences?array<string>

Sequences where the API will stop generating further tokens. Maximum of 4 sequences are supported. Defaults to none.

stream?boolean

If set, partial message deltas will be sent. Defaults to false.

temperature?number

What sampling temperature to use. Value can be between 0 and 2 and defaults to 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

Formatfloat
top_p?number

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. For openai: Between 0 and

  1. Defaults to 1.0.
Formatfloat

Response Body

curl -X POST "https://api.devrev.ai/recommendations.chat.completions" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "content": "string",        "role": "assistant"      }    ]  }'
{
  "text_response": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}