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

Part 2 of 2 - Budi 8608 ai platform level config #14602

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

shogunpurple
Copy link
Member

Description

This PR allows budibase to inject the AI configs that can be created with #14543 into LLM providers. Right now, the only place we have AI in the platform is in automations, so support is provided there to allow users who already use the OpenAI integration to continue as is, but users who have access to Budibase AI on paid plans can use custom configs, such as Anthropic instead of OpenAI.

All the LLM code (a majority of this work) is wrapped up in this budibase pro repo. There's further context there on how the LLM integration works, but I tried to keep it as abstracted as possible (including reading the config etc) in pro, so it can just be pulled in and used in a few lines anywhere in the platform that we need AI, and has a dependency on @budibase/pro.
https://github.com/Budibase/budibase-pro/pull/320

Addresses

https://linear.app/budibase/issue/BUDI-8608/ai-platform-level-config

There are 2 parts to the above:

Launchcontrol

Add the ability to use custom AI configs and the built in budibase AI in cloud for automations

Copy link

linear bot commented Sep 18, 2024

@shogunpurple shogunpurple changed the title Budi 8608 ai platform level config pt 2 Part 2 of 2 - Budi 8608 ai platform level config Sep 18, 2024
@shogunpurple shogunpurple marked this pull request as ready for review September 19, 2024 16:09
@shogunpurple shogunpurple requested a review from a team as a code owner September 19, 2024 16:09
@shogunpurple shogunpurple requested review from samwho and removed request for a team September 19, 2024 16:09
// unset the default value from other configs if default is set
if (editingAIConfig.isDefault) {
for (let key in fullAIConfig.config) {
fullAIConfig.config[key].isDefault = false
if (key !== id) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand this change. The old code looks correct, what does this fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it iterates through all the configs, It unsets the new one you actually want to set to default back to false, so it needs to know not to do that

Comment on lines +352 to +356
for (const key in scopedConfig.config) {
if (scopedConfig.config[key].apiKey) {
scopedConfig.config[key].apiKey = PASSWORD_REPLACEMENT
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test to prevent us ever breaking this behaviour by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants