Skip to main content
POST
/
kb
/
v1
/
knowledge-bases
/
{id}
/
query
Query Knowledge Base
curl --request POST \
  --url https://api-prod.interactly.ai/kb/v1/knowledge-bases/{id}/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o",
  "prompt": "<string>",
  "messages": [
    {
      "role": "user",
      "content": "What are the services offered?"
    }
  ],
  "temperature": 0.1,
  "seed": 42,
  "stream": false
}
'
{
  "response": "string"
}

Authorizations

Authorization
string
header
required

Retrieve your API Key from Dashboard API Keys Section.

Path Parameters

id
string
required

The ID of the knowledge base to train.

Body

application/json
model
enum<string>
default:gpt-4o

Optional parameter - The GPT model to use for generating responses

Available options:
gpt-4o,
gpt-4o-mini
prompt
string
deprecated

[DEPRECATED. USE "messages" instead] The query prompt to send to the knowledge base.

messages
object[]

A list of messages to query with. Note that "messages" and "prompt" cannot be used together. If both are found in the request, "messages" takes precedence and "prompt" is ignored.

temperature
number

Temperature controls the randomness in the output of the underlying language model; while lower values produce predictable and factual replies, higher values allow the model to be creative and reword the responses.

Required range: 0 <= x <= 2
Example:

0.1

seed
integer

Seed initializes the random number generator in the underlying language model, ensuring reproducible outputs for the same prompt and settings.

Example:

42

stream
boolean
default:false

Determines whether to stream the generated response back instead of returning it all at once. When stream = true, the response is a list of JSON objects of the form {"response": string} separated by newline characters

Response

Successful response

response
string

The response from the knowledge base.

Example:

"string"