Skip to content

DeepSeekFileStore

Namespace: Vercel.AI.DeepSeek

public sealed class DeepSeekFileStore : IFileStore, IFileStore

Uploads images to POST /files with purpose user_data.

Inheritance: object

Implements: IFileStore, IFileStore

View source

public DeepSeekFileStore(DeepSeekProvider provider)

Creates a file store.

Parameters

Name Type Description
provider DeepSeekProvider

View source

public const long MaxBytes = 67108864

Maximum upload size, 64 MiB.

Value: long

View source

public const int MaxExpirySeconds = 2592000

Longest accepted expiry, in seconds.

Value: int

View source

public const int MaxFileNameLength = 512

Maximum filename length.

Value: int

View source

public const int MinExpirySeconds = 3600

Shortest accepted expiry, in seconds.

Value: int

View source

public int? ExpiresAfterSeconds { get; set; }

When set, sent as expires_after[seconds] with anchor created_at.

Value: int?

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Files specification version.

Value: string

View source

UploadFileAsync(string, byte[], string, CancellationToken)

Section titled “UploadFileAsync(string, byte[], string, CancellationToken)”
public Task<UploadedFile> UploadFileAsync(string fileName, byte[] data, string mediaType, CancellationToken cancellationToken)

Uploads a file.

Parameters

Name Type Description
fileName string
data byte[]
mediaType string
cancellationToken CancellationToken

Returns: Task<UploadedFile>

View source

UploadFileAsync(UploadFileCall, CancellationToken)

Section titled “UploadFileAsync(UploadFileCall, CancellationToken)”
public Task<UploadFileModelResult> UploadFileAsync(UploadFileCall call, CancellationToken cancellationToken)

Uploads inline data. Streams are rejected. deepseek.expiresAfter overrides ExpiresAfterSeconds.

Parameters

Name Type Description
call UploadFileCall
cancellationToken CancellationToken

Returns: Task<UploadFileModelResult>

View source

public static void Validate(long length, string? fileName, string mediaType, byte[]? data)

Checks size, filename, media type, and magic bytes before any request is sent.

Parameters

Name Type Description
length long
fileName string
mediaType string
data byte[]

View source

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