mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-14 14:38:11 +01:00
🪨 feat: Add Bedrock Prompt Caching Support (#8271)
* feat: Add Bedrock Cache Control Functionality - fix: Update Bedrock Cache Control to Require cachePoint as a Separate Content Block - Modified the addBedrockCacheControl function to ensure cachePoint is added as a separate content block in the content array, rather than as a property of text objects. - refactor: move addBedrockCacheControl over to packages/api - ci: add tests for addBedrockCacheControl until full coverage reached * ci: add test similar to example from the langchain PR * refactor: move addBedrockCacheControl logic and tests to agents repository * chore: remove extraneous comment * chore: update @librechat/agents dependency to version 3.0.12 * chore: update @librechat/agents dependency to version 3.0.13 * chore: update @librechat/agents dependency to version 3.0.14 * chore: update @librechat/agents to v3.0.15 * chore: update default value for prompt cache setting to true * refactor: set default promptCache to true for claude and nova models --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
bc561840bb
commit
c9ee0f138a
5 changed files with 37 additions and 8 deletions
|
|
@ -492,6 +492,19 @@ const bedrock: Record<string, SettingDefinition> = {
|
|||
default: 0.999,
|
||||
range: { min: 0, max: 1, step: 0.01 },
|
||||
}),
|
||||
promptCache: {
|
||||
key: 'promptCache',
|
||||
label: 'com_endpoint_prompt_cache',
|
||||
labelCode: true,
|
||||
type: 'boolean',
|
||||
description: 'com_endpoint_anthropic_prompt_cache',
|
||||
descriptionCode: true,
|
||||
default: true,
|
||||
component: 'switch',
|
||||
optionType: 'conversation',
|
||||
showDefault: false,
|
||||
columnSpan: 2,
|
||||
},
|
||||
};
|
||||
|
||||
const mistral: Record<string, SettingDefinition> = {
|
||||
|
|
@ -752,6 +765,7 @@ const bedrockAnthropic: SettingsConfiguration = [
|
|||
baseDefinitions.stop,
|
||||
librechat.resendFiles,
|
||||
bedrock.region,
|
||||
bedrock.promptCache,
|
||||
anthropic.thinking,
|
||||
anthropic.thinkingBudget,
|
||||
librechat.fileTokenLimit,
|
||||
|
|
@ -789,6 +803,7 @@ const bedrockGeneral: SettingsConfiguration = [
|
|||
meta.topP,
|
||||
librechat.resendFiles,
|
||||
bedrock.region,
|
||||
bedrock.promptCache,
|
||||
librechat.fileTokenLimit,
|
||||
];
|
||||
|
||||
|
|
@ -807,6 +822,7 @@ const bedrockAnthropicCol2: SettingsConfiguration = [
|
|||
bedrock.topK,
|
||||
librechat.resendFiles,
|
||||
bedrock.region,
|
||||
bedrock.promptCache,
|
||||
anthropic.thinking,
|
||||
anthropic.thinkingBudget,
|
||||
librechat.fileTokenLimit,
|
||||
|
|
@ -856,6 +872,7 @@ const bedrockGeneralCol2: SettingsConfiguration = [
|
|||
meta.topP,
|
||||
librechat.resendFiles,
|
||||
bedrock.region,
|
||||
bedrock.promptCache,
|
||||
librechat.fileTokenLimit,
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue