Skip to content

Commit 2648f5c

Browse files
birdayzclaude
andcommitted
proto: add model and base_url to OpenAI provider, deprecate top-level model
Add model and base_url fields to the OpenAI provider configuration. Keep the existing top-level model field but mark it as deprecated for backward compatibility. The new provider.openai.model field takes precedence when both are set. This allows for a gradual migration path while making the schema cleaner and more extensible for future providers with different model requirements. Changes: - Added optional model field to Provider.OpenAI message - Added optional base_url field to Provider.OpenAI message - Marked top-level model field as deprecated in AIAgent, AIAgentCreate, and AIAgentUpdate - Updated comments to indicate migration path - Regenerated all protobuf code and OpenAPI specs Co-Authored-By: Claude <[email protected]>
1 parent 1bdb3cb commit 2648f5c

File tree

9 files changed

+592
-502
lines changed

9 files changed

+592
-502
lines changed

backend/pkg/protogen/redpanda/api/dataplane/v1alpha3/ai_agent.pb.go

Lines changed: 521 additions & 484 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/protogen/redpanda/api/dataplane/v1alpha3/ai_agent_pb.ts

Lines changed: 29 additions & 4 deletions
Large diffs are not rendered by default.

proto/gen/openapi/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

proto/gen/openapi/openapi.v1alpha2.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

proto/gen/openapi/openapi.v1alpha2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4375,7 +4375,7 @@ paths:
43754375
content:
43764376
multipart/form-data:
43774377
schema:
4378-
example: '{"name":"redact-orders", "input_topic_name":"orders", "output_topic_names":["orders-redacted"], "environment_variables":[{"key":"LOGGER_LEVEL", "value":"DEBUG"}]}'
4378+
example: '{"name":"redact-orders","input_topic_name":"orders","output_topic_names":["orders-redacted"],"environment_variables":[{"key":"LOGGER_LEVEL","value":"DEBUG"}]}'
43794379
properties:
43804380
metadata:
43814381
$ref: '#/components/schemas/DeployTransformRequest'

proto/gen/openapi/openapi.v1alpha3.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

proto/gen/openapi/openapi.v1alpha3.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ components:
2222
description: Map of MCP servers that this AI agent can use.
2323
type: object
2424
model:
25+
description: |-
26+
Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
27+
If both are set, provider.openai.model takes precedence.
2528
type: string
2629
provider:
2730
$ref: '#/components/schemas/AIAgent.Provider'
@@ -49,7 +52,6 @@ components:
4952
- display_name
5053
- system_prompt
5154
- provider
52-
- model
5355
- service_account
5456
type: object
5557
AIAgent.MCPServer:
@@ -68,6 +70,13 @@ components:
6870
properties:
6971
api_key:
7072
type: string
73+
base_url:
74+
type: string
75+
model:
76+
description: |-
77+
Model to use for this AI agent. If not set, falls back to the deprecated top-level model field.
78+
Preferred over the top-level model field when both are set.
79+
type: string
7180
required:
7281
- api_key
7382
type: object
@@ -115,6 +124,9 @@ components:
115124
description: Map of MCP servers that this AI agent can use.
116125
type: object
117126
model:
127+
description: |-
128+
Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
129+
If both are set, provider.openai.model takes precedence.
118130
type: string
119131
provider:
120132
$ref: '#/components/schemas/AIAgent.Provider'
@@ -134,7 +146,6 @@ components:
134146
- display_name
135147
- system_prompt
136148
- provider
137-
- model
138149
- service_account
139150
type: object
140151
AIAgentUpdate:
@@ -154,6 +165,9 @@ components:
154165
description: Map of MCP servers that this AI agent can use.
155166
type: object
156167
model:
168+
description: |-
169+
Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
170+
If both are set, provider.openai.model takes precedence.
157171
type: string
158172
provider:
159173
$ref: '#/components/schemas/AIAgent.Provider'

proto/gen/openapi/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5608,7 +5608,7 @@ paths:
56085608
content:
56095609
multipart/form-data:
56105610
schema:
5611-
example: '{"name":"redact-orders","input_topic_name":"orders","output_topic_names":["orders-redacted"],"environment_variables":[{"key":"LOGGER_LEVEL","value":"DEBUG"}]}'
5611+
example: '{"name":"redact-orders", "input_topic_name":"orders", "output_topic_names":["orders-redacted"], "environment_variables":[{"key":"LOGGER_LEVEL", "value":"DEBUG"}]}'
56125612
properties:
56135613
metadata:
56145614
$ref: '#/components/schemas/DeployTransformRequest'

proto/redpanda/api/dataplane/v1alpha3/ai_agent.proto

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ message AIAgent {
5050
(google.api.field_behavior) = REQUIRED,
5151
(buf.validate.field).required = true
5252
];
53+
// Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
54+
// If both are set, provider.openai.model takes precedence.
5355
string model = 7 [
54-
(google.api.field_behavior) = REQUIRED,
5556
(google.api.field_behavior) = IMMUTABLE,
56-
(buf.validate.field).required = true,
57-
(buf.validate.field).string.max_len = 128
57+
(buf.validate.field).string.max_len = 128,
58+
deprecated = true
5859
];
5960

6061
// Map of MCP servers that this AI agent can use.
@@ -95,6 +96,13 @@ message AIAgent {
9596
(buf.validate.field).required = true,
9697
(buf.validate.field).string.pattern = "^\\$\\{secrets\\.[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)?\\}$"
9798
];
99+
// Model to use for this AI agent. If not set, falls back to the deprecated top-level model field.
100+
// Preferred over the top-level model field when both are set.
101+
string model = 2 [
102+
(google.api.field_behavior) = IMMUTABLE,
103+
(buf.validate.field).string.max_len = 128
104+
];
105+
string base_url = 3;
98106
}
99107

100108
oneof provider {
@@ -374,11 +382,12 @@ message AIAgentCreate {
374382
(google.api.field_behavior) = REQUIRED,
375383
(buf.validate.field).required = true
376384
];
385+
// Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
386+
// If both are set, provider.openai.model takes precedence.
377387
string model = 6 [
378-
(google.api.field_behavior) = REQUIRED,
379388
(google.api.field_behavior) = IMMUTABLE,
380-
(buf.validate.field).required = true,
381-
(buf.validate.field).string.max_len = 128
389+
(buf.validate.field).string.max_len = 128,
390+
deprecated = true
382391
];
383392

384393
// Map of MCP servers that this AI agent can use.
@@ -502,7 +511,12 @@ message AIAgentUpdate {
502511
// LLM configuration settings for the AI agent.
503512
AIAgent.Provider provider = 4;
504513

505-
string model = 6 [(buf.validate.field).string.max_len = 128];
514+
// Deprecated: Use provider.openai.model instead. This field is kept for backward compatibility.
515+
// If both are set, provider.openai.model takes precedence.
516+
string model = 6 [
517+
(buf.validate.field).string.max_len = 128,
518+
deprecated = true
519+
];
506520

507521
// Map of MCP servers that this AI agent can use.
508522
map<string, AIAgent.MCPServer> mcp_servers = 7;

0 commit comments

Comments
 (0)