Search Results for

    Show / Hide Table of Contents

    Class GenerateContentRequest

    Generates a response from the model given an input GenerateContentRequest. Input capabilities differ between models, including tuned models.See the model guide and tuning guide for details.

    Inheritance
    object
    GoogleGeminiRequest
    GenerateContentRequest
    Implements
    IJsonRequest
    IValidatable
    Inherited Members
    GoogleGeminiRequest.Model
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Google
    Assembly: Glitch9.AIDevKit.Provider.Google.dll
    Syntax
    public sealed class GenerateContentRequest : GoogleGeminiRequest, IJsonRequest, IValidatable
    Remarks

    Lastest parameters confirmed on 2025.12.17

    Properties

    | Edit this page View Source

    CachedContent

    Optional. The name of the cached content used as context to serve the prediction.

    Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings.

    Format: cachedContents/{cachedContent}

    Declaration
    [JsonProperty("cachedContent")]
    public string CachedContent { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Config

    Optional. Configuration options for model generation and outputs.

    Declaration
    [JsonProperty("generationConfig")]
    public GeminiConfig Config { get; set; }
    Property Value
    Type Description
    GeminiConfig
    | Edit this page View Source

    Contents

    Required. The content of the current conversation with the model. For single-turn queries, this is a single instance.For multi-turn queries, this is a repeated field that contains conversation history + latest request.

    Declaration
    [JsonProperty("contents")]
    public List<GeminiContent> Contents { get; set; }
    Property Value
    Type Description
    List<GeminiContent>
    | Edit this page View Source

    SafetySettings

    Optional.

    A list of unique SafetySetting instances for blocking unsafe content.

    This will be enforced on the Contents and Candidates. There should not be more than one setting for each SafetyCategory type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each SafetyCategory specified in the safetySettings. If there is no SafetySetting for a given SafetyCategory provided in the list, the API will use the default safety setting for that category. Harm categories Hate, Sexual, Dangerous, Harassment are supported.

    Declaration
    [JsonProperty("safetySettings")]
    public List<SafetySetting> SafetySettings { get; set; }
    Property Value
    Type Description
    List<SafetySetting>
    | Edit this page View Source

    SystemInstruction

    Optional. (Beta) Developer set system instruction. Currently, text only.

    Declaration
    [JsonProperty("systemInstruction")]
    public GeminiContent SystemInstruction { get; set; }
    Property Value
    Type Description
    GeminiContent
    | Edit this page View Source

    ToolConfig

    Optional. Tool configuration for any Tool (Tools) specified in the request.

    Declaration
    [JsonProperty("toolConfig")]
    public ToolConfig ToolConfig { get; set; }
    Property Value
    Type Description
    ToolConfig
    | Edit this page View Source

    Tools

    Optional. (Beta) A list of GeminiTool the model may use to generate the next response.

    Declaration
    [JsonProperty("tools")]
    public List<GeminiTool> Tools { get; set; }
    Property Value
    Type Description
    List<GeminiTool>

    Methods

    | Edit this page View Source

    IsValid()

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool
    | Edit this page View Source

    Validate()

    Validates the object's parameters and throws if invalid.

    Declaration
    public void Validate()

    Implements

    IJsonRequest
    IValidatable

    Extension Methods

    GenerateContentRequestExtensions.Append(GenerateContentRequest, GeminiContent)
    GenerateContentRequestExtensions.SetFunctionSchema(GenerateContentRequest, JsonSchema)
    GenerateContentRequestExtensions.SetFunctionSchema(GenerateContentRequest, Type)
    GenerateContentRequestExtensions.SetPrompt(GenerateContentRequest, ImagePrompt)
    GenerateContentRequestExtensions.SetTools(GenerateContentRequest, Tool[], ToolChoice)
    GenerateContentRequestExtensions.SetVoice(GenerateContentRequest, string)
    GenerateContentRequestExtensions.SetVoiceInput(GenerateContentRequest, AudioClip)
    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation