mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:27:21 +00:00
Added a home page prompt for missing API keys of enterprise providers (#1056)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
1f8d72aa45
commit
7d35536c87
29 files changed
+920
-31
No files matched your search
@@ -963,6 +963,45 @@ document: if your configuration stops offering this provider, AI Studio removes
|
||||
the settings but leaves the user's key in the OS keyring rather than deleting it, in case the same
|
||||
provider comes back later. See [Withdrawing a configuration](#withdrawing-a-configuration).
|
||||
|
||||
### Asking users for their API key
|
||||
|
||||
With `AllowUserProvidedAPIKey` alone, users have to find the provider in the settings and enter
|
||||
their key there. Set `PromptForUserAPIKey` instead, and AI Studio asks for the key itself: as long
|
||||
as such a provider has no API key, the home page shows a panel with an input field for the key.
|
||||
The panel comes first and is open, even when your configuration hides the other panels of the
|
||||
home page. AI Studio also stays on the home page after starting, even when another start page is
|
||||
configured, until the key is there. `PromptForUserAPIKey` implies `AllowUserProvidedAPIKey`, and
|
||||
it works for LLM, embedding, and transcription providers alike. Other API keys, such as the one of
|
||||
a web search, are not covered: they belong to the tool settings.
|
||||
|
||||
All providers of one configuration which set the option share one panel and one key: the user
|
||||
enters the key once, and AI Studio stores it for every one of them. Therefore, mark only providers
|
||||
which accept the same key, for example several models behind one Open WebUI server. Providers
|
||||
which need another key belong in a configuration of their own.
|
||||
|
||||
Before storing the key, AI Studio loads the models of the first of these providers which can list
|
||||
them. A key the provider rejects is not stored, and the user is told so. When the
|
||||
provider cannot be reached, or none of the providers can list its models, the key is stored with
|
||||
a warning, so that an outage does not keep anyone from finishing the setup. A few providers, such
|
||||
as Perplexity, answer with a fixed list of models whatever the key; AI Studio cannot tell a wrong
|
||||
key there.
|
||||
|
||||
Explain how users obtain their key with `CONFIG["USER_API_KEY_PROMPT"]`. Its Markdown is shown
|
||||
above the input field and is required; the title is optional:
|
||||
|
||||
```lua
|
||||
CONFIG["USER_API_KEY_PROMPT"] = {
|
||||
["Title"] = "Please add your API key",
|
||||
["Markdown"] = [===[
|
||||
To use the AI models of your organization, you need a personal API key:
|
||||
|
||||
1. Open [Open WebUI](https://example.org) and sign in.
|
||||
2. Click your profile picture, then "Settings" and "Account".
|
||||
3. Create an API key, copy it, and paste it below.
|
||||
]===]
|
||||
}
|
||||
```
|
||||
|
||||
## Describing your own models
|
||||
|
||||
AI Studio knows what the models of the large vendors can do, and reads that knowledge from their
|
||||
|
||||
Reference in new issue
Block a user