Thanks to visit codestin.com
Credit goes to scripting.getdrafts.com

Drafts Script Reference
    Preparing search index...

    Class SystemLanguageModelSchema

    Create generable schema to provide to SystemLanguageModel objects to get back structured, non-string responses.

    Getting Structured Responses

    // CREATE A PROMPT TO SEND TO MODEL
    const prompt = `Generate tag suggestions to use classifying the * text below:

    ${draft.content}`

    // CREATE MODEL OBJECT
    let m = new SystemLanguageModel()
    // CREATE SCHEMA TO GET BACK STRUCTURED DATA
    let schema = SystemLanguageModelSchema.create("Tag Suggestions", "A set of tag suggestions to classify a text.")
    schema.addStringArray("tags", "A list of tags to assign the text")
    // QUERY THE MODEL
    let response = m.respond(prompt, schema)
    Index

    Constructor

    • Create new instance.

      Parameters

      • name: string

        Human-readable name for property

      • description: string

        Detail regarding the use of the property

      Returns SystemLanguageModelSchema

    Values

    • Add a boolean type property

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add an array of boolean type properties

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add an integer type property

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add an array of integer type properties

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add a number type property

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add an array of number type properties

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add a string type property

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add a string type property

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any

    • Add an array of strings type properties

      Parameters

      • name: string

        Human-readable name for property. This will translate to a key for the value in returned object.

      • description: string

        Details on the usage and meaning of the property to guide the model in creation of results.

      Returns any