@@ -71,13 +71,13 @@ func NewDatabaseStore(db *Database) *Store {
7171}
7272
7373// GetDatabase returns the models.dev database, fetching from cache or API as needed.
74- func (s * Store ) GetDatabase (ctx context. Context ) (* Database , error ) {
74+ func (s * Store ) GetDatabase () (* Database , error ) {
7575 return s .db ()
7676}
7777
7878// GetProvider returns a specific provider by ID.
79- func (s * Store ) GetProvider (ctx context. Context , providerID string ) (* Provider , error ) {
80- db , err := s .GetDatabase (ctx )
79+ func (s * Store ) GetProvider (providerID string ) (* Provider , error ) {
80+ db , err := s .GetDatabase ()
8181 if err != nil {
8282 return nil , err
8383 }
@@ -91,15 +91,15 @@ func (s *Store) GetProvider(ctx context.Context, providerID string) (*Provider,
9191}
9292
9393// GetModel returns a specific model by provider ID and model ID.
94- func (s * Store ) GetModel (ctx context. Context , id string ) (* Model , error ) {
94+ func (s * Store ) GetModel (id string ) (* Model , error ) {
9595 parts := strings .SplitN (id , "/" , 2 )
9696 if len (parts ) != 2 {
9797 return nil , fmt .Errorf ("invalid model ID: %q" , id )
9898 }
9999 providerID := parts [0 ]
100100 modelID := parts [1 ]
101101
102- provider , err := s .GetProvider (ctx , providerID )
102+ provider , err := s .GetProvider (providerID )
103103 if err != nil {
104104 return nil , err
105105 }
@@ -236,7 +236,7 @@ var datePattern = regexp.MustCompile(`-\d{4}-?\d{2}-?\d{2}$`)
236236// For example, ("anthropic", "claude-sonnet-4-5") might resolve to "claude-sonnet-4-5-20250929".
237237// If the model is not an alias (already pinned or unknown), the original model name is returned.
238238// This method uses the models.dev database to find the corresponding pinned version.
239- func (s * Store ) ResolveModelAlias (ctx context. Context , providerID , modelName string ) string {
239+ func (s * Store ) ResolveModelAlias (providerID , modelName string ) string {
240240 if providerID == "" || modelName == "" {
241241 return modelName
242242 }
@@ -247,7 +247,7 @@ func (s *Store) ResolveModelAlias(ctx context.Context, providerID, modelName str
247247 }
248248
249249 // Get the provider from the database
250- provider , err := s .GetProvider (ctx , providerID )
250+ provider , err := s .GetProvider (providerID )
251251 if err != nil {
252252 return modelName
253253 }
@@ -296,7 +296,7 @@ func isBedrockRegionPrefix(prefix string) bool {
296296// - If modelID is empty or not in "provider/model" format, returns true (fail-open)
297297// - If models.dev lookup fails for any reason, returns true (fail-open)
298298// - If lookup succeeds, returns the model's Reasoning field value
299- func ModelSupportsReasoning (ctx context. Context , modelID string ) bool {
299+ func ModelSupportsReasoning (modelID string ) bool {
300300 // Fail-open for empty model ID
301301 if modelID == "" {
302302 return true
@@ -314,7 +314,7 @@ func ModelSupportsReasoning(ctx context.Context, modelID string) bool {
314314 return true
315315 }
316316
317- model , err := store .GetModel (ctx , modelID )
317+ model , err := store .GetModel (modelID )
318318 if err != nil {
319319 slog .Debug ("Failed to lookup model in models.dev, assuming reasoning supported to allow user choice" , "model_id" , modelID , "error" , err )
320320 return true
0 commit comments