DeepInfraImageModel
Namespace: Vercel.AI.DeepInfra
public sealed class DeepInfraImageModel : IImageModelDeepInfra image model. Generation posts to /inference/{model}.
Edits post multipart to the OpenAI-compatible /openai/images/edits route.
Inheritance: object
Implements: IImageModel
Constructors
Section titled “Constructors”DeepInfraImageModel(DeepInfraProvider, string, Func<DateTimeOffset>?)
Section titled “DeepInfraImageModel(DeepInfraProvider, string, Func<DateTimeOffset>?)”public DeepInfraImageModel(DeepInfraProvider provider, string modelId, Func<DateTimeOffset>? clock = null)Creates an image model. <code class=“paramref”>clock</code> sets the response timestamp and defaults to UTC now.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
DeepInfraProvider | |
modelId |
string | |
clock |
Func<DateTimeOffset> |
Properties
Section titled “Properties”MaxImagesPerCall
Section titled “MaxImagesPerCall”public int MaxImagesPerCall { get; }DeepInfra accepts one image per call.
Value: int
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
Methods
Section titled “Methods”DoGenerateAsync(ImageCallOptions, CancellationToken)
Section titled “DoGenerateAsync(ImageCallOptions, CancellationToken)”public Task<ImageGenerationResult> DoGenerateAsync(ImageCallOptions options, CancellationToken cancellationToken)Generates images. Maps to doGenerate on an image model.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ImageCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<ImageGenerationResult>
ReadError(string?)
Section titled “ReadError(string?)”public static string? ReadError(string? body)Reads detail.error, then the shared OpenAI-compatible error message.
Parameters
| Name | Type | Description |
|---|---|---|
body |
string |
Returns: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product