This commit introduces a new `PageAssistSelect` component to the header, which replaces the previous `Select` component for selecting the active chat model. The new component provides improved functionality, including:
- Ability to display provider icons alongside the model name
- Truncation of long model names to ensure they fit within the available space
- Improved loading state handling
- Ability to refresh the model list on demand
These changes enhance the user experience and make it easier for users to quickly select the desired chat model.
Adds error handling to the `updateMessageByIndex` function to prevent the temporary chat from breaking when an error occurs during the update process. This ensures a more robust and reliable experience for users.
This commit addresses an issue where temporary chat history was not being updated correctly when using voice input.
The `setHistoryId` function is now called within the `saveMessageOnError` function to ensure that the history ID is set correctly when a message is saved.
This commit introduces a more efficient approach to fetching ollama2 models, ensuring proper filtering and handling of providers. This enhances the robustness and reliability of the model loading process, streamlining the overall user experience.
Expanded the list of providers for which models are fetched dynamically to include Ollama and Llamafile, removing the need for manual model addition in the user interface for these providers. This simplifies the user experience and ensures users always have access to the latest models without manual intervention.
Adds support for using Ollama 2 as a model provider. This includes:
- Adding Ollama 2 to the list of supported providers in the UI
- Updating the model identification logic to properly handle Ollama 2 models
- Modifying the model loading and runtime configuration to work with Ollama 2
- Implementing Ollama 2 specific functionality in the embedding and chat models
This change allows users to leverage the capabilities of Ollama 2 for both embeddings and conversational AI tasks.
Add support for LlamaFile, a new model provider that allows users to interact with models stored in LlamaFile format. This includes:
- Adding an icon for LlamaFile in the provider selection menu.
- Updating the model provider selection to include LlamaFile.
- Updating the model handling logic to properly identify and process LlamaFile models.
- Updating the API providers list to include LlamaFile.
This enables users to leverage the capabilities of LlamaFile models within the application.
The code was relying on optional fields like `content` in chat history and chunk objects, leading to potential errors if these fields were missing. This commit ensures proper handling of these fields by adding optional chaining (`?.`) for safer access. This prevents crashes and ensures the application handles the missing fields gracefully.
Adds a new "Temporary Chat" mode for quick, non-persistent conversations. The new mode is available in the header bar and will trigger a visually distinct chat experience with a temporary background color. Temporary chats do not save to the chat history and are meant for short, one-off interactions. This feature enhances flexibility and provides a more convenient option for users who need to quickly interact with the AI without committing the conversation to their history.
Adds support for using the currently selected system prompt in the current model settings. This allows users to fine-tune their chat experience based on their preferred prompt.
Adds a new setting to control the maximum number of tokens generated by the model. This provides more control over the length of responses and can be useful for limiting the amount of text generated in certain situations.
Adds the `generationInfo` field to the message history output to provide more context about the message's origin. This will be helpful for debugging and understanding the provenance of messages.
This commit introduces a new feature that displays generation information for each message in the chat.
The generation info is displayed in a popover and includes details about the model used, the prompt, and other relevant information. This helps users understand how their messages were generated and troubleshoot any issues that may arise.
The generation info is retrieved from the LLM response and is stored in the database alongside other message details.
This commit also includes translations for the generation info label in all supported languages.
Support `equation` and `align` environments for LaTeX.
This change enables us to handle more complex LaTeX expressions, including those within environments. By replacing the delimiters for these environments with the appropriate MathJax equivalents, we ensure consistent rendering of mathematical equations within the application.
The previous LaTeX preprocessing logic had a bug that could lead to incorrect rendering of mathematical equations. This commit refactors the logic to ensure that both block-level and inline equations are properly handled, improving the accuracy of LaTeX rendering in the application.
Adds a "Save" button to the edit message form in Playground, allowing users to save changes without immediately submitting them. This also introduces a new `isSend` flag to the `onEditFormSubmit` prop, enabling developers to control whether a message should be sent immediately or saved for later submission. This enhances flexibility and user control during the message editing process.
Adds LaTeX processing to the code, enabling the rendering of LaTeX equations within the application. This improves the user experience by allowing users to insert mathematical formulas directly into the content.
The LaTeX processing is implemented using a dedicated utility function that replaces LaTeX tags with appropriate MathJax syntax, ensuring seamless rendering. This change is expected to have a positive impact on the overall user experience, making the application more versatile and convenient for users who work with mathematical content.
Firefox does not allow extensions to run content scripts on PDF pages, so we have to work around this limitation. This commit adds a workaround that retrieves the PDF URL and type directly from the tab. This ensures that the extension can handle PDFs in Firefox while waiting for the bug in Firefox to be fixed.
Adds a button to the Hugging Face website allowing users to download models directly from the Page Assist extension. The button appears next to the copy snippet button on model pages. This allows users to easily pull models directly to their local machine for use with Ollama.
The button triggers a confirmation dialog, ensuring users understand the action before proceeding. The process leverages a background script to handle the actual download and displays a message during the download process.
Adds pin/unpin functionality to the chat history sidebar, allowing users to keep important conversations readily accessible. This improves user experience and helps organize past interactions.
This feature includes:
- Pin/unpin buttons in the chat history sidebar.
- Updated database schema to include `is_pinned` field for chat history items.
- Localized translations for pin/unpin actions.
- Updated UI to display pinned items at the top of the list.
The language detection mechanism has been removed to streamline the translation process and ensure a consistent user experience across all locales. This change aims to simplify the i18n setup and minimize potential complexities associated with dynamic language switching.
Adds a new "Download Code" button to the code block component, allowing users to download the code displayed for offline use.
This feature enhances user convenience and provides a more versatile experience for exploring and utilizing code snippets.
Refine the Playground's UI to improve user experience:
- Streamline chat window layout for better message readability
- Introduce a knowledge selection dropdown for easier context setting
- Improve image upload integration for a smoother workflow
- Optimize spacing and styling for a more polished visual appearance
Adds an HTML preview feature to the code block component, allowing users to view the rendered output of their HTML code snippets. This improves the user experience by providing a more interactive and informative way to understand the code.
Adds the "OpenAI" provider to the list of available OpenAI API providers, enabling users to connect to and use their own OpenAI API keys. This change expands the flexibility of the application, allowing users to leverage the power of OpenAI models directly without relying solely on the provided provider.
Shorten the displayed embedding model names in the knowledge settings by removing the "embedding" suffix. This improves readability and makes the table more concise.