Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Info tooltips and links to docs, fixes component duplication #554

Merged
merged 47 commits into from
Jun 27, 2023

Conversation

ogabrielluiz
Copy link
Contributor

@ogabrielluiz ogabrielluiz commented Jun 27, 2023

  • Adds button in the Toolbar in the components with docs available
  • Adds a new info attribute to TemplateField to allow passing field-specific information if needed.
  • Fixes a bug when duplicating components

Cristhianzl and others added 30 commits June 23, 2023 19:18
… prop change to fix inputList not updating on prop change

🔒 chore(utils.ts): add random number to getRandomKeyByssmm function to reduce the chance of key collision
…n input value changes

✨ feat(inputListComponent): add PopUpContext to be able to close pop-ups when input value changes
🐛 fix(floatComponent): add missing context imports and dependencies
🐛 fix(intComponent): add missing context imports and dependencies
This commit adds a new property to the LangChainTypeCreator class called docs_map, which is a dictionary that maps the name of the component to its documentation link. The docs_map property is used to set the documentation of the component in the signature of the component. This change improves the readability and maintainability of the code by making it easier to add and update documentation for components.
…ntation of the frontend node

✨ feat(frontend_node): add documentation field to the frontend node dict representation
The `set_documentation` method is added to the `FrontendNode` class to allow setting the documentation of the frontend node. The `to_dict` method is updated to include the `documentation` field in the dict representation of the frontend node. This improves the readability and usability of the frontend node by providing documentation for the node.
…tation link to node toolbar

🚀 feat(api/index.ts): add documentation field to APIClassType
The unused imports were removed to improve code readability. A documentation link was added to the node toolbar to allow users to easily access the documentation for the node. The documentation field was added to the APIClassType to allow for the storage of a link to the documentation for the API class.
…space and consistent formatting

The code has been refactored to improve readability by adding whitespace and consistent formatting. The function names have been updated to use camelCase for consistency. The updateDisplay_name function has been updated to use a logical OR operator instead of a ternary operator for better readability. The updateNodeDocumentation function has been added to update the node documentation. The updateNodeBaseClasses, updateNodeEdges, updateNodeDescription, and updateNodeTemplate functions have been updated to use consistent parameter names and whitespace.
…o prevent empty href

The documentation link was previously always rendered, even if the href was empty. This caused an issue where the link would be clickable but lead to nowhere. The fix adds a conditional rendering to the link, so it is only rendered if the href is not empty.
… list to dictionary

The default values of the settings attributes were changed from an empty list to an empty dictionary. This change was made to avoid errors that could occur when trying to access a non-existent key in the dictionary.
…_template function

The test_few_shot_prompt_template function is not being used and is not necessary for the tests. Removing it will make the code cleaner and easier to maintain.
…ormers integrations

This commit adds documentation links for the LlamaCpp and CTransformers integrations in the config.yaml file. The links point to the relevant documentation pages on the LangChain website. This improves the accessibility of the documentation for these integrations.
…ass to VectorStoreFrontendNode

The VectorStoreFrontendNode class now has VectorStoreRetriever as an extra base class in addition to BaseRetriever. This change was made to improve the functionality of the class by allowing it to inherit from VectorStoreRetriever.
… memories

Added documentation links for new integrations and memories to improve the documentation of the project. The new integrations are Cohere and HuggingFaceHub, and the new memories are ConversationBufferWindowMemory and VectorStoreRetrieverMemory.
…urn types

This commit adds type hints to the function parameters and return types in the loading.py file. This improves the readability and maintainability of the codebase by making it easier to understand the expected types of the parameters and return values of the functions.
…CharacterTextSplitter

The RecursiveCharacterTextSplitter class in textsplitters.py now has a new field called separator_type. This field is used to specify the type of separator to be used in the splitter. The separator_type field is a string and can take any value from the Language enum or "Text". This change was made to improve the flexibility of the RecursiveCharacterTextSplitter class.
…ions

Added documentation links to the vectorstores integrations in the config.yaml file. This will make it easier for developers to access the documentation for each integration.
🐛 fix(loading.py): fix type hinting in instantiate_embedding function
🔨 refactor(loading.py): add type hinting to instantiate_textsplitter function
The changes in this commit add type hinting to the `instantiate_agent`, `instantiate_embedding`, and `instantiate_textsplitter` functions to improve code readability and maintainability. The `instantiate_embedding` function had a bug in its type hinting which has been fixed.
…ser experience

The tooltip now includes a link to the documentation of the node, which makes it more accessible and user-friendly. The link is now wrapped in the tooltip title, which improves the semantics of the code.
The commit changes the comparison operator from '==' to 'is' to compare object types. This is because 'is' compares the object identity while '==' compares the object value. In this case, we want to compare the object identity, so 'is' is the correct operator to use.
…cessary check for RecursiveCharacterTextSplitter

The import of RecursiveCharacterTextSplitter was removed as it was not being used in the code. The instantiation of TextSplitter was fixed by removing the unnecessary check for RecursiveCharacterTextSplitter and simplifying the code.
🔥 refactor(loading.py): remove unused import of RecursiveCharacterTextSplitter
…onents

🔧 refactor(tabsContext.tsx): add missing type annotations and improve code readability
🔧 refactor(ApiModal): improve code readability by adding a new line to a JSX element
🔧 refactor(EditNodeModal): remove unnecessary blank line in a JSX element
… a more readable and maintainable code structure

✨ feat(GenericNode/index.tsx): add documentation link to GenericNode component and display it as a tooltip when hovering over the info icon.
…ders, embeddings, and llms

Added documentation links for various document loaders, embeddings, and llms to improve the readability and usability of the config.yaml file. These links provide a quick reference to the documentation for each of the modules, making it easier for developers to understand and use them.
The ParameterComponent now has an info icon and tooltip to show additional information about the parameter. The GenericNode component now passes the info prop to the ParameterComponent to show the additional information. The ParameterComponentType has been refactored to include the info property.
🎨 style(parameterComponent): add info icon and tooltip to show additional information
🚀 feat(GenericNode): pass info prop to ParameterComponent to show additional information
ogabrielluiz and others added 11 commits June 27, 2023 07:33
…eld and OPENAI_API_BASE_INFO constant

The `info` field is added to the `TemplateField` class to provide additional information about the field. The `OPENAI_API_BASE_INFO` constant is added to the `constants.py` file to provide information about the base URL of the OpenAI API and how it can be changed to use other APIs like Prem and LocalAI. The `info` field is set to `OPENAI_API_BASE_INFO` for the `openai_api_base` field in the `LLMFrontendNode` class in `llms.py`.
…al API options

This commit updates the documentation in the constants.py file to include additional API options that can be used instead of the default OpenAI API. The new options are JinaChat, LocalAI, and Prem. This change provides more information to the user and allows them to make an informed decision when choosing an API to use.
… main.py and rename create_app to setup_app

✨ feat(__main__.py, main.py): add support for a custom static files directory to be passed as an argument to the app
The `setup_static_files` function has been moved from `__main__.py` to `main.py` to improve code organization. The function has also been renamed to `setup_app` to better reflect its purpose. The `create_app` function has been renamed to `setup_app` to follow the naming convention of the new function. The `setup_app` function now accepts an optional argument `static_files_dir` which allows the user to specify a custom directory for static files. This improves the flexibility of the app as it can now be run with a custom frontend.
Added a setup_app function to reuse the app object
…to True

The ChatConfig class is added to the project with a single attribute, streaming, set to True. This attribute is used to determine whether the chatbot should use streaming or request-response communication with the client.
…ntiation and set ChatConfig.streaming based on openai_api_base parameter

This commit adds a new function `instantiate_llm` to handle LLM (Language Model) instantiation. It also sets the `ChatConfig.streaming` attribute based on the `openai_api_base` parameter. This is a workaround to ensure that JinaChat works until streaming is implemented.
The first change removes an extra blank line in the ChatManager class. The second change updates the try_setting_streaming_options function to use the ChatConfig class to set the streaming option instead of hardcoding it. This makes the code more modular and easier to maintain.
…_app function

The variable name static_files_dir was changed to improve semantics. It is now more clear that it is a directory path. An optional static_files_dir parameter was added to the setup_app function to allow for a directory path to be passed in. This allows for more flexibility in serving static files.
🐛 fix(__main__.py): fix static_files_dir variable name to improve semantics
@ogabrielluiz ogabrielluiz added the Release Label to be set only on release PR label Jun 27, 2023
🔥 refactor(manager.py): remove unnecessary blank line at the end of the file
The package version has been updated to 0.2.3 in the pyproject.toml file. This is a chore as it does not affect the functionality of the package. The blank line at the end of the manager.py file has been removed as it is unnecessary and does not add any value to the code. This is a refactor as it improves the code readability.
The ShadTooltipComponent has been refactored to destructure the props and add types to improve readability and maintainability. The ShadTooltipProps type has been added to the types/components/index.ts file to define the expected props for the ShadTooltipComponent. The delayDuration, side, content, and children props are now destructured from the props object and have their respective types defined.
…tion tooltip

The required indicator is now next to the title, which improves readability and makes it easier to see which parameters are required. The documentation tooltip has been simplified to only show the documentation link, which improves the user experience by reducing clutter. Unused imports have been removed to improve code quality.
🔨 refactor(parameterComponent): move required indicator next to title
… component

The delayDuration prop was removed from all ShadTooltip components in the ExtraSidebar component. This improves the user experience by removing the delay before the tooltip is displayed.
…ter visibility and consistency

🐛 fix(nodeToolbarComponent): fix documentation link not working when no documentation is provided
The button colors and icons have been updated to improve visibility and consistency. The delete and copy buttons now have a darker background color when hovered over. The edit button now has a rounded right corner and a lighter background color when there are no nodes present. The documentation button now shows a "Coming Soon" tooltip when no documentation is provided and has a muted color. The documentation link now works correctly even when no documentation is provided.
@ogabrielluiz ogabrielluiz merged commit a795632 into main Jun 27, 2023
3 checks passed
@ogabrielluiz ogabrielluiz deleted the release branch June 27, 2023 19:32
@ogabrielluiz ogabrielluiz restored the release branch June 27, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Label to be set only on release PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants