POST
/
v2
/
bots
/
ask-question

Body

instruction
string

Prompt to generate completions. If you remove this parameter from your request, the instruction from the Fini’s UI setup page will be picked up instead. We recommend always filling this for faster responses (skips DB lookup of instruction)

question
string
required

User question for which the answer needs to be fetched

messageHistory
array
required

A list of messages comprising the conversation so far.

functions
array

A list of functions the model may generate JSON inputs for.

function_call
string or object

Controls how the model responds to function calls. “none” means the model does not call a function, and responds to the end-user. “auto” means the model can pick between an end-user or calling a function. Specifying a particular function via {"name":\ "my_function"} forces the model to call that function. “none” is the default when no functions are present. “auto” is the default if functions are present.

stream
boolean
default: "false"

Whether to stream back partial progress.

temperature
number
default: "0.4"

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We recommend using 0.4 as the default.

stop
string

The API will stop generating further tokens. The returned text will not contain the stop sequence. It can be set to [“Optional”, “stop”, “words”]

categories
array

List of categories that you want to use to categorize the Q&A pair.

Response

success
number

Indicates whether the call was successful. 1 if successful, 0 if not.

based_on
object

The contents of the “based_on” field. “based_on” is a list of all data blocks from the knowledgbase that were used to generate the answer

messages
object

A list of messages comprising the conversation so far.