Repository navigation
Commit e32352f
committed
fix: make CachingOpenAIModel._map_messages version-adaptive
pydantic-ai 1.0.6 (the pinned version) has OpenAIChatModel._map_messages
accepting only messages, while >=1.107 added model_request_parameters and
model_settings. The override forwarded the newer arguments unconditionally,
so every _map_messages call raised
'TypeError: _map_messages() got an unexpected keyword argument
'model_settings''. Inspect the base signature and forward the matching
argument set, and default model_request_parameters to None so pydantic-ai
1.0.6's internal one-argument call also works.1 parent a61f0f2 commit e32352f
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
0 commit comments