LibreChat/api/app/clients
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
..
agents 🧹 chore: clean commented code (#3160) 2024-06-23 18:13:01 -04:00
callbacks fix: Avoid Throwing Errors for Unsupported Token Count Endpoints 🪙 (#1356) 2023-12-15 02:40:15 -05:00
chains refactor(api): Central Logging 📜 (#1348) 2023-12-14 07:49:27 -05:00
document feat: ConversationSummaryBufferMemory (#973) 2023-09-26 21:02:28 -04:00
llm 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
memory refactor(api): Central Logging 📜 (#1348) 2023-12-14 07:49:27 -05:00
output_parsers 🖼️ fix: correct image extraction (#3538) 2024-08-04 20:53:11 -04:00
prompts 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
specs 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
tools 🔧 fix: API Key Handling for GoogleSearch and TavilySearch Tools (#3541) 2024-08-05 19:29:16 -04:00
AnthropicClient.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
BaseClient.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
ChatGPTClient.js 🛠️ refactor: Improve Logging and Error Handling in ToolService and useSSE (#2922) 2024-05-30 12:58:43 -04:00
GoogleClient.js 🖼️ fix: correct image extraction (#3538) 2024-08-04 20:53:11 -04:00
index.js ci(backend-review.yml): add linter step to the backend review workflow (#625) 2023-07-14 09:36:49 -04:00
OllamaClient.js ⚙️ feat: Adjust Rate of Stream Progress (#3244) 2024-07-17 10:47:17 -04:00
OpenAIClient.js 💾 feat: Anthropic Prompt Caching (#3670) 2024-08-17 03:24:09 -04:00
PluginsClient.js ⚙️ feat: Adjust Rate of Stream Progress (#3244) 2024-07-17 10:47:17 -04:00
TextStream.js refactor(api): Central Logging 📜 (#1348) 2023-12-14 07:49:27 -05:00