Skip to content

DecisionFilePart

Namespace: E2E.Decision.Sdk

public sealed record DecisionFilePart : DecisionStatePart, IEquatable<DecisionStatePart>, IEquatable<DecisionFilePart>

A file, such as a screenshot, as bytes with its media type (the AI SDK’s file part). The data is the bytes, or the same bytes as base64 text in Base64; DataType names another kind (url, reference, or text) a provider may reject.

Inheritance: object → DecisionStatePart

Implements: IEquatable<DecisionStatePart>, IEquatable<DecisionFilePart>

View source

public DecisionFilePart(string MediaType, byte[] Data)

A file, such as a screenshot, as bytes with its media type (the AI SDK’s file part). The data is the bytes, or the same bytes as base64 text in Base64; DataType names another kind (url, reference, or text) a provider may reject.

Parameters

Name Type Description
MediaType string
Data byte[]

public string? Base64 { get; init; }

The data as base64 text, when it came that way; Data is then ignored.

Value: string

public byte[] Data { get; init; }

Value: byte[]

public string DataType { get; init; }

The kind of data the part carries: data, url, reference, or text.

Value: string

public string? Filename { get; init; }

The file’s name.

Value: string

public string MediaType { get; init; }

Value: string

public IReadOnlyDictionary<string, JsonElement>? ProviderOptions { get; init; }

The options for this part, keyed by provider name. Each value is a JSON value.

Value: IReadOnlyDictionary<string, JsonElement>

public JsonElement? Reference { get; init; }

The provider references of a reference part.

Value: JsonElement?

public string? Text { get; init; }

The text of a text part.

Value: string

public Uri? Url { get; init; }

The URL of a url part.

Value: Uri

public string GetBase64()

The file’s bytes as base64 text.

Returns: string

public byte[] GetBytes()

The file’s bytes.

Returns: byte[]