Serverless.ChatRender

Chat render

Given a list of messages forming a conversation, the API renders them into the final prompt text that will be sent to the model.

post/serverless/v1/chat/render

Request

Headers

X-Friendli-Teamstring nullable

ID of team to run requests as (optional parameter).

Request body

modelstring required

Code of the model to use. See available model list.

chat_template_kwargsobject nullable

Additional keyword arguments supplied to the template renderer. These parameters will be available for use within the chat template.

Example request

{
  "messages": [
    {
      "content": "You are a helpful assistant.",
      "role": "system"
    },
    {
      "content": "Hello!",
      "role": "user"
    }
  ],
  "model": "meta-llama/Llama-3.1-8B-Instruct"
}

Response

Successfully rendered chat messages into prompt text.

textstring required

The rendered text.

Changes

No recorded changes to this operation across all 1 revision of this API.