The Lucidworks AI Generative AI Prompting Preview API returns Prediction API passthrough use case prompts before being sent to any generative AI (GenAI) model.This API is used to help debug passthrough use case prompts to ensure the input to the GenAI model is valid, and within the model’s processing limits.
Before the prompt is passed to the GenAI model, it may be formatted, truncated, expanded, or modified in other ways to meet that model’s requirements so the API call is successful.
These preprocessing steps are integral to deliver an optimized prompt that generates coherent and relevant responses. By examining the prompt after preprocessing, you can better understand how your input is being interpreted by the AI, which can help you refine your queries for more accurate and useful outputs.The input parameter keys and values are the same used in the Prediction API passthrough use case except for apiKey or similar authentication params, which must be provided for consistency. However, the model third-party API is not called, so those parameters are not used. You can enter placeholder values instead.
For detailed API specifications in Swagger/OpenAPI format, see Platform APIs.
The unique APPLICATION_ID for your Lucidworks AI application. For more information, see credentials to use APIs.
A bearer token generated with a scope value of machinelearning.predict. For more information, see Authentication API.
The GenAI model name in the MODEL_ID field for the request. The path is: /ai/prompt/passthrough/MODEL_ID. For more information about supported models, see Generative AI models.
Some parameters in the /ai/prompt/passthrough/MODEL_ID request POST request are common to all of the generative AI (GenAI) use cases.
Also referred to as hyperparameters, these fields set certain controls on the response.
Refer to the API spec for more information.
Enables or disables automatic system prompts.If true, the LLM input is wrapped in a model-specific prompt format with a generic system prompt before sending to the model or third-party API.If false, the batch.text value serves directly as the prompt. The input must meet the model’s requirements because it is passed as is.Use this parameter if custom prompts are needed, or if the prompt response format must be manipulated. Longer prompts may increase response time.Some models, such as mistral-7b-instruct and llama-3-8b-instruct, generate more effective results when system prompts are included.
Optional parameter that controls how the text in the /prompt request is handled.Accepted values:
"text": Equivalent to "useSystemPrompt": true. Uses a pre-defined, generic system prompt.
"raw_prompt": Equivalent to "useSystemPrompt": false. The request text is passed directly to the model.
"json_prompt": Allows role-based formatting with the roles system, user, and assistant.
Additional rules for json_prompt:
Only the last user message is truncated. If the API does not support system prompts, the user role substitutes for the system role.
If the last message role is assistant, it is used as a pre-fill for generation. This reduces verbosity and can enforce specific outputs such as YAML. Google Vertex AI does not support pre-fills and raises an error.
Consecutive messages for the same role are merged.
You can paste the information for a hosted model into the json_prompt value and change the model name in the stage.