Roo-Code/packages/types
Murilo Pires a0018c9d04
feat: add prompt caching support for LiteLLM (#5791) (#6074)
* feat: add prompt caching support for LiteLLM (#5791)

- Add litellmUsePromptCache configuration option to provider settings
- Implement cache control headers in LiteLLM handler when enabled
- Add UI checkbox for enabling prompt caching (only shown for supported models)
- Track cache read/write tokens in usage data
- Add comprehensive test for prompt caching functionality
- Reuse existing translation keys for consistency across languages

This allows LiteLLM users to benefit from prompt caching with supported models
like Claude 3.7, reducing costs and improving response times.

* fix: improve LiteLLM prompt caching to work for multi-turn conversations

- Convert system message to structured format with cache_control
- Handle both string and array content types for user messages
- Apply cache_control to content items, not just message level
- Update tests to match new message structure

This ensures prompt caching works correctly for all messages in a conversation,
not just the initial system prompt and first user message.

* fix: resolve TypeScript linter error for cache_control property

Use type assertion to handle cache_control property that's not in OpenAI types
2025-07-28 12:56:06 -07:00
..
npm Add type for allowing org members to view all tasks (#6193) 2025-07-24 22:16:43 -04:00
src feat: add prompt caching support for LiteLLM (#5791) (#6074) 2025-07-28 12:56:06 -07:00
eslint.config.mjs Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
package.json Farewell jest (#4607) 2025-06-16 21:39:45 -07:00
README.md Bump @roo-code/types to v1.26.0 (#4584) 2025-06-12 11:05:53 -04:00
tsconfig.json Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
tsup.config.ts Improve configuration for npm publish of @roo-code/types (#4062) 2025-05-27 22:10:41 -07:00
vitest.config.ts Convert jest tests to vitest and disable default watch mode for vitest (#4568) 2025-06-11 14:48:01 -07:00

@roo-code/types

Publish to NPM

First authenticate with NPM:

npm login

Next, manually bump the NPM package version:

cd packages/types/npm && npm version minor && cd -

Finally, publish to NPM:

pnpm --filter @roo-code/types npm:publish

Note that you'll be asked for an MFA code to complete the publish.