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