import requests
url = "https://application_id.applications.lucidworks.com/ai/prediction/passthrough/{MODEL_ID}"
payload = {
"batch": [{ "text": "who was the first president of the USA?" }],
"useCaseConfig": { "useSystemPrompt": True }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"predictions": [
{
"tokensUsed": {
"promptTokens": 58,
"completionTokens": 34,
"totalTokens": 92
},
"response": "The first President of the United States of America was George Washington. He served from April 30, 1789, to March 4, 1797."
}
]
}Passthrough use case
The passthrough use case lets you use the service as a proxy to the large language model (LLM). The service sends text (no additional prompts or other information) to the LLM and returns a response.
import requests
url = "https://application_id.applications.lucidworks.com/ai/prediction/passthrough/{MODEL_ID}"
payload = {
"batch": [{ "text": "who was the first president of the USA?" }],
"useCaseConfig": { "useSystemPrompt": True }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"predictions": [
{
"tokensUsed": {
"promptTokens": 58,
"completionTokens": 34,
"totalTokens": 92
},
"response": "The first President of the United States of America was George Washington. He served from April 30, 1789, to March 4, 1797."
}
]
}Headers
Bearer token used for authentication. Format: Authorization: Bearer ACCESS_TOKEN.
application/json
"application/json"
Path Parameters
Unique identifier for the model.
Body
The batch of key:value pairs used as inputs in the prediction. Up to 32 inputs per request are allowed.
32Show child attributes
Show child attributes
NOTE: If both useSystemPrompt and dataType are present, the value in dataType is used.
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Was this page helpful?