Prediction

Create a new prediction

Create a new prediction

POST/prediction/{id}
Authorization
Path parameters
id*string

Chatflow ID

Body
questionstring

The question being asked

overrideConfigobject

The configuration to override the default prediction settings (optional)

historyarray of object

The history messages to be prepended (optional)

uploadsarray of object
Response

Prediction created successfully

Body
textstring

The result of the prediction

jsonobject

The result of the prediction in JSON format if available

questionstring

The question asked during the prediction process

chatIdstring

The chat ID associated with the prediction

chatMessageIdstring

The chat message ID associated with the prediction

sessionIdstring

The session ID associated with the prediction

memoryTypestring

The memory type associated with the prediction

sourceDocumentsarray of Document (object)
usedToolsarray of UsedTool (object)
fileAnnotationsarray of FileAnnotation (object)
Request
const response = await fetch('/prediction/{id}', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "text": "text",
  "question": "text",
  "chatId": "text",
  "chatMessageId": "text",
  "sessionId": "text",
  "memoryType": "text",
  "sourceDocuments": [
    {
      "pageContent": "This is the content of the page.",
      "metadata": {
        "author": "John Doe",
        "date": "2024-08-24"
      }
    }
  ],
  "usedTools": [
    {
      "tool": "Name of the tool",
      "toolInput": {
        "input": "search query"
      },
      "toolOutput": "text"
    }
  ],
  "fileAnnotations": [
    {
      "filePath": "path/to/file",
      "fileName": "file.txt"
    }
  ]
}

Last updated