LibreChat/api/app/clients/prompts
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
..
addCacheControl.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
addCacheControl.spec.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
createContextHandlers.js 🗃️ fix: revise RAG prompt (#3006) 2024-06-07 20:51:43 -04:00
createVisionPrompt.js 👓 feat: Vision Support for Assistants (#2195) 2024-03-24 23:43:00 -04:00
formatGoogleInputs.js feat(Google): Support all Text/Chat Models, Response streaming, PaLM -> Google 🤖 (#1316) 2023-12-10 14:54:13 -05:00
formatGoogleInputs.spec.js feat(Google): Support all Text/Chat Models, Response streaming, PaLM -> Google 🤖 (#1316) 2023-12-10 14:54:13 -05:00
formatMessages.js 🤖 feat(Anthropic): Claude 3 & Vision Support (#1984) 2024-03-06 00:04:52 -05:00
formatMessages.spec.js feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) 2024-02-13 20:42:27 -05:00
handleInputs.js feat: ConversationSummaryBufferMemory (#973) 2023-09-26 21:02:28 -04:00
index.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
instructions.js ci(backend-review.yml): add linter step to the backend review workflow (#625) 2023-07-14 09:36:49 -04:00
summaryPrompts.js feat: Accurate Token Usage Tracking & Optional Balance (#1018) 2023-10-05 18:34:10 -04:00
titlePrompts.js 🌏 refactor: Improve Title Prompt for Multilingual Titles (#2832) 2024-05-22 23:18:59 -04:00
truncateText.js 🤖 feat: Gemini 1.5 Support (+Vertex AI) (#2383) 2024-04-16 08:32:40 -04:00