Class GenerateContentRequestExtensions
public static class GenerateContentRequestExtensions
- Inheritance
-
objectGenerateContentRequestExtensions
Methods
AddMessage(GenerateContentRequest, Message)
public static GenerateContentRequest AddMessage(this GenerateContentRequest req, Message message)
Parameters
reqGenerateContentRequestmessageMessage
Returns
SetFunctionSchema(GenerateContentRequest, JsonSchema)
public static GenerateContentRequest SetFunctionSchema(this GenerateContentRequest req, JsonSchema jsonSchema)
Parameters
reqGenerateContentRequestjsonSchemaJsonSchema
Returns
SetFunctionSchema(GenerateContentRequest, Type)
public static GenerateContentRequest SetFunctionSchema(this GenerateContentRequest req, Type type)
Parameters
reqGenerateContentRequesttypeType
Returns
SetFunctions(GenerateContentRequest, params Function[])
public static GenerateContentRequest SetFunctions(this GenerateContentRequest req, params Function[] functions)
Parameters
reqGenerateContentRequestfunctionsFunction[]
Returns
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
reqGenerateContentRequestclipAudioClip
Returns
SetInstructions(GenerateContentRequest, string)
public static GenerateContentRequest SetInstructions(this GenerateContentRequest req, string instructions)
Parameters
reqGenerateContentRequestinstructionsstring
Returns
SetMessages(GenerateContentRequest, List<Message>)
public static GenerateContentRequest SetMessages(this GenerateContentRequest req, List<Message> messages)
Parameters
reqGenerateContentRequestmessagesList<Message>
Returns
SetPrompt(GenerateContentRequest, ImagePrompt)
public static GenerateContentRequest SetPrompt(this GenerateContentRequest req, ImagePrompt prompt)
Parameters
reqGenerateContentRequestpromptImagePrompt
Returns
SetPrompt(GenerateContentRequest, string, List<IFile>)
public static GenerateContentRequest SetPrompt(this GenerateContentRequest req, string prompt, List<IFile> attachedFiles = null)
Parameters
reqGenerateContentRequestpromptstringattachedFilesList<IFile>
Returns
SetStartingMessage(GenerateContentRequest, string)
public static GenerateContentRequest SetStartingMessage(this GenerateContentRequest req, string startingMessage)
Parameters
reqGenerateContentRequeststartingMessagestring
Returns
SetVoice(GenerateContentRequest, string)
public static GenerateContentRequest SetVoice(this GenerateContentRequest req, string voiceId)
Parameters
reqGenerateContentRequestvoiceIdstring