cacheTTLFromCommon reads provider metadata cache_ttl_seconds from the store-backed file shape. Default: 24h.
(common map[string]any)
| 174 | // cacheTTLFromCommon reads provider metadata cache_ttl_seconds from the store-backed file shape. |
| 175 | // Default: 24h. |
| 176 | func cacheTTLFromCommon(common map[string]any) time.Duration { |
| 177 | const defaultSeconds = int64(86400) |
| 178 | seconds := defaultSeconds |
| 179 | if common != nil { |
| 180 | if v, ok := common["cache_ttl_seconds"]; ok { |
| 181 | switch n := v.(type) { |
| 182 | case float64: |
| 183 | seconds = int64(n) |
| 184 | case int: |
| 185 | seconds = int64(n) |
| 186 | case int64: |
| 187 | seconds = n |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | return time.Duration(seconds) * time.Second |
| 192 | } |
| 193 | |
| 194 | // autoResolve fills missing pinned fields using today's |
| 195 | // auto-selection logic (first matching endpoint, first model). Used |
no outgoing calls
no test coverage detected