Skip to content

JsonInstructions

Namespace: Vercel.AI.GenerateText

public static class JsonInstructions

JSON output instructions. Maps to injectJsonInstruction.

Inheritance: object

View source

InjectJsonInstruction(string?, JsonElement?, JsonInstructionText, JsonInstructionText)

Section titled “InjectJsonInstruction(string?, JsonElement?, JsonInstructionText, JsonInstructionText)”
public static string InjectJsonInstruction(string? prompt = null, JsonElement? schema = null, JsonInstructionText schemaPrefix = default, JsonInstructionText schemaSuffix = default)

Builds the instruction text appended to a prompt.

Parameters

Name Type Description
prompt string
schema JsonElement?
schemaPrefix JsonInstructionText
schemaSuffix JsonInstructionText

Returns: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product