AI Dev Kit
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
    RequestBody
    GenerativeAIRequest
    GenerateContentRequest
    Inherited Members
    GenerativeAIRequest.Model
    Namespace: Glitch9.AIDevKit.Google
    Assembly: .dll
    Syntax
    public class GenerateContentRequest : GenerativeAIRequest

    Properties

    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
    public string CachedContent { get; set; }
    Property Value
    Type Description
    string

    Config

    Optional. Configuration options for model generation and outputs.

    Declaration
    public GenerationConfig Config { get; set; }
    Property Value
    Type Description
    GenerationConfig

    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
    public List<Content> Contents { get; set; }
    Property Value
    Type Description
    List<Content>

    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 HateSpeech, SexuallyExplicit, DangerousContent, Harassment are supported.
    Declaration
    public List<SafetySetting> SafetySettings { get; set; }
    Property Value
    Type Description
    List<SafetySetting>

    SystemInstruction

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

    Declaration
    public Content SystemInstruction { get; set; }
    Property Value
    Type Description
    Content

    ToolConfig

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

    Declaration
    public ToolConfig ToolConfig { get; set; }
    Property Value
    Type Description
    ToolConfig

    Tools

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

    Declaration
    public List<Tool> Tools { get; set; }
    Property Value
    Type Description
    List<Tool>

    Methods

    ValidateBody()

    Validate the request. This is used to check if all required properties are set. Fix the request if needed.

    Declaration
    public override void ValidateBody()
    Overrides
    Glitch9.IO.Networking.RESTApi.RequestBody.ValidateBody()

    Extension Methods

    RequestExtensions.ExecuteAsync(GenerateContentRequest)
    RequestExtensions.StreamAsync(GenerateContentRequest, ChatStreamHandler)
    ResponseExtensions.AddContent(GenerateContentRequest, params Content[])
    In this article
    Back to top Generated by DocFX