8000 chore: Migrate json field names to camelCase (2/n) · Syntax404-coder/adk-python@27b2297 · GitHub
[go: up one dir, main page]

Skip to content

Commit 27b2297

Browse files
google-genai-botcopybara-github
authored andcommitted
chore: Migrate json field names to camelCase (2/n)
PiperOrigin-RevId: 757937550
1 parent 05a0c6b commit 27b2297

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

src/google/adk/cli/fast_api.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
from .cli_eval import EvalMetricResult
7777
from .cli_eval import EvalSetResult
7878
from .cli_eval import EvalStatus
79+
from .utils import common
7980
from .utils import create_empty_state
8081
from .utils import envs
8182
from .utils import evals
@@ -119,27 +120,18 @@ class AgentRunRequest(BaseModel):
119120
streaming: bool = False
120121

121122

122-
class AddSessionToEvalSetRequest(BaseModel):
123+
class AddSessionToEvalSetRequest(common.BaseModel):
123124
eval_id: str
124125
session_id: str
125126
user_id: str
126127

127128

128-
class RunEvalRequest(BaseModel):
129-
model_config = ConfigDict(
130-
alias_generator=alias_generators.to_camel,
131-
)
132-
129+
class RunEvalRequest(common.BaseModel):
133130
eval_ids: list[str] # if empty, then all evals in the eval set are run.
134131
eval_metrics: list[EvalMetric]
135132

136133

137-
class RunEvalResult(BaseModel):
138-
model_config = ConfigDict(
139-
alias_generator=alias_generators.to_camel,
140-
populate_by_name=True,
141-
)
142-
134+
class RunEvalResult(common.BaseModel):
143135
eval_set_file: str
144136
eval_set_id: str
145137
eval_id: str

src/google/adk/cli/utils/common.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import pydantic
16+
from pydantic import alias_generators
17+
18+
19+
class BaseModel(pydantic.BaseModel):
20+
model_config = pydantic.ConfigDict(
21+
alias_generator=alias_generators.to_camel,
22+
populate_by_name=True,
23+
)

0 commit comments

Comments
 (0)
0