mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* feat: Add thinking and thinkingBudget parameters for Bedrock Anthropic models * chore: Update @librechat/agents to version 2.1.8 * refactor: change region order in params * refactor: Add maxTokens parameter to conversation preset schema * refactor: Update agent client to use bedrockInputSchema and improve error handling for model parameters * refactor: streamline/optimize llmConfig initialization and saving for bedrock * fix: ensure config titleModel is used for all endpoints * refactor: enhance OpenAIClient and agent initialization to support endpoint checks for OpenRouter * chore: bump @google/generative-ai
37 lines
807 B
JavaScript
37 lines
807 B
JavaScript
const { removeNullishValues } = require('librechat-data-provider');
|
|
const generateArtifactsPrompt = require('~/app/clients/prompts/artifacts');
|
|
|
|
const buildOptions = (endpoint, parsedBody) => {
|
|
const {
|
|
modelLabel: name,
|
|
promptPrefix,
|
|
maxContextTokens,
|
|
resendFiles = true,
|
|
imageDetail,
|
|
iconURL,
|
|
greeting,
|
|
spec,
|
|
artifacts,
|
|
...model_parameters
|
|
} = parsedBody;
|
|
const endpointOption = removeNullishValues({
|
|
endpoint,
|
|
name,
|
|
resendFiles,
|
|
imageDetail,
|
|
iconURL,
|
|
greeting,
|
|
spec,
|
|
promptPrefix,
|
|
maxContextTokens,
|
|
model_parameters,
|
|
});
|
|
|
|
if (typeof artifacts === 'string') {
|
|
endpointOption.artifactsPrompt = generateArtifactsPrompt({ endpoint, artifacts });
|
|
}
|
|
|
|
return endpointOption;
|
|
};
|
|
|
|
module.exports = { buildOptions };
|