Commit 596e6db
authored
Update _base.py
Pydantic v2 中适配字段名和字段别名的方式,原始方式
model_config = ConfigDict(
# SEE: https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.populate_by_name
validate_by_name=True,
validate_by_alias=True,
serialize_by_alias=True,
alias_generator=to_camel_custom,
)
会导致 实例化 AgentCard 方法的时候 报错
pydantic_core._pydantic_core.ValidationError: 2 validation errors for AgentCard
defaultInputModes
Field required [type=missing, input_value={'name': 'Hello World Age...ed_extended_card': True}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.10/v/missing
defaultOutputModes1 parent 1dbe33d commit 596e6db
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
37 | 35 | | |
38 | 36 | | |
0 commit comments