OpenAICompatibleTransforms
Namespace: Vercel.AI.OpenAICompatible
public static class OpenAICompatibleTransformsRequest-body transforms used by thin OpenAI-compatible providers.
Inheritance: object
Methods
Section titled “Methods”BasetenError(string?)
Section titled “BasetenError(string?)”public static string? BasetenError(string? body)Reads a Baseten error. The Model APIs send error as a string; dedicated deployments send an
object with a message.
Parameters
| Name | Type | Description |
|---|---|---|
body |
string |
Returns: string
Cerebras(JsonObject, IList<CallWarning>)
Section titled “Cerebras(JsonObject, IList<CallWarning>)”public static JsonObject Cerebras(JsonObject body, IList<CallWarning> warnings)Maps Cerebras field names and assistant reasoning_content onto reasoning.
Parameters
| Name | Type | Description |
|---|---|---|
body |
JsonObject | |
warnings |
IList<CallWarning> |
Returns: JsonObject
CerebrasError(string?)
Section titled “CerebrasError(string?)”public static string? CerebrasError(string? body)Reads a Cerebras error message from the top-level message field.
Parameters
| Name | Type | Description |
|---|---|---|
body |
string |
Returns: string
Fireworks(JsonObject, IList<CallWarning>)
Section titled “Fireworks(JsonObject, IList<CallWarning>)”public static JsonObject Fireworks(JsonObject body, IList<CallWarning> warnings)Maps Fireworks thinking, cache, service tier, and reasoning effort. Fireworks supports low, medium, and high.
Parameters
| Name | Type | Description |
|---|---|---|
body |
JsonObject | |
warnings |
IList<CallWarning> |
Returns: JsonObject
GmiCloudError(string?)
Section titled “GmiCloudError(string?)”public static string? GmiCloudError(string? body)Reads a GMI Cloud error, preferring the diagnostic nested in error.details.
Parameters
| Name | Type | Description |
|---|---|---|
body |
string |
Returns: string
Groq(JsonObject, IList<CallWarning>)
Section titled “Groq(JsonObject, IList<CallWarning>)”public static JsonObject Groq(JsonObject body, IList<CallWarning> warnings)Maps Groq reasoning levels. none is kept only for qwen/qwen3.6-27b.
minimal becomes low and xhigh and max become high.
Parameters
| Name | Type | Description |
|---|---|---|
body |
JsonObject | |
warnings |
IList<CallWarning> |
Returns: JsonObject
Zai(JsonObject, IList<CallWarning>)
Section titled “Zai(JsonObject, IList<CallWarning>)”public static JsonObject Zai(JsonObject body, IList<CallWarning> warnings)Drops fields Z.AI does not accept and renames its provider options.
Parameters
| Name | Type | Description |
|---|---|---|
body |
JsonObject | |
warnings |
IList<CallWarning> |
Returns: JsonObject
ZaiError(string?)
Section titled “ZaiError(string?)”public static string? ZaiError(string? body)Reads a Z.AI error from error.message or a top-level message.
Parameters
| Name | Type | Description |
|---|---|---|
body |
string |
Returns: string
ZaiFinish(string?)
Section titled “ZaiFinish(string?)”public static FinishReason? ZaiFinish(string? raw)Maps a Z.AI finish reason. Unrecognized values fall through.
Parameters
| Name | Type | Description |
|---|---|---|
raw |
string |
Returns: FinishReason?
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product