LibreChat/api/server/services
Danny Avila a45b384bbc
💾 feat: Anthropic Prompt Caching (#3670)
* wip: initial cache control implementation, add typing for transactions handling

* feat: first pass of Anthropic Prompt Caching

* feat: standardize stream usage as pass in when calculating token counts

* feat: Add getCacheMultiplier function to calculate cache multiplier for different valueKeys and cacheTypes

* chore: imports order

* refactor: token usage recording in AnthropicClient, no need to "correct" as we have the correct amount

* feat: more accurate token counting using stream usage data

* feat: Improve token counting accuracy with stream usage data

* refactor: ensure more accurate than not token estimations if custom instructions or files are not being resent with every request

* refactor: cleanup updateUserMessageTokenCount to allow transactions to be as accurate as possible even if we shouldn't update user message token counts

* ci: fix tests
2024-08-17 03:24:09 -04:00
..
Config 🔉 fix: Elevenlabs TTS and STT (#3482) 2024-07-30 12:46:46 -04:00
Endpoints fix: Wait for Initial Message Save & Correct Latest Message (#3399) 2024-07-20 01:51:59 -04:00
Files 🎙️ a11y: Screen Reader Support for Dynamic Content Updates (#3625) 2024-08-13 03:04:27 -04:00
Runs ⚙️ feat: Adjust Rate of Stream Progress (#3244) 2024-07-17 10:47:17 -04:00
start ⚙️ feat: Adjust Rate of Stream Progress (#3244) 2024-07-17 10:47:17 -04:00
Threads 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
ActionService.js 🕸️ refactor: Migrate from crypto to Web Crypto API (#3357) 2024-08-04 23:59:45 -04:00
ActionService.spec.js 🤖 feat: OpenAI Assistants v2 (initial support) (#2781) 2024-05-19 12:56:55 -04:00
AppService.js ⚙️ feat: Adjust Rate of Stream Progress (#3244) 2024-07-17 10:47:17 -04:00
AppService.spec.js 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
AssistantService.js 🤖 feat: OpenAI Assistants v2 (initial support) (#2781) 2024-05-19 12:56:55 -04:00
AuthService.js 🧹 chore: pre-release cleanup 2 (#3600) 2024-08-09 15:17:13 -04:00
isDomainAllowed.js 🧪 refactor(isDomainAllowed): change directory, add tests (#2539) 2024-04-25 13:14:07 -04:00
isDomainAllowed.spec.js 🧪 refactor(isDomainAllowed): change directory, add tests (#2539) 2024-04-25 13:14:07 -04:00
ModelService.js 🤖 feat: OpenAI Assistants v2 (initial support) (#2781) 2024-05-19 12:56:55 -04:00
ModelService.spec.js 🦙 feat: Ollama Vision Support (#2643) 2024-05-08 20:24:40 -04:00
PluginService.js 🕸️ refactor: Migrate from crypto to Web Crypto API (#3357) 2024-08-04 23:59:45 -04:00
signPayload.js chore: remove jose as Bun now supports JWT 🍞 (#1167) 2023-11-12 00:44:46 -05:00
ToolService.js 🕸️ refactor: Migrate from crypto to Web Crypto API (#3357) 2024-08-04 23:59:45 -04:00
UserService.js 🕸️ refactor: Migrate from crypto to Web Crypto API (#3357) 2024-08-04 23:59:45 -04:00