Skip to content

ProdiaLanguageModel

Namespace: Vercel.AI.Prodia

public sealed class ProdiaLanguageModel : ILanguageModel

Prodia image-to-image job exposed as a language model. The last user message supplies the text and the optional input image. The result holds the returned text and images.

Inheritance: object

Implements: ILanguageModel

View source

ProdiaLanguageModel(ProdiaProvider, string, Func<DateTimeOffset>?)

Section titled “ProdiaLanguageModel(ProdiaProvider, string, Func<DateTimeOffset>?)”
public ProdiaLanguageModel(ProdiaProvider provider, string modelId, Func<DateTimeOffset>? clock = null)

Creates a model. <code class=“paramref”>clock</code> sets the response timestamp.

Parameters

Name Type Description
provider ProdiaProvider
modelId string
clock Func<DateTimeOffset>

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id, such as openai.

Value: string

View source

public string SpecificationVersion { get; }

Always V4.

Value: string

View source

DoGenerateAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoGenerateAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelGenerateResult> DoGenerateAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Generates a complete result.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelGenerateResult>

View source

DoStreamAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoStreamAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelStreamResult> DoStreamAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Runs CancellationToken) and replays the result as stream parts. Generated images are not streamed.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelStreamResult>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product