Commit graph

901 commits

Author SHA1 Message Date
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
9138b1c55f Merge remote-tracking branch 'origin/websocket' into chat_and_cache 2023-04-25 21:23:53 -03:00
anovazzi1
4cc2babcf1 bug on file 2023-04-25 21:23:13 -03:00
Gabriel Almeida
dc72f2e52f refactor(test_websocket.py): change sender field to is_bot field in chat history tests 2023-04-25 21:06:29 -03:00
anovazzi1
6ba97f64c4 Merge remote-tracking branch 'origin/chat_and_cache' into websocket 2023-04-25 20:55:58 -03:00
anovazzi1
fcbc92f609 file card ready 2023-04-25 20:55:16 -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
c50f80ae53 Merge remote-tracking branch 'origin/websocket' into chat_and_cache 2023-04-25 19:47:13 -03:00
anovazzi1
804c9a5a3e check ws status to unlock chat on error 2023-04-25 19:24:56 -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
anovazzi1
f36fe34831 new lock chat implemented 2023-04-25 18:53:27 -03:00
anovazzi1
be5b7822d7 custom scrollbar and text input became text area for chat 2023-04-25 18:36:46 -03:00
anovazzi1
61a3b9aad4 chat working as old with websocket, need to improve error handling and file events 2023-04-25 17:51:16 -03:00
anovazzi1
bc97420b5e Merge remote-tracking branch 'origin/chat_and_cache' into websocket 2023-04-25 17:34:21 -03:00
anovazzi1
b526c436cd removed chat history from flow save 2023-04-25 17:34:14 -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
anovazzi1
3c93e73082 new poetry config for websocket 2023-04-25 16:41:14 -03:00
anovazzi1
9053eb81a0 package-lock.json update 2023-04-25 16:36:11 -03:00
anovazzi1
4fd659703f socket small changes 2023-04-25 16:35:44 -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
anovazzi1
e4fdfdd649 added new icon 2023-04-25 15:40:21 -03:00
anovazzi1
f8f6283464 websocket first implementation 2023-04-25 15:29:02 -03:00
anovazzi1
ce7e9d0254 shortcut on ctrl shift k 2023-04-24 23:31:42 -03:00
anovazzi1
7c16616273 chat popUp not using popUp context 2023-04-24 23:21:22 -03:00
anovazzi1
152525decc chat clear 2023-04-24 23:10:51 -03:00
anovazzi1
68870301f3 chat modal messages firts version finished 2023-04-24 22:04:25 -03:00
anovazzi1
020e9c8461 chat modal working 2023-04-24 21:10:51 -03:00
anovazzi1
2c0b846f54 migrate chat logic to chat modal 2023-04-24 21:02:23 -03:00
anovazzi1
8ed1ea92d4 clean chat area 2023-04-24 20:03:05 -03:00
anovazzi1
9464b8790c added chat trigger component 2023-04-24 19:25:33 -03:00
anovazzi1
b3155a58a9
Add Import Examples Feature to Flow Editor (#175)
This pull request adds a new feature to the flow editor that allows
users to easily import example flows from the
[logspace-ai/langflow_examples](https://github.com/logspace-ai/langflow_examples)
repository on GitHub. The feature is accessible via the import example
button

Clicking on the "Import Examples" button opens a dialog box that
displays a list of available example flows from the GitHub repository.
Users can select one example to import, and the flow editor will
automatically add the selected flow to the user's current project.

This feature saves users time and effort by providing a convenient way
to explore and utilize pre-built flows.

Additionally, this feature promotes collaboration and community
involvement by encouraging users to contribute their own flows to the
repository for others to use and benefit from.
2023-04-24 19:08:21 -03:00
anovazzi1
a15d605cc8 update styles 2023-04-24 19:03:20 -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
Gabriel Luiz Freitas Almeida
ad24cdc1dd Update README.md 2023-04-23 14:37:11 -03:00
Paul Lockett
b1971570c9 Correct run instructions
Fix this for future users so they can get it up and running without having to probe the  GitHub forum
2023-04-23 14:37:11 -03:00
Gabriel Almeida
ebc1f6a0df feat(api): add callback handler for streaming LLM responses
Add a new file `callback.py` that contains a new class `StreamingLLMCallbackHandler` that inherits from `AsyncCallbackHandler`. This class handles streaming LLM responses. It has a constructor that takes a `websocket` parameter and sets it as an instance variable. It also has an `on_llm_new_token` method that takes a `token` parameter and sends a `ChatResponse` object to the `websocket` instance variable.

Update `chat_manager.py` to import the new `StreamingLLMCallbackHandler` class. Add a new function `try_setting_streaming_options` that takes a `langchain_object` and a `websocket` parameter. This function checks if the `llm` attribute of the `langchain_object` is an instance of `OpenAI`, `ChatOpenAI`, `AzureOpenAI`, or `AzureChatOpenAI`. If it is, it sets the
2023-04-23 14:31:21 -03:00
Robert Wilkins III
b9a9892db6 layout changes 2023-04-21 12:22:12 -03:00
Robert Wilkins III
e90b036b01 remove the nats 2023-04-21 12:22:12 -03:00
Robert Wilkins III
adc93c7902 improve grammer and remove nat 2023-04-21 12:22:12 -03:00