Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce SEND_USERNAME_TO_MODEL to send username instead of id to model calls #4249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ DEBUG_CONSOLE=false
# ENDPOINTS=openAI,assistants,azureOpenAI,bingAI,google,gptPlugins,anthropic

PROXY=
SEND_USERNAME_TO_MODEL= # Set to true to send username to model API calls instead of user id

#===================================#
# Known Endpoints - librechat.yaml #
Expand Down
3 changes: 2 additions & 1 deletion api/server/controllers/AskController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { sendMessage, createOnProgress } = require('~/server/utils');
const { getLogStores } = require('~/cache');
const { saveMessage } = require('~/models');
const { logger } = require('~/config');
const { isEnabled } = require('~/server/utils');

const AskController = async (req, res, next, initializeClient, addTitle) => {
let {
Expand Down Expand Up @@ -113,7 +114,7 @@ const AskController = async (req, res, next, initializeClient, addTitle) => {
});

const messageOptions = {
user,
user: isEnabled(process.env.SEND_USERNAME_TO_MODEL) ? req.user.username : user,
parentMessageId,
conversationId,
overrideParentMessageId,
Expand Down