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
2023-08-22 18:44:59 -04:00
|
|
|
const partialRight = require('lodash/partialRight');
|
2023-03-15 15:44:48 -04:00
|
|
|
const citationRegex = /\[\^\d+?\^]/g;
|
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
2023-08-17 12:50:05 -04:00
|
|
|
const { getCitations, citeText } = require('./citations');
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
const cursor = '<span className="result-streaming">█</span>';
|
2023-03-14 15:42:59 -04:00
|
|
|
|
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
2023-08-17 12:50:05 -04:00
|
|
|
const addSpaceIfNeeded = (text) => (text.length > 0 && !text.endsWith(' ') ? text + ' ' : text);
|
|
|
|
|
2023-03-15 00:50:27 +08:00
|
|
|
const handleError = (res, message) => {
|
|
|
|
res.write(`event: error\ndata: ${JSON.stringify(message)}\n\n`);
|
2023-02-25 09:04:32 -05:00
|
|
|
res.end();
|
|
|
|
};
|
|
|
|
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
const sendMessage = (res, message, event = 'message') => {
|
2023-02-25 09:04:32 -05:00
|
|
|
if (message.length === 0) {
|
|
|
|
return;
|
|
|
|
}
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
res.write(`event: ${event}\ndata: ${JSON.stringify(message)}\n\n`);
|
2023-02-25 09:04:32 -05:00
|
|
|
};
|
|
|
|
|
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
2023-08-17 12:50:05 -04:00
|
|
|
const createOnProgress = ({ generation = '', onProgress: _onProgress }) => {
|
2023-03-14 15:42:59 -04:00
|
|
|
let i = 0;
|
2023-03-21 13:41:31 -04:00
|
|
|
let code = '';
|
|
|
|
let precode = '';
|
|
|
|
let codeBlock = false;
|
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
2023-08-17 12:50:05 -04:00
|
|
|
let tokens = addSpaceIfNeeded(generation);
|
2023-03-14 15:42:59 -04:00
|
|
|
|
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
2023-08-28 12:03:08 -04:00
|
|
|
const progressCallback = async (partial, { res, text, bing = false, ...rest }) => {
|
2023-03-21 13:41:31 -04:00
|
|
|
let chunk = partial === text ? '' : partial;
|
|
|
|
tokens += chunk;
|
|
|
|
precode += chunk;
|
2023-03-14 15:42:59 -04:00
|
|
|
tokens = tokens.replaceAll('[DONE]', '');
|
2023-03-14 16:05:46 -04:00
|
|
|
|
2023-03-21 13:41:31 -04:00
|
|
|
if (codeBlock) {
|
|
|
|
code += chunk;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (precode.includes('```') && codeBlock) {
|
|
|
|
codeBlock = false;
|
|
|
|
precode = precode.replace(/```/g, '');
|
|
|
|
code = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (precode.includes('```') && code === '') {
|
|
|
|
precode = precode.replace(/```/g, '');
|
|
|
|
codeBlock = true;
|
|
|
|
}
|
|
|
|
|
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
2023-08-28 12:03:08 -04:00
|
|
|
if (tokens.match(/^\n(?!:::plugins:::)/)) {
|
2023-03-14 16:05:46 -04:00
|
|
|
tokens = tokens.replace(/^\n/, '');
|
2023-03-14 15:42:59 -04:00
|
|
|
}
|
2023-03-15 14:36:17 -04:00
|
|
|
|
2023-03-14 15:42:59 -04:00
|
|
|
if (bing) {
|
|
|
|
tokens = citeText(tokens, true);
|
|
|
|
}
|
|
|
|
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
const payload = { text: tokens, message: true, initial: i === 0, ...rest };
|
|
|
|
sendMessage(res, { ...payload, text: tokens });
|
|
|
|
_onProgress && _onProgress(payload);
|
|
|
|
i++;
|
|
|
|
};
|
2023-04-11 03:26:38 +08:00
|
|
|
|
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
2023-08-28 12:03:08 -04:00
|
|
|
const sendIntermediateMessage = (res, payload, extraTokens = '') => {
|
|
|
|
tokens += extraTokens;
|
feat: ChatGPT Plugins/OpenAPI specs for Plugins Endpoint (#620)
* wip: proof of concept for openapi chain
* chore(api): update langchain dependency to version 0.0.105
* feat(Plugins): use ChatGPT Plugins/OpenAPI specs (first pass)
* chore(manifest.json): update pluginKey for "Browser" tool to "web-browser"
chore(handleTools.js): update customConstructor key for "web-browser" tool
* fix(handleSubmit.js): set unfinished property to false for all endpoints
* fix(handlers.js): remove unnecessary capitalizeWords function and use action.tool directly
refactor(endpoints.js): rename availableTools to tools and transform it into a map
* feat(endpoints): add plugins selector to endpoints file
refactor(CodeBlock.tsx): refactor to typescript
refactor(Plugin.tsx): use recoil Map for plugin name and refactor to typescript
chore(Message.jsx): linting
chore(PluginsOptions/index.jsx): remove comment/linting
chore(svg): export Clipboard and CheckMark components from SVG index and refactor to typescript
* fix(OpenAPIPlugin.js): rename readYamlFile function to readSpecFile
fix(OpenAPIPlugin.js): handle JSON files in readSpecFile function
fix(OpenAPIPlugin.js): handle JSON URLs in getSpec function
fix(OpenAPIPlugin.js): handle JSON variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add description for variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(loadSpecs.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(Plugin.tsx): remove unnecessary callback parameter in getPluginName function
fix(getDefaultConversation.js): fix browser console error: handle null value for lastConversationSetup in getDefaultConversation function
* feat(api): add new tools
Add Ai PDF tool for super-fast, interactive chats with PDFs of any size, complete with page references for fact checking.
Add VoxScript tool for searching through YouTube transcripts, financial data sources, Google Search results, and more.
Add WebPilot tool for browsing and QA of webpages, PDFs, and data. Generate articles from one or more URLs.
feat(api): update OpenAPIPlugin.js
- Add support for bearer token authorization in the OpenAPIPlugin.
- Add support for custom headers in the OpenAPIPlugin.
fix(api): fix loadTools.js
- Pass the user parameter to the loadSpecs function.
* feat(PluginsClient.js): import findMessageContent function from utils
feat(PluginsClient.js): add message parameter to options object in initializeCustomAgent function
feat(PluginsClient.js): add content to errorMessage if message content is found
feat(PluginsClient.js): break out of loop if message content is found
feat(PluginsClient.js): add delay option with value of 8 to generateTextStream function
feat(PluginsClient.js): add support for process.env.PORT environment variable in app.listen function
feat(askyourpdf.json): add askyourpdf plugin configuration
feat(metar.json): add metar plugin configuration
feat(askyourpdf.yaml): add askyourpdf plugin OpenAPI specification
feat(OpenAPIPlugin.js): add message parameter to createOpenAPIPlugin function
feat(OpenAPIPlugin.js): add description_for_model to chain run message
feat(addOpenAPISpecs.js): remove verbose option from loadSpecs function call
fix(loadSpecs.js): add 'message' parameter to the loadSpecs function
feat(findMessageContent.js): add utility function to find message content in JSON objects
* fix(PluginStoreDialog.tsx): update z-index value for the dialog container
The z-index value for the dialog container was updated to "102" to ensure it appears above other elements on the page.
* chore(web_pilot.json): add "params" field with "user_has_request" parameter set to true
* chore(eslintrc.js): update eslint rules
fix(Login.tsx): add missing semicolon after import statement
* fix(package-lock.json): update langchain dependency to version ^0.0.105
* fix(OpenAPIPlugin.js): change header key from 'id' to 'librechat_user_id' for consistency and clarity
feat(plugins): add documentation for using official ChatGPT Plugins with OpenAPI specs
This commit adds a new file `chatgpt_plugins_openapi.md` to the `docs/features/plugins` directory. The file provides detailed information on how to use official ChatGPT Plugins with OpenAPI specifications. It explains the components of a plugin, including the Plugin Manifest file and the OpenAPI spec. It also covers the process of adding a plugin, editing manifest files, and customizing OpenAPI spec files. Additionally, the commit includes disclaimers about the limitations and compatibility of plugins with LibreChat. The documentation also clarifies that the use of ChatGPT Plugins with LibreChat does not violate OpenAI's Terms of Service.
The purpose of this commit is to provide comprehensive documentation for developers who want to integrate ChatGPT Plugins into their projects using OpenAPI specs. It aims to guide them through the process of adding and configuring plugins, as well as addressing potential issues and
chore(introduction.md): update link to ChatGPT Plugins documentation
docs(introduction.md): clarify the purpose of the plugins endpoint and its capabilities
* fix(OpenAPIPlugin.js): update SUFFIX variable to provide a clearer description
docs(chatgpt_plugins_openapi.md): update information about adding plugins via url on the frontend
* feat(PluginsClient.js): sendIntermediateMessage on successful Agent load
fix(PluginsClient.js, server/index.js, gptPlugins.js): linting fixes
docs(chatgpt_plugins_openapi.md): update links and add additional information
* Update chatgpt_plugins_openapi.md
* chore: rebuild package-lock file
* chore: format/lint all files with new rules
* chore: format all files
* chore(README.md): update AI model selection list
The AI model selection list in the README.md file has been updated to reflect the current options available. The "Anthropic" model has been added as an alternative name for the "Claude" model.
* fix(Plugin.tsx): type issue
* feat(tools): add new tool WebPilot
feat(tools): remove tool Weather Report
feat(tools): add new tool Prompt Perfect
feat(tools): add new tool Scholarly Graph Link
* feat(OpenAPIPlugin.js): add getSpec and readSpecFile functions
feat(OpenAPIPlugin.spec.js): add tests for readSpecFile, getSpec, and createOpenAPIPlugin functions
* chore(agent-demo-1.js): remove unused code and dependencies
chore(agent-demo-2.js): remove unused code and dependencies
chore(demo.js): remove unused code and dependencies
* feat(addOpenAPISpecs): add function to transform OpenAPI specs into desired format
feat(addOpenAPISpecs.spec): add tests for transformSpec function
fix(loadSpecs): remove debugging code
* feat(loadSpecs.spec.js): add unit tests for ManifestDefinition, validateJson, and loadSpecs functions
* fix: package file resolution bug
* chore: move scholarly_graph_link manifest to 'has-issues'
* refactor(client/hooks): convert to TS and export from index
* Update introduction.md
* Update chatgpt_plugins_openapi.md
2023-07-16 12:19:47 -04:00
|
|
|
sendMessage(res, {
|
|
|
|
text: tokens?.length === 0 ? cursor : tokens,
|
|
|
|
message: true,
|
|
|
|
initial: i === 0,
|
|
|
|
...payload,
|
|
|
|
});
|
2023-03-14 15:42:59 -04:00
|
|
|
i++;
|
|
|
|
};
|
|
|
|
|
2023-04-11 03:26:38 +08:00
|
|
|
const onProgress = (opts) => {
|
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
2023-08-22 18:44:59 -04:00
|
|
|
return partialRight(progressCallback, opts);
|
2023-03-14 15:42:59 -04:00
|
|
|
};
|
|
|
|
|
2023-04-11 03:26:38 +08:00
|
|
|
const getPartialText = () => {
|
|
|
|
return tokens;
|
|
|
|
};
|
|
|
|
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
return { onProgress, getPartialText, sendIntermediateMessage };
|
2023-03-14 15:42:59 -04:00
|
|
|
};
|
|
|
|
|
2023-03-15 15:44:48 -04:00
|
|
|
const handleText = async (response, bing = false) => {
|
|
|
|
let { text } = response;
|
|
|
|
response.text = text;
|
|
|
|
|
|
|
|
if (bing) {
|
|
|
|
const links = getCitations(response);
|
|
|
|
if (response.text.match(citationRegex)?.length > 0) {
|
|
|
|
text = citeText(response);
|
|
|
|
}
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
text += links?.length > 0 ? `\n- ${links}` : '';
|
2023-03-15 15:44:48 -04:00
|
|
|
}
|
|
|
|
|
2023-03-14 16:05:46 -04:00
|
|
|
return text;
|
|
|
|
};
|
|
|
|
|
2023-06-14 07:23:11 -04:00
|
|
|
const isObject = (item) => item && typeof item === 'object' && !Array.isArray(item);
|
feat: ChatGPT Plugins/OpenAPI specs for Plugins Endpoint (#620)
* wip: proof of concept for openapi chain
* chore(api): update langchain dependency to version 0.0.105
* feat(Plugins): use ChatGPT Plugins/OpenAPI specs (first pass)
* chore(manifest.json): update pluginKey for "Browser" tool to "web-browser"
chore(handleTools.js): update customConstructor key for "web-browser" tool
* fix(handleSubmit.js): set unfinished property to false for all endpoints
* fix(handlers.js): remove unnecessary capitalizeWords function and use action.tool directly
refactor(endpoints.js): rename availableTools to tools and transform it into a map
* feat(endpoints): add plugins selector to endpoints file
refactor(CodeBlock.tsx): refactor to typescript
refactor(Plugin.tsx): use recoil Map for plugin name and refactor to typescript
chore(Message.jsx): linting
chore(PluginsOptions/index.jsx): remove comment/linting
chore(svg): export Clipboard and CheckMark components from SVG index and refactor to typescript
* fix(OpenAPIPlugin.js): rename readYamlFile function to readSpecFile
fix(OpenAPIPlugin.js): handle JSON files in readSpecFile function
fix(OpenAPIPlugin.js): handle JSON URLs in getSpec function
fix(OpenAPIPlugin.js): handle JSON variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add description for variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(loadSpecs.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(Plugin.tsx): remove unnecessary callback parameter in getPluginName function
fix(getDefaultConversation.js): fix browser console error: handle null value for lastConversationSetup in getDefaultConversation function
* feat(api): add new tools
Add Ai PDF tool for super-fast, interactive chats with PDFs of any size, complete with page references for fact checking.
Add VoxScript tool for searching through YouTube transcripts, financial data sources, Google Search results, and more.
Add WebPilot tool for browsing and QA of webpages, PDFs, and data. Generate articles from one or more URLs.
feat(api): update OpenAPIPlugin.js
- Add support for bearer token authorization in the OpenAPIPlugin.
- Add support for custom headers in the OpenAPIPlugin.
fix(api): fix loadTools.js
- Pass the user parameter to the loadSpecs function.
* feat(PluginsClient.js): import findMessageContent function from utils
feat(PluginsClient.js): add message parameter to options object in initializeCustomAgent function
feat(PluginsClient.js): add content to errorMessage if message content is found
feat(PluginsClient.js): break out of loop if message content is found
feat(PluginsClient.js): add delay option with value of 8 to generateTextStream function
feat(PluginsClient.js): add support for process.env.PORT environment variable in app.listen function
feat(askyourpdf.json): add askyourpdf plugin configuration
feat(metar.json): add metar plugin configuration
feat(askyourpdf.yaml): add askyourpdf plugin OpenAPI specification
feat(OpenAPIPlugin.js): add message parameter to createOpenAPIPlugin function
feat(OpenAPIPlugin.js): add description_for_model to chain run message
feat(addOpenAPISpecs.js): remove verbose option from loadSpecs function call
fix(loadSpecs.js): add 'message' parameter to the loadSpecs function
feat(findMessageContent.js): add utility function to find message content in JSON objects
* fix(PluginStoreDialog.tsx): update z-index value for the dialog container
The z-index value for the dialog container was updated to "102" to ensure it appears above other elements on the page.
* chore(web_pilot.json): add "params" field with "user_has_request" parameter set to true
* chore(eslintrc.js): update eslint rules
fix(Login.tsx): add missing semicolon after import statement
* fix(package-lock.json): update langchain dependency to version ^0.0.105
* fix(OpenAPIPlugin.js): change header key from 'id' to 'librechat_user_id' for consistency and clarity
feat(plugins): add documentation for using official ChatGPT Plugins with OpenAPI specs
This commit adds a new file `chatgpt_plugins_openapi.md` to the `docs/features/plugins` directory. The file provides detailed information on how to use official ChatGPT Plugins with OpenAPI specifications. It explains the components of a plugin, including the Plugin Manifest file and the OpenAPI spec. It also covers the process of adding a plugin, editing manifest files, and customizing OpenAPI spec files. Additionally, the commit includes disclaimers about the limitations and compatibility of plugins with LibreChat. The documentation also clarifies that the use of ChatGPT Plugins with LibreChat does not violate OpenAI's Terms of Service.
The purpose of this commit is to provide comprehensive documentation for developers who want to integrate ChatGPT Plugins into their projects using OpenAPI specs. It aims to guide them through the process of adding and configuring plugins, as well as addressing potential issues and
chore(introduction.md): update link to ChatGPT Plugins documentation
docs(introduction.md): clarify the purpose of the plugins endpoint and its capabilities
* fix(OpenAPIPlugin.js): update SUFFIX variable to provide a clearer description
docs(chatgpt_plugins_openapi.md): update information about adding plugins via url on the frontend
* feat(PluginsClient.js): sendIntermediateMessage on successful Agent load
fix(PluginsClient.js, server/index.js, gptPlugins.js): linting fixes
docs(chatgpt_plugins_openapi.md): update links and add additional information
* Update chatgpt_plugins_openapi.md
* chore: rebuild package-lock file
* chore: format/lint all files with new rules
* chore: format all files
* chore(README.md): update AI model selection list
The AI model selection list in the README.md file has been updated to reflect the current options available. The "Anthropic" model has been added as an alternative name for the "Claude" model.
* fix(Plugin.tsx): type issue
* feat(tools): add new tool WebPilot
feat(tools): remove tool Weather Report
feat(tools): add new tool Prompt Perfect
feat(tools): add new tool Scholarly Graph Link
* feat(OpenAPIPlugin.js): add getSpec and readSpecFile functions
feat(OpenAPIPlugin.spec.js): add tests for readSpecFile, getSpec, and createOpenAPIPlugin functions
* chore(agent-demo-1.js): remove unused code and dependencies
chore(agent-demo-2.js): remove unused code and dependencies
chore(demo.js): remove unused code and dependencies
* feat(addOpenAPISpecs): add function to transform OpenAPI specs into desired format
feat(addOpenAPISpecs.spec): add tests for transformSpec function
fix(loadSpecs): remove debugging code
* feat(loadSpecs.spec.js): add unit tests for ManifestDefinition, validateJson, and loadSpecs functions
* fix: package file resolution bug
* chore: move scholarly_graph_link manifest to 'has-issues'
* refactor(client/hooks): convert to TS and export from index
* Update introduction.md
* Update chatgpt_plugins_openapi.md
2023-07-16 12:19:47 -04:00
|
|
|
const getString = (input) => (isObject(input) ? JSON.stringify(input) : input);
|
2023-06-14 07:23:11 -04:00
|
|
|
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
function formatSteps(steps) {
|
|
|
|
let output = '';
|
|
|
|
|
|
|
|
for (let i = 0; i < steps.length; i++) {
|
|
|
|
const step = steps[i];
|
2023-06-14 13:50:00 -04:00
|
|
|
const actionInput = getString(step.action.toolInput);
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
const observation = step.observation;
|
|
|
|
|
|
|
|
if (actionInput === 'N/A' || observation?.trim()?.length === 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-06-14 13:50:00 -04:00
|
|
|
output += `Input: ${actionInput}\nOutput: ${getString(observation)}`;
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
|
|
|
|
if (steps.length > 1 && i !== steps.length - 1) {
|
|
|
|
output += '\n---\n';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatAction(action) {
|
|
|
|
const formattedAction = {
|
feat: ChatGPT Plugins/OpenAPI specs for Plugins Endpoint (#620)
* wip: proof of concept for openapi chain
* chore(api): update langchain dependency to version 0.0.105
* feat(Plugins): use ChatGPT Plugins/OpenAPI specs (first pass)
* chore(manifest.json): update pluginKey for "Browser" tool to "web-browser"
chore(handleTools.js): update customConstructor key for "web-browser" tool
* fix(handleSubmit.js): set unfinished property to false for all endpoints
* fix(handlers.js): remove unnecessary capitalizeWords function and use action.tool directly
refactor(endpoints.js): rename availableTools to tools and transform it into a map
* feat(endpoints): add plugins selector to endpoints file
refactor(CodeBlock.tsx): refactor to typescript
refactor(Plugin.tsx): use recoil Map for plugin name and refactor to typescript
chore(Message.jsx): linting
chore(PluginsOptions/index.jsx): remove comment/linting
chore(svg): export Clipboard and CheckMark components from SVG index and refactor to typescript
* fix(OpenAPIPlugin.js): rename readYamlFile function to readSpecFile
fix(OpenAPIPlugin.js): handle JSON files in readSpecFile function
fix(OpenAPIPlugin.js): handle JSON URLs in getSpec function
fix(OpenAPIPlugin.js): handle JSON variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add description for variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(loadSpecs.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(Plugin.tsx): remove unnecessary callback parameter in getPluginName function
fix(getDefaultConversation.js): fix browser console error: handle null value for lastConversationSetup in getDefaultConversation function
* feat(api): add new tools
Add Ai PDF tool for super-fast, interactive chats with PDFs of any size, complete with page references for fact checking.
Add VoxScript tool for searching through YouTube transcripts, financial data sources, Google Search results, and more.
Add WebPilot tool for browsing and QA of webpages, PDFs, and data. Generate articles from one or more URLs.
feat(api): update OpenAPIPlugin.js
- Add support for bearer token authorization in the OpenAPIPlugin.
- Add support for custom headers in the OpenAPIPlugin.
fix(api): fix loadTools.js
- Pass the user parameter to the loadSpecs function.
* feat(PluginsClient.js): import findMessageContent function from utils
feat(PluginsClient.js): add message parameter to options object in initializeCustomAgent function
feat(PluginsClient.js): add content to errorMessage if message content is found
feat(PluginsClient.js): break out of loop if message content is found
feat(PluginsClient.js): add delay option with value of 8 to generateTextStream function
feat(PluginsClient.js): add support for process.env.PORT environment variable in app.listen function
feat(askyourpdf.json): add askyourpdf plugin configuration
feat(metar.json): add metar plugin configuration
feat(askyourpdf.yaml): add askyourpdf plugin OpenAPI specification
feat(OpenAPIPlugin.js): add message parameter to createOpenAPIPlugin function
feat(OpenAPIPlugin.js): add description_for_model to chain run message
feat(addOpenAPISpecs.js): remove verbose option from loadSpecs function call
fix(loadSpecs.js): add 'message' parameter to the loadSpecs function
feat(findMessageContent.js): add utility function to find message content in JSON objects
* fix(PluginStoreDialog.tsx): update z-index value for the dialog container
The z-index value for the dialog container was updated to "102" to ensure it appears above other elements on the page.
* chore(web_pilot.json): add "params" field with "user_has_request" parameter set to true
* chore(eslintrc.js): update eslint rules
fix(Login.tsx): add missing semicolon after import statement
* fix(package-lock.json): update langchain dependency to version ^0.0.105
* fix(OpenAPIPlugin.js): change header key from 'id' to 'librechat_user_id' for consistency and clarity
feat(plugins): add documentation for using official ChatGPT Plugins with OpenAPI specs
This commit adds a new file `chatgpt_plugins_openapi.md` to the `docs/features/plugins` directory. The file provides detailed information on how to use official ChatGPT Plugins with OpenAPI specifications. It explains the components of a plugin, including the Plugin Manifest file and the OpenAPI spec. It also covers the process of adding a plugin, editing manifest files, and customizing OpenAPI spec files. Additionally, the commit includes disclaimers about the limitations and compatibility of plugins with LibreChat. The documentation also clarifies that the use of ChatGPT Plugins with LibreChat does not violate OpenAI's Terms of Service.
The purpose of this commit is to provide comprehensive documentation for developers who want to integrate ChatGPT Plugins into their projects using OpenAPI specs. It aims to guide them through the process of adding and configuring plugins, as well as addressing potential issues and
chore(introduction.md): update link to ChatGPT Plugins documentation
docs(introduction.md): clarify the purpose of the plugins endpoint and its capabilities
* fix(OpenAPIPlugin.js): update SUFFIX variable to provide a clearer description
docs(chatgpt_plugins_openapi.md): update information about adding plugins via url on the frontend
* feat(PluginsClient.js): sendIntermediateMessage on successful Agent load
fix(PluginsClient.js, server/index.js, gptPlugins.js): linting fixes
docs(chatgpt_plugins_openapi.md): update links and add additional information
* Update chatgpt_plugins_openapi.md
* chore: rebuild package-lock file
* chore: format/lint all files with new rules
* chore: format all files
* chore(README.md): update AI model selection list
The AI model selection list in the README.md file has been updated to reflect the current options available. The "Anthropic" model has been added as an alternative name for the "Claude" model.
* fix(Plugin.tsx): type issue
* feat(tools): add new tool WebPilot
feat(tools): remove tool Weather Report
feat(tools): add new tool Prompt Perfect
feat(tools): add new tool Scholarly Graph Link
* feat(OpenAPIPlugin.js): add getSpec and readSpecFile functions
feat(OpenAPIPlugin.spec.js): add tests for readSpecFile, getSpec, and createOpenAPIPlugin functions
* chore(agent-demo-1.js): remove unused code and dependencies
chore(agent-demo-2.js): remove unused code and dependencies
chore(demo.js): remove unused code and dependencies
* feat(addOpenAPISpecs): add function to transform OpenAPI specs into desired format
feat(addOpenAPISpecs.spec): add tests for transformSpec function
fix(loadSpecs): remove debugging code
* feat(loadSpecs.spec.js): add unit tests for ManifestDefinition, validateJson, and loadSpecs functions
* fix: package file resolution bug
* chore: move scholarly_graph_link manifest to 'has-issues'
* refactor(client/hooks): convert to TS and export from index
* Update introduction.md
* Update chatgpt_plugins_openapi.md
2023-07-16 12:19:47 -04:00
|
|
|
plugin: action.tool,
|
2023-06-14 13:50:00 -04:00
|
|
|
input: getString(action.toolInput),
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
thought: action.log.includes('Thought: ')
|
|
|
|
? action.log.split('\n')[0].replace('Thought: ', '')
|
2023-07-14 09:36:49 -04:00
|
|
|
: action.log.split('\n')[0],
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
};
|
|
|
|
|
2023-06-14 07:23:11 -04:00
|
|
|
formattedAction.thought = getString(formattedAction.thought);
|
|
|
|
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
if (action.tool.toLowerCase() === 'self-reflection' || formattedAction.plugin === 'N/A') {
|
|
|
|
formattedAction.inputStr = `{\n\tthought: ${formattedAction.input}${
|
|
|
|
!formattedAction.thought.includes(formattedAction.input)
|
|
|
|
? ' - ' + formattedAction.thought
|
|
|
|
: ''
|
|
|
|
}\n}`;
|
|
|
|
formattedAction.inputStr = formattedAction.inputStr.replace('N/A - ', '');
|
|
|
|
} else {
|
2023-06-14 07:23:11 -04:00
|
|
|
const hasThought = formattedAction.thought.length > 0;
|
refactor: Client Classes & Azure OpenAI as a separate Endpoint (#532)
* refactor: start new client classes, test localAi support
* feat: create base class, extend chatgpt from base
* refactor(BaseClient.js): change userId parameter to user
refactor(BaseClient.js): change userId parameter to user
feat(OpenAIClient.js): add sendMessage method
refactor(OpenAIClient.js): change getConversation method to use user parameter instead of userId
refactor(OpenAIClient.js): change saveMessageToDatabase method to use user parameter instead of userId
refactor(OpenAIClient.js): change buildPrompt method to use messages parameter instead of orderedMessages
feat(index.js): export client classes
refactor(askGPTPlugins.js): use req.body.token or process.env.OPENAI_API_KEY as OpenAI API key
refactor(index.js): comment out askOpenAI route
feat(index.js): add openAI route
feat(openAI.js): add new route for OpenAI API requests with support for progress updates and aborting requests.
* refactor(BaseClient.js): use optional chaining operator to access messageId property
refactor(OpenAIClient.js): use orderedMessages instead of messages to build prompt
refactor(OpenAIClient.js): use optional chaining operator to access messageId property
refactor(fetch-polyfill.js): remove fetch polyfill
refactor(openAI.js): comment out debug option in clientOptions
* refactor: update import statements and remove unused imports in several files
feat: add getAzureCredentials function to azureUtils module
docs: update comments in azureUtils module
* refactor(utils): rename migrateConversations to migrateDataToFirstUser for clarity and consistency
* feat(chatgpt-client.js): add getAzureCredentials function to retrieve Azure credentials
feat(chatgpt-client.js): use getAzureCredentials function to generate reverseProxyUrl
feat(OpenAIClient.js): add isChatCompletion property to determine if chat completion model is used
feat(OpenAIClient.js): add saveOptions parameter to sendMessage and buildPrompt methods
feat(OpenAIClient.js): modify buildPrompt method to handle chat completion model
feat(openAI.js): modify endpointOption to include modelOptions instead of individual options
refactor(OpenAIClient.js): modify getDelta property to use isChatCompletion property instead of isChatGptModel property
refactor(OpenAIClient.js): modify sendMessage method to use saveOptions parameter instead of modelOptions parameter
refactor(OpenAIClient.js): modify buildPrompt method to use saveOptions parameter instead of modelOptions parameter
refactor(OpenAIClient.js): modify ask method to include endpointOption parameter
* chore: delete draft file
* refactor(OpenAIClient.js): extract sendCompletion method from sendMessage method for reusability
* refactor(BaseClient.js): move sendMessage method to BaseClient class
feat(OpenAIClient.js): inherit from BaseClient class and implement necessary methods and properties for OpenAIClient class.
* refactor(BaseClient.js): rename getBuildPromptOptions to getBuildMessagesOptions
feat(BaseClient.js): add buildMessages method to BaseClient class
fix(ChatGPTClient.js): use message.text instead of message.message
refactor(ChatGPTClient.js): rename buildPromptBody to buildMessagesBody
refactor(ChatGPTClient.js): remove console.debug statement and add debug log for prompt variable
refactor(OpenAIClient.js): move setOptions method to the bottom of the class
feat(OpenAIClient.js): add support for cl100k_base encoding
feat(OpenAIClient.js): add support for unofficial chat GPT models
feat(OpenAIClient.js): add support for custom modelOptions
feat(OpenAIClient.js): add caching for tokenizers
feat(OpenAIClient.js): add freeAndInitializeEncoder method to free and reinitialize tokenizers
refactor(OpenAIClient.js): rename getBuildPromptOptions to getBuildMessagesOptions
refactor(OpenAIClient.js): rename buildPrompt to buildMessages
refactor(OpenAIClient.js): remove endpointOption from ask function arguments in openAI.js
* refactor(ChatGPTClient.js, OpenAIClient.js): improve code readability and consistency
- In ChatGPTClient.js, update the roleLabel and messageString variables to handle cases where the message object does not have an isCreatedByUser property or a role property with a value of 'user'.
- In OpenAIClient.js, rename the freeAndInitializeEncoder method to freeAndResetEncoder to better reflect its functionality. Also, update the method calls to reflect the new name. Additionally, update the getTokenCount method to handle errors by calling the freeAndResetEncoder method instead of the now-renamed freeAndInitializeEncoder method.
* refactor(OpenAIClient.js): extract instructions object to a separate variable and add it to payload after formatted messages
fix(OpenAIClient.js): handle cases where progressMessage.choices is undefined or empty
* refactor(BaseClient.js): extract addInstructions method from sendMessage method
feat(OpenAIClient.js): add maxTokensMap object to map maximum tokens for each model
refactor(OpenAIClient.js): use addInstructions method in buildMessages method instead of manually building the payload list
* refactor(OpenAIClient.js): remove unnecessary condition for modelOptions.model property in buildMessages method
* feat(BaseClient.js): add support for token count tracking and context strategy
feat(OpenAIClient.js): add support for token count tracking and context strategy
feat(Message.js): add tokenCount field to Message schema and updateMessage function
* refactor(BaseClient.js): add support for refining messages based on token limit
feat(OpenAIClient.js): add support for context refinement strategy
refactor(OpenAIClient.js): use context refinement strategy in message sending
refactor(server/index.js): improve code readability by breaking long lines
* refactor(BaseClient.js): change `remainingContext` to `remainingContextTokens` for clarity
feat(BaseClient.js): add `refinePrompt` and `refinePromptTemplate` to handle message refinement
feat(BaseClient.js): add `refineMessages` method to refine messages
feat(BaseClient.js): add `handleContextStrategy` method to handle context strategy
feat(OpenAIClient.js): add `abortController` to `buildPrompt` method options
refactor(OpenAIClient.js): change `payload` and `tokenCountMap` to let variables in `handleContextStrategy` method
refactor(BaseClient.js): change `remainingContext` to `remainingContextTokens` in `handleContextStrategy` method for consistency
refactor(BaseClient.js): change `remainingContext` to `remainingContextTokens` in `getMessagesWithinTokenLimit` method for consistency
refactor(BaseClient.js): change `remainingContext` to `remainingContext
* chore(openAI.js): comment out contextStrategy option in clientOptions
* chore(openAI.js): comment out debug option in clientOptions object
* test: BaseClient tests in progress
* test: Complete OpenAIClient & BaseClient tests
* fix(OpenAIClient.js): remove unnecessary whitespace
fix(OpenAIClient.js): remove unused variables and comments
fix(OpenAIClient.test.js): combine getTokenCount and freeAndResetEncoder tests
* chore(.eslintrc.js): add rule for maximum of 1 empty line
feat(ask/openAI.js): add abortMessage utility function
fix(ask/openAI.js): handle error and abort message if partial text is less than 2 characters
feat(utils/index.js): export abortMessage utility function
* test: complete additional tests
* feat: Azure OpenAI as a separate endpoint
* chore: remove extraneous console logs
* fix(azureOpenAI): use chatCompletion endpoint
* chore(initializeClient.js): delete initializeClient.js file
chore(askOpenAI.js): delete old OpenAI route handler
chore(handlers.js): remove trailing whitespace in thought variable assignment
* chore(chatgpt-client.js): remove unused chatgpt-client.js file
refactor(index.js): remove askClient import and export from index.js
* chore(chatgpt-client.tokens.js): update test script for memory usage and encoding performance
The test script in `chatgpt-client.tokens.js` has been updated to measure the memory usage and encoding performance of the client. The script now includes information about the initial memory usage, peak memory usage, final memory usage, and memory usage after a timeout. It also provides insights into the number of encoding requests that can be processed per second.
The script has been modified to use the `OpenAIClient` class instead of the `ChatGPTClient` class. Additionally, the number of iterations for the encoding loop has been reduced to 10,000.
A timeout function has been added to simulate a delay of 15 seconds. After the timeout, the memory usage is measured again.
The script now handles uncaught exceptions and logs any errors that occur, except for errors related to failed fetch requests.
Note: This is a test script and should not be used in production
* feat(FakeClient.js): add a new class `FakeClient` that extends `BaseClient` and implements methods for a fake client
feat(FakeClient.js): implement the `setOptions` method to handle options for the fake client
feat(FakeClient.js): implement the `initializeFakeClient` function to initialize a fake client with options and fake messages
fix(OpenAIClient.js): remove duplicate `maxTokensMap` import and use the one from utils
feat(BaseClient): return promptTokens and completionTokens
* refactor(gptPlugins): refactor ChatAgent to PluginsClient, which extends OpenAIClient
* refactor: client paths
* chore(jest.config.js): remove jest.config.js file
* fix(PluginController.js): update file path to manifest.json
feat(gptPlugins.js): add support for aborting messages
refactor(ask/index.js): rename askGPTPlugins to gptPlugins for consistency
* fix(BaseClient.js): fix spacing in generateTextStream function signature
refactor(BaseClient.js): remove unnecessary push to currentMessages in generateUserMessage function
refactor(BaseClient.js): remove unnecessary push to currentMessages in handleStartMethods function
refactor(PluginsClient.js): remove unused variables and date formatting in constructor
refactor(PluginsClient.js): simplify mapping of pastMessages in getCompletionPayload function
* refactor(GoogleClient): GoogleClient now extends BaseClient
* chore(.env.example): add AZURE_OPENAI_MODELS variable
fix(api/routes/ask/gptPlugins.js): enable Azure integration if PLUGINS_USE_AZURE is true
fix(api/routes/endpoints.js): getOpenAIModels function now accepts options, use AZURE_OPENAI_MODELS if PLUGINS_USE_AZURE is true
fix(client/components/Endpoints/OpenAI/Settings.jsx): remove console.log statement
docs(features/azure.md): add documentation for Azure OpenAI integration and environment variables
* fix(e2e:popup): includes the icon + endpoint names in role, name property
2023-07-03 16:51:12 -04:00
|
|
|
const thought = hasThought ? `\n\tthought: ${formattedAction.thought}` : '';
|
2023-06-14 07:23:11 -04:00
|
|
|
formattedAction.inputStr = `{\n\tplugin: ${formattedAction.plugin}\n\tinput: ${formattedAction.input}\n${thought}}`;
|
feat: Plugins endpoint - Reverse Engineering of official Plugins features (#197)
* components for plugins in progress
* WIP: add langchain client implementation for tools/plugins
feat(langchain): add loadHistory function for loading chat history from database
feat(langchain): add saveMessageToDatabase function for saving chat messages to database
* chore(Memory.js): remove Memory.js file from the project directory.
* WIP: adding plugin functionality
——————————————————
fix(eslintrc.js): change arrow-parens rule to always require parentheses
refactor(agent.js): reorganize imports and add new imports
feat(agent.js): add support for saving and loading chat history
feat(agent.js): add support for saving messages to database
feat(agent.js): add ChatAgent class with initialize and sendMessage methods
fix(langchain): use getConvo and saveMessage functions from models.js instead of Conversation and Message models
feat(langchain): add user parameter to loadHistory and saveMessageToDatabase functions
chore(package.json): update langchain package version to 0.0.59 and add langchain script to run test2.js file
——————————————————
* WIP: testing agent initialization
* WIP: testing various agent methods
feat(agent.js): add CustomChatAgent class and initializeAgentExecutorWithOptions method
feat(customChatAgent.js): add CustomPromptTemplate and CustomOutputParser classes
refactor(langchain): uncomment code for input2 and options
feat(langchain): add input1 to read comments on a youtube video
docs(langchain): remove commented code and add whitespace to package.json
* WIP: feat: plugin endpoint, backend class working
* feat(agent.js): add support for Zapier NLA API key
feat(agent.js): add ZapierToolKit to tools if zapierApiKey is provided
feat(customAgent.js): change prompt prefix and suffix to reflect new task-based prompt
feat(test4.js): add test for new task-based prompt
* style(langchain): improve readability and add comments to code
feat(langchain): update prompt message for custom agent
fix(langchain): update message format in test4.js
* style(customAgent.js): remove unnecessary capitalization and rephrase some sentences
test(langchain): add test2 and test3 scripts to package.json
* chore(customAgent.js): fix typo in comment, change "an" to "identical"
* WIP: gpt-4 testing
* feat(langchain): add AIPluginTool and HumanTool classes
fix(langchain): remove zapierApiKey option from ChatAgent constructor
refactor(langchain): update langchain package to v0.0.64
misc(langchain): update test2, test3, and test4 scripts to use --inspect flag
* feat(langchain): add GoogleSearchAPI tool for searching the web using Google Custom Search API
* feat(askGPTPlugins.js): add support for progress callback in ask function
fix(agent.js): pass progress callback to sendApiMessage function
* refactor(agent.js): load tools from options and initialize them in constructor
feat(agent.js): add support for environment variable SERPAPI_API_KEY
feat(agent.js): add support for environment variable ZAPIER_NLA_API_KEY
docs(agent.js): remove commented out code and add comments to clarify code
* chore(langchain): remove unused files loadHistory.js and saveMessage.js
* feat(validateTools.js): add function to validate API keys for supported tools
* feat(langchain): update langchain package to version 0.0.66
feat(langchain): add support for GPT-4 model
fix(server/index.js): fix uncaughtException handler to ignore 'fetch failed' errors
* refactor(agent.js): remove FORMAT_INSTRUCTIONS and replace with a more concise message
refactor(agent.js): remove unused variable 'errorMessage'
refactor(agent.js): change 'result' variable initialization to an empty object instead of null
refactor(agent.js): change error message when response generation fails
refactor(agent.js): change output message when response generation fails
refactor(agent.js): change output message when response generation succeeds
* chore(langchain): comment out unused model in ChatAgent constructor
feat(langchain): add test5 script to package.json for running test5.js script
* refactor(agent.js): change response to answer and update message
refactor(test3.js, test5.js): remove commented out code and add comments
The changes in agent.js are to improve the message that is returned to the user. The word "response" has been changed to "answer" to better reflect the output of the chatbot. The message has also been updated to provide clearer instructions to the user.
The changes in test3.js and test5.js are to remove commented out code and add comments to improve readability.
* docs: update links to LOCAL_INSTALL.md and defaultSystemMessage.md
fix: fix typo in BingAI/Settings.jsx
feat: add Dockerfile for app containerization
docs(google_search.md): add guide for setting up Google Custom Search API key and ID
* docs: update link to system message guidelines in Bing AI Settings component
docs: update link to system message guidelines in GOOGLE_SEARCH.md
feat: add JAILBREAK_INFO.md guide for Bing AI jailbreak mode system message guidelines
* style(api): remove unnecessary quotes and empty values from .env.example
style(agent.js): refactor getActions method to accept an input parameter
feat(agent.js): add handleChainEnd method to CustomChatAgent class
style(customAgent.js): add a new line to the end of the file
style(test5.js): comment out unused variable and update input1 variable
style(googleSearch.js): change tool name to kebab-case
* chore(langchain): comment out handleChainEnd method in agent.js
feat(langchain): add browser tool to ChatAgent in test2.js
feat(langchain): add modelOptions to ChatAgent in test2.js
feat(langchain): change question in input1 and request article review summary in test5.js
* fix(askGPTPlugins.js): fix syntax error by removing extra comma in parentMessageId field
feat(askGPTPlugins.js): add default value of null to parentMessageId parameter in ask function
* fix(askGPTPlugins.js): change endpoint string from 'GPTPlugins' to 'gptPlugins'
feat(endpoints.js): add support for gptPlugins endpoint
feat(PresetItem.jsx): add support for gptPlugins endpoint
feat(HoverButtons.jsx): add support for gptPlugins endpoint
feat(createPayload.ts): add support for gptPlugins endpoint
feat(types.ts): add gptPlugins endpoint to EModelEndpoint enum
feat(endpoints.js): add gptPlugins endpoint to availableEndpoints selector
feat(cleanupPreset.js): add support for gptPlugins endpoint
feat(getDefaultConversation.js): add support for gptPlugins endpoint
feat(getIcon.jsx): add support for gptPlugins endpoint
feat(handleSubmit.js): add support for gptPlugins endpoint
* refactor(agent.js): remove debug option from options object
refactor(agent.js): change tool name from 'google-search' to 'google'
refactor(agent.js): update description for 'google' tool
feat(agent.js): add support for citing sources when using web links in response message
fix(agent.js): update error message to not mention error to user
feat(agent.js): add unique message ids for user message and response message
feat(agent.js): limit number of search results to 5 in 'google' tool
refactor(validateTools.js): add console log to show valid tools
* feat(askGPTPlugins.js): add support for GPT-3.5-turbo model and validate model option
refactor(askGPTPlugins.js): remove unused imports and variables
refactor(askGPTPlugins.js): remove commented code
refactor(askGPTPlugins.js): remove unused parameters in ask function
feat(ask/index.js): add askGPTPlugins route to router
* feat(NewConversationMenu): add alpha tag to gptPlugins endpoint and rename it to Plugins
* refactor(askGPTPlugins.js): remove commented code and unused imports
feat(askGPTPlugins.js): add support for debug option in endpointOption
feat(askGPTPlugins.js): add support for chatGptLabel, promptPrefix, temperature, top_p, presence_penalty, and frequency_penalty in endpointOption
feat(askGPTPlugins.js): add support for sending plugin and pluginend events
feat(askGPTPlugins.js): add onAgentAction and onChainEnd callbacks to ChatAgent.sendMessage
refactor(titleConvo.js): comment out unused imports
refactor(validateTools.js): comment out console.log statement
refactor(agent.js): change saveMessage to include unfinished property
feat(agent.js): add endpoint property to saveConvo call in saveMessageToDatabase
feat(askGPTPlugins.js): add validateTools import and use it to validate endpointOption.tools before passing to ChatAgent constructor
feat(askGPTPlugins.js
* refactor(MessageHeader.jsx): extract plugins section into a separate variable and add support for gptPlugins endpoint
fix(MessageHeader.jsx): disable clicking on non-clickable endpoints
* components for plugins in progress
* feat(Plugin.jsx): add plugin prop to Plugin component and display plugin name
feat(Plugin.jsx): add loading state and display loading spinner
feat(Plugin.jsx): add Disclosure component to Plugin component
feat(Plugin.jsx): add Disclosure.Panel to Plugin component to display team pricing information
feat(Spinner.jsx): add classProp prop to Spinner component to allow for custom styling
feat(Landing.jsx): add Plugin component to Landing page for testing
testing gpt plugins
feat(plugins): Milestone commit
- Add formatAction function to format plugin actions.
- Add prefix.js file to store the prefix message for ChatAgent.
- Update ask function to include plugin object to store plugin data.
- Update onAgentAction and onChainEnd functions to format plugin data and send intermediate messages.
- Update response object to include plugin data.
The `handlers.js` file now includes a `formatAction` function that formats the action object for display in the UI. The `createOnProgress` function now returns a `sendIntermediateMessage` function that sends intermediate messages to the client.
feat (client): add support for plugins in messages
This commit adds support for plugins in messages. It includes changes to the `handlers.js`, `index.jsx`, `CodeBlock.jsx`, `Message.jsx`, `MessageHeader.jsx`, and `Plugin.jsx` files.
The `index.jsx` file now includes a `plugin` property in the `messageHandler` function.
The `CodeBlock.jsx` file now includes a `plugin` property that determines the language of the code block.
The `Message.jsx` file now includes a `Plugin` component that displays the plugin used in the message.
The `MessageHeader.jsx` file now includes a `Plugins` component that displays the enabled plugins.
feat(langchain): add OpenAICreateImage tool for generating images based on user prompts
fix(langchain): update validateTools to include create-image tool
fix(langchain): save plugin data to messageSchema
fix(server/routes/askGPTPlugins.js): save userMessage and response to messageSchema
feat(langchain): add SelfReflectionTool
Add a new tool to the LangChain agent, SelfReflectionTool, which enhances the agent's self-awareness by reflecting on its thoughts before taking action. The tool provides a space for the agent to explore and organize its ideas in response to the user's message.
Also, update the prefix message to reflect the changes in the agent's behavior and the way it should engage with the user. The prefix message now emphasizes the use of tools when necessary, and relying on the agent's knowledge for creative requests. It also provides clear instructions on how to use the 'Action' input and how to carry out tasks in the sequence written by the human.
Finally, update the OpenAICreateImage tool to return the image URL in markdown format. The tool replaces newlines and spaces in the input text with hyphens to create a valid markdown link.
Milestone commit: better error handling with custom output parser, dir and file re-org
style(langchain): fix formatting and add comments to prefix.js
fix(langchain): remove commented out code in test6.js
feat(langchain): reduce maxAttempts from 3 to 2 in CustomChatAgent's buildPromptPrefix method
feat(langchain): add null check for result.output in CustomChatAgent's buildPromptPrefix method
style(langchain): improve consistency and readability of code
This commit improves the consistency and readability of the code in the langchain directory. Specifically, it:
- Changes the case of the "Thought" output in the CustomChatAgent class to match the "Thought" output in the SelfReflectionTool class.
- Adds a currentDateString property to the CustomChatAgent class to avoid repeating the same code in multiple places.
- Updates the prefix in the prefix.js file to match the current objectives of the ChatGPT model.
- Changes the description of the OpenAICreateImage tool to request a description of the image to be generated.
- Updates the tools used by the ChatAgent in the askGPTPlugins.js file to include the Google and Browser tools instead of the Calculator and Create-Image tools.
feat: add wolfram, improve image creation, rename to dall-e
* refactor(langchain): update language and formatting in various files
- Update tool-based instructions to use proper Markdown syntax for image URLs
- Adjust temperature for modelOptions in CustomChatAgent class
- Comment out console.debug statement in CustomChatAgent class
- Update prefix in initializeCustomAgent function to use proper line breaks
- Update prefix in instructions.js to use proper line breaks and change "user" to "human"
- Update input in test6.js to use Ezra Pound instead of Hemingway
- Update return statement in OpenAICreateImage class to use "generated-image" as alt-text
- Update description in SelfReflectionTool class to provide clearer instructions
- Update tools in ask function in askGPTPlugins.js to use only the DALL-E tool and enable debug mode
feat(ask): add support for DALL-E tool in formatAction function
feat(ask): add support for self-reflection tool in formatAction function
feat(Plugin.jsx): add support for self-reflection tool in Plugin component
fix(Plugin.jsx): fix Plugin component to not display 'None' when latest is not available
* docs(openaiCreateImage.js): update tool description to clarify usage
* feat(agent.js): add message parameter to initialize function
feat(agent.js): pass message parameter to SelfReflectionTool constructor
feat(customAgent.js): add longestToolName variable to CustomOutputParser
feat(openaiCreateImage.js): replace new lines with spaces in prompt parameter
feat(selfReflection.js): add message parameter to SelfReflectionTool constructor
feat(selfReflection.js): add placeholder response to selfReflect function
* feat: frontend plugin selection
* fix: agent updates, available tools via endpoint config
* fix: improve frontend plugin selection
* feat: further customize agent and bypass executor when no tools are provided
* fix: key issue in multiselect and allow setting changes during convo in plugins endpoint
* fix: convo will save modelOptions, fix persistent errors with agent
* fix: add looser final answer parsing and edit action formatting
* fix: handle edge case where stop token is not hit and causes long parsing error
* feat: trying new prompt for image creation
* fix: improvements based on gpt-3.5
* feat: allow setting model options throughout plugin conversation
* fix: agent adjustments
* improve final reply for gpt-4, gpt-3.5 needs a more stable approach
* fix: better context output for gpt-3.5
* fix: added clarification for better context output for gpt-3.5
* feat(PluginsOptions): add advanced mode to show/hide options
style(PluginsOptions): add styles for advanced mode and show/hide options
* minor changes to styling
* refactor(langchain): add support for custom GPT-4 agent
This commit adds support for a custom GPT-4 agent in the langchain
module. The `CustomGpt4Agent` class extends the `ZeroShotAgent` class
and includes a new `createPrompt` method that generates a prompt
template for the agent. The `initializeCustomAgent` function has been
updated to use the `CustomGpt4Agent` class when the model is not GPT-3.
The `instructions.js` file has also been updated to include new
instructions for the GPT-4 agent. The `formatInstructions` method has
been removed and replaced with `gpt4Instructions` and `prefix2` and
`suffix2` have been added to include the new instructions.
feat(langchain): add custom output parser for langchain agents
This commit adds a custom output parser for langchain agents. The new parser is called CustomOutputParser and it extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the CustomOutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
This commit also adds a Gpt4OutputParser class that extends ZeroShotAgentOutputParser. It takes a fields object as a parameter and sets the tools and longestToolName properties. It also sets the finishToolNameRegex property to match the final answer. The parse method of the Gpt4OutputParser class takes a text parameter and returns an object with returnValues, log, and toolInput properties.
feat(langchain): add isGpt3 parameter to
* Stable Diffusion Plugin (#204)
* Added stable diffusion plugin
* Added example prompt
* Fixed naming
* Removed brackets in the prompt
* fix: improved agent for gpt-3.5
* fix: outparser, gpt3 instructions, and wolfram error handling
* chore: update langchain to 0.0.71
* fix: long parsing action input fix
* fix: make plugin select close on clicking label/button
* fix: make plugin select close on clicking label/button
* fix: wolfram input formatting and gpt-3 payload without plugins
* chore(api): update axios package version to 1.3.4
feat(api): add requireJwtAuth middleware to askGPTPlugins endpoint
fix(api): replace session user with user id in askGPTPlugins endpoint
docs(LOCAL_INSTALL.md): update guide for local installation and testing
This commit updates the guide for local installation and testing of the
ChatGPT-Clone app. It includes instructions for locally running the app,
updating the app version, and running tests. It also includes a new
option for running the app using Docker. The commit also fixes some
typos and formatting issues.
* add reverseProxy to plugins client
* chore(Dockerfile-app): add Dockerfile for building and running the app in a container
docs: remove outdated guides on Google search and Bing jailbreak mode
docs(LOCAL_INSTALL.md): remove outdated Windows installation instructions and update MeiliSearch configuration file
* fix: handle n/a parsing error better, reduce token waste if no agentic behavior is needed
* style: fix formatting and add parentheses around arrow function parameter
style: change hover background color to white and dark hover background color to gray-700
* chore: re-organize agent dir and files
* feat(ChatAgent.js): add support for PlanAndExecuteAgentExecutor
feat(PlanAndExecuteAgentExecutor.js): add PlanAndExecuteAgentExecutor class
feat(planExecutor.js): add demo for PlanAndExecuteAgentExecutor
* feat: add azure support to plugins
* refactor(utils): add basePath endpoint for genAzureEndpoint
feat(api): add support for Azure OpenAI API in various modules and tools
* feat: add plugin api for fetching available tools
* feat: add data service for getting available plugins
* feat: first iteration plugin store UI
* refactor: rename files to follow proper naming convention
* feat: Plugin store UI components
* feat: create separate user routes, service, controller, and add plugins to user model
* feat: create data service for adding and removing plugins per user
* feat: UI for adding and removing plugins, displaying plugins in dropdown based on what user has installed
* fix: merge conflicts from main
* fix: fix plugin items titles
* fix: tool.value -> tool.pluginKey
* fix: testing returnDirect for self-reflection
* fix: add browser tool to manifest
* refactor(outputParser.js): remove commented out code
feat(outputParser.js): add support for thought input when there is no action input
* handling 'use tool' edge case
* merge main to langchain
* fix(User.js, auth.service.js, localStrategy.js): change deprecated Joi.validate() to schema.validate() method (#322)
* fix(auth.service.js): fixes deprecated error callback in mongoose save method (#323)
* chore: run formatting script with new rules
* refactor: add requiresAuth to manifest, fix uninstall button
* version with plugin auth as dialog modal
* feat: Complete frontend for plugin auth
* frontend styling updates
* feat: api for plugin auth
* feat: Add tooltip with field description to plugin auth form
* fix: issue with plugin that has no auth
* feat(tools): add support for user-specific API keys
This commit adds support for user-specific API keys for the following tools:
- Google Search API
- Web Browser
- SerpAPI
- Zapier
- DALL-E
- Wolfram Alpha API
It also adds support for OpenAI API key for the Web Browser tool.
The `validateTools` function now takes a `user` parameter and checks for user-specific API keys before falling back to environment variables.
The `loadTools` function now takes a `user` parameter and initializes the tools with user-specific API keys if available.
The `manifest.json` file has been updated to include the new `authConfig` fields for the tools that support user-specific API keys.
The `askGPTPlugins.js` file has been updated to use the `validateTools` function with the `user` parameter.
refactor(ChatAgent.js): add user parameter to initialize function and pass it to loadTools function
refactor(tools/index.js): set default value for tools parameter in validateTools function
refactor(askGPTPlugins.js): remove duplicate user variable declaration and use the one from req object
* refactor(ChatAgent.js): await validTool() before pushing to this.tools array
refactor(tools/index.js): use Map instead of Set to store valid tools
refactor(tools/index.js): filter availableTools to only validate tools passed in
refactor(PluginController.js): filter out duplicate plugins by pluginKey
refactor(crypto.js): use environment variables for encryption key and initialization vector
feat(PluginService.js): add null check for pluginAuth in getUserPluginAuthValue()
* feat(api): add credentials key and IV to .env.example for securely storing credentials
* Adds testing for handling tools, introducing a test env to the backend
Fixes bugs & optimizes code as revealed through testing, including:
- wolfram.js: fixes bug where wolfram was not handling authentication
- ChatAgent.js: ChatAgent modified to reflect 'handleTools' changes
- handleTools.js: Moves logic out of index file
- handleTools.js: loadTools: returns only requested tools
- handleTools.js: validTools: correctly returns tools based on authentication
* test(index.test.js): add test to validate a tool from an environment variable
* test(tools): add test for initializing an authenticated tool through Environment Variables
* refactor(ChatAgent.js): remove commented out code and unused imports
* refactor(ChatAgent.js): move instructions to a separate file and import them
fix(ChatAgent.js): replace hardcoded instructions with imported ones
* refactor(ChatAgent.js): change import path for TextStream
refactor(stream.js): remove unused TextStream class
* chore(.gitignore): add .env.test to gitignore
refactor(ChatAgent.js): rename CustomChatAgent to ChatAgent
test(ChatAgent.test.js): add tests for ChatAgent class
refactor(outputParser.js): remove OldOutputParser class
refactor(outputParser.js): rename CustomOutputParser to OutputParser
docs(.env.test.example): add comment explaining how to use OPENAI_API_KEY
refactor(jestSetup.js): use dotenv to load environment variables from .env.test file
* Various optimizations and config, add tests for PluginStoreDialog
* test(ChatAgent.test.js): add test to check if chat history is returned correctly
* test: unit tests for plugin store
* test: add frontend-test script to root package.json
* feat(ChatAgent.js, askGPTPlugins.js): add support for aborting chat requests (in progress)
* test: add more client tests
* feat(ChatAgent): allow plugin requests to be cancelled
* feat(ChatAgent): allow message regeneration
* feat(ChatAgent): remember last selected tools
* Remove plugins we don't yet have from manifest.json
* fix(ChatAgent.js): increase maxAttempts from 1 to 2
fix(ChatAgent.js): change error message to 'Cancelled.' if message was aborted mid-generation
fix(openaiCreateImage.js): replace unwanted characters in input string
fix(handlers.js): compare action.tool in lowercase to 'self-reflection'
* fix(ChatAgent): Fix up plugin I/O formatting for n/a actions
* refactor(Plugin.jsx): remove unused import statement
feat(Plugin.jsx): add Plugin component with svg paths and styles
* refactor: simplify credential encryption/decryption by using a single key and IV for all environments. Update crypto.js and .env.example files accordingly.
* fix(ChatAgent.js): reduce maxAttempts from 2 to 1
feat(ChatAgent.js): add model information to responseMessage object
feat(Message.js): add model field to messageSchema
feat(Message.js): add model field to message object
feat(Message.jsx): pass model information to getIcon function
feat(getIcon.jsx): add Plugin component and handle plugin messages differently
* feat(askGPTPlugins.js): add model property to the ask function response object
feat(EndpointItem.jsx): add message property to the EndpointItem component
feat(MessageHeader.jsx): add Plugin icon to the plugins section
feat(MessageHeader.jsx): change alpha to beta in the plugins section
feat(svg): add Plugin, GPTIcon, and BingIcon components to the svg folder
refactor(EndpointItems.jsx): remove unused import statement
* refactor(googleSearch.js, wolfram.js): change error handling to return a message instead of throwing an error
* refactor(CustomAgent): remove commented code and change return object to include returnValues property
* feat(CustomAgent.js): add currentDateString to createPrompt method options
deps(api/package.json): update langchain to v0.0.81
* fix: do not show pagination if the maxPage is 1
* Add Zapier back to manifest (accidentally removed)
* chore(api): update langchain dependency to version 0.0.84
* feat(DALL-E.js): add DALL-E tool for generating images using OpenAI's DALL-E API
refactor(handleTools.js): update import for DALL-E tool
refactor(index.test.js): update import for DALL-E tool
refactor(stablediffusion.js): add check for image directory existence before saving image
* refactor(CustomAgent): rename instructions prefix variable to gpt3 and add gpt4 instructions
feat(CustomAgent): add support for gpt-4 model
fix(initializeCustomAgent.js): pass model name to createPrompt method
fix(outputParser.js): set selectedTool to 'self-reflection' when tool parsing fails
* style(langchain/tools): update guidelines for image creation in DALL-E and StableDiffusion
- Update guidelines for image creation in DALL-E and StableDiffusion tools
- Emphasize the importance of "showing" and not "telling" the imagery in crafting input
- Update formatting for the example prompt for generating a realistic portrait photo of a man
- Generate images only once per human query unless explicitly requested by the user
* docs(tools): update tool descriptions for DALL-E and Stable Diffusion
- Update the description for DALL-E tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
- Update the description for Stable Diffusion tool to indicate that it is exclusively for visual content and provide guidelines for generating images with a focus on visual attributes.
* chore(api): update "@waylaidwanderer/chatgpt-api" dependency to version "^1.36.3"
* refactor(ChatAgent.js): use environment variable for reverse proxy url
refactor(ChatAgent.js): use environment variable for openai base path
refactor(instructions.js): update gpt3 and gpt3-v2 instructions
refactor(outputParser.js): update finishToolNameRegex in CustomOutputParser class
* refactor(DALL-E.js): change apiKey and azureKey fields to uppercase
refactor(googleSearch.js): change cx and apiKey fields to uppercase
feat(manifest.json): add authConfig field for Stable Diffusion WebUI API URL
refactor(stablediffusion.js): add url field to constructor and change getServerURL() to this.url
refactor(wolfram.js): change apiKey field to uppercase WOLFRAM_APP_ID
* refactor(handleTools.js): simplify tool loading and add support for custom tool constructors and options
* refactor(handleTools.js): remove commented out code and unused imports
* refactor(handleTools.js, index.js): change file name from wolfram.js to Wolfram.js and selfReflection.js to SelfReflection.js to follow PascalCase convention
* refactor(outputParser.js, askGPTPlugins.js): improve code readability and remove unnecessary comments
* feat(GoogleSearch.js): add GoogleSearchAPI tool to allow agents to use the Google Custom Search API
feat(SelfReflection.js): add SelfReflectionTool to allow agents to reflect on their thoughts and actions
feat(StableDiffusion.js): add StableDiffusionAPI tool to allow agents to generate images using stable diffusion webui's api
feat(Wolfram.js): add WolframAlphaAPI tool for computation, math, curated knowledge & real-time data through WolframAlpha.
* testing openai specs
* doc: fix link in .env.example
* package-update
* fix(MultiSelectDropDown.jsx): handle null or undefined values in availableValues array
* refactor(DALL-E.js, StableDiffusion.js): remove 'dist/' from image path
feat(docker-compose.yml): add comments for reverse proxy configuration
* chore(.gitignore): ignore client/public/images/
fix(DALL-E.js, StableDiffusion.js): change image path from dist/ to public/
feat(index.js): add support for serving static files from client/public/ directory
* fix: remove selected tool when uninstalled
* plugin options in progress
* fix: fix issue with uninstalling a plugin that is in use and typescript errors
* feat(gptPlugins): add Preset support for GPT Plugins endpoint
feat(ChatAgent.js): add support for agentOptions object
feat(convoSchema.js): add agentOptions field to conversation schema
feat(defaults.js): add agentOptions object to defaults
feat(presetSchema.js): add agentOptions field to preset schema
feat(askGPTPlugins.js): add support for agentOptions object in request body
feat(EditPresetDialog.jsx): add support for showing/hiding GPT Plugins agent settings
feat(EditPresetDialog.jsx): add support for setting GPT Plugins agent options
fix(EndpointOptionsDialog.jsx): change endpoint name from 'gptPlugins' to 'Plugins'
feat(AgentSettings.jsx): add AgentSettings component for GPT plugins configuration
feat(client): add GPT Plugins settings component and endpoint to Settings component
fix(client): remove unused imports in GoogleOptions component
feat(PluginsOptions): add support for agent settings and refactor code
feat(PluginsOptions): add GPTIcon to show/hide agent settings button
feat(index.ts): export SVG components
feat(GPTIcon.jsx): add className prop to GPTIcon component
feat(GPTIcon.jsx): import cn function from utils
feat(BingIcon.tsx): export BingIcon component
feat(index.ts): export BingIcon component
feat(index.ts): export MessagesSquared component
refactor(cleanupPreset.js): add default values for agentOptions in gptPlugins endpoint
feat(getDefaultConversation.js, handleSubmit.js): add agentOptions object to conversation object for GPT plugins endpoint. Update default temperature value to 0.8. Add chatGptLabel and promptPrefix properties to conversation object.
* fix: set default convo back to null
* refactor(ChatAgent.js, askGPTPlugins.js, AgentSettings.jsx): change variable names for better readability and remove redundant code
* test: add RecoilRoot to layout-test-utils
* refactor(askGPTPlugins.js): remove redundant code and use endpointOption directly
feat(askGPTPlugins.js): add validation for tools in endpointOption before using it
* chore(ChatAgent.js, Settings.jsx): add agentOptions to saveConvo function and adjust Settings component height
The ChatAgent.js file was modified to include the agentOptions object in the saveConvo function. The Settings.jsx file was modified to adjust the height of the component to ensure that all content is visible.
* refactor(ChatAgent.js): extract reverseProxyUrl option to a class property and add support for it
feat(ChatAgent.js): add support for completionMode option in sendApiMessage method
feat(ChatAgent.js): add support for user-provided promptPrefix in buildPrompt method
* feat(plugins): allow preset change mid conversation
* chore: update OPENAI_KEY to OPENAI_API_KEY in .github/playwright.yml and api/.env.example
refactor(chatgpt-client.js): update OPENAI_KEY to OPENAI_API_KEY
feat(langchain): add demo-aiplugin.js and demo-yaml.js, remove test2.js, test3.js, and test4.js
chore: remove unused test files
fix(titleConvo.js): fix typo in environment variable name
fix(askGPTPlugins.js): fix typo in environment variable name
fix(endpoints.js): fix typo in environment variable name
docs: update installation guide to use OPENAI_API_KEY instead of OPENAI_KEY in .env file
* fix(index.test.js): change import of GoogleSearchAPI to use uppercase G in GoogleSearch
* chore(api): bump langchain version
* feat(PluginController.js): authenticate plugins from environment variables if they are set
feat(PluginStoreDialog.tsx): show plugin auth form only if plugin is not authenticated by env var and require authentication
feat(types.ts): add authenticated field to TPlugin type definition
* docs: update google_search.md and add stable_diffusion.md
* Update stable_diffusion.md
* refactor(Wolfram.js): remove newline characters from query before encoding
docs(wolfram.md): add instructions for setting WOLFRAM_APP_ID in api.env to bypass prompt for AppID in plugin
* refactor(Wolfram.js): replace deprecated replaceAll method with replace method
* Update wolfram.md
* fix(askGPTPlugins): error message will reference correct Parent Message
* refactor(chatgpt-client.js, ChatAgent.js): simplify maxContextTokens calculation and add promptPrefix parameter to buildPrompt method
* docs: initial draft of intro to plugins
* Update introduction.md
* Update introduction.md
* Feature: User/Reg cleanup + Install / Upgrade script for langchain (#427)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* feature: Init a app config file
- Simplifies the ENV vars too
- Legacy fallbacks for older builds
* refactor(auth): Refactor log in/out controllers
- Moves both login and logout controllers to their own file
* chore(jwt): Throw warning if secret is default
* feature(frontend): Ability to disable registration
* feature(env): Env in the root + version support
ie .env.prod, .env.dev, .env.test
* feature: Upgrade .env script for users
* chore(config): Refactor and remove legacy env refs
* feature(upgrade): Upgrade script for .env changes
* feature: Install script and upgrade script
* bugfix: Uncomment line to remove old .env file
* chore: rename OPENAI_KEY to OPENAI_API_KEY
* chore: Cleanup config changes/bugs
* bugfix: Fix config and node env issues
* bugfix: Config validation logic
* bugfix: Handle unusual env configs gracefully
* bugfix: Revert route changes and fix registration disable calling
* bugfix: Fix env issues in frontend
* bugfix: Fix login
* bugfix: Fix frontend envs
* bugfix: Fix frontend jest tests
* bugfix: Fix upgrade scripts
* bugfix: Allow install in non-tty envs
* bugfix(windows): Use cross-env to set for windows
* bugfix(env): Handle .env being incorrect to begin with for client domain
* chore(merge-conflict): Update to LibreChat
* chore(merge-conflict): Update to package-lock
---------
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
* chore: comment out unused agent options
* Update langchain plugins docs (#461)
* Update: install docs (LibreChat) (#458)
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Release: rename project from ChatGPT Clone to LibreChat
Release: rename project from ChatGPT Clone to LibreChat
* Update documentation_guidelines.md
* Update introduction.md
add link to readme
* Update stable_diffusion.md
add link back to readme
* Update wolfram.md
add link back to readme
* Update README.md
add Plugins to ToC
* feat(ChatAgent.js): add support for langchainProxy configuration option
Add a new configuration option `langchainProxy` to the ChatAgent class. If the option is set, the `basePath` configuration option of the `ChatOpenAI` instance is set to the base path of `langchainProxy`.
* bugfix(errors): Possible workaround for error flashing (#463)
* Test/user auth system client tests (#462)
* test: login tests
* test: finish login tests
* test: initial tests for registration
* test: registration specs
* chore(api): update langchain dependency to version 0.0.91
* Update introduction.md
* Update introduction.md
* Update introduction.md
* fix: no longer renders html in markdown content
fix: patch XSS vulnerability completely by handling cursor on the frontend without css/html
* fix(Content.jsx): fix cursor logic so it never shows for static messages
* bugfix(langchain): Upgrade script, docker, env and docs (#465)
* bugfix(errors): Remove incorrect manual fix from misunderstanding
* chore(env): Lets not make a .env.prod and use the prod values in the default root .env
- .env.dev will still be created
* chore(upgrade.js): Lets tell the user about .env.dev if we create it
* bugfix(env): Move to full name environments for vite
- .env.prod => .env.production
- .env.dev => .env.development
* chore(env-example): Explain how to get google login working in production
* bugfix(oauth): Minor fix to point isProduction to a correct value
* bugfix: Typo in public
* chore(docs): Update docs to note the changes to .env
* chore(docs): Include note on how to get google auth working in dev and how to disable registration
* bugfix: Fix missing env changes
* bugfix: Fix up docker to work with new env / npm changes
* Update .env.example
Cleanup the env of the palm2 instruction and fix to formating
* chore(docker): Simplify Docker deployments
- Needs work to support dev env/hotreload
* bugfix: Remove volume map for client dir
* chore(env-example): Change instructions to be more user centric
---------
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
* update: install docs (#466)
* Add files via upload
* Update apis-and-tokens.md
* Update apis-and-tokens.md
* Update docker_install.md
* Update linux_install.md
* Rename apis-and-tokens.md to apis_and_tokens.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update mac_install.md
* Update linux_install.md
* Update docker_install.md
* Update README.md
* Update README.md : Breaking Changes
---------
Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
* Update README.md (#468)
add new API/Token docs to Toc
* docs: guide on how to create your own plugin
* Update make_your_own.md
* Update make_your_own.md
* feat(docker): add build args for frontend variables in Dockerfile
feat(docker-compose): add build args for frontend variables in docker-compose.yml
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* Update docker_install.md
* docs: update (#469)
* Update: make_your_own.md
* Update README.md
add `make_your_own.md` to ToC
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update docker_install.md
* Update docker_install.md
* Update linux_install.md
* Update mac_install.md
* Update windows_install.md
* Update apis_and_tokens.md
* Update user_auth_system.md
* Update docker_install.md
clean up of repeated information
* Update docker_install.md
* Update docker_install.md
typo
* fix: fix issue with pluginstore next and prev buttons going out of bounds
* fix: add icon for web browser plugin
* docs(GoogleSearch.js): update description of GoogleSearchAPI class to be more descriptive of its functionality
* feat(ask/handlers.js): add cursor to indicate ongoing progress of a long-running task
fix(Content.jsx): handle null content in the message stream by replacing it with an empty string (with a space so a text space is rendered)
* Update README.md
* Update README.md
* fix: plugin option stacking order
* update: web browser icon (#470)
* Delete web-browser.png
* update: web browser icon
* Update readme (#472)
* Update README.md
Discord badge now displays the number of online users
Project description has been updated to reflect current status
Feature section has been updated to reflect current capabilities
Sponsors section is now located just above the contributors section
Roadmap has been removed as it was outdated.
* Delete roadmap.md
Roadmap has been removed to streamline document maintenance.
* Update README.md
* Update README.md
* Delete CHANGELOG.md
* fix: pluginstore in mobile view getting clipped and not scrolling
* docs(linux_install.md): remove duplicate git clone command
* chore(Dockerfile): comment out nginx-client build stage
docs(README.md): update installation instructions and mention docker-compose changes
docs(features/plugins/introduction.md): bold plugin names and add emphasis to notes
* feat: add superscript and subscript support to markdown rendering
refactor: support markdown citations for BingAI
* refactor: support markdown citations for BingAI
---------
Co-authored-by: David Shin <42793498+dncc89@users.noreply.github.com>
Co-authored-by: Daniel D Orlando <dan@danorlando.com>
Co-authored-by: LaraClara <2524209+ClaraLeigh@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
2023-06-10 19:10:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return formattedAction;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
handleError,
|
|
|
|
sendMessage,
|
|
|
|
createOnProgress,
|
|
|
|
handleText,
|
|
|
|
formatSteps,
|
2023-07-14 09:36:49 -04:00
|
|
|
formatAction,
|
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
2023-08-17 12:50:05 -04:00
|
|
|
addSpaceIfNeeded,
|
feat: ChatGPT Plugins/OpenAPI specs for Plugins Endpoint (#620)
* wip: proof of concept for openapi chain
* chore(api): update langchain dependency to version 0.0.105
* feat(Plugins): use ChatGPT Plugins/OpenAPI specs (first pass)
* chore(manifest.json): update pluginKey for "Browser" tool to "web-browser"
chore(handleTools.js): update customConstructor key for "web-browser" tool
* fix(handleSubmit.js): set unfinished property to false for all endpoints
* fix(handlers.js): remove unnecessary capitalizeWords function and use action.tool directly
refactor(endpoints.js): rename availableTools to tools and transform it into a map
* feat(endpoints): add plugins selector to endpoints file
refactor(CodeBlock.tsx): refactor to typescript
refactor(Plugin.tsx): use recoil Map for plugin name and refactor to typescript
chore(Message.jsx): linting
chore(PluginsOptions/index.jsx): remove comment/linting
chore(svg): export Clipboard and CheckMark components from SVG index and refactor to typescript
* fix(OpenAPIPlugin.js): rename readYamlFile function to readSpecFile
fix(OpenAPIPlugin.js): handle JSON files in readSpecFile function
fix(OpenAPIPlugin.js): handle JSON URLs in getSpec function
fix(OpenAPIPlugin.js): handle JSON variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add description for variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(loadSpecs.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(Plugin.tsx): remove unnecessary callback parameter in getPluginName function
fix(getDefaultConversation.js): fix browser console error: handle null value for lastConversationSetup in getDefaultConversation function
* feat(api): add new tools
Add Ai PDF tool for super-fast, interactive chats with PDFs of any size, complete with page references for fact checking.
Add VoxScript tool for searching through YouTube transcripts, financial data sources, Google Search results, and more.
Add WebPilot tool for browsing and QA of webpages, PDFs, and data. Generate articles from one or more URLs.
feat(api): update OpenAPIPlugin.js
- Add support for bearer token authorization in the OpenAPIPlugin.
- Add support for custom headers in the OpenAPIPlugin.
fix(api): fix loadTools.js
- Pass the user parameter to the loadSpecs function.
* feat(PluginsClient.js): import findMessageContent function from utils
feat(PluginsClient.js): add message parameter to options object in initializeCustomAgent function
feat(PluginsClient.js): add content to errorMessage if message content is found
feat(PluginsClient.js): break out of loop if message content is found
feat(PluginsClient.js): add delay option with value of 8 to generateTextStream function
feat(PluginsClient.js): add support for process.env.PORT environment variable in app.listen function
feat(askyourpdf.json): add askyourpdf plugin configuration
feat(metar.json): add metar plugin configuration
feat(askyourpdf.yaml): add askyourpdf plugin OpenAPI specification
feat(OpenAPIPlugin.js): add message parameter to createOpenAPIPlugin function
feat(OpenAPIPlugin.js): add description_for_model to chain run message
feat(addOpenAPISpecs.js): remove verbose option from loadSpecs function call
fix(loadSpecs.js): add 'message' parameter to the loadSpecs function
feat(findMessageContent.js): add utility function to find message content in JSON objects
* fix(PluginStoreDialog.tsx): update z-index value for the dialog container
The z-index value for the dialog container was updated to "102" to ensure it appears above other elements on the page.
* chore(web_pilot.json): add "params" field with "user_has_request" parameter set to true
* chore(eslintrc.js): update eslint rules
fix(Login.tsx): add missing semicolon after import statement
* fix(package-lock.json): update langchain dependency to version ^0.0.105
* fix(OpenAPIPlugin.js): change header key from 'id' to 'librechat_user_id' for consistency and clarity
feat(plugins): add documentation for using official ChatGPT Plugins with OpenAPI specs
This commit adds a new file `chatgpt_plugins_openapi.md` to the `docs/features/plugins` directory. The file provides detailed information on how to use official ChatGPT Plugins with OpenAPI specifications. It explains the components of a plugin, including the Plugin Manifest file and the OpenAPI spec. It also covers the process of adding a plugin, editing manifest files, and customizing OpenAPI spec files. Additionally, the commit includes disclaimers about the limitations and compatibility of plugins with LibreChat. The documentation also clarifies that the use of ChatGPT Plugins with LibreChat does not violate OpenAI's Terms of Service.
The purpose of this commit is to provide comprehensive documentation for developers who want to integrate ChatGPT Plugins into their projects using OpenAPI specs. It aims to guide them through the process of adding and configuring plugins, as well as addressing potential issues and
chore(introduction.md): update link to ChatGPT Plugins documentation
docs(introduction.md): clarify the purpose of the plugins endpoint and its capabilities
* fix(OpenAPIPlugin.js): update SUFFIX variable to provide a clearer description
docs(chatgpt_plugins_openapi.md): update information about adding plugins via url on the frontend
* feat(PluginsClient.js): sendIntermediateMessage on successful Agent load
fix(PluginsClient.js, server/index.js, gptPlugins.js): linting fixes
docs(chatgpt_plugins_openapi.md): update links and add additional information
* Update chatgpt_plugins_openapi.md
* chore: rebuild package-lock file
* chore: format/lint all files with new rules
* chore: format all files
* chore(README.md): update AI model selection list
The AI model selection list in the README.md file has been updated to reflect the current options available. The "Anthropic" model has been added as an alternative name for the "Claude" model.
* fix(Plugin.tsx): type issue
* feat(tools): add new tool WebPilot
feat(tools): remove tool Weather Report
feat(tools): add new tool Prompt Perfect
feat(tools): add new tool Scholarly Graph Link
* feat(OpenAPIPlugin.js): add getSpec and readSpecFile functions
feat(OpenAPIPlugin.spec.js): add tests for readSpecFile, getSpec, and createOpenAPIPlugin functions
* chore(agent-demo-1.js): remove unused code and dependencies
chore(agent-demo-2.js): remove unused code and dependencies
chore(demo.js): remove unused code and dependencies
* feat(addOpenAPISpecs): add function to transform OpenAPI specs into desired format
feat(addOpenAPISpecs.spec): add tests for transformSpec function
fix(loadSpecs): remove debugging code
* feat(loadSpecs.spec.js): add unit tests for ManifestDefinition, validateJson, and loadSpecs functions
* fix: package file resolution bug
* chore: move scholarly_graph_link manifest to 'has-issues'
* refactor(client/hooks): convert to TS and export from index
* Update introduction.md
* Update chatgpt_plugins_openapi.md
2023-07-16 12:19:47 -04:00
|
|
|
};
|