Skip to content

ProviderResponse

Namespace: Vercel.AI.Operations

public sealed class ProviderResponse

Headers and body returned by one provider call.

Inheritance: object

View source

ProviderResponse(IReadOnlyDictionary<string, string>?, JsonElement?, string?, DateTime?, string?, JsonElement?)

Section titled “ProviderResponse(IReadOnlyDictionary<string, string>?, JsonElement?, string?, DateTime?, string?, JsonElement?)”
public ProviderResponse(IReadOnlyDictionary<string, string>? headers = null, JsonElement? body = null, string? id = null, DateTime? timestamp = null, string? modelId = null, JsonElement? providerMetadata = null)

Creates response metadata.

Parameters

Name Type Description
headers IReadOnlyDictionary<string, string>
body JsonElement?
id string
timestamp DateTime?
modelId string
providerMetadata JsonElement?

View source

public JsonElement? Body { get; }

Response body.

Value: JsonElement?

View source

public IReadOnlyDictionary<string, string>? Headers { get; }

Response headers.

Value: IReadOnlyDictionary<string, string>

View source

public string? Id { get; }

Provider response id.

Value: string

View source

public string? ModelId { get; }

Model id reported by the provider.

Value: string

View source

public JsonElement? ProviderMetadata { get; }

Provider metadata stored on the response, when the call includes it there.

Value: JsonElement?

View source

public DateTime? Timestamp { get; }

Provider timestamp.

Value: DateTime?

View source

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