Skip to content

Commit 174122d

Browse files
herewasmikenacx
andauthored
docs: mark version and prefix optional in VersionedAPISchema (#1934)
**Description** Since they have "omitempty" tag they should be optional This is a bit confusing as it is now Signed-off-by: Mikhail Toldov <matoldov@gmail.com> Co-authored-by: Ignasi Barrera <ignasi@tetrate.io>
1 parent 085fccb commit 174122d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

api/v1alpha1/shared_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type VersionedAPISchema struct {
2727
// prefix field. This is to maintain backward compatibility. This will be removed in future releases.
2828
//
2929
// See https://aigateway.envoyproxy.io/docs/capabilities/llm-integrations/supported-providers for details.
30+
// +optional
3031
Version *string `json:"version,omitempty"`
3132

3233
// Prefix is the prefix for the API.
@@ -41,6 +42,7 @@ type VersionedAPISchema struct {
4142
// use prefix, so you can leave this field unset.
4243
//
4344
// See https://aigateway.envoyproxy.io/docs/capabilities/llm-integrations/supported-providers for details.
45+
// +optional
4446
Prefix *string `json:"prefix,omitempty"`
4547
}
4648

site/docs/api/api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,12 +2524,12 @@ the ai-gateway, but by the vendor via proper versioning.
25242524
/><ApiField
25252525
name="version"
25262526
type="string"
2527-
required="true"
2527+
required="false"
25282528
description="Version is the version of the API schema.<br />When the name is set to AzureOpenAI, this version maps to `API Version` in the<br />Azure OpenAI API documentation (https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning).<br />**Deprecated Behavior**: When the name is set to `OpenAI`, this version field will behave as the<br />prefix field. This is to maintain backward compatibility. This will be removed in future releases.<br />See https://aigateway.envoyproxy.io/docs/capabilities/llm-integrations/supported-providers for details."
25292529
/><ApiField
25302530
name="prefix"
25312531
type="string"
2532-
required="true"
2532+
required="false"
25332533
description="Prefix is the prefix for the API.<br />When the name is set to `OpenAI`, `chat completions` API endpoint will be `$\{this_field\}/chat/completions`.<br />It can be with or without a leading slash (`/`).<br />This is especially useful when routing to the backend that has an OpenAI compatible API but has a different<br />prefix. For example, Gemini OpenAI compatible API (https://ai.google.dev/gemini-api/docs/openai) uses<br />`/v1beta/openai` prefix. Another example is that Cohere AI (https://docs.cohere.com/v2/docs/compatibility-api)<br />uses `/compatibility/v1` prefix. On the other hand, DeepSeek (https://api-docs.deepseek.com/) doesn't<br />use prefix, so you can leave this field unset.<br />See https://aigateway.envoyproxy.io/docs/capabilities/llm-integrations/supported-providers for details."
25342534
/>
25352535

0 commit comments

Comments
 (0)