Table of Contents

Class GenerateContentRequestExtensions

public static class GenerateContentRequestExtensions
Inheritance
object
GenerateContentRequestExtensions

Methods

AddMessage(GenerateContentRequest, Message)

public static GenerateContentRequest AddMessage(this GenerateContentRequest req, Message message)

Parameters

req GenerateContentRequest
message Message

Returns

GenerateContentRequest

SetFunctionSchema(GenerateContentRequest, JsonSchema)

public static GenerateContentRequest SetFunctionSchema(this GenerateContentRequest req, JsonSchema jsonSchema)

Parameters

req GenerateContentRequest
jsonSchema JsonSchema

Returns

GenerateContentRequest

SetFunctionSchema(GenerateContentRequest, Type)

public static GenerateContentRequest SetFunctionSchema(this GenerateContentRequest req, Type type)

Parameters

req GenerateContentRequest
type Type

Returns

GenerateContentRequest

SetFunctions(GenerateContentRequest, params Function[])

public static GenerateContentRequest SetFunctions(this GenerateContentRequest req, params Function[] functions)

Parameters

req GenerateContentRequest
functions Function[]

Returns

GenerateContentRequest

SetInlineAudioData(GenerateContentRequest, AudioClip)

Add STT (Speech to Text) audio prompt. The maximum request size is 20 MB, which includes text prompts, system instructions, and files provided inline.

If your file's size will make the total request size exceed 20 MB, then use the Files API to upload an audio file for use in the request. If you're using an audio sample multiple times, it's more efficient to upload an audio file.

public static GenerateContentRequest SetInlineAudioData(this GenerateContentRequest req, AudioClip clip)

Parameters

req GenerateContentRequest
clip AudioClip

Returns

GenerateContentRequest

SetInstructions(GenerateContentRequest, string)

public static GenerateContentRequest SetInstructions(this GenerateContentRequest req, string instructions)

Parameters

req GenerateContentRequest
instructions string

Returns

GenerateContentRequest

SetMessages(GenerateContentRequest, List<Message>)

public static GenerateContentRequest SetMessages(this GenerateContentRequest req, List<Message> messages)

Parameters

req GenerateContentRequest
messages List<Message>

Returns

GenerateContentRequest

SetPrompt(GenerateContentRequest, ImagePrompt)

public static GenerateContentRequest SetPrompt(this GenerateContentRequest req, ImagePrompt prompt)

Parameters

req GenerateContentRequest
prompt ImagePrompt

Returns

GenerateContentRequest

SetPrompt(GenerateContentRequest, string, List<IFile>)

public static GenerateContentRequest SetPrompt(this GenerateContentRequest req, string prompt, List<IFile> attachedFiles = null)

Parameters

req GenerateContentRequest
prompt string
attachedFiles List<IFile>

Returns

GenerateContentRequest

SetStartingMessage(GenerateContentRequest, string)

public static GenerateContentRequest SetStartingMessage(this GenerateContentRequest req, string startingMessage)

Parameters

req GenerateContentRequest
startingMessage string

Returns

GenerateContentRequest

SetVoice(GenerateContentRequest, string)

public static GenerateContentRequest SetVoice(this GenerateContentRequest req, string voiceId)

Parameters

req GenerateContentRequest
voiceId string

Returns

GenerateContentRequest