mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-21 17:56:13 +01:00
Squashed commit of the following:
commit28230d9305Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Sun Sep 3 02:44:26 2023 +0200 feat: delete button confirm (#875) * base for confirm delete * more like OpenAI commit2b54e3f9feAuthor: Fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Fri Sep 1 14:20:51 2023 -0400 update: install script (#858) commit1cd0fd9d5aAuthor: Fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Fri Sep 1 08:12:35 2023 -0400 doc: Hugging Face Deployment (#867) * docs: update ToC * docs: update ToC * update huggingface.md * update render.md * update huggingface.md * update mongodb.md * update huggingface.md * update README.md commitaeeb3d3050Author: Mu Yuan <yuanmu.email@gmail.com> Date: Thu Aug 31 07:21:27 2023 +0800 Update Zh.tsx (#862) * Update Zh.tsx Changed the translation of several words to make it more relevant to Chinese usage habits. * Update Zh.tsx Changed the translation of several words to make it more relevant to Chinese usage habits commit80e2e2675bAuthor: Raí <140329135+itzraiss@users.noreply.github.com> Date: Mon Aug 28 18:05:46 2023 -0300 Translation of 'com_ui_pay_per_call:' to Spanish and Portuguese that were missing. (#857) * Update Br.tsx * Update Es.tsx * Update Br.tsx * Update Es.tsx commit3574d0b823Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 28 14:49:26 2023 -0400 docs: make_your_own.md formatting fix for mkdocs (#855) commitd672ac690dAuthor: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 28 14:24:10 2023 -0400 Release v0.5.8 (#854) * chore: add 'api' image to tag release workflow * docs: update DO deployment docs to include instruction about latest stable release, as well as security best practices * Release v0.5.8 * docs: Update digitalocean.md with firewall section images * docs: make_your_own.md formatting fix for mkdocs commitd3e7627046Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 28 12:03:08 2023 -0400 refactor(plugins): Improve OpenAPI handling, Show Multiple Plugins, & Other Improvements (#845) * feat(PluginsClient.js): add conversationId to options object in the constructor feat(PluginsClient.js): add support for Code Interpreter plugin feat(PluginsClient.js): add support for Code Interpreter plugin in the availableTools manifest feat(CodeInterpreter.js): add CodeInterpreterTools module feat(CodeInterpreter.js): add RunCommand class feat(CodeInterpreter.js): add ReadFile class feat(CodeInterpreter.js): add WriteFile class feat(handleTools.js): add support for loading Code Interpreter plugin * chore(api): update langchain dependency to version 0.0.123 * fix(CodeInterpreter.js): add support for extracting environment from code fix(WriteFile.js): add support for extracting environment from data fix(extractionChain.js): add utility functions for creating extraction chain from Zod schema fix(handleTools.js): refactor getOpenAIKey function to handle user-provided API key fix(handleTools.js): pass model and openAIApiKey to CodeInterpreter constructor * fix(tools): rename CodeInterpreterTools to E2BTools fix(tools): rename code_interpreter pluginKey to e2b_code_interpreter * chore(PluginsClient.js): comment out unused import and function findMessageContent feat(PluginsClient.js): add support for CodeSherpa plugin feat(PluginsClient.js): add CodeSherpaTools to available tools feat(PluginsClient.js): update manifest.json to include CodeSherpa plugin feat(CodeSherpaTools.js): create RunCode and RunCommand classes for CodeSherpa plugin feat(E2BTools.js): Add E2BTools module for extracting environment from code and running commands, reading and writing files fix(codesherpa.js): Remove codesherpa module as it is no longer needed feat(handleTools.js): add support for CodeSherpaTools in loadTools function feat(loadToolSuite.js): create loadToolSuite utility function to load a suite of tools * feat(PluginsClient.js): add support for CodeSherpa v2 plugin feat(PluginsClient.js): add CodeSherpa v1 plugin to available tools feat(PluginsClient.js): add CodeSherpa v2 plugin to available tools feat(PluginsClient.js): update manifest.json for CodeSherpa v1 plugin feat(PluginsClient.js): update manifest.json for CodeSherpa v2 plugin feat(CodeSherpa.js): implement CodeSherpa plugin for interactive code and shell command execution feat(CodeSherpaTools.js): implement RunCode and RunCommand plugins for CodeSherpa v1 feat(CodeSherpaTools.js): update RunCode and RunCommand plugins for CodeSherpa v2 fix(handleTools.js): add CodeSherpa import statement fix(handleTools.js): change pluginKey from 'codesherpa' to 'codesherpa_tools' fix(handleTools.js): remove model and openAIApiKey from options object in e2b_code_interpreter tool fix(handleTools.js): remove openAIApiKey from options object in codesherpa_tools tool fix(loadToolSuite.js): remove model and openAIApiKey parameters from loadToolSuite function * feat(initializeFunctionsAgent.js): add prefix to agentArgs in initializeFunctionsAgent function The prefix is added to the agentArgs in the initializeFunctionsAgent function. This prefix is used to provide instructions to the agent when it receives any instructions from a webpage, plugin, or other tool. The agent will notify the user immediately and ask them if they wish to carry out or ignore the instructions. * feat(PluginsClient.js): add ChatTool to the list of tools if it meets the conditions feat(tools/index.js): import and export ChatTool feat(ChatTool.js): create ChatTool class with necessary properties and methods * fix(initializeFunctionsAgent.js): update PREFIX message to include sharing all output from the tool fix(E2BTools.js): update descriptions for RunCommand, ReadFile, and WriteFile plugins to provide more clarity and context * chore: rebuild package-lock after rebase * chore: remove deleted file from rebase * wip: refactor plugin message handling to mirror chat.openai.com, handle incoming stream for plugin use * wip: new plugin handling * wip: show multiple plugins handling * feat(plugins): save new plugins array * chore: bump langchain * feat(experimental): support streaming in between plugins * refactor(PluginsClient): factor out helper methods to avoid bloating the class, refactor(gptPlugins): use agent action for mapping the name of action * fix(handleTools): fix tests by adding condition to return original toolFunctions map * refactor(MessageContent): Allow the last index to be last in case it has text (may change with streaming) * feat(Plugins): add handleParsingErrors, useful when LLM does not invoke function params * chore: edit out experimental codesherpa integration * refactor(OpenAPIPlugin): rework tool to be 'function-first', as the spec functions are explicitly passed to agent model * refactor(initializeFunctionsAgent): improve error handling and system message * refactor(CodeSherpa, Wolfram): optimize token usage by delegating bulk of instructions to system message * style(Plugins): match official style with input/outputs * chore: remove unnecessary console logs used for testing * fix(abortMiddleware): render markdown when message is aborted * feat(plugins): add BrowserOp * refactor(OpenAPIPlugin): improve prompt handling * fix(useGenerations): hide edit button when message is submitting/streaming * refactor(loadSpecs): optimize OpenAPI spec loading by only loading requested specs instead of all of them * fix(loadSpecs): will retain original behavior when no tools are passed to the function * fix(MessageContent): ensure cursor only shows up for last message and last display index fix(Message): show legacy plugin and pass isLast to Content * chore: remove console.logs * docs: update docs based on breaking changes and new features refactor(structured/SD): use description_for_model for detailed prompting * docs(azure): make plugins section more clear * refactor(structured/SD): change default payload to SD-WebUI to prefer realism and config for SDXL * refactor(structured/SD): further improve system message prompt * docs: update breaking changes after rebase * refactor(MessageContent): factor out EditMessage, types, Container to separate files, rename Content -> Markdown * fix(CodeInterpreter): linting errors * chore: reduce browser console logs from message streams * chore: re-enable debug logs for plugins/langchain to help with user troubleshooting * chore(manifest.json): add [Experimental] tag to CodeInterpreter plugins, which are not intended as the end-all be-all implementation of this feature for Librechat commit66b8580487Author: Fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Mon Aug 28 09:18:25 2023 -0400 docs: third-party tools (#848) * docs: third-party tools * docs: third-party tools * Update third-party.md * Update third-party.md --------- Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com> commit9791a78161Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Mon Aug 28 15:14:05 2023 +0200 adjust the animation (#843) commit3797ec6082Author: Ronith <87087292+ronith256@users.noreply.github.com> Date: Mon Aug 28 18:43:50 2023 +0530 feat: Add Code Interpreter Plugin (#837) * feat: Add Code Interpreter Plugin Adds a Simple Code Interpreter Plugin. ## Features: - Runs code using local Python Environment ## Issues - Code execution is not sandboxed. * Add Docker Sandbox for Python Server commite2397076a2Author: Alex Zhang <ztc2011@gmail.com> Date: Mon Aug 28 00:55:34 2023 +0800 🌐: Chinese Translation (#846) commit50c15c704fAuthor: Fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Sat Aug 26 19:36:59 2023 -0400 Language translation: Polish (#840) * Language translation: Polish * Language translation: Polish * Revert changes in language-contributions.md commit29d3640546Author: Fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Sat Aug 26 19:36:25 2023 -0400 docs: updates (#841) commit39c626aa8eAuthor: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 25 09:29:19 2023 -0400 fix: isEdited edge case where latest Message is not saved due to aborting too quickly commitae5c06f381Author: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 25 09:13:50 2023 -0400 fix(chatGPTBrowser): render markdown formatting by setting isCreatedByUser, fix(useMessageHandler): avoid double appearance of cursor by setting latest message at initial response creation time commit9ef1686e18Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Thu Aug 24 20:24:47 2023 -0400 Update mkdocs.yml commit5bbe411569Author: Flynn <dev@flynnbuckingham.com> Date: Thu Aug 24 20:20:37 2023 -0400 Add podman installation instructions. Update dockerfile to stub env (#819) * Added podman container installation docs. Updated dockerfile to stub env file if not present in source * Fix typos commit887fec99caAuthor: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Fri Aug 25 02:11:27 2023 +0200 🌐: Russian Translation (#830) commit007d51ede1Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Fri Aug 25 02:10:48 2023 +0200 feat: facebook login (#820) * Facebook strategy * Update user_auth_system.md * Update user_auth_system.md commita569020312Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Thu Aug 24 21:59:11 2023 +0200 Fix Meilisearch error and refactor of the server index.js (#832) * fix meilisearch error at startup * limit the nesting * disable useless console log * fix(indexSync.js): removed redundant searchEnabled * refactor(index.js): moved configureSocialLogins to a new file * refactor(socialLogins.js): removed unnecessary conditional commit37347d4683Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Wed Aug 23 16:14:17 2023 -0400 fix(registration): Make Username optional (#831) * fix(User.js): update validation schema for username field, allow empty string as a valid value fix(validators.js): update validation schema for username field, allow empty string as a valid value fix(Registration.tsx, validators.js): update validation rules for name and username fields, change minimum length to 2 and maximum length to 80, assure they match and allow empty string as a valid value fix(Eng.tsx): update localization string for com_auth_username, indicate that it is optional * fix(User.js): update regex pattern for username validation to allow special characters @#$%&*() fix(validators.js): update regex pattern for username validation to allow special characters @#$%&*() * fix(Registration.spec.tsx): fix validation error message for username length requirement commitd38e463d34Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Wed Aug 23 13:44:40 2023 -0400 fix(bingAI): markdown and error formatting for final stream response (#829) * fix(bingAI): markdown formatting for final stream response due to new strict payload validation on the frontend * fix: add missing prop to bing Error response commit7dc27b10f1Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Tue Aug 22 18:44:59 2023 -0400 feat: Edit AI Messages, Edit Messages in Place (#825) * refactor: replace lodash import with specific function import fix(api): esm imports to cjs * refactor(Messages.tsx): convert to TS, out-source scrollToDiv logic to a custom hook fix(ScreenshotContext.tsx): change Ref to RefObject in ScreenshotContextType feat(useScrollToRef.ts): add useScrollToRef hook for scrolling to a ref with throttle fix(Chat.tsx): update import path for Messages component fix(Search.tsx): update import path for Messages component * chore(types.ts): add TAskProps and TOptions types refactor(useMessageHandler.ts): use TAskFunction type for ask function signature * refactor(Message/Content): convert to TS, move Plugin component to Content dir * feat(MessageContent.tsx): add MessageContent component for displaying and editing message content feat(index.ts): export MessageContent component from Messages/Content directory * wip(Message.jsx): conversion and use of new component in progress * refactor: convert Message.jsx to TS and fix typing/imports based on changes * refactor: add typed props and refactor MultiMessage to TS, fix typing issues resulting from the conversion * edit message in progress * feat: complete edit AI message logic, refactor continue logic * feat(middleware): add validateMessageReq middleware feat(routes): add validation for message requests using validateMessageReq middleware feat(routes): add create, read, update, and delete routes for messages * feat: complete frontend logic for editing messages in place feat(messages.js): update route for updating a specific message - Change the route for updating a message to include the messageId in the URL - Update the request handler to use the messageId from the request parameters and the text from the request body - Call the updateMessage function with the updated parameters feat(MessageContent.tsx): add functionality to update a message - Import the useUpdateMessageMutation hook from the data provider - Destructure the conversationId, parentMessageId, and messageId from the message object - Create a mutation function using the useUpdateMessageMutation hook - Implement the updateMessage function to call the mutation function with the updated message parameters - Update the messages state to reflect the updated message text feat(api-endpoints.ts): update messages endpoint to include messageId - Update the messages endpoint to include the messageId as an optional parameter feat(data-service.ts): add updateMessage function - Implement the updateMessage function to make a PUT request to * fix(messages.js): make updateMessage function asynchronous and await its execution * style(EditIcon): make icon active for AI message * feat(gptPlugins/anthropic): add edit support * fix(validateMessageReq.js): handle case when conversationId is 'new' and return empty array feat(Message.tsx): pass message prop to SiblingSwitch component refactor(SiblingSwitch.tsx): convert to TS * fix(useMessageHandler.ts): remove message from currentMessages if isContinued is true feat(useMessageHandler.ts): add support for submission messages in setMessages fix(useServerStream.ts): remove unnecessary conditional in setMessages fix(useServerStream.ts): remove isContinued variable from submission * fix(continue): switch to continued message generation when continuing an earlier branch in conversation * fix(abortMiddleware.js): fix condition to check partialText length chore(abortMiddleware.js): add error logging when abortMessage fails * refactor(MessageHeader.tsx): convert to TS fix(Plugin.tsx): add default value for className prop in Plugin component * refactor(MultiMessage.tsx): remove commented out code docs(MultiMessage.tsx): update comment to clarify when siblingIdx is reset * fix(GenerationButtons): optimistic state for continue button * fix(MessageContent.tsx): add data-testid attribute to message text editor fix(messages.spec.ts): update waitForServerStream function to include edit endpoint check feat(messages.spec.ts): add test case for editing messages * fix(HoverButtons & Message & useGenerations): Refactor edit functionality and related conditions - Update enterEdit function signature and prop - Create and utilize hideEditButton variable - Enhance conditions for edit button visibility and active state - Update button event handlers - Introduce isEditableEndpoint in useGenerations and refine continueSupported condition. * fix(useGenerations.ts): fix condition for hideEditButton to include error and searchResult chore(data-provider): bump version to 0.1.6 fix(types.ts): add status property to TError type * chore: bump @dqbd/tiktoken to 1.0.7 * fix(abortMiddleware.js): add required isCreatedByUser property to the error response object * refactor(Message.tsx): remove unnecessary props from SiblingSwitch component, as setLatestMessage is firing on every switch already refactor(SiblingSwitch.tsx): remove unused imports and code * chore(BaseClient.js): move console.debug statements back inside if block commitdb77163f5dAuthor: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Tue Aug 22 14:15:14 2023 +0200 docs: update chimeragpt (#826) * Update free_ai_apis.md * Update free_ai_apis.md commit4a4e803df3Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Mon Aug 21 20:15:18 2023 +0200 style(Dialog): Improved Close Button ("X") position (#824) commit909b00c752Author: Daniel Avila <messagedaniel@protonmail.com> Date: Sun Aug 20 21:04:36 2023 -0400 fix(HoverButtons): light/dark styling to match official site commit61dcb4d307Author: Naosuke Yokoe <ankerasoy@gmail.com> Date: Sat Aug 19 20:11:31 2023 +0900 feat: Azure Cognitive Search Plugin (#815) * feat(AzureCognitiveSearchPlugin) * feat(tools/AzureCognitiveSearch.js): Add a new plugin (not structured version) * feat(tools/structured/AzureCognitiveSearch.js): Add a new plugin (structured version) * feat(tools/manifest.json, tools/index.js, tools/util/handleTools.js): Add configurations for the plugin * feat(api/package.json, package-lock.json): Installed a new package for the plugin (@azure/search-documents) * feat(.env.example): Add new environment variables for the plugin Here is the link to the corresponding discussion page: https://github.com/danny-avila/LibreChat/discussions/567 * docs(AzureCognitiveSearchPlugin) * docs(features/plugins/azure_cognitive_search.md): Add a new document for the plugin * (fix:.env.example) * reverted extra whitespaces removed by the editor * docs(mkdocs.yml) * Add the Azure Cognitive Search Plugin's documentation item to mkdocs.yml. commit3c7f67fa76Author: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 18 12:40:33 2023 -0400 fix(abortMiddleware): handle early abort error where userMessage.conversationId is undefined. In this case, the userId will be used as the abortKey commitc74c68a135Author: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 18 12:10:30 2023 -0400 refactor(MessageHandler -> useServerStream): convert all relating files to TS and correct typings based on this change: properly refactor MessageHandler to a custom hook, where it's passed a submission object to instantiate the stream. This is the bare minimum groundwork for potentially having multiple streams running, which would be a big project to modularize a lot of the global state into maps/multiple streams, particular useful for having multiple views in place commit8b4d3c2c21Author: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 18 12:04:29 2023 -0400 refactor(routes): convert to TS commitd612cfcb45Author: Danny Avila <messagedaniel@protonmail.com> Date: Fri Aug 18 12:02:39 2023 -0400 chore(Auth): reorder exports in Auth component fix(PluginAuthForm): handle case when pluginKey is null or undefined fix(PluginStoreDialog): handle case when getAvailablePluginFromKey is null or undefined fix(AuthContext): make authConfig optional in AuthContextProvider feat(hooks): add useServerStream hook fix(conversation): setSubmission to null instead of empty object fix(preset): specify type for presets atom fix(search): specify type for isSearchEnabled atom fix(submission): specify type for submission atom commitc40b95f424Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Fri Aug 18 16:11:00 2023 +0200 feat: Disable Registration with social login (#813) * Google, Github and Discord * update .env.example with ALLOW_SOCIAL_REGISTRATION * fix some conflict * refactor strategy * Update user_auth_system.md * Update user_auth_system.md commit46ed5aaccdAuthor: Patrick <psarnowski@gmail.com> Date: Fri Aug 18 09:38:24 2023 -0400 Show the response scores from Bing. (#814) commit1dacfa49f0Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Thu Aug 17 20:32:31 2023 +0200 update profile picture (#792) commitafd43afb60Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Thu Aug 17 12:50:05 2023 -0400 feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) * feat(useMessageHandler.js/ts): Refactor and add features to handle user messages, support multiple endpoints/models, generate placeholder responses, regeneration, and stopGeneration function fix(conversation.ts, buildTree.ts): Import TMessage type, handle null parentMessageId feat(schemas.ts): Update and add schemas for various AI services, add default values, optional fields, and endpoint-to-schema mapping, create parseConvo function chore(useMessageHandler.js, schemas.ts): Remove unused imports, variables, and chatGPT enum * wip: add generation buttons * refactor(cleanupPreset.ts): simplify cleanupPreset function refactor(getDefaultConversation.js): remove unused code and simplify getDefaultConversation function feat(utils): add getDefaultConversation function This commit adds a new utility function called `getDefaultConversation` to the `client/src/utils/getDefaultConversation.ts` file. This function is responsible for generating a default conversation object based on the provided parameters. The `getDefaultConversation` function takes in an object with the following properties: - `conversation`: The conversation object to be used as a base. - `endpointsConfig`: The configuration object containing information about the available endpoints. - `preset`: An optional preset object that can be used to override the default behavior. The function first tries to determine the target endpoint based on the preset object. If a valid endpoint is found, it is used as the target endpoint. If not, the function tries to retrieve the last conversation setup from the local storage and uses its endpoint if it is valid. If neither the preset nor the local storage contains a valid endpoint, the function falls back to a default endpoint. Once the target endpoint is determined, * fix(utils): remove console.error statement in buildDefaultConversation function fix(schemas): add default values for catch blocks in openAISchema, googleSchema, bingAISchema, anthropicSchema, chatGPTBrowserSchema, and gptPluginsSchema * fix: endpoint not changing on change of preset from other endpoint, wip: refactor * refactor: preset items to TSX * refactor: convert resetConvo to TS * refactor(getDefaultConversation.ts): move defaultEndpoints array to the top of the file for better readability refactor(getDefaultConversation.ts): extract getDefaultEndpoint function for better code organization and reusability * feat(svg): add ContinueIcon component feat(svg): add RegenerateIcon component feat(svg): add ContinueIcon and RegenerateIcon components to index.ts * feat(Button.tsx): add onClick and className props to Button component feat(GenerationButtons.tsx): add logic to display Regenerate or StopGenerating button based on isSubmitting and messages feat(Regenerate.tsx): create Regenerate component with RegenerateIcon and handleRegenerate function feat(StopGenerating.tsx): create StopGenerating component with StopGeneratingIcon and handleStopGenerating function * fix(TextChat.jsx): reorder imports and variables for better readability fix(TextChat.jsx): fix typo in condition for isNotAppendable variable fix(TextChat.jsx): remove unused handleStopGenerating function fix(ContinueIcon.tsx): remove unnecessary closing tags for polygon elements fix(useMessageHandler.ts): add missing type annotations for handleStopGenerating and handleRegenerate functions fix(useMessageHandler.ts): remove unused variables in return statement * fix(getDefaultConversation.ts): refactor code to use getLocalStorageItems function feat(getLocalStorageItems.ts): add utility function to retrieve items from local storage * fix(OpenAIClient.js): add support for streaming result in sendCompletion method feat(OpenAIClient.js): add finish_reason metadata to opts in sendCompletion method feat(Message.js): add finish_reason field to Message model feat(messageSchema.js): add finish_reason field to messageSchema feat(openAI.js): parse chatGptLabel and promptPrefix from req.body and pass rest of the modelOptions to endpointOption feat(openAI.js): add addMetadata function to store metadata in ask function feat(openAI.js): add metadata to response if available feat(schemas.ts): add finish_reason field to tMessageSchema * feat(types.ts): add TOnClick and TGenButtonProps types for button components feat(Continue.tsx): create Continue component for generating button feat(GenerationButtons.tsx): update GenerationButtons component to use Continue component feat(Regenerate.tsx): create Regenerate component for regenerating button feat(Stop.tsx): create Stop component for stop generating button * feat(MessageHandler.jsx): add MessageHandler component to handle messages and conversations fix(Root.jsx): fix import paths for Nav and MessageHandler components * feat(useMessageHandler.ts): add support for generation parameter in ask function feat(useMessageHandler.ts): add support for isEdited parameter in ask function feat(useMessageHandler.ts): add support for continueGeneration function fix(createPayload.ts): replace endpoint URL when isEdited parameter is true * chore(client): set skipLibCheck to true in tsconfig.json * fix(useMessageHandler.ts): remove unused clientId variable fix(schemas.ts): make clientId field in tMessageSchema nullable and optional * wip: edit route for continue generation * refactor(api): move handlers to root of routes dir * fix(useMessageHandler.ts): initialize currentMessages to an empty array if messages is null fix(useMessageHandler.ts): update initialResponse text to use responseText variable fix(useMessageHandler.ts): update setMessages logic for isRegenerate case fix(MessageHandler.jsx): update setMessages logic for cancelHandler, createdHandler, and finalHandler * fix(schemas.ts): make createdAt and updatedAt fields optional and set default values using new Date().toISOString() fix(schemas.ts): change type annotation of TMessage from infer to input * refactor(useMessageHandler.ts): rename AskProps type to TAskProps refactor(useMessageHandler.ts): remove generation property from ask function arguments refactor(useMessageHandler.ts): use nullish coalescing operator (??) instead of logical OR (||) refactor(useMessageHandler.ts): pass the responseMessageId to message prop of submission * fix(BaseClient.js): use nullish coalescing operator (??) instead of logical OR (||) for default values * fix(BaseClient.js): fix responseMessageId assignment in handleStartMethods method feat(BaseClient.js): add support for isEdited flag in sendMessage method feat(BaseClient.js): add generation to responseMessage text in sendMessage method * fix(openAI.js): remove unused imports and commented out code feat(openAI.js): add support for generation parameter in request body fix(openAI.js): remove console.log statement fix(openAI.js): remove unused variables and parameters fix(openAI.js): update response text in case of error fix(openAI.js): handle error and abort message in case of error fix(handlers.js): add generation parameter to createOnProgress function fix(useMessageHandler.ts): update responseText variable to use generation parameter * refactor(api/middleware): move inside server dir * refactor: add endpoint specific, modular functions to build options and initialize clients, create server/utils, move middleware, separate utils into api general utils and server specific utils * fix(abortMiddleware.js): import getConvo and getConvoTitle functions from models feat(abortMiddleware.js): add abortAsk function to abortController to handle aborting of requests fix(openAI.js): import buildOptions and initializeClient functions from endpoints/openAI refactor(openAI.js): use getAbortData function to get data for abortAsk function * refactor: move endpoint specific logic to an endpoints dir * refactor(PluginService.js): fix import path for encrypt and decrypt functions in PluginService.js * feat(openAI): add new endpoint for adding a title to a conversation - Added a new file `addTitle.js` in the `api/server/routes/endpoints/openAI` directory. - The `addTitle.js` file exports a function `addTitle` that takes in request parameters and performs the following actions: - If the `parentMessageId` is `'00000000-0000-0000-0000-000000000000'` and `newConvo` is true, it proceeds with the following steps: - Calls the `titleConvo` function from the `titleConvo` module, passing in the necessary parameters. - Calls the `saveConvo` function from the `saveConvo` module, passing in the user ID and conversation details. - Updated the `index.js` file in the `api/server/routes/endpoints/openAI` directory to export the `addTitle` function. - This change adds * fix(abortMiddleware.js): remove console.log statement refactor(gptPlugins.js): update imports and function parameters feat(gptPlugins.js): add support for abortController and getAbortData refactor(openAI.js): update imports and function parameters feat(openAI.js): add support for abortController and getAbortData fix(openAI.js): refactor code to use modularized functions and middleware fix(buildOptions.js): refactor code to use destructuring and update variable names * refactor(askChatGPTBrowser.js, bingAI.js, google.js): remove duplicate code for setting response headers feat(askChatGPTBrowser.js, bingAI.js, google.js): add setHeaders middleware to set response headers * feat(middleware): validateEndpoint, refactor buildOption to only be concerned of endpointOption * fix(abortMiddleware.js): add 'finish_reason' property with value 'incomplete' to responseMessage object fix(abortMessage.js): remove console.log statement for aborted message fix(handlers.js): modify tokens assignment to handle empty generation string and trailing space * fix(BaseClient.js): import addSpaceIfNeeded function from server/utils fix(BaseClient.js): add space before generation in text property fix(index.js): remove getCitations and citeText exports feat(buildEndpointOption.js): add buildEndpointOption middleware fix(index.js): import buildEndpointOption middleware fix(anthropic.js): remove buildOptions function and use endpointOption from req.body fix(gptPlugins.js): remove buildOptions function and use endpointOption from req.body fix(openAI.js): remove buildOptions function and use endpointOption from req.body feat(utils): add citations.js and handleText.js modules fix(utils): fix import statements in index.js module * refactor(gptPlugins.js): use getResponseSender function from librechat-data-provider * feat(gptPlugins): complete 'continue generating' * wip: anthropic continue regen * feat(middleware): add validateRegistration middleware A new middleware function called `validateRegistration` has been added to the list of exported middleware functions in `index.js`. This middleware is responsible for validating registration data before allowing the registration process to proceed. * feat(Anthropic): complete continue regen * chore: add librechat-data-provider to api/package.json * fix(ci): backend-review will mock meilisearch, also installs data-provider as now needed * chore(ci): remove unneeded SEARCH env var * style(GenerationButtons): make text shorter for sake of space economy, even though this diverges from chat.openai.com * style(GenerationButtons/ScrollToBottom): adjust visibility/position based on screen size * chore(client): 'Editting' typo * feat(GenerationButtons.tsx): add support for endpoint prop in GenerationButtons component feat(OptionsBar.tsx): pass endpoint prop to GenerationButtons component feat(useGenerations.ts): create useGenerations hook to handle generation logic fix(schemas.ts): add searchResult field to tMessageSchema * refactor(HoverButtons): convert to TSX and utilize new useGenerations hook * fix(abortMiddleware): handle error with res headers set, or abortController not found, to ensure proper API error is sent to the client, chore(BaseClient): remove console log for onStart message meant for debugging * refactor(api): remove librechat-data-provider dep for now as it complicates deployed docker build stage, re-use code in CJS, located in server/endpoints/schemas * chore: remove console.logs from test files * ci: add backend tests for AnthropicClient, focusing on new buildMessages logic * refactor(FakeClient): use actual BaseClient sendMessage method for testing * test(BaseClient.test.js): add test for loading chat history test(BaseClient.test.js): add test for sendMessage logic with isEdited flag * fix(buildEndpointOption.js): add support for azureOpenAI in buildFunction object wip(endpoints.js): fetch Azure models from Azure OpenAI API if opts.azure is true * fix(Button.tsx): add data-testid attribute to button component fix(SelectDropDown.tsx): add data-testid attribute to Listbox.Button component fix(messages.spec.ts): add waitForServerStream function to consolidate logic for awaiting the server response feat(messages.spec.ts): add test for stopping and continuing message and improve browser/page context order and closing * refactor(onProgress): speed up time to save initial message for editable routes * chore: disable AI message editing (for now), was accidentally allowed * refactor: ensure continue is only supported for latest message style: improve styling in dark mode and across all hover buttons/icons, including making edit icon for AI invisible (for now) * fix: add test id to generation buttons so they never resolve to 2+ items * chore(package.json): add 'packages/' to the list of ignored directories chore(data-provider/package.json): bump version to 0.1.5 commitae5b7d3d53Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Tue Aug 15 18:27:54 2023 -0400 fix(PluginsClient.js): fix ChatOpenAI Azure Config Issue (#812) * fix(PluginsClient.js): fix issue with creating LLM when using Azure * chore(PluginsClient.js): omit azure logging * refactor(PluginsClient.js): simplify assignment of azure variable The code was simplified by directly assigning the value of `this.azure` to the `azure` variable using object destructuring. This makes the code cleaner and more concise. commitb85f3bf91eAuthor: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Tue Aug 15 18:42:24 2023 +0200 update from lang to localize (#810) commit80aab73bf6Author: Danny Avila <messagedaniel@protonmail.com> Date: Mon Aug 14 19:19:04 2023 -0400 chore: rebuilt package-lock file commitbbe4931a97Author: Danny Avila <messagedaniel@protonmail.com> Date: Mon Aug 14 19:13:24 2023 -0400 refactor(ScreenshotContext): use html-to-image for lighter bundle, faster processing commit74802dd720Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Mon Aug 14 17:51:03 2023 +0200 chore: Translation Fixes, Lint Error Corrections, and Additional Translations (#788) * fix translation and small lint error * changed from localize to useLocalize hook * changed to useLocalize commitb64cc71d88Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 14 10:23:00 2023 -0400 chore(docker-compose.yml): comment out meilisearch ports in docker-compose.yml (#807) commit89f260bc78Author: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 14 10:12:00 2023 -0400 fix(CodeBlock.tsx): fix copy-to-clipboard functionality. The code has been updated to use the copy function from the copy-to-clipboard library instead of the (#806) avigator.clipboard.writeText method. This should fix the issue with browser incompatibility with navigator SDK and allow users to copy code from the CodeBlock component successfully. commitd00c7354cdAuthor: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Mon Aug 14 09:45:44 2023 -0400 fix: Corrected Registration Validation, Case-Insensitive Variable Handling, Playwright workflow (#805) * feat(auth.js): add validation for registration endpoint using validateRegistration middleware feat(validateRegistration.js): add middleware to validate registration based on ALLOW_REGISTRATION environment variable * fix(config.js): fix registrationEnabled and socialLoginEnabled variables to handle case-insensitive environment variable values * refactor(validateRegistration.js): remove console.log statement * chore(playwright.yml): skip browser download during yarn install chore(playwright.yml): place Playwright binaries to node_modules/@playwright/test chore(playwright.yml): install Playwright dependencies using npx playwright install-deps chore(playwright.yml): install Playwright chromium browser using npx playwright install chromium chore(playwright.yml): install @playwright/test@latest using npm install -D @playwright/test@latest chore(playwright.yml): run Playwright tests using npm run e2e:ci * chore(playwright.yml): change npm install order and update comment The order of the npm install commands in the "Install Playwright Browsers" step has been changed to first install @playwright/test@latest and then install chromium. Additionally, the comment explaining the PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD variable has been updated to mention npm install instead of yarn install. * chore(playwright.yml): remove commented out code for caching and add separate steps for installing Playwright dependencies and browsers commit1aa4b34dc6Author: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Fri Aug 11 19:02:52 2023 +0200 added the dot (.) username rules (#787)
This commit is contained in:
parent
7e8bae2d9a
commit
ed4b25b2c1
250 changed files with 10111 additions and 24812 deletions
|
|
@ -1,80 +0,0 @@
|
|||
# How to add a language to LibreChat
|
||||
|
||||
## Minimum Requirements:
|
||||
|
||||
1. Good knowledge of the language (some terms may undergo significant changes during translation)
|
||||
2. An editor, which can be Notepad or (**recommended**: [VSCode](https://code.visualstudio.com/download))
|
||||
|
||||
## Language translation
|
||||
|
||||
|
||||
1. Fork the LibreChat repository and download it using git clone https://github.com/danny-avila/LibreChat
|
||||
2. Navigate to the "client\src\localization" folder and open the "Translation.tsx" file
|
||||
3. At the beginning of the code, add your language below all the others in this format:
|
||||
|
||||
`import Language-name from './languages/** ';`
|
||||
|
||||
For example, let's take English as an example:
|
||||
|
||||
Note: Replace "LanguageName" with the name of your language (capitalized) and "**" with the ISO 3166 Alpha-2 code of your country (the initial of the nation).
|
||||
If you don't know the ISO 3166 code for your language, check it [here](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) and also use it with an initial capital)
|
||||
|
||||
4. Further down in the code, add the following
|
||||
|
||||
`if (langCode === '**') return Language-name;`
|
||||
|
||||
Replace "**" with the ISO 3166 Alpha-2 code of your language (in lowercase). Here's an example: `if (langCode === 'en') return English;`)
|
||||
|
||||
7.Go into the "languages" folder and create a file named as follows: **.tsx
|
||||
|
||||
For example: En.tsx
|
||||
|
||||
9. Copy all the content from En.tsx into your file and modify it as follows:
|
||||
|
||||
```
|
||||
// your-language-name phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'Examples',
|
||||
// Add more translations here
|
||||
```
|
||||
|
||||
Rename only the part after the colon ":" to the corresponding translation in your language. For example:
|
||||
|
||||
```
|
||||
// my-language phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'WORD_THAT_I_TRANSLATE_IN_TO_MY_LANGUAGE',
|
||||
// Add more translations here
|
||||
};
|
||||
```
|
||||
|
||||
⚠️DO NOT CHANGE com_... ⚠️
|
||||
|
||||
10. To add your language to the menu, open the file "client\src\components\Nav\SettingsTabs\General.tsx" and add your language to the "LangSelector" variable in the following way:
|
||||
|
||||
```
|
||||
export const LangSelector = ({
|
||||
//other code
|
||||
<option value="en">{localize(lang, 'com_nav_lang_english')}</option>
|
||||
//other languages...
|
||||
<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
where ** is the ISO 3166 Alpha-2 code and "com_nav_lang_your-language-name" stands for the name in your language (for example com_nav_lang_english or com_nav_lang_italian)
|
||||
The only line of code to add is:
|
||||
|
||||
`<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>`
|
||||
|
||||
11. Commit your changes using git add *, git commit -m "Language translation: your-language translation" and git push.
|
||||
12. Open your repository in a browser and click on "Contribute"
|
||||
|
||||

|
||||
|
||||
14. Answer all the questions, and in the "Type of Change" section, add `- [x] Translation support`
|
||||
15. Create a pull request 🎉
|
||||
113
docs/contributions/translation_contribution.md
Normal file
113
docs/contributions/translation_contribution.md
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
# How to add a new language to LibreChat 🌍
|
||||
|
||||
## Minimum Requirements:
|
||||
|
||||
1. Good knowledge of the language (some terms may undergo significant changes during translation)
|
||||
2. A text editor is required. While options like Notepad or Notepad++ are available, it is recommended to use **[VSCode](https://code.visualstudio.com/download)** as it is more suitable for this task..
|
||||
|
||||
## Language Translation
|
||||
|
||||
### Preparation
|
||||
Fork the [LibreChat repository](https://github.com/danny-avila/LibreChat) and download it using git clone
|
||||
|
||||
### Add your language to `Translation.tsx`:
|
||||
- Navigate to the `client\src\localization` folder and open the `Translation.tsx` file
|
||||
|
||||
- At the beginning of the code, add your language below all the others in this format:
|
||||
|
||||
`import Language-name from './languages/** ';`
|
||||
Example (English):`import English from './languages/Eng';`
|
||||
|
||||
- Further down in the code, add the following:
|
||||
|
||||
`if (langCode === '**') return Language-name;`
|
||||
|
||||
>Replace "**" with the ISO 3166 Alpha-2 code of your language (in lowercase).
|
||||
Example (English): `if (langCode === 'en') return English;`
|
||||
|
||||
>If you don't know the ISO 3166 code for your language, check it [here](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) and also use it with an initial capital)
|
||||
|
||||
### Create your new language file
|
||||
- Go into the `client\src\localization\languages` folder and create a file named as follows: `**.tsx`
|
||||
|
||||
Example: `Eng.tsx`
|
||||
|
||||
- Copy all the content from `Eng.tsx` into your file and modify it as follows:
|
||||
|
||||
```js
|
||||
// your-language-name phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'Examples',
|
||||
// more translations here...
|
||||
```
|
||||
|
||||
__Translate only the part after the `:`.__
|
||||
Example:
|
||||
|
||||
```js
|
||||
// my-language phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'This is a translated example',
|
||||
// Add more translations here
|
||||
};
|
||||
```
|
||||
|
||||
⚠️ Do not modify the `com_...` part ⚠️
|
||||
|
||||
> Delete the Language list after `com_nav_setting_general: 'General',` near the bottom of the file (You do not need to translate the individual language names)
|
||||
|
||||
|
||||
### Add your language to `Eng.tsx`
|
||||
Open `Eng.tsx` and add your language to the language list in the bottom of the document.
|
||||
|
||||
### Add your language to the menu
|
||||
To add your language to the menu, open the file `client\src\components\Nav\SettingsTabs\General.tsx`.
|
||||
Add your language to the `LangSelector` variable in the following way:
|
||||
|
||||
```js
|
||||
export const LangSelector = ({
|
||||
//other code
|
||||
<option value="en">{localize(lang, 'com_nav_lang_english')}</option>
|
||||
//other languages...
|
||||
<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
Where `**` is the ISO 3166 Alpha-2 code and `com_nav_lang_your-language-name` stands for the name of your language.
|
||||
Example: `com_nav_lang_english` or `com_nav_lang_italian`
|
||||
|
||||
**You should only need to add one line of code:**
|
||||
```js
|
||||
<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>
|
||||
```
|
||||
|
||||
### Summary
|
||||
If you followed everything you should have __one__ new file and __3__ files with modifications:
|
||||
|
||||
```bash
|
||||
new file: client/src/localization/languages/**.tsx <-----new language
|
||||
modified: client/src/components/Nav/SettingsTabs/General.tsx
|
||||
modified: client/src/localization/Translation.tsx
|
||||
modified: client/src/localization/languages/Eng.tsx
|
||||
```
|
||||
|
||||
You can confirm this by using the following command: `git status`
|
||||
|
||||
### Commit and create a new PR
|
||||
- Commit your changes using:
|
||||
- `git add *`
|
||||
- `git commit -m "Language translation: your-language translation"`
|
||||
- `git push`
|
||||
|
||||
- Open your repository in a browser and click on "Contribute"
|
||||
|
||||

|
||||
|
||||
- Answer all the questions, and in the "Type of Change" section, add `- [x] Translation support`
|
||||
- Delete irrelevant comments from the template
|
||||
- Create a pull request 🎉
|
||||
|
|
@ -21,24 +21,28 @@ Digital Ocean is also my preferred choice for testing deployment, as it comes wi
|
|||
## Table of Contents
|
||||
|
||||
- **[Part I: Starting from Zero](#part-i-starting-from-zero)**
|
||||
- [1. DigitalOcean signup](#1-click-here-or-on-the-banner-above-to-get-started-on-digitalocean)
|
||||
- [2. Access console](#2-access-your-droplet-console)
|
||||
- [3. Console user setup](#3-once-you-have-logged-in-immediately-create-a-new-non-root-user)
|
||||
- [1. DigitalOcean signup](#1-click-here-or-on-the-banner-above-to-get-started-on-digitalocean)
|
||||
- [2. Access console](#2-access-your-droplet-console)
|
||||
- [3. Console user setup](#3-once-you-have-logged-in-immediately-create-a-new-non-root-user)
|
||||
- [4. Firewall Setup](#4-firewall-setup)
|
||||
- **[Part II: Installing Docker & Other Dependencies](#part-ii-installing-docker-and-other-dependencies)**
|
||||
- [1. Update and Install Docker dependencies](#1-update-and-install-docker-dependencies)
|
||||
- [2. Add Docker Repository to APT Sources](#2-add-docker-repository-to-apt-sources)
|
||||
- [3. Install Docker](#3-install-docker)
|
||||
- [4. Verify Docker](#4-verify-that-docker-is-running-on-ubuntu)
|
||||
- [5. Install the Latest Version of Docker Compose](#5-install-the-latest-version-of-docker-compose)
|
||||
- [6. Install git & npm](#6-as-part-of-this-guide-i-will-recommend-you-have-git-and-npm-installed)
|
||||
- [1. Update and Install Docker dependencies](#1-update-and-install-docker-dependencies)
|
||||
- [2. Add Docker Repository to APT Sources](#2-add-docker-repository-to-apt-sources)
|
||||
- [3. Install Docker](#3-install-docker)
|
||||
- [4. Verify Docker](#4-verify-that-docker-is-running-on-ubuntu)
|
||||
- [5. Install the Latest Version of Docker Compose](#5-install-the-latest-version-of-docker-compose)
|
||||
- [6. Install git & npm](#6-as-part-of-this-guide-i-will-recommend-you-have-git-and-npm-installed)
|
||||
- **[Part III: Setup LibreChat](#part-iii-setup-librechat)**
|
||||
- [1. Clone down the repo](#1-clone-down-the-repo)
|
||||
- [2. Create a global environment file](#2-create-a-global-environment-file)
|
||||
- [3. Start docker and run LibreChat](#3-start-docker-and-then-run-the-installationupdate-script)
|
||||
- [4. Access LibreChat](#4-once-the-app-is-running-you-can-access-it-at-httpyourserverip)
|
||||
- [1. Clone down the repo](#1-clone-down-the-repo)
|
||||
- [2. Create a global environment file](#2-create-a-global-environment-file)
|
||||
- [3. Start docker and run LibreChat](#3-start-docker-and-then-run-the-installationupdate-script)
|
||||
- [4. Access LibreChat](#4-once-the-app-is-running-you-can-access-it-at-httpyourserverip)
|
||||
- **[Part IV: Updating LibreChat](#part-iv-updating-librechat)**
|
||||
- **[Part V: Editing the NGINX file (optional)](#part-v-editing-the-nginx-file-for-custom-domains-and-advanced-configs)**
|
||||
|
||||
> The last sections are all optional configurations
|
||||
|
||||
- **[Part V: Editing the NGINX file](#part-v-editing-the-nginx-file-for-custom-domains-and-advanced-configs)**
|
||||
- **[Part VI: Use the Latest Stable Release instead of Latest Main Branch](#part-vi-use-the-latest-stable-release-instead-of-latest-main-branch)**
|
||||
|
||||
## Part I: Starting from Zero:
|
||||
|
||||
|
|
@ -120,6 +124,18 @@ getent group sudo | cut -d: -f4
|
|||
su - <yourusername>
|
||||
```
|
||||
|
||||
### **4. Firewall Setup**
|
||||
|
||||
It's highly recommended you setup a simple firewall for your setup.
|
||||
|
||||
Click on your droplet from the projects page again, and goto the Networking tab on the left-hand side under your ipv4:
|
||||
|
||||

|
||||
|
||||
Create a firewall, add your droplet to it, and add these inbound rules (will work for this guide, but configure as needed)
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
### Part II: Installing Docker and Other Dependencies:
|
||||
|
|
@ -287,13 +303,22 @@ cd LibreChat/
|
|||
```
|
||||
|
||||
### **2. Create a global environment file.**
|
||||
The default values are enough to get you started and running the app! API credentials can be provided when accessing the web app.
|
||||
The default values are enough to get you started and running the app.
|
||||
|
||||
```bash
|
||||
# Copies the example file as your global env file
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
However, it's highly recommended you use environment variables for any sensitive credentials until we remove use of localStorage for passing credentials from the frontend
|
||||
|
||||
```bash
|
||||
nano .env
|
||||
|
||||
# then, add your credentials
|
||||
OPENAI_API_KEY=sk-yourKey
|
||||
```
|
||||
|
||||
**That's it!**
|
||||
|
||||
For thorough configuration, however, you should edit your .env file as needed, and do read the comments in the file and the resources below.
|
||||
|
|
@ -447,8 +472,7 @@ You should be all set!
|
|||
|
||||
> Note that any changes to the code in this environment won't be reflected because the compose file is pulling the docker images built automatically by GitHub
|
||||
|
||||
<!-- TODO: since the api images are not part of the tag workflow yet
|
||||
## Part VI: Latest Stable Release vs. Latest Release (editing the compose file)
|
||||
## Part VI: Use the Latest Stable Release instead of Latest Main Branch
|
||||
|
||||
By default, this setup will pull the latest updates to the main branch of Librechat. If you would rather have the latest "stable" release, which is defined by the [latest tags](https://github.com/danny-avila/LibreChat/releases), you will need to edit deploy-compose.yml and commit your changes exactly as above in Part V.
|
||||
|
||||
|
|
@ -457,8 +481,14 @@ Let's edit `deploy-compose.yml`:
|
|||
```bash
|
||||
nano deploy-compose.yml
|
||||
```
|
||||
-->
|
||||
|
||||
Change `librechat-dev-api` to `librechat-api`:
|
||||
|
||||
```yaml
|
||||
image: ghcr.io/danny-avila/librechat-api:latest
|
||||
```
|
||||
|
||||
Stage and commit as in Part V, and you're all set!
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
91
docs/deployment/huggingface.md
Normal file
91
docs/deployment/huggingface.md
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# Hugging Face Deployment 🤗
|
||||
|
||||
>#### ⚠️ Note - Some features are not supported by HuggingFace:
|
||||
>- Meilisearch
|
||||
>- Social Logins
|
||||
|
||||
> #### ❗Also:
|
||||
>- You will have to create an online MongoDB Atlas Database to be able to properly deploy
|
||||
|
||||
## Create and Configure your Database (Required)
|
||||
|
||||
The first thing you need is to create a MongoDB Atlas Database and get your connection string.
|
||||
|
||||
Follow the instructions in this document: [Online MongoDB Database](..\install\mongodb.md)
|
||||
|
||||
## Getting Started
|
||||
|
||||
**1.** Login or Create an account on [Hugging Face](https://huggingface.co/)
|
||||
|
||||
**2.** Visit [https://huggingface.co/spaces/LibreChat/LibreChat](https://huggingface.co/spaces/LibreChat/LibreChat) and click on `Duplicate this Space` to copy LibreChat into your profile
|
||||
|
||||

|
||||
|
||||
**3.** Name your Space and Fill the `Secrets` and `Variables`
|
||||
|
||||
>You can also decide here to make it public or private
|
||||
|
||||

|
||||
|
||||
You will need to fill these values:
|
||||
|
||||
| Secrets | Values |
|
||||
| --- | --- |
|
||||
| MONGO_URI | * use the string aquired in the previous step |
|
||||
| OPENAI_API_KEY | `user_provided` |
|
||||
| BINGAI_TOKEN | `user_provided` |
|
||||
| CHATGPT_TOKEN | `user_provided` |
|
||||
| ANTHROPIC_API_KEY | `user_provided` |
|
||||
| PALM_KEY | `user_provided` |
|
||||
| CREDS_KEY | * see bellow |
|
||||
| CREDS_IV | * see bellow |
|
||||
| JWT_SECRET | * see bellow |
|
||||
| JWT_REFRESH_SECRET | * see bellow |
|
||||
|
||||
> ⬆️ **Leave the value field blank for any endpoints that you wish to disable.**
|
||||
|
||||
>⚠️ setting the API keys and token to `user_provided` allows you to provide them safely from the webUI
|
||||
|
||||
>* For `CREDS_KEY`, `CREDS_IV` and `JWT_SECRET` use this tool: [https://replit.com/@daavila/crypto#index.js](https://replit.com/@daavila/crypto#index.js).
|
||||
>* Run the tool a second time and use the new `JWT_SECRET` value for the `JWT_REFRESH_SECRET`
|
||||
|
||||
| Variables | Values |
|
||||
| --- | --- |
|
||||
| APP_TITLE | LibreChat |
|
||||
| ALLOW_REGISTRATION | true |
|
||||
|
||||
|
||||
## Deployment
|
||||
|
||||
**1.** When you're done filling the `secrets` and `variables`, click `Duplicate Space` in the bottom of that window
|
||||
|
||||

|
||||
|
||||
|
||||
**2.** The project will now build, this will take a couple of minutes
|
||||
|
||||

|
||||
|
||||
|
||||
**3.** When ready, `Building` will change to `Running`
|
||||
|
||||

|
||||
|
||||
And you will be able to access LibreChat!
|
||||
|
||||

|
||||
|
||||
## Update
|
||||
To update LibreChat, simply select `Factory Reboot` from the ⚙️Settings menu
|
||||
|
||||

|
||||
|
||||
|
||||
## Conclusion
|
||||
You can now access it with from the current URL. If you want to access it without the Hugging Face overlay, you can modify this URL template with your info:
|
||||
|
||||
`https://username-projectname.hf.space/`
|
||||
|
||||
e.g. `https://cooluser-librechat.hf.space/`
|
||||
|
||||
### 🎉 Congratulation, you've sucessfully deployed LibreChat on Hugging Face! 🤗
|
||||
|
|
@ -3,11 +3,11 @@
|
|||
## Note:
|
||||
|
||||
Some features will not work:
|
||||
- Bing/Sydney (the IP is blocked by Microsoft)
|
||||
- Bing/Sydney (success may vary)
|
||||
- Meilisearch
|
||||
|
||||
Also:
|
||||
- You will have to create an online MongoDB Atlas Database to be able to properly deploy
|
||||
- You need to create an online MongoDB Atlas Database to be able to properly deploy
|
||||
|
||||
## Create an account
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ Also:
|
|||
| PORT | 3080 |
|
||||
| SESSION_EXPIRY | (1000 * 60 * 60 * 24) * 7 |
|
||||
|
||||
⬆️ **Add a single space in the value field for `BINGAI_TOKEN` and all other endpoints that you wish to disable.**
|
||||
> ⬆️ **Add a single space in the value field for any endpoints that you wish to disable.**
|
||||
|
||||
**DO NOT FORGET TO SAVE YOUR CHANGES**
|
||||
|
||||
|
|
|
|||
57
docs/features/plugins/azure_cognitive_search.md
Normal file
57
docs/features/plugins/azure_cognitive_search.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# Azure Cognitive Search Plugin
|
||||
Through the plugins endpoint, you can use Azure Cognitive Search for answers to your questions with assistance from GPT.
|
||||
|
||||
## Configurations
|
||||
|
||||
### Required
|
||||
|
||||
To get started, you need to get a Azure Cognitive Search endpoint URL, index name, and a API Key. You can then define these as follows in your `.env` file:
|
||||
```env
|
||||
AZURE_COGNITIVE_SEARCH_SERVICE_ENDPOINT="..."
|
||||
AZURE_COGNITIVE_SEARCH_INDEX_NAME="..."
|
||||
AZURE_COGNITIVE_SEARCH_API_KEY="..."
|
||||
```
|
||||
|
||||
### AZURE_COGNITIVE_SEARCH_SERVICE_ENDPOINT
|
||||
|
||||
This is the URL of the search endpoint. It can be obtained from the top page of the search service in the Cognitive Search management console (e.g., 'https://example.search.windows.net').
|
||||
|
||||
### AZURE_COGNITIVE_SEARCH_INDEX_NAME
|
||||
|
||||
This is the name of the index to be searched (e.g., 'hotels-sample-index').
|
||||
|
||||
### AZURE_COGNITIVE_SEARCH_API_KEY
|
||||
|
||||
This is the authentication key to use when utilizing the search endpoint. Please issue it from the management console. Use the Value, not the name of the authentication key.
|
||||
|
||||
### Optional
|
||||
|
||||
The following are configuration values that are not required but can be specified as parameters during a search.
|
||||
|
||||
If there are concerns that the search result data may be too large and exceed the prompt size, consider reducing the size of the search result data by using AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_TOP and AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_SELECT.
|
||||
|
||||
For details on each parameter, please refer to the following document:
|
||||
https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents
|
||||
|
||||
```env
|
||||
AZURE_COGNITIVE_SEARCH_API_VERSION=2023-07-01-Preview
|
||||
AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_QUERY_TYPE=simple
|
||||
AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_TOP=3
|
||||
AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_SELECT=field1,field2,field3
|
||||
```
|
||||
|
||||
#### AZURE_COGNITIVE_SEARCH_API_VERSION
|
||||
|
||||
Specify the version of the search API. When using new features such as semantic search, you may need to specify the preview version. The default value is '2020-06-30'.
|
||||
|
||||
#### AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_QUERY_TYPE
|
||||
|
||||
Specify 'simple' or 'full'. The default value is 'simple'.
|
||||
|
||||
#### AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_TOP
|
||||
|
||||
Specify the number of items to search for. The default value is 5.
|
||||
|
||||
#### AZURE_COGNITIVE_SEARCH_SEARCH_OPTION_SELECT
|
||||
|
||||
Specify the fields of the index to be retrieved, separated by commas. Please note that these are not the fields to be searched.
|
||||
|
|
@ -45,7 +45,7 @@ Download the Plugin manifest file, or copy the raw JSON data into a new file, an
|
|||
|
||||
`api\app\clients\tools\.well-known`
|
||||
|
||||
You should see multiple manifest files that I've already tested/edited and work with LibreChat as of 7/12/23. I've renamed them by their `name_for_model` property and it's recommended, but not required, that you do the same.
|
||||
You should see multiple manifest files that have been tested, or edited, to work with LibreChat. ~~I've renamed them by their `name_for_model` property and it's recommended, but not required, that you do the same.~~ As of v0.5.8, It's **required** to name the manifest JSON file after its `name_for_model` property should you add one yourself.
|
||||
|
||||
After doing so, start/re-start the project server and they should now load in the Plugin store.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
Creating custom plugins for this project involves extending the `Tool` class from the `langchain/tools` module.
|
||||
|
||||
**Note:** I will use the word plugin interchangeably with tool, as the latter is specific to langchain, and we are mainly conforming to the library in this implementation.
|
||||
**Note:** I will use the word plugin interchangeably with tool, as the latter is specific to LangChain, and we are mainly conforming to the library.
|
||||
|
||||
You are essentially creating DynamicTools in Langchain speak. See the [langchainjs docs](https://js.langchain.com/docs/modules/agents/tools/dynamic) for more info.
|
||||
You are essentially creating DynamicTools in LangChain speak. See the [LangChainJS docs](https://js.langchain.com/docs/modules/agents/tools/dynamic) for more info.
|
||||
|
||||
This guide will walk you through the process of creating your own custom plugins, using the `StableDiffusionAPI` and `WolframAlphaAPI` tools as examples.
|
||||
|
||||
The most common implementation is to make an API call based on the natural language input from the AI.
|
||||
When using the Functions Agent (the default mode for plugins), tools are converted to [OpenAI functions](https://openai.com/blog/function-calling-and-other-api-updates); in any case, plugins/tools are invoked conditionally based on the LLM generating a specific format that we parse.
|
||||
|
||||
The most common implementation of a plugin is to make an API call based on the natural language input from the AI, but there is virtually no limit in programmatic use case.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -19,11 +21,11 @@ Here are the key takeaways for creating your own plugin:
|
|||
|
||||
**1.** [**Import Required Modules:**](make_your_own.md#step-1-import-required-modules) Import the necessary modules for your plugin, including the `Tool` class from `langchain/tools` and any other modules your plugin might need.
|
||||
|
||||
**2.** [**Define Your Plugin Class:**](make_your_own.md#step-2-define-your-tool-class) Define a class for your plugin that extends the `Tool` class. Set the `name` and `description` properties in the constructor. If your plugin requires credentials or other variables, set them from the fields parameter or from a method that retrieves them from your process environment.
|
||||
**2.** [**Define Your Plugin Class:**](make_your_own.md#step-2-define-your-tool-class) Define a class for your plugin that extends the `Tool` class. Set the `name` and `description` properties in the constructor. If your plugin requires credentials or other variables, set them from the fields parameter or from a method that retrieves them from your process environment. Note: if your plugin requires long, detailed instructions, you can add a `description_for_model` property and make `description` more general.
|
||||
|
||||
**3.** [**Define Helper Methods:**](make_your_own.md#step-3-define-helper-methods) Define helper methods within your class to handle specific tasks if needed.
|
||||
|
||||
**4.** [**Implement the `_call` Method:**](make_your_own.md#step-4-implement-the-_call-method) Implement the `_call` method where the main functionality of your plugin is defined. This method is called when the language model decides to use your plugin. It should take an `input` parameter and return a result. If an error occurs, the function should return a string representing an error, rather than throwing an error.
|
||||
**4.** [**Implement the `_call` Method:**](make_your_own.md#step-4-implement-the-_call-method) Implement the `_call` method where the main functionality of your plugin is defined. This method is called when the language model decides to use your plugin. It should take an `input` parameter and return a result. If an error occurs, the function should return a string representing an error, rather than throwing an error. If your plugin requires multiple inputs from the LLM, read the [StructuredTools](#StructuredTools) section.
|
||||
|
||||
**5.** [**Export Your Plugin and Import into handleTools.js:**](make_your_own.md#step-5-export-your-plugin-and-import-into-handletoolsjs) Export your plugin and import it into `handleTools.js`. Add your plugin to the `toolConstructors` object in the `loadTools` function. If your plugin requires more advanced initialization, add it to the `customConstructors` object.
|
||||
|
||||
|
|
@ -37,6 +39,14 @@ Remember, the key to creating a custom plugin is to extend the `Tool` class and
|
|||
|
||||
---
|
||||
|
||||
## StructuredTools
|
||||
|
||||
**Multi-Input Plugins**
|
||||
|
||||
If you would like to make a plugin that would benefit from multiple inputs from the LLM, instead of a singular input string as we will review, you need to make a LangChain [StructuredTool](https://blog.langchain.dev/structured-tools/) instead. A detailed guide for this is in progress, but for now, you can look at how I've made StructuredTools in this directory: `api\app\clients\tools\structured\`. This guide is foundational to understanding StructuredTools, and it's recommended you continue reading to better understand LangChain tools first. The blog linked above is also helpful once you've read through this guide.
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Import Required Modules
|
||||
|
||||
Start by importing the necessary modules. This will include the `Tool` class from `langchain/tools` and any other modules your tool might need. For example:
|
||||
|
|
@ -63,11 +73,33 @@ class StableDiffusionAPI extends Tool {
|
|||
}
|
||||
```
|
||||
|
||||
Note that we're getting the necessary variable from the process env with this method if it isn't passed in the fields object.
|
||||
|
||||
A distinction has to be made. The credentials are passed through `fields` when the user provides it from the frontend; otherwise, the admin can "authorize" the plugin through environment variables.
|
||||
**Optional:** As of v0.5.8, when using Functions, you can add longer, more detailed instructions, with the `description_for_model` property. When doing so, it's recommended you make the `description` property more generalized to optimize tokens. Each line in this property is prefixed with `// ` to mirror how the prompt is generated for ChatGPT (chat.openai.com). This format more closely aligns to the prompt engineering of official ChatGPT plugins.
|
||||
|
||||
```js
|
||||
// ...
|
||||
this.description_for_model = `// Generate images and visuals using text with 'stable-diffusion'.
|
||||
// Guidelines:
|
||||
// - ALWAYS use {{"prompt": "7+ detailed keywords", "negative_prompt": "7+ detailed keywords"}} structure for queries.
|
||||
// - Visually describe the moods, details, structures, styles, and/or proportions of the image. Remember, the focus is on visual attributes.
|
||||
// - Craft your input by "showing" and not "telling" the imagery. Think in terms of what you'd want to see in a photograph or a painting.
|
||||
// - Here's an example for generating a realistic portrait photo of a man:
|
||||
// "prompt":"photo of a man in black clothes, half body, high detailed skin, coastline, overcast weather, wind, waves, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3"
|
||||
// "negative_prompt":"semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, out of frame, low quality, ugly, mutation, deformed"
|
||||
// - Generate images only once per human query unless explicitly requested by the user`;
|
||||
this.description = 'You can generate images using text with \'stable-diffusion\'. This tool is exclusively for visual content.';
|
||||
// ...
|
||||
```
|
||||
|
||||
Within the constructor, note that we're getting a sensitive variable from either the fields object or from the **getServerURL** method we define to access an environment variable.
|
||||
|
||||
```js
|
||||
this.url = fields.SD_WEBUI_URL || this.getServerURL();
|
||||
```
|
||||
|
||||
Any credentials necessary are passed through `fields` when the user provides it from the frontend; otherwise, the admin can "authorize" the plugin for all users through environment variables. All credentials passed from the frontend are encrypted.
|
||||
|
||||
```js
|
||||
// It's recommended you follow this convention when accessing environment variables.
|
||||
getServerURL() {
|
||||
const url = process.env.SD_WEBUI_URL || '';
|
||||
if (!url) {
|
||||
|
|
@ -77,7 +109,6 @@ A distinction has to be made. The credentials are passed through `fields` when t
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
## Step 3: Define Helper Methods
|
||||
|
||||
You can define helper methods within your class to handle specific tasks if needed. For example, the `StableDiffusionAPI` class includes methods like `replaceNewLinesWithSpaces`, `getMarkdownImageUrl`, and `getServerURL` to handle various tasks.
|
||||
|
|
@ -96,6 +127,8 @@ class StableDiffusionAPI extends Tool {
|
|||
|
||||
The `_call` method is where the main functionality of your plugin is implemented. This method is called when the language model decides to use your plugin. It should take an `input` parameter and return a result.
|
||||
|
||||
> In a basic Tool, the LLM will generate one string value as an input. If your plugin requires multiple inputs from the LLM, read the [StructuredTools](#StructuredTools) section.
|
||||
|
||||
```javascript
|
||||
class StableDiffusionAPI extends Tool {
|
||||
...
|
||||
|
|
@ -126,6 +159,7 @@ const StableDiffusionAPI = require('./StableDiffusion');
|
|||
```
|
||||
|
||||
In handleTools.js, find the beginning of the `loadTools` function and add your plugin/tool to the toolConstructors object.
|
||||
|
||||
```js
|
||||
const loadTools = async ({ user, model, tools = [], options = {} }) => {
|
||||
const toolConstructors = {
|
||||
|
|
@ -136,13 +170,14 @@ const loadTools = async ({ user, model, tools = [], options = {} }) => {
|
|||
'stable-diffusion': StableDiffusionAPI // <----- Newly Added. Note: the key is the 'name' provided in the class.
|
||||
// We will now refer to this name as the `pluginKey`
|
||||
};
|
||||
```
|
||||
```
|
||||
|
||||
If your Tool class requires more advanced initialization, you would add it to the customConstructors object.
|
||||
|
||||
The default initialization can be seen in the `loadToolWithAuth` function, and most custom plugins should be initialized this way.
|
||||
|
||||
Here are a few customConstructors, which have varying initializations
|
||||
|
||||
```javascript
|
||||
const customConstructors = {
|
||||
browser: async () => {
|
||||
|
|
@ -162,7 +197,7 @@ Here are a few customConstructors, which have varying initializations
|
|||
]
|
||||
}
|
||||
};
|
||||
```
|
||||
```
|
||||
|
||||
## Step 6: Export your Plugin into index.js
|
||||
|
||||
|
|
@ -206,7 +241,7 @@ module.exports = {
|
|||
}
|
||||
]
|
||||
},
|
||||
```
|
||||
```
|
||||
|
||||
Each of the fields of the "plugin" object are important. Follow this format strictly. If your plugin requires authentication, you will add those details under `authConfig` as an array since there could be multiple authentication variables. See the Calculator plugin for an example of one that doesn't require authentication, where the authConfig is an empty array (an array is always required).
|
||||
|
||||
|
|
@ -214,7 +249,8 @@ module.exports = {
|
|||
**Note:** the `authField` prop must match the process.env variable name
|
||||
|
||||
Here is an example of a plugin with more than one credential variable
|
||||
```json
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "Google",
|
||||
|
|
@ -234,7 +270,7 @@ module.exports = {
|
|||
}
|
||||
]
|
||||
},
|
||||
```
|
||||
```
|
||||
|
||||
## Example: WolframAlphaAPI Tool
|
||||
|
||||
|
|
|
|||
44
docs/features/third-party.md
Normal file
44
docs/features/third-party.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Third-Party Tools
|
||||
|
||||
> ⚠️ Warning: The tools featured here are not officially maintained or supported by the LibreChat team
|
||||
|
||||
#### ❗Note: If you would like to include your own tool in the list, you're welcome to submit a Pull Request.
|
||||
---
|
||||
|
||||
## [LibreChat Discord Bot](https://github.com/Berry-13/LibreChat-DiscordBot)
|
||||
|
||||
The LibreChat-DiscordBot is a versatile and user-friendly Discord bot designed to streamline interactions with your LibreChat server. With this bot, you can effortlessly manage the LibreChat server directly from your Discord server, eliminating the need for direct server access. It offers an array of functionalities to enhance your LibreChat experience.
|
||||
|
||||
<div>
|
||||
<img src="https://github.com/fuegovic/LibreChat/assets/32828263/d3841040-64d0-402f-95a5-8eb07bfbbfe5" width=400>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## [LibreChat Android App](https://github.com/goodair220917/LibreChat-Android-App)
|
||||
|
||||
This app is a webview for LibreChat instance Android independent app, this project is forked from ChatGPT-android-app. Default webpage of this app has been set to LibreChat's GitHub Page. This app is optimized for LibreChat's function which is not an original project. For example, Social Login Oauth login support is added to this build.
|
||||
|
||||
<div>
|
||||
<img src="https://github.com/fuegovic/LibreChat/assets/32828263/2da13b4c-8d77-42fc-9d36-75e9913d0545" width=300>
|
||||
<img src="https://github.com/fuegovic/LibreChat/assets/32828263/6ec84228-f030-4aa9-9f9d-d81245dd9c03" width=300>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## [LibreChat Windows Installer](https://github.com/fuegovic/LibreChat-Windows-Installer)
|
||||
|
||||
This script automates the local Windows 64 bits installation and offers a utility for initiating startups and updates
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## [LibreChat Azure Deployment](https://github.com/thunderbug1/LibreChatAzureDeployment)
|
||||
A Terraform setup to deploy LibreChat to Azure and setup all the necessary services.
|
||||
<div>
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Microsoft_Azure.svg/1280px-Microsoft_Azure.svg.png" width=150>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
# ⚠️ **Breaking Changes** ⚠️
|
||||
|
||||
> **Note:**
|
||||
**If you experience any issues after updating, we recommend clearing your browser cache and cookies.**
|
||||
Certain changes in the updates may impact cookies, leading to unexpected behaviors if not cleared properly.
|
||||
|
||||
## v0.5.8
|
||||
**If you have issues after updating, please try to clear your browser cache and cookies!**
|
||||
|
||||
Some of the latest changes affect the cookies and can cause weird behaviors if not properly cleared.
|
||||
- It's now required to name manifest JSON files (for [ChatGPT Plugins](..\features\plugins\chatgpt_plugins_openapi.md)) in the `api\app\clients\tools\.well-known` directory after their `name_for_model` property should you add one yourself.
|
||||
- This was a recommended convention before, but is now required.
|
||||
|
||||
## v0.5.7
|
||||
|
||||
|
|
|
|||
|
|
@ -91,23 +91,21 @@ You should also consider changing the `AZURE_OPENAI_MODELS` variable to the mode
|
|||
|
||||
These two variables are optional but may be used in future updates of this project.
|
||||
|
||||
### Plugin Endpoint Variables
|
||||
### Using Plugins with Azure
|
||||
|
||||
Note: The Plugins endpoint may not work as expected with Azure OpenAI, which may not support OpenAI Functions yet. Even when results were generated, they were not great compared to the regular OpenAI endpoint. You should set the "Functions" off in the Agent settings, and it's recommend to not skip completion with functions off.
|
||||
Note: To use the Plugins endpoint with Azure OpenAI, you need a deployment supporting [function calling](https://techcommunity.microsoft.com/t5/azure-ai-services-blog/function-calling-is-now-available-in-azure-openai-service/ba-p/3879241). Otherwise, you need to set "Functions" off in the Agent settings. When you are not using "functions" mode, it's recommend to have "skip completion" off as well, which is a review step of what the agent generated.
|
||||
|
||||
To use Azure with the Plugins endpoint, there are some extra steps to take as the langchain library is particular with envrionment variables:
|
||||
|
||||
* `PLUGINS_USE_AZURE`: If set to "true" or any truthy value, this will enable the program to use Azure with the Plugins endpoint.
|
||||
* `AZURE_OPENAI_API_KEY`: Your Azure API key must be set to this environment variable, not to be confused with `AZURE_API_KEY`, which can remain as before.
|
||||
* `OPENAI_API_KEY`: Must be omitted or commented to use Azure with Plugins
|
||||
|
||||
These steps are quick workarounds as other solutions would require renaming environment variables. This is due to langchain overriding environment variables, and will have to be solved with a later solution.
|
||||
To use Azure with the Plugins endpoint, make sure the following environment variables are set:
|
||||
|
||||
* `PLUGINS_USE_AZURE`: If set to "true" or any truthy value, this will enable the program to use Azure with the Plugins endpoint.
|
||||
* `AZURE_API_KEY`: Your Azure API key must be set with an environment variable.
|
||||
|
||||
## That's it! You're all set. 🎉
|
||||
|
||||
---
|
||||
## [Free AI APIs](free_ai_apis.md)
|
||||
---
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
||||
---
|
||||
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
||||
|
|
|
|||
222
docs/install/container_install.md
Normal file
222
docs/install/container_install.md
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
|
||||
# Container installation guide
|
||||
|
||||
If you don't like docker compose, don't want a bare-metal installation, but still want to leverage the benefits from the isolation and modularity of containers - this is the guide you should use.
|
||||
|
||||
> Likewise, If you are actively developing LibreChat, aren't using the service productively (i.e production environments), you should avoid this guide and look to something easier to work with such as docker compose.
|
||||
|
||||
**Important:** `docker` and `podman` commands are for the most part, interoperable and interchangeable. Since podman should be the better "Libre" choice, code instructions below will use (and heavily favor) `podman` - and some commands will need to be tweaked to compensate for this.
|
||||
|
||||
|
||||
## Creating the base image
|
||||
|
||||
Since LibreChat is very active in development, it's recommended for now to build
|
||||
the image locally for the container you plan on using. Thankfully this is easy enough to do.
|
||||
|
||||
In your target directory, run the following:
|
||||
```bash
|
||||
git clone https://github.com/danny-avila/LibreChat
|
||||
```
|
||||
|
||||
This will add a directory, `LibreChat` into your local environment.
|
||||
|
||||
Without entering the `LibreChat` directory, add a script `./image.sh` with the following:
|
||||
|
||||
> If you don't want to run this as a script, you can run the container command rather images
|
||||
|
||||
```bash
|
||||
# Build the base container image (which contains the LibreChat stack - api, client and data providers)
|
||||
podman build \
|
||||
--tag "librechat:local" \
|
||||
--file ./LibreChat/Dockerfile;
|
||||
```
|
||||
|
||||
> Note: the downside of running a base container that has a live root is that image revisions need to be done manually. The easiest way is to remove and recreate the image when the container is no longer. If that's not possible for you, manually updating the image to increment versions can be done manually. Simply amend $image with the version you're building.
|
||||
|
||||
> We'll document how to go about the update process more effectively further on. You wont need to remove your existing containers, or lose any data when updating.
|
||||
|
||||
## Setting up the env file
|
||||
|
||||
Execute the following command to create a env file solely for LibreChat containers:
|
||||
|
||||
```bash
|
||||
cp ./LibreChat/.env.example .env
|
||||
```
|
||||
|
||||
This will add the env file to the top level directory that we will create the containers, allowing us to pass it easily as via the `--env-file` command argument.
|
||||
|
||||
Follow [this guide](https://docs.librechat.ai/install/free_ai_apis.html) to populate the containers with the correct env values for various apis. There are other env values of interest that might be worth changing, documented within the env itself. Afterwords, edit the following lines in the `.env` file.
|
||||
|
||||
```
|
||||
HOST=0.0.0.0
|
||||
MONGO_URI=mongodb://librechat-mongodb:27017/LibreChat
|
||||
MEILI_HOST=http://librechat-meilisearch:7700
|
||||
MEILI_HTTP_ADDR=librechat-meilisearch:7700
|
||||
MEILI_NO_ANALYTICS=true
|
||||
```
|
||||
|
||||
These values will be uses by some of our containers to correctly use container DNS, using the LibreChat network.
|
||||
|
||||
## Creating a network for LibreChat
|
||||
|
||||
If you're going about this the _manual_ way, it's likely safe to assume you're running more than a few different containers and services on your machine. One of the nice features offered by most container engines is that you don't need to have every single container exposed on the host network. This has the added benefit of not exposing your data and dependant services to other containers on your host.
|
||||
|
||||
```bash
|
||||
podman network create librechat
|
||||
```
|
||||
|
||||
We will be using this network when creating our containers.
|
||||
|
||||
## Creating dependant containers
|
||||
|
||||
LibreChat currently uses mongoDB and meilisearch, so we'll also be creating those containers.
|
||||
|
||||
## Mongodb
|
||||
|
||||
Install and boot the mongodb container with the following command:
|
||||
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat-mongodb" \
|
||||
--network=librechat \
|
||||
-v "librechat-mongodb-data:/data/db" \
|
||||
--detach \
|
||||
docker.io/mongo \
|
||||
mongod --noauth;
|
||||
```
|
||||
|
||||
## Meilisearch
|
||||
|
||||
Install and boot the melisearch container with the following command:
|
||||
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat-meilisearch" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-v "librechat-meilisearch-data:/meili_data" \
|
||||
--detach \
|
||||
docker.io/getmeili/meilisearch:v1.0;
|
||||
```
|
||||
|
||||
## Starting LibreChat
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-p 3080:3080 \
|
||||
--detach \
|
||||
librechat:local;
|
||||
```
|
||||
|
||||
If you're using LibreChat behind another load balancer, you can omit the `-p` declaration, you can also attach the container to the same network by adding an additional network argument:
|
||||
|
||||
```bash
|
||||
--network=librechat \
|
||||
--network=mybalancernetwork \
|
||||
```
|
||||
|
||||
As described by the original `-p` command argument, it would be possible to access librechat as `librechat:3080`, `mybalancernetwork` would be replaced with whatever network your balancer exists.
|
||||
|
||||
## Auto-starting containers on boot (podman + Linux only)
|
||||
|
||||
Podman has a declarative way to ensure that pod starts up automatically on system boot using systemd.
|
||||
|
||||
To use this method you need to run the following commands:
|
||||
|
||||
First, let's stop any running containers related to LibreChat:
|
||||
s
|
||||
```bash
|
||||
podman stop librechat librechat-mongodb librechat-meilisearch
|
||||
```
|
||||
|
||||
Next, we'll update our user's systemd configuration to enable lingering. In systemd-based systems, when a user logs in and out, user-based services typically terminate themselves to save CPU, but since we're using rootless containers (which is podman's preferred way of running), we need to indicate that our user has permission to have user-locked services running after their session ends.
|
||||
|
||||
```bash
|
||||
loginctl enable-linger $(whoami)
|
||||
```
|
||||
|
||||
Next, we'll create a script somewhere in our `home` directory using a text editor. Let's call the script `./install.sh`
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Install podman container as systemd container
|
||||
set -e
|
||||
name="$1";
|
||||
podman generate systemd --name "$name" > ~/.config/systemd/user/container-$name.service
|
||||
systemctl --user enable --now container-$name;
|
||||
```
|
||||
|
||||
After saving, we'll update the script to be executable:
|
||||
|
||||
```bash
|
||||
chmod +x ./install.sh
|
||||
```
|
||||
|
||||
Assuming we aren't running those LibreChat containers from before, we can enable on-boot services for each of them using the following:
|
||||
|
||||
```bash
|
||||
./install.sh librechat-mongodb
|
||||
./install.sh librechat-meilisearch
|
||||
./install.sh librechat
|
||||
```
|
||||
|
||||
The containers (assuming everything was done to par), will be now running using the systemd layer instead of the podman layer. This means services will load on boot, but also means managing these containers is a little more manual and requires interacting with systemd instead of podman directly.
|
||||
|
||||
For instance, instead of `podman stop {name}`, you would instead do `systemctl --user stop container-{name}` to perform maintenance (such as updates or backups). Likewise, if you need to start the service again you simply can run `systemctl --user start container-{name}`. If wanting to use auto-boot functionality, interacting with managed containers using podman can cause issues with systemd's fault tolerance as it can't correctly indicate the state of a container when interfered with.
|
||||
|
||||
## Backing up volume containers (podman only)
|
||||
|
||||
The podman containers above are using named volumes for persistent data, which means we can't simply copy files from one place to another. This has benefits though. In podman, we can simply backup the volume into a tape archive format (tarball). To do this, run the following commands:
|
||||
|
||||
> It's recommended you stop the containers before running these commands.
|
||||
|
||||
```bash
|
||||
# backup the
|
||||
podman volume export librechat-meilisearch-data --output "librechat-meilisearch-backup-$(date +"%d-%m-%Y").tar"
|
||||
podman volume export librechat-mongodb-data --output "librechat-mongodb-backup-$(date +"%d-%m-%Y").tar"
|
||||
```
|
||||
|
||||
These will leave archive files that you can do what you wish with, including reverting volumes to a previous state if needed. Refer to [podman documentation](https://docs.podman.io/en/latest/markdown/podman-volume-import.1.html) for how to do this.
|
||||
|
||||
## Updating LibreChat
|
||||
|
||||
LibreChat is still under development, so depending on published images isn't a huge viability at the moment. Instead, it's easier to update using git. Data persistence in librechat is managed outside of the main container, so it's rather simple to do an in-place update.
|
||||
|
||||
In the parent directory containing the LibreChat repo:
|
||||
|
||||
```bash
|
||||
# Update the git repo
|
||||
(cd LibreChat && git pull);
|
||||
|
||||
# (ONLY if using systemd auto start) Stop the service
|
||||
systemctl --user stop container-librechat
|
||||
|
||||
# Remove the librechat container
|
||||
podman rm -f librechat
|
||||
|
||||
# Destroy the local image
|
||||
podman rmi -f librechat:local
|
||||
|
||||
# Rebuild the image
|
||||
podman build \
|
||||
--tag "librechat:local" \
|
||||
--file ./LibreChat/Dockerfile;
|
||||
|
||||
# Recreate the container (using the Starting LibreChat step)
|
||||
podman run \
|
||||
--name="librechat" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-p 3080:3080 \
|
||||
--detach \
|
||||
librechat:local;
|
||||
|
||||
# Stop the container (if it's confirmed to be running) and restart the service
|
||||
podman stop librechat && systemctl --user start container-librechat
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
36
docs/install/default_language.md
Normal file
36
docs/install/default_language.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Default Language 🌍
|
||||
|
||||
## How to change the default language
|
||||
|
||||
- Open this file `client\src\store\language.js`
|
||||
- Modify the "default" in the lang variable with your ISO 3166 Alpha-2 code :
|
||||
|
||||
Example:
|
||||
from **English** as default
|
||||
|
||||
```js
|
||||
import { atom } from 'recoil';
|
||||
|
||||
const lang = atom({
|
||||
key: 'lang',
|
||||
default: 'en',
|
||||
});
|
||||
|
||||
export default { lang };
|
||||
```
|
||||
|
||||
to **Italian** as default
|
||||
|
||||
```js
|
||||
import { atom } from 'recoil';
|
||||
|
||||
const lang = atom({
|
||||
key: 'lang',
|
||||
default: 'it',
|
||||
});
|
||||
|
||||
export default { lang };
|
||||
```
|
||||
---
|
||||
|
||||
> **❗If you wish to contribute your own translation to LibreChat, please refer to this document for instructions: [Contribute a Translation](../contributions/translation_contribution.md)**
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Docker Installation Guide
|
||||
# Docker Compose Installation Guide
|
||||
|
||||
Docker installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
|
||||
See the video guide for [Windows](windows_install.md#recommended) or [Ubuntu 22.04 LTS](linux_install.md#recommended)
|
||||
## Installation and Configuration
|
||||
|
|
@ -111,4 +111,4 @@ That's it! If you need more detailed information on configuring your compose fil
|
|||
|
||||
---
|
||||
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
@ -6,7 +6,7 @@ Feel free to check out the others, but I haven't personally tested them: [Free A
|
|||
|
||||
### ChimeraGPT
|
||||
|
||||
Since ChimeraGPT works with LibreChat, and offers Llama2 along with OpenAI models, let's start with that one: [ChimeraGPT](https://discord.gg/chimeragpt)
|
||||
Since ChimeraGPT works with LibreChat, and offers Llama2 along with OpenAI models, let's start with that one: [ChimeraGPT](https://discord.gg/ge48uqZUSr)
|
||||
|
||||
> ⚠️ Never trust 3rd parties. Use at your own risk of privacy loss. Your data may be used for AI training at best or for nefarious reasons at worst; this is true in all cases, even with official endpoints: never give an LLM sensitive/identifying information. If something is free, you are the product. If errors arise, they are more likely to be due to the 3rd party, and not this project, as I test the official endpoints first and foremost.
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ OPENAI_REVERSE_PROXY=https://chimeragpt.adventblocks.cc/api/v1/chat/completions
|
|||
# OPENAI_MODELS=gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-3.5-turbo-0301,text-davinci-003,gpt-4,gpt-4-0314,gpt-4-0613
|
||||
```
|
||||
|
||||
**Note:** The `OPENAI_MODELS` variable is commented out so that the server can fetch chimeragpt/v1/api/models for all available models. Uncomment and adjust if you wish to specify which exact models you want to use.
|
||||
**Note:** The `OPENAI_MODELS` variable is commented out so that the server can fetch chimeragpt/api/v1/models for all available models. Uncomment and adjust if you wish to specify which exact models you want to use.
|
||||
|
||||
It's worth noting that not all models listed by their API will work, with or without this project. The exact URL may also change, just make sure you include `/v1/chat/completions` in the reverse proxy URL if it ever changes.
|
||||
|
||||
|
|
@ -40,3 +40,7 @@ You can set `OPENAI_API_KEY=user_provided` if you would like the user to add the
|
|||
|
||||
### Plugins also work with this reverse proxy (OpenAI models). [More info on plugins here](https://docs.librechat.ai/features/plugins/introduction.html)
|
||||

|
||||
|
||||
---
|
||||
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
# Languages 🌍
|
||||
|
||||
## Default language
|
||||
|
||||
1. Open this file "client\src\store\language.js"
|
||||
2. modify the "default" in the lang variable with your ISO 3166 Alpha-2 code :
|
||||
|
||||
for example from english as default
|
||||
|
||||
```
|
||||
import { atom } from 'recoil';
|
||||
|
||||
const lang = atom({
|
||||
key: 'lang',
|
||||
default: 'en',
|
||||
});
|
||||
|
||||
export default { lang };
|
||||
```
|
||||
|
||||
to italian as dafult
|
||||
|
||||
```
|
||||
import { atom } from 'recoil';
|
||||
|
||||
const lang = atom({
|
||||
key: 'lang',
|
||||
default: 'it',
|
||||
});
|
||||
|
||||
export default { lang };
|
||||
```
|
||||
|
||||
# How to add a translation to LibreChat
|
||||
|
||||
### Minimum Requirements:
|
||||
|
||||
1. Good knowledge of the language (some terms may undergo significant changes during translation)
|
||||
2. An editor, which can be Notepad or (**recommended**: [VSCode](https://code.visualstudio.com/download))
|
||||
|
||||
### Language translation
|
||||
|
||||
|
||||
1. Fork the LibreChat repository and download it using git clone https://github.com/danny-avila/LibreChat
|
||||
2. Navigate to the "client\src\localization" folder and open the "Translation.tsx" file
|
||||
3. At the beginning of the code, add your language below all the others in this format:
|
||||
|
||||
`import Language-name from './languages/** ';`
|
||||
|
||||
For example, let's take English as an example:
|
||||
|
||||
Note: Replace "LanguageName" with the name of your language (capitalized) and "**" with the ISO 3166 Alpha-2 code of your country (the initial of the nation).
|
||||
If you don't know the ISO 3166 code for your language, check it [here](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) and also use it with an initial capital)
|
||||
|
||||
4. Further down in the code, add the following
|
||||
|
||||
`if (langCode === '**') return Language-name;`
|
||||
|
||||
Replace "**" with the ISO 3166 Alpha-2 code of your language (in lowercase). Here's an example: `if (langCode === 'en') return English;`)
|
||||
|
||||
7. Go into the "languages" folder and create a file named as follows: **.tsx
|
||||
|
||||
For example: En.tsx
|
||||
|
||||
9. Copy all the content from En.tsx into your file and modify it as follows:
|
||||
|
||||
```
|
||||
// your-language-name phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'Examples',
|
||||
// Add more translations here
|
||||
```
|
||||
|
||||
Rename only the part after the colon ":" to the corresponding translation in your language. For example:
|
||||
|
||||
```
|
||||
// my-language phrases
|
||||
|
||||
export default {
|
||||
com_ui_examples: 'WORD_THAT_I_TRANSLATE_IN_TO_MY_LANGUAGE',
|
||||
// Add more translations here
|
||||
};
|
||||
```
|
||||
|
||||
⚠️DO NOT CHANGE com_... ⚠️
|
||||
|
||||
10. To add your language to the menu, open the file "client\src\components\Nav\SettingsTabs\General.tsx" and add your language to the "LangSelector" variable in the following way:
|
||||
|
||||
```
|
||||
export const LangSelector = ({
|
||||
//other code
|
||||
<option value="en">{localize(lang, 'com_nav_lang_english')}</option>
|
||||
//other languages...
|
||||
<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
where ** is the ISO 3166 Alpha-2 code and "com_nav_lang_your-language-name" stands for the name in your language (for example com_nav_lang_english or com_nav_lang_italian)
|
||||
The only line of code to add is:
|
||||
|
||||
`<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>`
|
||||
|
||||
11. Commit your changes using git add *, git commit -m "Language translation: your-language translation" and git push.
|
||||
12. Open your repository in a browser and click on "Contribute"
|
||||
|
||||

|
||||
|
||||
14. Answer all the questions, and in the "Type of Change" section, add `- [x] Translation support`
|
||||
15. Create a pull request 🎉
|
||||
|
|
@ -132,4 +132,4 @@ gnome-terminal --tab --title="LibreChat" --working-directory=/home/user/LibreCha
|
|||
|
||||
---
|
||||
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
|
|||
|
|
@ -92,4 +92,4 @@ npm run backend
|
|||
|
||||
---
|
||||
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
- Open a new tab and go to [https://account.mongodb.com/account/register](https://account.mongodb.com/account/register) to create an account.
|
||||
|
||||
## Create a project
|
||||
- Once you have set up your account, create a new project and name it:
|
||||
- Once you have set up your account, create a new project and name it (the name can be anything):
|
||||
|
||||

|
||||
|
||||
|
|
@ -86,4 +86,6 @@
|
|||
mongodb+srv://fuegovic:1Gr8Banana@render-librechat.fgycwpi.mongo.net/?retryWrites=true
|
||||
```
|
||||
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
---
|
||||
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# User/Auth System
|
||||
|
||||
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
||||
## **First Time Setup**
|
||||
|
||||
In order for the auth system to function properly, there are some environment variables that are needed. Note that this information is also included in the [/.env.example](/.env.example) file.
|
||||
|
|
@ -45,6 +48,24 @@ To enable Google login, you must create an application in the [Google Cloud Cons
|
|||
|
||||
---
|
||||
|
||||
## Facebook Authentication
|
||||
### (It only works with a domain, not with localhost)
|
||||
|
||||
1. Go to [Facebook Developer Portal](https://developers.facebook.com/)
|
||||
2. Create a new Application and give it a name
|
||||
4. In the Dashboard tab select product and select "Facebook login", then tap on "Configure" and "Settings". Male sure "OAuth client access", "Web OAuth access", "Apply HTTPS" and "Use limited mode for redirect URIs" are **enabled**
|
||||
5. In the Valid OAuth Redirect URIs add "your-domain/oauth/facebook/callback" (example: http://example.com/oauth/facebook/callback)
|
||||
6. Save changes and in the "settings" tab, reset the Client Secret
|
||||
7. Put the Client ID and Client Secret in the .env file:
|
||||
```bash
|
||||
FACEBOOK_CLIENT_ID=your_client_id
|
||||
FACEBOOK_CLIENT_SECRET=your_client_secret
|
||||
FACEBOOK_CALLBACK_URL=/oauth/facebook/callback # this should be the same for everyone
|
||||
```
|
||||
8. Save the .env file
|
||||
|
||||
---
|
||||
|
||||
## OpenID Authentication with Azure AD
|
||||
|
||||
1. Go to the [Azure Portal](https://portal.azure.com/) and sign in with your account.
|
||||
|
|
@ -132,6 +153,7 @@ DISCORD_CLIENT_SECRET=your_client_secret
|
|||
DISCORD_CALLBACK_URL=/oauth/discord/callback # this should be the same for everyone
|
||||
```
|
||||
8. Save the .env file
|
||||
|
||||
---
|
||||
## **Email and Password Reset**
|
||||
|
||||
|
|
@ -173,6 +195,10 @@ NOTE: The variable EMAIL_FROM currently does not work. To stay updated, check th
|
|||
|
||||
To disable or re-enable registration, open up the root `.env` file and set `ALLOW_REGISTRATION=true` or `ALLOW_REGISTRATION=false` depending on if you want registration open or closed.
|
||||
|
||||
To disable or re-enable social registration, open up the root `.env` file and set `ALLOW_SOCIAL_REGISTRATION=true` or `ALLOW_SOCIAL_REGISTRATION=false` depending on if you want social registration open or closed.
|
||||
|
||||
**NOTE: OpenID does not support the ability to disable only registration.**
|
||||
|
||||
### ⚠️***Warning***
|
||||
|
||||
If you previously implemented your own user system using the original scaffolding that was provided, you will no longer see conversations and presets by switching to the new user system. This is because of a design flaw in the scaffolding implementation that was problematic for the inclusion of social login.
|
||||
|
|
|
|||
|
|
@ -33,47 +33,44 @@ In this video we're going to install LibreChat on Windows 11 using Docker and Gi
|
|||
|
||||
Have fun!
|
||||
|
||||
---
|
||||
## **Other installation methods:**
|
||||
### **[Windows Installer](https://github.com/fuegovic/LibreChat-Windows-Installer)**
|
||||
(Includes a Startup and Update Utility)
|
||||
|
||||
---
|
||||
|
||||
## **Manual Installation**
|
||||
## Install the prerequisites on your machine
|
||||
|
||||
## **Download LibreChat**
|
||||
|
||||
- Download the latest release here: https://github.com/danny-avila/LibreChat/releases/
|
||||
- Install the prerequisites on your machine 👇
|
||||
|
||||
### Download and Install Node.js (Required)
|
||||
|
||||
- Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.)
|
||||
|
||||
### Download and Install Git (Recommended)
|
||||
- Git: https://git-scm.com/download/win
|
||||
|
||||
### [Create a MongoDB database](mongodb.md) (Required)
|
||||
|
||||
### [Get Your API keys and Tokens](apis_and_tokens.md) (Required)
|
||||
- You must set up at least one of these tokens or APIs to run the app.
|
||||
|
||||
### Download LibreChat (Required)
|
||||
- (With Git) Open Terminal (command prompt) and clone the repository by running `git clone https://github.com/danny-avila/LibreChat.git`
|
||||
- Or download the latest release here: https://github.com/danny-avila/LibreChat/releases/
|
||||
- Or by clicking on the green code button in the top of the page and selecting "Download ZIP"
|
||||
- Open Terminal (command prompt) and clone the repository by running `git clone https://github.com/danny-avila/LibreChat.git`
|
||||
- If you downloaded a zip file, extract the content in "C:/LibreChat/"
|
||||
- **IMPORTANT : If you install the files somewhere else modify the instructions accordingly**
|
||||
|
||||
## **Enable the Conversation search feature:** (optional)
|
||||
### Enable the Conversation search feature: (optional)
|
||||
|
||||
- Download MeiliSearch latest release from : https://github.com/meilisearch/meilisearch/releases
|
||||
- Copy it to "C:/LibreChat/"
|
||||
- Rename the file to "meilisearch.exe"
|
||||
- Open it by double clicking on it
|
||||
- Copy the generated Master Key and save it somewhere (You will need it later)
|
||||
|
||||
|
||||
## **Download and Install Node.js**
|
||||
|
||||
- Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.)
|
||||
|
||||
## [Create a MongoDB database](mongodb.md) (Required)
|
||||
|
||||
## [Get Your API keys and Tokens](apis_and_tokens.md) (Required)
|
||||
- You must set up at least one of these tokens or APIs to run the app.
|
||||
|
||||
## [User/Auth System](../install/user_auth_system.md) (Optional)
|
||||
### [User/Auth System](../install/user_auth_system.md) (Optional)
|
||||
- How to set up the user/auth system and Google login.
|
||||
|
||||
## Setup and Run the app
|
||||
|
||||
## Using the command line (in the root directory)
|
||||
## Setup and Run LibreChat
|
||||
Using the command line (in the root directory)
|
||||
### To setup the app:
|
||||
1. Run `npm ci` (this step will also create the env file)
|
||||
2. Run `npm run frontend`
|
||||
|
|
@ -109,4 +106,4 @@ Have fun!
|
|||
|
||||
---
|
||||
|
||||
### Note: If you're still having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue