Beta
Beta
instructionOptional
Beta
instructionparam values for the string template, keys are the variable name, ie if the template has "$variable", one key must be "variable"
client.agent.action.prompt({
instruction: 'Give the following topic:\n $topic \n ---\nReturns some facts about it',
instructionParams: {
topic: 'Grapefruit'
},
})
client.agent.action.prompt({
instruction: 'Give the following topic:\n $topic \n ---\nReturns some facts about it.',
instructionParams: {
topic: {
type: 'constant',
value: 'Grapefruit'
},
},
})
client.agent.action.prompt({
instruction: 'Give the following field value:\n $pte \n ---\nGenerate keywords.',
instructionParams: {
pte: {
type: 'field',
path: ['pteField'],
documentId: 'someSanityDocId'
},
},
})
client.agent.action.prompt({
json: true,
instruction: 'Given the following document:$document\nCreate a JSON string[] array with keywords describing it.',
instructionParams: {
document: {
type: 'document',
documentId: 'someSanityDocId'
},
},
})
client.agent.action.prompt({
instruction: 'Return the best title amongst these: $titles.',
instructionParams: {
titles: {
type: 'groq',
query: '* [_type==$type].title',
params: {type: 'article'}
},
},
})
Optional
Beta
temperatureControls how much variance the instructions will run with.
Value must be in the range [0, 1] (inclusive).
Default: 0.3
Instruct the LLM how it should generate content. Be as specific and detailed as needed.
The LLM only has access to information in the instruction, plus the target schema.
String template with support for $variable from
instructionParams
.