Skip to main content
GET
/
ask
Search / Ask
curl --request GET \
  --url https://api.pal.ai/v1/ask \
  --header 'Content-Type: application/json' \
  --data '
{
  "applicationId": "<string>",
  "prompt": "<string>",
  "shouldGenerateResponse": true,
  "filter": {},
  "": "<string>"
}
'
{
  "searchResults": {
    "documents": {
      "content": "<string>",
      "id": "<string>",
      "title": "<string>",
      "url": "<string>",
      "contentType": "<string>",
      "metadata": {
        "{{metadataKey}}": "<string>"
      }
    }
  },
  "answer": "<string>"
}

Body

application/json

shouldGenerateResponse: false Fast semantic search, just returns relevant sections and the corresponding Documents from the index of the application

shouldGenerateResponse: true Generates a response using the model provider (defaults to OpenAI), given the additional context of documents found.

applicationId
string
required
prompt
string
required

The question you want an answer for, or the action you want the assistant to take given the additonal context of relevant documents.

shouldGenerateResponse
boolean

Defaults to true. Determines whether the application just generates matches of similar documents or also tries to generate a longer-form synthesized response.

filter
object

A set of metadata keys and corresponding values, to only have documents that match those criteria return.

string

Response

200 - application/json

OK

searchResults
object
required
answer
string