mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-11 20:14:24 +01:00
feat: artifacts system prompt in backend
This commit is contained in:
parent
fa0032d91d
commit
e3bcfc560d
11 changed files with 225 additions and 3 deletions
|
|
@ -1,8 +1,10 @@
|
|||
const { removeNullishValues } = require('librechat-data-provider');
|
||||
const artifactsPrompt = require('~/app/clients/prompts/artifacts');
|
||||
|
||||
const buildOptions = (endpoint, parsedBody) => {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { promptPrefix, assistant_id, iconURL, greeting, spec, ...modelOptions } = parsedBody;
|
||||
const { promptPrefix, assistant_id, iconURL, greeting, spec, artifacts, ...modelOptions } =
|
||||
parsedBody;
|
||||
const endpointOption = removeNullishValues({
|
||||
endpoint,
|
||||
promptPrefix,
|
||||
|
|
@ -13,6 +15,10 @@ const buildOptions = (endpoint, parsedBody) => {
|
|||
modelOptions,
|
||||
});
|
||||
|
||||
if (artifacts === 'default') {
|
||||
endpointOption.promptPrefix = `${promptPrefix ?? ''}\n${artifactsPrompt}`.trim();
|
||||
}
|
||||
|
||||
return endpointOption;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue