Commit graph

6,479 commits

Author SHA1 Message Date
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
Gabriel Almeida
167d6c0f1e refactor(chat_manager.py): add continue statement to clear_history block to skip message processing 2023-04-25 21:47:50 -03:00
Gabriel Almeida
ea210af19b refactor(chat_manager.py, utils.py): remove unused imports and functions, move pil_to_base64 and try_setting_streaming_options to utils module 2023-04-25 21:46:02 -03:00
Gabriel Almeida
42a17e3aaf refactor(chat_manager.py): remove redundant or condition in line 129
feat(chat_manager.py): add strip() method to intermediate_steps to remove leading/trailing whitespaces
2023-04-25 20:50:49 -03:00
Gabriel Almeida
57826f1248 fix(api/chat.py): catch and log exceptions in websocket endpoint
fix(api/chat_manager.py): remove async from ChatHistory.add_message and on_chat_history_update
fix(interface/run.py): remove async from async_get_result_and_steps
refactor(utils/util.py): remove unused code and simplify sync_to_async decorator
2023-04-25 20:26:17 -03:00
Gabriel Almeida
db46f80ac8 Merge remote-tracking branch 'origin/websocket' into chat_and_cache 2023-04-25 19:11:40 -03:00
Gabriel Almeida
60e09a3628 feat(langflow): add support for async functions in Node's func parameter
fix(langflow): fix Node's func parameter to be a coroutine function if it is a sync function
2023-04-25 19:11:04 -03:00
Gabriel Almeida
601ec86273 style(langflow): fix formatting and add type hinting to custom.py and run.py files 2023-04-25 17:47:43 -03:00
anovazzi1
bc97420b5e Merge remote-tracking branch 'origin/chat_and_cache' into websocket 2023-04-25 17:34:21 -03:00
Gabriel Almeida
2d68541650 refactor(api): remove sender field from ChatMessage and ChatResponse schemas
fix(api): fix ChatManager.get_history method to exclude start and stream messages
feat(api): add is_bot field to ChatMessage, ChatResponse, and FileResponse schemas
2023-04-25 17:30:53 -03:00
anovazzi1
8932a959c0 Merge remote-tracking branch 'origin/chat_and_cache' into websocket 2023-04-25 16:41:20 -03:00
Gabriel Almeida
e1544aadae chore(pyproject.toml): add websockets dependency
refactor(chat_manager.py): remove redundant json.dumps() and convert BaseModel to dict before sending to websocket
2023-04-25 16:35:17 -03:00
anovazzi1
7f2ad60a35 Merge remote-tracking branch 'origin/chat_and_cache' into websocket 2023-04-25 15:42:06 -03:00
Gabriel Almeida
0f0366ebbb Refactor chromadb import in run.py for type hinting
This commit modifies run.py to use type hinting and avoid circular imports by changing the import for NotEnoughElementsException to use type: ignore. Specifically, the code now imports from chromadb.errors instead of chromadb.exceptions.
2023-04-25 15:38:21 -03:00
Gabriel Almeida
c14fb1eac3 feat(base.py): add logic to detect api keys in FrontendNode fields 2023-04-25 15:38:21 -03:00
Gabriel Almeida
3497161105 fix(base.py): set OpenAI API Key field as not required 2023-04-25 15:38:21 -03:00
Gabriel Almeida
c6d2d96da8 refactor(nodes.py): set 'required' field to False for API key and token fields to support loading from environment variables 2023-04-25 15:38:21 -03:00
Gabriel Almeida
7af5f68861 feat(validate): add debounced validation for nodes in GenericNode component
fix(validate): set validation status to "success" or "error" based on response status
feat(validate): add state for validation status and outline color in GenericNode component
refactor(validate): use useDebouncedCallback hook for debouncing validation function
refactor(validate): simplify useEffect dependencies in GenericNode component
2023-04-25 14:31:57 -03:00
Gabriel Almeida
9f5f222f2a refactor(base.py): remove print statement from ToolCreator class 2023-04-25 09:38:28 -03:00
Gabriel Almeida
f122151b12 fix(validate.py): raise an exception with a message when node is not found
feat(GenericNode): add node validation with outline color feedback
feat(tailwind.config.js): add styles for outline colors and animations
2023-04-24 13:43:52 -03:00
Gabriel Almeida
09320824a9 refactor(validate.py): extract build_graph function to langflow.interface.run module
feat(validate.py): add post_validate_node endpoint to validate a single node in the graph by its id
2023-04-24 10:32:15 -03:00
Gabriel Almeida
23eb511560 Merge branch 'dev' of https://github.com/logspace-ai/langflow into dev 2023-04-24 08:40:49 -03:00
Gabriel Almeida
23fbec9d42 feat(loading.py): add error handling for empty documents in vectorstore instantiation
feat(loading.py): add optional build parameter to load_flow_from_json function
2023-04-24 08:40:06 -03:00
Rodrigo Nader
76162a9ffa feat(langflow): Handle ChromaDB NotEnoughElementsException
This change adds error handling to catch a specific exception that may occur when processing documents with the ChromaDB library. If there are not enough documents for indexing, the error message will suggest reducing the chunk size in TextSplitter.
2023-04-23 23:06:10 -03:00