Skip to main content

/chat endpoint deprecated

Summary

The /chat endpoint has been deprecated and will be removed by the end of July 2024. Please use the /ask endpoint instead, it takes the same parameters but the response format is different. See below.

Migration guide

Using the API

The /chat endpoint used to return a readable stream response containing a list of different blocks being either JSON encoded in base64 or plain text, sometimes prefixed with a value indicating the length of the block or using predefined delimiters. That was pretty challenging to decode.

The /ask endpoint returns also a readable stream response but uses the NDJSON format, so each line is a JSON object containing an item of the response.

It makes it easier to decode. You can iterate over the lines and parse each of them as a JSON object.

The /ask endpoint returns the information returned by /chat (search results, answer, citations and relations) plus some extra information (metadata and status).

See the Ask guide for more information.

Using the Python SDK/CLI

The chat() method of the Python SDK has been deprecated. Please use the ask() method instead.

The returned value uses the same data structure as the one returned by chat().

Using the JavaScript SDK

The chat() method of the JavaScript SDK has been deprecated. Please use the ask() method instead.

The returned value uses the same data structure as the one returned by chat().

Using the widget

No changes.