OperationHeaders
Namespace: Vercel.AI.Operations
public static class OperationHeadersHeader and retry helpers shared by the operation types.
Inheritance: object
Methods
Section titled “Methods”MediaTypeFromContentType(IReadOnlyDictionary<string, string>?, string)
Section titled “MediaTypeFromContentType(IReadOnlyDictionary<string, string>?, string)”public static string? MediaTypeFromContentType(IReadOnlyDictionary<string, string>? headers, string requiredPrefix)Reads a header, ignoring case and parameters after ;.
Parameters
| Name | Type | Description |
|---|---|---|
headers |
IReadOnlyDictionary<string, string> | |
requiredPrefix |
string |
Returns: string
WithUserAgent(IReadOnlyDictionary<string, string>?, string)
Section titled “WithUserAgent(IReadOnlyDictionary<string, string>?, string)”public static Dictionary<string, string> WithUserAgent(IReadOnlyDictionary<string, string>? headers, string suffix)Lowercases header names and appends the AI SDK user-agent.
Parameters
| Name | Type | Description |
|---|---|---|
headers |
IReadOnlyDictionary<string, string> | |
suffix |
string |
Returns: Dictionary<string, string>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product