Skip to content

Commit

Permalink
Merge branch 'main' into feat/openid-custom-data
Browse files Browse the repository at this point in the history
  • Loading branch information
rubentalstra authored Feb 4, 2025
2 parents 6de5b50 + 0312d4f commit 48e1cfd
Show file tree
Hide file tree
Showing 29 changed files with 311 additions and 139 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ FACEBOOK_CALLBACK_URL=/oauth/facebook/callback
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CALLBACK_URL=/oauth/github/callback
# GitHub Eenterprise
# GITHUB_ENTERPRISE_BASE_URL=
# GITHUB_ENTERPRISE_USER_AGENT=

# Google
GOOGLE_CLIENT_ID=
Expand Down
1 change: 1 addition & 0 deletions api/app/clients/OpenAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ ${convo}
if (
this.isOmni === true &&
(this.azure || /o1(?!-(?:mini|preview)).*$/.test(modelOptions.model)) &&
!/o3-.*$/.test(this.modelOptions.model) &&
modelOptions.stream
) {
delete modelOptions.stream;
Expand Down
5 changes: 3 additions & 2 deletions api/server/services/ModelService.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ const fetchOpenAIModels = async (opts, _models = []) => {
}

if (baseURL === openaiBaseURL) {
const regex = /(text-davinci-003|gpt-|o1-)/;
models = models.filter((model) => regex.test(model));
const regex = /(text-davinci-003|gpt-|o\d+-)/;
const excludeRegex = /audio|realtime/;
models = models.filter((model) => regex.test(model) && !excludeRegex.test(model));
const instructModels = models.filter((model) => model.includes('instruct'));
const otherModels = models.filter((model) => !model.includes('instruct'));
models = otherModels.concat(instructModels);
Expand Down
11 changes: 11 additions & 0 deletions api/server/services/ToolService.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ function loadAndFormatTools({ directory, adminFilter = [], adminIncluded = [] })
const basicToolInstances = [new Calculator(), ...createYouTubeTools({ override: true })];
for (const toolInstance of basicToolInstances) {
const formattedTool = formatToOpenAIAssistantTool(toolInstance);
let toolName = formattedTool[Tools.function].name;
toolName = toolkits.some((toolkit) => toolName.startsWith(toolkit.pluginKey))
? toolName.split('_')[0]
: toolName;
if (filter.has(toolName) && included.size === 0) {
continue;
}

if (included.size > 0 && !included.has(toolName)) {
continue;
}
tools.push(formattedTool);
}

Expand Down
2 changes: 1 addition & 1 deletion api/server/socialLogins.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ const configureSocialLogins = (app) => {
}
};

module.exports = configureSocialLogins;
module.exports = configureSocialLogins;
9 changes: 9 additions & 0 deletions api/strategies/githubStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ module.exports = () =>
callbackURL: `${process.env.DOMAIN_SERVER}${process.env.GITHUB_CALLBACK_URL}`,
proxy: false,
scope: ['user:email'],
...(process.env.GITHUB_ENTERPRISE_BASE_URL && {
authorizationURL: `${process.env.GITHUB_ENTERPRISE_BASE_URL}/login/oauth/authorize`,
tokenURL: `${process.env.GITHUB_ENTERPRISE_BASE_URL}/login/oauth/access_token`,
userProfileURL: `${process.env.GITHUB_ENTERPRISE_BASE_URL}/api/v3/user`,
userEmailURL: `${process.env.GITHUB_ENTERPRISE_BASE_URL}/api/v3/user/emails`,
...(process.env.GITHUB_ENTERPRISE_USER_AGENT && {
userAgent: process.env.GITHUB_ENTERPRISE_USER_AGENT,
}),
}),
},
githubLogin,
);
2 changes: 1 addition & 1 deletion api/strategies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports = {
facebookLogin,
setupOpenId,
ldapLogin,
};
};
Loading

0 comments on commit 48e1cfd

Please sign in to comment.