({
scope,
querySource,
}: {
scope?: CacheScope
querySource?: QuerySource
} = {})
| 356 | } |
| 357 | |
| 358 | export function getCacheControl({ |
| 359 | scope, |
| 360 | querySource, |
| 361 | }: { |
| 362 | scope?: CacheScope |
| 363 | querySource?: QuerySource |
| 364 | } = {}): { |
| 365 | type: 'ephemeral' |
| 366 | ttl?: '1h' |
| 367 | scope?: CacheScope |
| 368 | } { |
| 369 | return { |
| 370 | type: 'ephemeral', |
| 371 | ...(should1hCacheTTL(querySource) && { ttl: '1h' }), |
| 372 | ...(scope === 'global' && { scope }), |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | /** |
| 377 | * Determines if 1h TTL should be used for prompt caching. |
no test coverage detected