Commit graph

302 commits

Author SHA1 Message Date
Gabriel Almeida
fa9825849a fix(validate.py): change logger.exception to logger.error to avoid logging traceback 2023-05-07 20:15:29 +00:00
Gabriel Almeida
17863c6e93 refactor(loading.py): add try-except block to handle KeyError when removing 'model' from params dictionary 2023-05-06 08:30:25 -03:00
Gabriel Almeida
64bf97ff84 chore(base.py): add type ignore comment to clear_cache function
fix(base.py): raise ValueError if content is None in save_binary_file function
feat(nodes.py): add memory field to TimeTravelGuideChainNode
test(test_chains_template.py): add test for memory field in TimeTravelGuideChainNode
2023-05-04 18:24:12 -03:00
Gabriel Almeida
e0761cfe23 refactor(agents): change tool_names variable from list to set
The `tool_names` variable was changed from a list to a set in the `JsonAgent`, `CSVAgent`, `VectorStoreAgent`, `SQLAgent`, and `MalfoyAgent` classes. This change was made to improve performance and avoid duplicates.
2023-05-02 23:23:36 +00:00
Gabriel Almeida
1b10041730 refactor(base.py): simplify type of Union fields to the first type in the Union
fix(test_agents_template.py): set value of list field to an empty list
fix(test_llms_template.py): change type of 'request_timeout' field to float
2023-05-02 23:23:36 +00:00
Gabriel Almeida
9d3098f3e2 refactor(langflow): reorder imports in multiple files
This commit reorders imports in multiple files to follow PEP8 guidelines
and improve code readability. No functional changes were made.
2023-05-02 23:23:36 +00:00
Gabriel Almeida
7a50129149 refactor(loading.py): process params before instantiating class object 2023-05-02 16:39:33 -03:00
Gabriel Almeida
7dddd641cf refactor(agents): change tool_names from set to list
This commit changes the `tool_names` variable from a set to a list in the `JsonAgent`, `CSVAgent`, `VectorStoreAgent`, `SQLAgent`, `VectorStoreRouterAgent`, `MalfoyAgent`, and `load_agent_executor_from_config` classes. This is done to ensure that the `tool_names` variable is always a list, even when there is only one tool.
2023-05-02 15:11:32 -03:00
Gabriel Almeida
d79f655d88 refactor(loading.py): use get method to set allowed_tools to an empty list if it is not present in params dictionary 2023-05-02 15:04:28 -03:00
Gabriel Almeida
8e1cb1d732 refactor(util.py): add support for Sequence and Set types in format_dict function 2023-05-02 13:12:03 -03:00
Gabriel Almeida
c623b02bf2 refactor(loading.py): make allowed_tools a list if it's not already a list or set 2023-05-02 11:29:38 -03:00
Gabriel Almeida
4eea69c563 refactor(agents, loading): change tool_names from list to set
This commit changes the `tool_names` variable from a list to a set in several
places in the codebase. This is done to improve performance and readability
since the `tool_names` variable is used as a set in the code. The affected
files are `custom.py`, `prebuilt.py`, and `loading.py`.
2023-05-02 10:56:01 -03:00
Gabriel Almeida
96ef8fd657 refactor(loading.py): remove unused imports and add validation for class_object parameters that are not in __fields__ attribute. 2023-05-01 22:52:17 -03:00
Gabriel Almeida
a44f6123a3 refactor(base.py): change default value of advanced field from True to False in TemplateFieldCreator class 2023-05-01 19:39:02 -03:00
Gabriel Almeida
5ebf71116d feat(nodes.py): make "llm" field required and show it in the frontend 2023-05-01 19:16:36 -03:00
Gabriel Almeida
5d424474f2 fix(util.py): handle ValueError when parsing tool name and description from ast.literal_eval() 2023-05-01 18:55:35 -03:00
Gabriel Almeida
811c3f75cf fix(utils.py): import statement for AsyncCallbackManager was incorrect, changed from langchain.callbacks.base to langchain.callbacks.manager 2023-05-01 18:55:27 -03:00
Gabriel Almeida
cc3841c9bf refactor(agents): import BaseLanguageModel from base_language module instead of schema module 2023-05-01 18:40:24 -03:00
Gabriel Almeida
f0ba11c840 other template fixes 2023-04-29 19:35:10 -03:00
Gabriel Almeida
17c58fd70d fixed api key fields 2023-04-29 19:27:38 -03:00
Gabriel Almeida
79a18b8c40 fix nodes advanced param 2023-04-29 19:23:12 -03:00
Gabriel Almeida
ce82b7e611 remove unused imports 2023-04-29 07:38:27 -03:00
Gabriel Almeida
ffb2aad45d fixes to tests 2023-04-29 07:38:06 -03:00
Gabriel Almeida
3a5b708d53 deactivate class params check for now 2023-04-29 07:37:32 -03:00
Gabriel Almeida
f3d50e9fea formatting 2023-04-29 07:37:16 -03:00
anovazzi1
8a169c9782 merged chat_and_cache into dev 2023-04-29 01:26:44 -03:00
Gabriel Almeida
8d5adbf266 fix: tests 2023-04-29 00:36:06 -03:00
Gabriel Almeida
1c35179aec refactor(nodes.py): remove unnecessary else statement in ChainFrontendNode class 2023-04-28 23:38:36 -03:00
Gabriel Almeida
659491f9a2 feat(langflow): add function support to build_template_from_class function
feat(langflow): add function base class to InitializeAgentNode

