mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00

* fix: missing console color methods for admin scripts * feat: Anthropic Claude 3.7 Sonnet Support * feat: update eventsource to version 3.0.2 and upgrade @modelcontextprotocol/sdk to 1.4.1 * fix: update DynamicInput to handle number type and improve initial value logic * feat: first pass Anthropic Reasoning (Claude 3.7) * feat: implement streaming support in AnthropicClient with reasoning UI handling * feat: add missing xAI (grok) models
42 lines
1 KiB
JavaScript
42 lines
1 KiB
JavaScript
const { removeNullishValues, anthropicSettings } = require('librechat-data-provider');
|
|
const generateArtifactsPrompt = require('~/app/clients/prompts/artifacts');
|
|
|
|
const buildOptions = (endpoint, parsedBody) => {
|
|
const {
|
|
modelLabel,
|
|
promptPrefix,
|
|
maxContextTokens,
|
|
resendFiles = anthropicSettings.resendFiles.default,
|
|
promptCache = anthropicSettings.promptCache.default,
|
|
thinking = anthropicSettings.thinking.default,
|
|
thinkingBudget = anthropicSettings.thinkingBudget.default,
|
|
iconURL,
|
|
greeting,
|
|
spec,
|
|
artifacts,
|
|
...modelOptions
|
|
} = parsedBody;
|
|
|
|
const endpointOption = removeNullishValues({
|
|
endpoint,
|
|
modelLabel,
|
|
promptPrefix,
|
|
resendFiles,
|
|
promptCache,
|
|
thinking,
|
|
thinkingBudget,
|
|
iconURL,
|
|
greeting,
|
|
spec,
|
|
maxContextTokens,
|
|
modelOptions,
|
|
});
|
|
|
|
if (typeof artifacts === 'string') {
|
|
endpointOption.artifactsPrompt = generateArtifactsPrompt({ endpoint, artifacts });
|
|
}
|
|
|
|
return endpointOption;
|
|
};
|
|
|
|
module.exports = buildOptions;
|