Commit graph

1,175 commits

Author SHA1 Message Date
Gabriel Almeida
f83160cf21 refactor(langflow): organize imports in multiple files
This commit organizes imports in multiple files to follow PEP8 guidelines
and improve code readability. No functionality changes were made.
2023-05-10 11:42:36 -03:00
Gabriel Almeida
7c1c513106 refactor(loading.py): refactor instantiate_class function to improve readability and maintainability 2023-05-10 11:41:34 -03:00
Gabriel Almeida
31062f2a8c refactor(run.py): remove unused process_graph function
refactor(test_graph.py): update get_result_and_steps to get_result_and_thought function name
2023-05-10 11:31:06 -03:00
Gabriel Almeida
222bb119d3 refactor(chat_manager.py): remove unused code and method call in ChatManager constructor
refactor(chat_manager.py): remove unused method call in ChatManager.handle_message()
2023-05-10 11:30:46 -03:00
Gabriel Almeida
fc007e4349 Merge remote-tracking branch 'origin/dev' into streaming 2023-05-10 11:19:04 -03:00
Gabriel Almeida
81f6382b40 Merge remote-tracking branch 'origin/chatUpdate' into streaming 2023-05-10 11:01:08 -03:00
dataman
67db4ba69c change line endings to linux. the other way was not wokring consistantly 2023-05-10 10:34:17 +00:00
dataman
858d84e2a2 change line endings to linux. 2023-05-10 10:34:17 +00:00
anovazzi1
eb4ebc4b3d first version image 2023-05-09 22:29:31 -03:00
anovazzi1
08dacd7042 handle files on end 2023-05-09 20:07:48 -03:00
anovazzi1
5c2c9b943b fancy code block implemmented 2023-05-09 19:33:44 -03:00
anovazzi1
4ca064ebdc fixed duplicated message 2023-05-09 18:02:43 -03:00
anovazzi1
bb5dae166f added markdown github extension and latex sintax to the user message 2023-05-09 17:31:56 -03:00
anovazzi1
aafb14add3 added markdown github extension and latex sintax to the chat 2023-05-09 17:31:30 -03:00
anovazzi1
702834731d Merge branch 'streaming' into chatUpdate 2023-05-09 17:12:44 -03:00
Gabriel Almeida
79fb021307 refactor(chat_manager.py): remove unused code block in ChatManager class 2023-05-09 16:52:04 -03:00
Gabriel Luiz Freitas Almeida
ae1ed90b35
Merge pull request #267 from logspace-ai:better_predict
Predict endpoint now has better docs and better API
2023-05-09 17:09:45 +00:00
Gabriel Almeida
2c836c1950 fix: remove snake to normal case from export flow 2023-05-09 13:19:53 -03:00
Gabriel Almeida
0bc96208e4 refactor(api): change predict endpoint to use async/await and add response model
feat(api): add predict request and response schemas
refactor(interface): rename get_result_and_steps to get_result_and_thought and remove async prefix
fix(interface): use get_result_and_thought instead of async_get_result_and_steps in process_graph_cached
2023-05-09 13:19:19 -03:00
Gabriel Almeida
f6bc152dab fix(chat_manager.py): add missing import statement
feat(chat_manager.py): add chat message to chat history when received and sent
2023-05-09 12:37:15 -03:00
Gabriel Almeida
956b28b6e9 refactor(chatModal): add condition to concatenate message string only if end is false 2023-05-09 11:52:01 -03:00
anovazzi1
7f162789a1 improve on markdwon, but image from bot is comming as code block 2023-05-08 18:16:51 -03:00
Gabriel Almeida
3a412510d8 Merge branch 'chatUpdate' of https://github.com/logspace-ai/langflow into streaming 2023-05-08 15:40:28 -03:00
anovazzi1
055b68a2a2 basic markdown implemented 2023-05-08 15:15:22 -03:00
Gabriel Almeida
8810a0392a refactor(langflow): rename BaseLLM to BaseLanguageModel in multiple files
fix(langflow): fix type hints in multiple files
2023-05-08 15:05:28 -03:00
Gabriel Almeida
01de3a2021 refactor(test_graph.py): remove unused import of build_json from payload module 2023-05-07 20:15:29 +00:00
Gabriel Almeida
7b8aaef359 feat(config.yaml): add GoogleSerperRun tool to the list of available tools 2023-05-07 20:15:29 +00:00
Gabriel Almeida
5836a91a39 fix: replace basic_example 2023-05-07 20:15:29 +00:00
Gabriel Almeida
3b733ada01 refactor(tests): remove unused imports and variables, fix typos and update node types 2023-05-07 20:15:29 +00:00
Gabriel Almeida
7ae42bf7d2 refactor(importing/utils.py): move tool_creator import to import_tool function
refactor(tools/base.py): remove redundant variable assignment
refactor(tools/constants.py): import all tools dynamically using __all__ attribute of langchain.tools module
2023-05-07 20:15:29 +00:00
Gabriel Almeida
bbf4f5ce1a chore(agents): add type ignore comments to ZeroShotAgent instantiation
The `ZeroShotAgent` instantiation in `JsonAgent`, `CSVAgent`, `VectorStoreAgent`, `SQLAgent`, and `MalfoyAgent` classes were updated to include a `# type: ignore` comment to suppress type checking errors.
2023-05-07 20:15:29 +00:00
Gabriel Almeida
1d5f156a22 refactor(cache): add cache attribute to memoized function wrapper
refactor(test_cache.py): update import statements and function names
test(cache): add tests for load_or_build_langchain_object, build_langchain_object_with_caching, build_graph, and cache size limit
2023-05-07 20:15:29 +00:00
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
8e9a745bd4 fix(test.yml): correct typo in make command from 'test' to 'tests' 2023-05-07 20:15:29 +00:00
Gabriel Almeida
c065ceb979 feat(pyproject.toml): add wikipedia package to dependencies 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
bb41f5af5d refactor(loading.py): add try-except block to handle KeyError when removing 'model' from params dictionary 2023-05-06 08:29:38 -03:00
Gabriel Almeida
5cf531b520 refactor(callback.py): rename StreamingLLMCallbackHandler to AsyncStreamingLLMCallbackHandler and add new StreamingLLMCallbackHandler
fix(chat_manager.py): assign result to result variable instead of empty string in ChatResponse
refactor(run.py): add AsyncStreamingLLMCallbackHandler and StreamingLLMCallbackHandler imports and use kwargs instead of callbacks in get_result_and_steps function
2023-05-06 08:29:06 -03:00
Gabriel Almeida
234358bc6e fix: if streaming did not work, get message from end 2023-05-06 08:28:54 -03:00
Gabriel Almeida
b5a1fec33d Merge branch 'chatUpdate' of https://github.com/logspace-ai/langflow into streaming 2023-05-06 07:32:31 -03:00
anovazzi1
88c5cd9147 added stream thought 2023-05-05 19:06:07 -03:00
anovazzi1
7f9651a305 fixed onClose method websocket, streaming for text working 2023-05-05 18:49:00 -03:00
Gabriel Almeida
9a67a49622 feat(chat.py, chat_manager.py): add try-except block to handle WebSocketException and WebSocketDisconnect
This commit adds a try-except block to handle WebSocketException and WebSocketDisconnect in the `websocket_endpoint` function in `chat.py` and `handle_websocket` function in `chat_manager.py`. If an exception occurs, the function logs the error and closes the websocket connection with the appropriate status code and reason.

Additionally, the `handle_websocket` function in `chat_manager.py` now waits for a final message after sending a message to the client. If the message is a string, it is a chat message, which is then added to the chat history.
2023-05-05 16:38:40 -03:00
anovazzi1
cc5ac22b85 Merge remote-tracking branch 'origin/streaming' into chatUpdate 2023-05-05 12:44:02 -03:00
anovazzi1
a99a434c12 update ws error handle 2023-05-05 12:43:39 -03:00
anovazzi1
8758dd85d5 fixed double ws bug 2023-05-05 12:42:59 -03:00
Gabriel Almeida
dd4803180c update lock 2023-05-05 12:42:52 -03:00
Gabriel Almeida
c032e2a0d1 refactor(chat_manager.py): remove unused variable 'result' and set message to empty string 2023-05-05 12:22:51 -03:00
Gabriel Almeida
474e14efaf refactor(langflow): replace langchain_object.run with langchain_object.acall in get_result_and_steps function
feat(langflow): add support for streaming intermediate steps to the client via websockets
2023-05-05 11:55:25 -03:00
anovazzi1
4c2f3b80dc update ws error handle 2023-05-04 19:25:24 -03:00