The `build_template_from_class` function in `ChainCreator` now supports adding a function to the chain. This is done by passing `add_function=True` to the function.

In `InitializeAgentNode`, the `base_classes` attribute has been updated to include the `function` base class. This allows the node to be used as a function in the chain.
2023-04-28 23:30:12 -03:00
Gabriel Almeida
c3dffa3508 feat(chat_manager.py): add empty_history method to ChatHistory class
fix(chat_manager.py): empty chat history for a client when an exception is raised
fix(GenericNode): fix useEffect dependencies to avoid unnecessary re-renders
2023-04-28 20:31:53 -03:00
Gabriel Almeida
c5d09f0e88 refactor(nodes.py): set advanced field to False for fields other than prompt in ChainFrontendNode class 2023-04-28 20:07:59 -03:00
Gabriel Almeida
0fd8f73c08 refactor(langflow): set advanced flag to True for TemplateFieldCreator class
refactor(langflow): set advanced flag to False for LLMFrontendNode class' api key field
feat(langflow): add show flag to LLMFrontendNode class' model_kwargs field
refactor(langflow): set advanced flag to False and show flag to True for LLMFrontendNode class' model_name and temperature fields
2023-04-28 19:17:38 -03:00
Gabriel Almeida
8e2342cf21 feat(loading.py): add validation for pydantic BaseModel subclasses
This commit adds validation for pydantic BaseModel subclasses in the
instantiate_class function. The function now checks if the class_object
is a subclass of BaseModel and if so, it validates the params passed to
it against the fields of the class_object.
2023-04-28 17:22:51 -03:00
Gabriel Almeida
357d13b1a9 refactor(validate.py): change wrapped_function from async to sync
fix(test_chains_template.py): set prompt show value to False for mid_journey_prompt_chain and time_travel_guide_chain tests
2023-04-28 15:45:53 -03:00
Gabriel Almeida
d52e7700c0 fix(nodes.py): set prompt field as not required and show it if no prompt is provided 2023-04-28 14:42:38 -03:00
anovazzi1
1f9cc38fd8 Merge branch 'dev' into NodeModal 2023-04-27 20:37:04 -03:00
anovazzi1
65172707d9 Merge branch 'dev' into NodeModal 2023-04-27 20:22:21 -03:00
Gabriel Almeida
3b5b63e070 refactor(loading.py): add comment explaining type ignore for agent variable 2023-04-27 15:03:11 -03:00
Gabriel Almeida
f00420ecbe feat(custom.py): pass llm parameter to SQLDatabaseToolkit constructor 2023-04-27 15:03:11 -03:00
Gabriel Almeida
7a951dcc59 refactor(cache/manager.py): extract add method to reduce code duplication
feat(cache/manager.py): add support for custom extensions when adding objects to cache
2023-04-27 12:11:02 -03:00
Gabriel Almeida
9cf286d4d3 refactor(base.py): remove print statement from ToolCreator class 2023-04-26 09:02:57 -03:00
Gabriel Luiz Freitas Almeida
5dbca85512
Merge branch 'chat_and_cache' into 186-endpoints-for-node-validation-and-debugging 2023-04-26 01:28:43 -03:00
Gabriel Almeida
0945dbe582 style(chat_manager.py, chatMessage/index.tsx): fix indentation and formatting issues 2023-04-26 00:55:44 -03:00
Gabriel Almeida
5894f32ab0 refactor(chat_manager.py): close connection in finally block to prevent memory leaks and improve code readability 2023-04-25 23:17:45 -03:00
Gabriel Almeida
aacfa378f3 refactor(langflow): add verbose and fix_memory_inputs to langchain_object
Add verbose and fix_memory_inputs to langchain_object in load_flow_from_json function. The verbose attribute is set to True if it exists in the langchain_object. The fix_memory_inputs function is called on the langchain_object.
2023-04-25 23:12:44 -03:00
Gabriel Almeida
ed2a2c7db8 feat(chat_manager.py): send error message to client when an exception occurs 2023-04-25 23:07:05 -03:00
Gabriel Almeida
70bfc77a82 feat(chat_manager.py): add base64 encoding for image data in FileResponse objects 2023-04-25 22:15:36 -03:00
Gabriel Almeida
d3b72f3958 refactor(chat_manager.py): add comment to clarify iteration direction in get_file_responses method 2023-04-25 22:12:06 -03:00
Gabriel Almeida
9f8b474a36 refactor(chat_manager.py): prevent notification when message is a FileResponse instance 2023-04-25 22:06:26 -03:00
Gabriel Almeida
4dcfd9d1db feat(chat_manager.py): add file responses to ChatResponse
feat(schemas.py): add files field to ChatResponse schema
2023-04-25 22:01:50 -03:00