Skip to content

TextWithAssets

Namespace: TypeSafe.AI.Sdk

public sealed class TextWithAssets

Text with the images interpolated into it, sent together with the text.

Inheritance: object

View source

public IReadOnlyList<Image> Assets { get; }

The images interpolated into the text, including those in nested TextWithAssets.

Value: IReadOnlyList<Image>

View source

public string Text { get; }

The text, with each image replaced by its reference.

Value: string

View source

public static TextWithAssets From(FormattableString text)

Write images into text: TextWithAssets.From($"Is {photo} damaged?"). Each image is replaced by its reference; other values are converted to strings as in an interpolated string. An image in a plain interpolated string is rejected before the request is sent.

Parameters

Name Type Description
text FormattableString

Returns: TextWithAssets

View source

public static TextWithAssets Join(IEnumerable<object?> values, string separator = ",")

Join <code class=“paramref”>values</code> with <code class=“paramref”>separator</code>, as String%7d) does, and send the images among them with the text. The result can be passed as content or interpolated into From(FormattableString).

Parameters

Name Type Description
values IEnumerable<object>
separator string

Returns: TextWithAssets

View source

public override string ToString()

Returns a string that represents the current object.

Returns: string — A string that represents the current object.

View source

MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API