Commit 55d2e84
Fix KeyError for custom/enterprise models in trim_messages (#74)
Use litellm.get_model_info() with exception handling to gracefully
handle models not in litellm's database (e.g., ollama_chat/gpt-oss).
When model info is unavailable, skip trimming and let the model API
handle context limits.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 06be363 commit 55d2e84
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
0 commit comments