(snap modelConfigSnapshot, config database.ChatModelConfig)
| 337 | } |
| 338 | |
| 339 | func (c *chatConfigCache) storeDefaultModelConfig(snap modelConfigSnapshot, config database.ChatModelConfig) { |
| 340 | c.mu.Lock() |
| 341 | defer c.mu.Unlock() |
| 342 | |
| 343 | if c.modelTopologyEpoch != snap.epoch { |
| 344 | return |
| 345 | } |
| 346 | if c.defaultModelConfigGeneration != snap.generation { |
| 347 | return |
| 348 | } |
| 349 | |
| 350 | c.defaultModelConfig = &cachedModelConfig{ |
| 351 | config: cloneModelConfig(config), |
| 352 | expiresAt: c.clock.Now().Add(chatConfigModelConfigTTL), |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | func (c *chatConfigCache) UserPrompt(ctx context.Context, userID uuid.UUID) (string, error) { |
| 357 | if prompt, ok := c.cachedUserPrompt(userID); ok { |
no test coverage detected