Sanity Library Reference Docs
    Preparing search index...

    Type Alias DocumentAgentActionParam<TParamConfig>Beta

    DocumentAgentActionParam: { type: "document" } & DocIdParam<TParamConfig>

    Includes a LLM-friendly version of the document in the instruction

    client.agent.action.generate({
    schemaId,
    documentId,
    instruction: 'Give the following document value:\n $document \n ---\nGenerate keywords.',
    instructionParams: {
    document: {
    type: 'document',
    },
    },
    target: {path: 'keywords' }
    })

    Type Parameters

    • TParamConfig extends { docIdRequired: boolean } = { docIdRequired: false }