Skip to main content
POST
/
ai
/
prediction
/
{USE_CASE}
/
{MODEL_ID}
Model predictions by use case
import requests

url = "https://application_id.applications.lucidworks.com/ai/prediction/{USE_CASE}/{MODEL_ID}"

payload = {
    "batch": [{ "text": "The content the model analyzes." }],
    "modelConfig": {
        "temperature": 0.8,
        "topP": 1,
        "topK": -1,
        "presencePenalty": 2,
        "frequencyPenalty": 1,
        "maxTokens": 1,
        "apiKey": "API key specific to use case and model",
        "azureDeployment": "DEPLOYMENT_NAME",
        "azureEndpoint": "https://azure.endpoint.com",
        "googleProjectId": "[GOOGLE_PROJECT_ID]",
        "googleRegion": "[GOOGLE_PROJECT_REGION_OF_MODEL_ACCESS]"
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
{
  "predictions": [
    {
      "response": "The response varies based on the use case of the request. For valid information, see the individual use case documentation. "
    }
  ]
}

Headers

Authorization: Bearer ACCESS_TOKEN
string

The authentication and authorization access token.

Content-Type
string

application/json

Path Parameters

USE_CASE
string
required

The name of the use case for the model.

MODEL_ID
string
required

The unique identifier of the model.

Body

application/json

Request information varies based on the use case in the request. See the specific use case for valid information for that use case.

batch
object[]

The batch of key:value pairs used as inputs in the prediction. Up to 32 inputs per request are allowed.

Maximum length: 32
modelConfig
object

Provides fields and values that specify ranges for tokens. Fields used for specific use cases and models are specified. The default values are used if other values are not specified.

Response

OK

IMPORTANT: This contains some of the information in a response to this use case. However, the response varies based on the use case and other information in the request. See the specific use case for valid information for that use case.

predictions
object[]