populateCatalogMetadata fetches models.dev metadata for the given provider/model pair and copies it onto choice. It silently does nothing when the lookup fails or when the runtime has no models store.
(ctx context.Context, choice *ModelChoice, providerID, modelID string)
| 705 | // provider/model pair and copies it onto choice. It silently does |
| 706 | // nothing when the lookup fails or when the runtime has no models store. |
| 707 | func (r *LocalRuntime) populateCatalogMetadata(ctx context.Context, choice *ModelChoice, providerID, modelID string) { |
| 708 | if r.modelsStore == nil { |
| 709 | return |
| 710 | } |
| 711 | m, err := r.modelsStore.GetModel(ctx, modelsdev.NewID(providerID, modelID)) |
| 712 | if err == nil { |
| 713 | applyCatalogMetadata(choice, m) |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | // applyCatalogMetadata copies pricing/limit/modality information from a |
| 718 | // models.dev Model entry onto a ModelChoice. |
no test coverage detected