ClearSignatureCache clears signature cache for a specific model group or all groups.
(modelName string)
| 237 | |
| 238 | // ClearSignatureCache clears signature cache for a specific model group or all groups. |
| 239 | func ClearSignatureCache(modelName string) { |
| 240 | if modelName == "" { |
| 241 | signatureCache.Range(func(key, _ any) bool { |
| 242 | signatureCache.Delete(key) |
| 243 | return true |
| 244 | }) |
| 245 | return |
| 246 | } |
| 247 | groupKey := GetModelGroup(modelName) |
| 248 | signatureCache.Delete(groupKey) |
| 249 | } |
| 250 | |
| 251 | // DeleteCachedSignatureRequired removes one exact cached signature. |
| 252 | func DeleteCachedSignatureRequired(ctx context.Context, modelName, text string) error { |