TextWithAssets
Namespace: TypeSafe.AI.Sdk
public sealed class TextWithAssetsText with the images interpolated into it, sent together with the text.
Inheritance: object
Properties
Section titled “Properties”Assets
Section titled “Assets”public IReadOnlyList<Image> Assets { get; }The images interpolated into the text, including those in nested TextWithAssets.
Value: IReadOnlyList<Image>
public string Text { get; }The text, with each image replaced by its reference.
Value: string
Methods
Section titled “Methods”From(FormattableString)
Section titled “From(FormattableString)”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
Join(IEnumerable<object?>, string)
Section titled “Join(IEnumerable<object?>, string)”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
ToString()
Section titled “ToString()”public override string ToString()Returns a string that represents the current object.
Returns: string — A string that represents the current object.
MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API