Commit graph

2,433 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
09a72fa856
Bugfix - Deep-cloning the nodes when duplicate (#547) 2023-06-27 13:16:21 -03:00
Gabriel Luiz Freitas Almeida
ae5f04a1b0
Merge branch 'release' into bugfix-duplicate 2023-06-27 13:15:49 -03:00
Gabriel Luiz Freitas Almeida
3a5cd957c3
Added info parameter to fields (#552) 2023-06-27 12:10:53 -03:00
Gabriel Luiz Freitas Almeida
93c3f7a2a6 feat(__main__.py): add optional static_files_dir parameter to setup_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
2023-06-27 11:09:26 -03:00
Gabriel Luiz Freitas Almeida
b741853454 🔧 chore(utils.py): use ChatConfig to set streaming option
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.
2023-06-27 10:16:41 -03:00
Gabriel Luiz Freitas Almeida
7c6845b15e 🔧 chore(loading.py): add instantiate_llm function to handle LLM instantiation 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.
2023-06-27 10:16:19 -03:00
Gabriel Luiz Freitas Almeida
c86f72e7a6 🎉 feat(config.py): add ChatConfig class with streaming attribute set 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.
2023-06-27 10:11:39 -03:00
Gabriel Luiz Freitas Almeida
b005f8d87c
Merge pull request #553 from logspace-ai:setup_app
Added a setup_app function to reuse the app object
2023-06-27 09:47:18 -03:00
Gabriel Luiz Freitas Almeida
f78088bdb2 🔧 refactor(__main__.py, main.py): move setup_static_files function to 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.
2023-06-27 09:44:20 -03:00
Gabriel Luiz Freitas Almeida
0d84d19657 📝 docs(constants.py): update OpenAI API base info to include additional 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.
2023-06-27 07:44:20 -03:00
Gabriel Luiz Freitas Almeida
415bee7384 🔧 chore(base.py, constants.py, llms.py): add info field to TemplateField 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`.
2023-06-27 07:33:35 -03:00
Gabriel Luiz Freitas Almeida
87af22d059 🔨 refactor(components): add info property to ParameterComponentType
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
2023-06-27 07:33:01 -03:00
Gabriel Luiz Freitas Almeida
e362cfcf16
Adds an Info button that links to docs (#539) 2023-06-26 23:16:58 +00:00
Gabriel Luiz Freitas Almeida
92aec903ea 📝 docs(config.yaml): add documentation links for various document loaders, 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.
2023-06-26 19:53:51 -03:00
Cristhian Zanforlin Lousa
47fcdaef41 🎨 style(GenericNode/index.tsx): refactor GenericNode component to use 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.
2023-06-26 18:29:27 -03:00
Cristhian Zanforlin Lousa
fcedf08073 🔧 refactor(frontend): remove unnecessary blank lines in multiple components
🔧 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
2023-06-26 17:11:47 -03:00
Gabriel Luiz Freitas Almeida
52329b36dc Merge remote-tracking branch 'origin/main' into dev 2023-06-26 14:54:53 -03:00
Gabriel Luiz Freitas Almeida
d4e01f28ef
Hotfix to AgentInitializer (#546) 2023-06-26 16:44:05 +00:00
Gabriel Luiz Freitas Almeida
644fc98271 🚀 chore(pyproject.toml): update package version to 0.2.2
The package version has been updated to 0.2.2 to reflect the changes made to the package. This is a chore commit as it does not include any functional changes to the package.
2023-06-26 13:38:00 -03:00
Gabriel Luiz Freitas Almeida
2b73f8fd5f
Merge branch 'main' into release 2023-06-26 16:36:59 +00:00
Gabriel Luiz Freitas Almeida
c51a90c537 🚀 feat(custom.py): add AgentType enum to improve readability and type safety
The `AgentType` enum is added to the `langchain.agents.custom` module to improve readability and type safety. The `InitializeAgent` class now uses the `AgentType` enum to ensure that the `agent` parameter is a valid value from the enum.
2023-06-26 13:27:05 -03:00
Gabriel Luiz Freitas Almeida
2d77aaaa15 🐛 fix(loading.py): fix instantiation of TextSplitter by removing unnecessary 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
2023-06-26 07:58:49 -03:00
Gabriel Luiz Freitas Almeida
6459a27777 🐛 fix(loading.py): use 'is' instead of '==' to compare object types
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.
2023-06-25 21:37:24 -03:00
Gabriel Luiz Freitas Almeida
7d415e62df 🎨 style(GenericNode): refactor tooltip to improve accessibility and user 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.
2023-06-25 21:32:48 -03:00
Rodrigo Nader
ae71a54a06
Main (#543) 2023-06-25 20:08:33 -03:00
Rodrigo Nader
f373d18502
Fix Icons, Add LLM Caching (#542)
- Fixed Icons that were not set properly on refactor.
- Added LLM Caching
2023-06-25 20:03:53 -03:00
Gabriel Luiz Freitas Almeida
a3efa8fe5d 🐛 fix(utils.py): fix import order to avoid import errors
The import order was changed to avoid import errors. The import of langchain was moved to the top of the file to avoid circular import errors.
2023-06-25 19:52:49 -03:00
Gabriel Luiz Freitas Almeida
31ee134ee7 Merge branch 'llm_caching' into release 2023-06-25 19:51:56 -03:00
Gabriel Luiz Freitas Almeida
5cd809ea6a 🔼 chore(pyproject.toml): update langchain dependency to version 0.0.215
🔼 chore(pyproject.toml): bump package version to 0.2.1
The langchain dependency has been updated to version 0.0.215, which includes bug fixes and performance improvements. The package version has been bumped to 0.2.1 to reflect the changes made.
2023-06-25 19:45:00 -03:00
Gabriel Luiz Freitas Almeida
6f9e6922df 🐛 fix(utils.ts): correct typo in MidjourneyIcon import
The import statement for the MidjourneyIcon was misspelled as MidjorneyIcon, which caused a runtime error. This commit fixes the typo by changing the import statement to MidjourneyIcon.
2023-06-25 19:42:56 -03:00
Gabriel Luiz Freitas Almeida
263ca75fd5 feat(utils.ts): add new icons to nodeIconsLucide
The import of Boxes and LayoutDashboard were removed as they were not being used in the file. New icons were added to nodeIconsLucide to improve the variety of icons available for use. The new icons added are MongoDBAtlasVectorSearch, Pinecone, and SupabaseVectorStore.
🔥 chore(utils.ts): remove unused import of Boxes and LayoutDashboard
2023-06-25 19:39:30 -03:00
Gabriel Luiz Freitas Almeida
a2197bfeb5 🐛 fix(Midjorney): fix typo in import statement and component name
The import statement and component name were both misspelled as "Midjorney" instead of "Midjourney". This commit fixes the typo in both places.
2023-06-25 19:39:20 -03:00
Naveen Choudhary
31f3b74c90 Update pyproject.toml 2023-06-25 19:35:39 -03:00
Gabriel Luiz Freitas Almeida
0c398fb6c5 🔨 refactor(loading.py): add type hinting to instantiate_agent function
🐛 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.
2023-06-25 19:34:25 -03:00
Gabriel Luiz Freitas Almeida
9510474aa6 📝 docs(config.yaml): add documentation links to vectorstores integrations
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.
2023-06-25 18:59:40 -03:00
Gabriel Luiz Freitas Almeida
005e7ec51c 🚀 feat(textsplitters.py): add a field for separator type in RecursiveCharacterTextSplitter
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.
2023-06-25 18:57:45 -03:00
Gabriel Luiz Freitas Almeida
217225467f 🔨 refactor(loading.py): add type hints to function parameters and return 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.
2023-06-25 18:57:35 -03:00
Gabriel Luiz Freitas Almeida
d4599a52b3 📝 docs(config.yaml): add documentation links for new integrations and 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.
2023-06-25 18:37:18 -03:00
Gabriel Luiz Freitas Almeida
a45947c01b 🚀 feat(vectorstores.py): add VectorStoreRetriever as an extra base class 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.
2023-06-25 18:37:05 -03:00
Gabriel Luiz Freitas Almeida
5f56384dce 🚀 feat(__main__.py): add support for cache configuration
The `update_settings` function now accepts a `cache` parameter that allows the user to specify the type of cache to use. The `cache` parameter is set to a default value of `SQLiteCache` and can be overridden by setting the `LANGCHAIN_CACHE` environment variable. This feature improves the flexibility of the application as it allows the user to choose the type of cache that best suits their needs.
2023-06-25 18:20:21 -03:00
Gabriel Luiz Freitas Almeida
a15da8eb0d 🚀 feat(settings.py): add cache configuration option
The cache configuration option has been added to the settings file with a default value of "InMemoryCache". This allows the user to choose the cache implementation they want to use.
2023-06-25 18:20:13 -03:00
Gabriel Luiz Freitas Almeida
89c2e5b064 🚀 feat(utils.py): add support for configurable LLM caching
This commit adds support for configurable LLM caching. The `setup_llm_caching` function now imports the cache class from the `langchain.cache` module based on the `settings.cache` value. If the import is successful, the `langchain.llm_cache` is set to an instance of the cache class. If the import fails, a warning is logged. If an exception is raised during the setup, a warning is logged with the error message.
2023-06-25 18:19:59 -03:00
Rodrigo Nader
1a318a82ae
Update README.md 2023-06-25 17:40:14 -03:00
Gustavo Schaedler
3287f45137
Add LLM cache (#541)
 feat(main.py): call setup_llm_caching function on app startup
The `setup_llm_caching` function is added to `utils.py` to set up LLM
caching. The function is then called on app startup in `main.py` using
the `app.on_event("startup")` method. This improves the performance of
the application by caching LLM objects.
2023-06-25 21:00:34 +01:00
Gabriel Luiz Freitas Almeida
02befe5052 📝 docs(config.yaml): add documentation links for LlamaCpp and CTransformers 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.
2023-06-25 09:27:44 -03:00
Gabriel Luiz Freitas Almeida
d523b7f8b0 fix: removing placeholders 2023-06-25 09:26:13 -03:00
Gabriel Luiz Freitas Almeida
29542f4cf8 🔧 chore(utils.py): add setup_llm_caching function to set up LLM caching
 feat(main.py): call setup_llm_caching function on app startup
The `setup_llm_caching` function is added to `utils.py` to set up LLM caching. The function is then called on app startup in `main.py` using the `app.on_event("startup")` method. This improves the performance of the application by caching LLM objects.
2023-06-25 09:12:41 -03:00
Gabriel Luiz Freitas Almeida
d0893d2eb7 🔥 chore(test_prompts_template.py): remove unused test_few_shot_prompt_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.
2023-06-24 16:53:13 -03:00
Gabriel Luiz Freitas Almeida
e7ce83562f 🐛 fix(settings.py): change default values of settings attributes from 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.
2023-06-24 16:38:24 -03:00
Gabriel Luiz Freitas Almeida
aa4b7bfc32 🐛 fix(GenericNode): add conditional rendering to documentation link to 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.
2023-06-24 16:38:11 -03:00