Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some maintenance work tidying the code #18

Merged
merged 28 commits into from
Jul 12, 2024
Merged

Conversation

efunneko
Copy link
Collaborator

  • Removed any remaining unneeded prints
  • Added a couple more tests

efunneko and others added 27 commits April 27, 2024 14:48
* Add ability to stream partial LLM responses to a named flow
* Add a configurable message that is sent to the slack channel that sent a message to slack_input
* Add the ability to clear the ack message and stream partial results to that ack message
…hHistory

- also started on converting absolute paths for imports to relative ones
The import statement in `main.py` was updated to remove the relative path and use an absolute import for `SolaceAiConnector` from `solace_ai_connector.solace_ai_connector`. This change improves the code organization and ensures proper module resolution.
…ensible. This is part of a cleanup before releasing to Pypi
…do a directory search looking for modules. We are more explicit now

Also promote the gen_docs tool to an installed script so that it can be used for plugins
Adjusted the importing of modules from config files to be more friendly for plugins and added a 'component_package' properly that will be auto-installed if it is specified and the package is not present.
…_kv_store

This commit updates the component_base.py file to include the flow_lock_manager and flow_kv_store attributes. These attributes are necessary for components to access the flow-level lock manager and key-value store. By adding these attributes, components can now utilize the lock manager to synchronize access to shared resources and the key-value store to store and retrieve data across multiple components within the flow. This change improves the flexibility and functionality of the component_base.py file.

Changed the default location of the trust_store for the Solace API to be provided by the certifi module.

Added a configuration item for the ChatModel with History component to be able to limit the size of entries being added to the chat history
This commit updates the trust_store_path for the Solace API in the solace_messaging.py file. The trust_store_path is now provided by the certifi module, which ensures that the default location of the trust store is used. This change improves the security and reliability of the Solace API integration.

```
DATAGO-78654: Add ci
* Cleanup of some lingering prints and add a couple more tests

* Print cleanup

* Exclude coverage.py result from sonarqube

---------

Co-authored-by: Edward Funnekotter <[email protected]>
Co-authored-by: Edward Funnekotter <[email protected]>
@efunneko efunneko requested a review from artyom-morozov July 11, 2024 19:58
@efunneko efunneko self-assigned this Jul 11, 2024
Copy link
Collaborator

@artyom-morozov artyom-morozov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me !

@efunneko efunneko merged commit 2920bcf into SolaceLabs:main Jul 12, 2024
1 check passed
artyom-morozov pushed a commit that referenced this pull request Aug 23, 2024
* First commit of big refactor

* refactor: improve event handling in TestOutputComponent

* refactor: handle both Message and Event objects in TestInputComponent

* fix: handle both Event and Message objects in TestOutputComponent

* feat: add Message import to utils_for_test_files

* feat: add send_message method to ComponentBase

* fix: wrap message in Event before enqueueing to next component

* refactor: move timer_manager creation to SolaceAiConnector and improve error handling

* feat: add logging for timer manager stop process

* perf: optimize TimerManager to reduce CPU usage

* fix: improve shutdown process for timer thread

* perf: Remove unnecessary sleep in TimerManager run loop

* refactor: remove unused send_message method from ComponentBase

* refactor: improve clean exit process and resource cleanup

* fix: import log module to resolve undefined name errors

* refactor: update aggregate component to handle timeout consistently

* refactor: update aggregate component output to return list

* refactor: simplify aggregation logic and improve method naming

* fix: reset current_aggregation after returning aggregation

* All tests now pass

* Warning cleanup

* chore: one additional small fix to account for input components that might return None

* refactor: rename Event class 'payload' to 'data'

* refactor: Update get_message_from_flow to use event.data instead of event.payload

* Switched the contained data in the Event class to be called data rather than payload to avoid confusion with message payload

* Remove commented code

* feat: add OpenAI chat model components with and without history

* refactor: replace LangChain with native OpenAI library for chat models

* feat: add history max time and clear history options to OpenAI chat model

* feat: implement clear_history_but_keep_depth functionality

* more changes

* feat: add method to clear chat history while retaining specified depth

* fix: correct data member references in clear_history_but_keep_depth method

* refactor: implement thread-safe history storage using KV store

* feat: implement history_max_time parameter for message pruning

* feat: add time-based history pruning to OpenAIChatModelWithHistory

* refactor: optimize history management in OpenAIChatModelWithHistory

* feat: implement time-based pruning in conversation history

* refactor: optimize chat history management

* feat: add history age-out functionality with hourly cleanup timer

* clean up some spacing

* feat: add base_url configuration for OpenAIChatModelBase

* feat: add streaming functionality to OpenAIChatModelBase

* feat: update chat history handling for system messages

* refactor: ensure first history message is user message in clear_history_but_keep_depth

* refactor: update clear_history_but_keep_depth to ensure depth includes last user message

* Make sure that the first message in the history has a user role when trimming the history

* Merge branch 'main' into open_ai_components

* chore: Some small formatting changes

* chore: Add some protection around clearing the history to make sure the first message is never a non-user message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants