mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
## What changed Add `modelProvider/config/write` to create custom gateways and patch existing custom gateway, Bedrock, and GCP settings. Return the saved provider using the same safe summary as `modelProvider/list`. Omitted fields retain their values; explicit `null` clears nullable user overrides. Apply patches through the shared configuration queue with last-write-wins semantics, enforce field editability and validation, and preserve unexposed authentication settings. Saving leaves provider selection and authentication unchanged. Saving the provider used by `model/list` invalidates its catalog for the next access. Include documentation and generated JSON, TypeScript, and Python protocol types. ## Testing Add coverage for gateway creation and ID allocation, patch and null semantics, configuration policy enforcement, authentication preservation, and catalog refresh after active-provider edits. Extend Python protocol tests to verify wire round trips and reject mismatched provider IDs or fields. GitOrigin-RevId: 850fe2c48ef5274944400efb5a859d720179c923
210 lines
4.7 KiB
JSON
Generated
210 lines
4.7 KiB
JSON
Generated
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"GatewayAuth": {
|
|
"oneOf": [
|
|
{
|
|
"properties": {
|
|
"mode": {
|
|
"enum": [
|
|
"none"
|
|
],
|
|
"title": "NoneGatewayAuthMode",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"mode"
|
|
],
|
|
"title": "NoneGatewayAuth",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"envKey": {
|
|
"type": "string"
|
|
},
|
|
"mode": {
|
|
"enum": [
|
|
"environmentVariable"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"envKey",
|
|
"mode"
|
|
],
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "Authentication is configured outside the gateway form. Preserve it on edits.",
|
|
"properties": {
|
|
"envKey": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"mode": {
|
|
"enum": [
|
|
"externallyConfigured"
|
|
],
|
|
"title": "ModeGatewayAuthMode",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"mode"
|
|
],
|
|
"title": "ModeGatewayAuth",
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"ModelProviderSummary": {
|
|
"properties": {
|
|
"baseUrl": {
|
|
"description": "Null when the endpoint is absent or cannot be safely displayed.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"canEdit": {
|
|
"description": "Whether a supported configuration field can be edited in the active user layer.",
|
|
"type": "boolean"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/definitions/ProviderSettings"
|
|
}
|
|
},
|
|
"required": [
|
|
"canEdit",
|
|
"id",
|
|
"name",
|
|
"settings"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"ProviderSettings": {
|
|
"oneOf": [
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"openai"
|
|
],
|
|
"title": "OpenaiProviderSettingsType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "OpenaiProviderSettings",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"auth": {
|
|
"$ref": "#/definitions/GatewayAuth"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"customGateway"
|
|
],
|
|
"title": "CustomGatewayProviderSettingsType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"auth",
|
|
"type"
|
|
],
|
|
"title": "CustomGatewayProviderSettings",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"profile": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"region": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"bedrock"
|
|
],
|
|
"title": "BedrockProviderSettingsType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "BedrockProviderSettings",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"credentialFile": {
|
|
"description": "Path on the app-server host, without credential-file contents.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"location": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"projectId": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"gcp"
|
|
],
|
|
"title": "GcpProviderSettingsType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "GcpProviderSettings",
|
|
"type": "object"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"properties": {
|
|
"provider": {
|
|
"$ref": "#/definitions/ModelProviderSummary"
|
|
}
|
|
},
|
|
"required": [
|
|
"provider"
|
|
],
|
|
"title": "ModelProviderConfigWriteResponse",
|
|
"type": "object"
|
|
} |