Template Query
More steerable control over prompting and output formats
For users wanting more flexible control over prompting and outputs as part of their RAG solution, they can do this with our template endpoint.
You want to use this endpoint if you are looking for:
- More fine-grained control over what the model outputs such as specifically HTML or Markdown.
- More steerable inputs where you want to provide an example response before adding references into the prompt.
The collection to query.
The template that you want to use. This template uses a reference
magic in order to provide
users with more flexible control over their LLM outputs.
An example template that is looking for just the returned Markdown could be:
You are a cybersecurity consultant, can users help provide
a clearer understanding of what is happening? Return
this in Markdown with clear headings to separate it out.
{reference}
Markdown:
On our backend, we replace reference with the relevant promptFields
that you supply. If None
is supplied, then it uses all fields in a collection.
The fields that you want to use to feed into the prompt template.
The fields that you want to be returned as reference. If not specified, it returns all fields as reference.
The conversation ID. This is returned in the response so you can use the one that has been automatically generated for you or you can also supply your own to keep track of the conversation on your side.
The minimum rerank score.
The max number of documents to returned
If true
then there will be a moderation layer applied after the user inputs
a query and when the AI outputs to ensure that the generated content is not
harmful or violent.
Whether or not a stream response should be returned. See examples below for details.
Requires JSON Content Type