Configures the full prompt for all Sensible Instruct methods in a config. For information about configuring the full prompt, see Advanced prompt configuration.
Parameters
Note: In a config, you can override the following parameters for each field that uses a Sensible Instruct method. For more information, see Advanced prompt configuration.
key | value | description |
---|---|---|
type (required) | nlp | |
query | object | For this object's parameters, see following table. |
nlpTable | object | For this object's parameters, see following table. |
list | object | For this object's parameters, see following table. |
contextDescription | For information about this parameter, see Advanced prompt configuration. | |
pageHinting | For information about this parameter, see Advanced prompt configuration. | |
chunkCount | For information about this parameter, see Advanced prompt configuration. | |
chunkSize | For information about this parameter, see Advanced prompt configuration. | |
chunkOverlapPercentage | For information about this parameter, see Advanced prompt configuration. |
Query parameters
See the following table for details about the Query object parameters:
key | value | description |
---|---|---|
promptIntroduction | string. defaults: When "confidenceSignals: false" :Answer the question as truthfully and concisely as possible using the provided context, and if the answer is not contained within the text below, say \"I don't know.\" When "confidenceSignals: true" :Sensible ignores this parameter and instead uses a nonconfigurable introduction that prompts for confidence signals. | Overwrites the default text at the beginning of the prompt that Sensible submits to the LLM for this field. For example: Answer the question as truthfully and concisely as possible using the provided context, and if the answer is not contained within the text below, say \"UNKNOWN\". Note Sensible returns null if the phrase I don't know is in the returned field value. If you alter this key phrase using this parameter, for example by asking the LLM to return a phrase like UNKNOWN , then Sensible returns a phrase like UNKNOWN instead of null. |
NLP Table parameters
See the following table for details about the NLP Table object parameters:
key | value | description |
---|---|---|
promptIntroduction | string. default: Below is a sample table. Please transform the data from the sample table into the target table where the target table's column headers are provided. Please do not modify the target table's headers. If cells in the sample table don't contain data, leave the corresponding cell of the new table blank. Finally return the transformed table without the header and header seperator line. | Overwrites the default text at the beginning of the prompt that Sensible submits to the LLM for each NLP Table method in this config. For example, overwrite with: Below is a sample table. Please transform the data from the sample table into the target table where the target table's column headers are provided. Please do not modify the target table's headers. If the cells in the sample table don't contain data, populate the cell with \"NOT FOUND\". Finally return the transformed table without the header and header seperator line. |
List parameters
See the following table for details about the List object parameters:
key | value | description |
---|---|---|
promptIntroduction | string. default: Using the provided context fill out the table below. If the context doesn't contain any of the described items, leave it empty. | Overwrites the default text at the beginning of the prompt that Sensible submits to the LLM for each List method in this config. For example: Using the provided context fill out the table below. If the context doesn't contain any of the described items, return \"NOT FOUND\ in each cell" |
Examples
Example 1
The following example shows using the NLP preprocessor to describe the context for each field in the config.
Config
{
"preprocessors": [
{
"type": "nlp",
"contextDescription": "The following context is an excerpt from an ID card for a presidential pet.",
/* since the ID cards are always a single page, you can omit page information
for more information, see the Advanced prompt configuration topic */
"pageHinting": false,
/* since one of the answers (pet breed) isn't contained in the ID card,
explicitly state that the LLM can provide an answer outside of the document context.
*/
"query": {
"promptIntroduction": "Answer the question as truthfully and concisely as possible using the provided context. If the answer is not contained within the provided context below, but you know the answer because of your general knowledge about USA history, then answer the question."
}
}
],
"fields": [
{
"id": "pet_name",
"method": {
"id": "query",
"description": "pet's name"
},
"type": "string"
},
{
"id": "pet_owner",
"method": {
"id": "query",
"description": "full name of the usa president who owned this pet"
},
"type": "string"
},
{
"id": "pet_breed",
"method": {
"id": "query",
"description": "pet breed. base your answer on your general knowledge of USA history"
},
"type": "string"
},
]
}
Example document
The following image shows the example document used with this example config:
Example PDF | Download link |
---|
Output
{
"pet_name": {
"type": "string",
"value": "Fala",
"confidenceSignal": "confident_answer"
},
"pet_owner": {
"type": "string",
"value": "Franklin D Roosevelt",
"confidenceSignal": "confident_answer"
},
"pet_breed": {
"type": "string",
"value": "Scottish Terrier",
"confidenceSignal": "answer_may_be_incomplete"
}
}
Updated about 10 hours ago