🅰️ feat: Azure OpenAI Assistants API Support (#1992)

* chore: rename dir from `assistant` to plural

* feat: `assistants` field for azure config, spread options in AppService

* refactor: rename constructAzureURL param for azure as `azureOptions`

* chore: bump openai and bun

* chore(loadDefaultModels): change naming of assistant -> assistants

* feat: load azure settings with currect baseURL for assistants' initializeClient

* refactor: add `assistants` flags to groups and model configs, add mapGroupToAzureConfig

* feat(loadConfigEndpoints): initialize assistants endpoint if azure flag `assistants` is enabled

* feat(AppService): determine assistant models on startup, throw Error if none

* refactor(useDeleteAssistantMutation): send model along with assistant id for delete mutations

* feat: support listing and deleting assistants with azure

* feat: add model query to assistant avatar upload

* feat: add azure support for retrieveRun method

* refactor: update OpenAIClient initialization

* chore: update README

* fix(ci): tests passing

* refactor(uploadOpenAIFile): improve logging and use more efficient REST API method

* refactor(useFileHandling): add model to metadata to target Azure region compatible with current model

* chore(files): add azure naming pattern for valid file id recognition

* fix(assistants): initialize openai with first available assistant model if none provided

* refactor(uploadOpenAIFile): add content type for azure, initialize formdata before azure options

* refactor(sleep): move sleep function out of Runs and into `~/server/utils`

* fix(azureOpenAI/assistants): make sure to only overwrite models with assistant models if `assistants` flag is enabled

* refactor(uploadOpenAIFile): revert to old method

* chore(uploadOpenAIFile): use enum for file purpose

* docs: azureOpenAI update guide with more info, examples

* feat: enable/disable assistant capabilities and specify retrieval models

* refactor: optional chain conditional statement in loadConfigModels.js

* docs: add assistants examples

* chore: update librechat.example.yaml

* docs(azure): update note of file upload behavior in Azure OpenAI Assistants

* chore: update docs and add descriptive message about assistant errors

* fix: prevent message submission with invalid assistant or if files loading

* style: update Landing icon & text when assistant is not selected

* chore: bump librechat-data-provider to 0.4.8

* fix(assistants/azure): assign req.body.model for proper azure init to abort runs
This commit is contained in:
Danny Avila 2024-03-14 17:21:42 -04:00 committed by GitHub
parent 1b243c6f8c
commit 5cd5c3bef8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 1044 additions and 300 deletions

View file

@ -7,6 +7,7 @@ export default {
com_sidepanel_assistant_builder: 'Assistant Builder',
com_sidepanel_attach_files: 'Attach Files',
com_sidepanel_manage_files: 'Manage Files',
com_assistants_capabilities: 'Capabilities',
com_assistants_knowledge: 'Knowledge',
com_assistants_knowledge_info:
'If you upload files under Knowledge, conversations with your Assistant may include file contents.',
@ -16,7 +17,8 @@ export default {
com_assistants_code_interpreter_files:
'The following files are only available for Code Interpreter:',
com_assistants_retrieval: 'Retrieval',
com_assistants_tools_section: 'Actions, Tools',
com_assistants_tools: 'Tools',
com_assistants_actions: 'Actions',
com_assistants_add_tools: 'Add Tools',
com_assistants_add_actions: 'Add Actions',
com_assistants_name_placeholder: 'Optional: The name of the assistant',
@ -285,6 +287,7 @@ export default {
com_endpoint_skip_hover:
'Enable skipping the completion step, which reviews the final answer and generated steps',
com_endpoint_config_key: 'Set API Key',
com_endpoint_assistant_placeholder: 'Please select an Assistant from the right-hand Side Panel',
com_endpoint_config_placeholder: 'Set your Key in the Header menu to chat.',
com_endpoint_config_key_for: 'Set API Key for',
com_endpoint_config_key_name: 'Key',
@ -316,6 +319,7 @@ export default {
com_endpoint_config_key_google_service_account: 'Create a Service Account',
com_endpoint_config_key_google_vertex_api_role:
'Make sure to click \'Create and Continue\' to give at least the \'Vertex AI User\' role. Lastly, create a JSON key to import here.',
com_nav_welcome_assistant: 'Please Select an Assistant',
com_nav_welcome_message: 'How can I help you today?',
com_nav_auto_scroll: 'Auto-scroll to Newest on Open',
com_nav_hide_panel: 'Hide Right-most Side Panel',