(ctx context.Context, db database.Store, clock quartz.Clock)
| 98 | } |
| 99 | |
| 100 | func newChatConfigCache(ctx context.Context, db database.Store, clock quartz.Clock) *chatConfigCache { |
| 101 | return &chatConfigCache{ |
| 102 | db: db, |
| 103 | clock: clock, |
| 104 | ctx: ctx, |
| 105 | modelConfigs: make(map[uuid.UUID]cachedModelConfig), |
| 106 | userPrompts: tlru.New[uuid.UUID]( |
| 107 | tlru.ConstantCost[string], |
| 108 | chatConfigUserPromptEntryLimit, |
| 109 | ), |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | // singleflightDoChan wraps a singleflight group's DoChan method, |
| 114 | // allowing the caller to abandon the wait if their context is |