cloud_llm_client: Make default_model and default_fast_model optional (#38288)
This PR makes the `default_model` and `default_fast_model` fields optional on the `ListModelsResponse`. Release Notes: - N/A
This commit is contained in:
@@ -215,11 +215,21 @@ impl State {
|
||||
|
||||
self.default_model = models
|
||||
.iter()
|
||||
.find(|model| model.id == response.default_model)
|
||||
.find(|model| {
|
||||
response
|
||||
.default_model
|
||||
.as_ref()
|
||||
.is_some_and(|default_model_id| &model.id == default_model_id)
|
||||
})
|
||||
.cloned();
|
||||
self.default_fast_model = models
|
||||
.iter()
|
||||
.find(|model| model.id == response.default_fast_model)
|
||||
.find(|model| {
|
||||
response
|
||||
.default_fast_model
|
||||
.as_ref()
|
||||
.is_some_and(|default_fast_model_id| &model.id == default_fast_model_id)
|
||||
})
|
||||
.cloned();
|
||||
self.recommended_models = response
|
||||
.recommended_models
|
||||
|
||||
Reference in New Issue
Block a user