Skip to content

ByteDanceProvider

Namespace: Vercel.AI.ByteDance

public sealed class ByteDanceProvider : OpenAICompatibleProvider

ByteDance provider.

Inheritance: object → ProviderBase → OpenAICompatibleProvider

View source

ByteDanceProvider(HttpClient, OpenAICompatibleOptions?)

Section titled “ByteDanceProvider(HttpClient, OpenAICompatibleOptions?)”
public ByteDanceProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options OpenAICompatibleOptions

View source

public const string DefaultBaseUrl = "https://ark.ap-southeast.bytepluses.com/api/v3"

Default API origin.

Value: string

View source

public const string ProviderId = "bytedance"

Provider id.

Value: string

View source

Create(OpenAICompatibleOptions?, HttpMessageHandler?)

Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”
public static ByteDanceProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)

Creates a provider.

Parameters

Name Type Description
options OpenAICompatibleOptions
handler HttpMessageHandler

Returns: ByteDanceProvider

View source

GenerateImageAsync(string, ImageCallOptions, IDictionary<string, string>?, CancellationToken)

Section titled “GenerateImageAsync(string, ImageCallOptions, IDictionary<string, string>?, CancellationToken)”
public Task<ImageGenerationResult> GenerateImageAsync(string modelId, ImageCallOptions options, IDictionary<string, string>? headers, CancellationToken cancellationToken)

Posts an image generation. <code class=“paramref”>headers</code> override the provider headers.

Parameters

Name Type Description
modelId string
options ImageCallOptions
headers IDictionary<string, string>
cancellationToken CancellationToken

Returns: Task<ImageGenerationResult>

View source

public override IImageModel ImageModel(string modelId)

Returns an image model.

Parameters

Name Type Description
modelId string

Returns: IImageModel

View source

public override ILanguageModel LanguageModel(string modelId)

Returns a language model.

Parameters

Name Type Description
modelId string

Returns: ILanguageModel

View source

public override IVideoModel VideoModel(string modelId)

Returns a video model.

Parameters

Name Type Description
modelId string

Returns: IVideoModel

View source

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