Class Part
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
A datatype containing media that is part of a multi-part Content message.
A Part consists of data which has an associated datatype.
A Part must have a fixed IANA MIME type identifying the type and subtype of the media
if the InlineData field is filled with raw bytes.
public class Part
- Inheritance
-
Part
- Inherited Members
- Extension Methods
Constructors
Part()
Represents a structured part of content that can include various types of data, such as plain text, inline data, function calls, or code execution details.
public Part()
Part(string)
Represents a component of a multi-part message in content processing. A Part includes media or data of various forms such as text, binary data, function invocation, or code execution details. Each Part is associated with a specific data type.
public Part(string text)
Parameters
textstring
Properties
AudioTranscription
Transcript of the audio in this part.
[JsonPropertyName("audioTranscription")]
public Transcription? AudioTranscription { get; set; }
Property Value
CodeExecutionResult
Result of executing the ExecutableCode.
[JsonPropertyName("codeExecutionResult")]
public CodeExecutionResult? CodeExecutionResult { get; set; }
Property Value
ExecutableCode
Code generated by the model that is meant to be executed.
[JsonPropertyName("executableCode")]
public ExecutableCode? ExecutableCode { get; set; }
Property Value
FileData
URI based data.
[JsonPropertyName("fileData")]
public FileData? FileData { get; set; }
Property Value
FunctionCall
A predicted FunctionCall returned from the model that contains a string representing the Name with the arguments and their values.
[JsonPropertyName("functionCall")]
public FunctionCall? FunctionCall { get; set; }
Property Value
FunctionResponse
The result output of a FunctionCall that contains a string representing the Name and a structured JSON object containing any output from the function is used as context to the model.
[JsonPropertyName("functionResponse")]
public FunctionResponse? FunctionResponse { get; set; }
Property Value
InlineData
Inline media bytes.
[JsonPropertyName("inlineData")]
public Blob? InlineData { get; set; }
Property Value
MediaProcessing
How the model processes this part's media.
[JsonPropertyName("mediaProcessing")]
public MediaProcessing? MediaProcessing { get; set; }
Property Value
MediaResolution
Media resolution for this part. Overrides GenerationConfig.MediaResolution for this part.
[JsonPropertyName("mediaResolution")]
public PartMediaResolution? MediaResolution { get; set; }
Property Value
PartMetadata
Custom metadata attached to the part (Gemini API only).
[JsonPropertyName("partMetadata")]
public JsonObject? PartMetadata { get; set; }
Property Value
SpeechMetadata
Speaker and style metadata for generated speech.
[JsonPropertyName("speechMetadata")]
public SpeechMetadata? SpeechMetadata { get; set; }
Property Value
Text
Inline text.
[JsonPropertyName("text")]
public string? Text { get; set; }
Property Value
Thought
Indicates if the part is thought from the model.
[JsonPropertyName("thought")]
public bool? Thought { get; set; }
Property Value
- bool?
ThoughtSignature
An opaque signature for the thought so it can be reused in subsequent requests. A base64-encoded string.
[JsonPropertyName("thoughtSignature")]
public string? ThoughtSignature { get; set; }
Property Value
ToolCall
A call to a server-side tool made by the model. Only returned when ToolConfig.IncludeServerSideToolInvocations is true.
[JsonPropertyName("toolCall")]
public ToolCall? ToolCall { get; set; }
Property Value
ToolResponse
The result of a server-side tool call. Only returned when ToolConfig.IncludeServerSideToolInvocations is true.
[JsonPropertyName("toolResponse")]
public ToolResponse? ToolResponse { get; set; }
Property Value
VideoMetadata
Metadata for a given video.
[JsonPropertyName("videoMetadata")]
public VideoMetadataResult? VideoMetadata { get; set; }