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

Enhanced Monitoring and Stability #48

Merged
merged 21 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f29c6e3
FEATURE: Enable stream overwrite for LLM Chat at the event level (#66)
cyrus2281 Nov 25, 2024
1ca1c0e
AI-95: Enhance request/response handling for streaming LLM access (#69)
cyrus2281 Nov 26, 2024
264fce2
Chore: Enable Whitesource scan
johnvincentcorpuz Nov 26, 2024
b122cb2
Alireza/none/hotfix bugs (#67)
alimosaed Dec 3, 2024
25d5e34
Merge branch 'SolaceLabs:main' into main
artyom-morozov Dec 4, 2024
4f3dfe9
feat: drop error messages when the queue is full (#75)
alimosaed Dec 9, 2024
b335985
Add a text splitter component (#76)
alimosaed Dec 11, 2024
f04ad51
AI-354: Add configuration for broker-request-response for placing the…
efunneko Dec 11, 2024
27fe021
Add a traceback if there is an error during startup (#73)
efunneko Dec 12, 2024
299c04a
JDE: Add MongoDB insert component. (#78)
cyrus2281 Dec 20, 2024
8c42f7e
REQUEST-RESPONSE: Support custom keys for reply and metadata in reque…
cyrus2281 Jan 3, 2025
e996822
DATAGO-91907: Investigate Solace AI connector (other solace ai libs) …
reubenjds Jan 14, 2025
b657ae9
Alireza/ai 278/add forever broker reconnection config (#77)
alimosaed Jan 20, 2025
2ab4d63
JDE: Added MongoDB insert action + example (#81)
cyrus2281 Jan 21, 2025
5fb33eb
Stabilize the connector and add monitoring (#70)
alimosaed Jan 22, 2025
5eacb82
DATAGO-90835:add nack (#83)
alimosaed Jan 24, 2025
d95f53b
Add missing functionality to dev broker that was causing error logs
gregmeldrum Jan 28, 2025
428252d
Merge pull request #84 from SolaceDev/greg/AI-406/devbroker
gregmeldrum Jan 28, 2025
15924de
fix: remove security vulnerabilities (#87)
alimosaed Feb 3, 2025
a597f4c
DATAGO-93603/fix security vulnerability (#89)
alimosaed Feb 3, 2025
37ff7af
fix: log connection (#90)
alimosaed Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### What is the purpose of this change?

### How is this accomplished?

### Anything reviews should focus on/be aware of?
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ jobs:
uses: SolaceDev/solace-public-workflows/.github/workflows/hatch_ci.yml@main
with:
min-python-version: "3.10"
whitesource_product_name: "solaceai"
whitesource_config_file: "wss-unified-agent.config"

secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }}
MANIFEST_AWS_ACCESS_KEY_ID: ${{ secrets.MANIFEST_READ_ONLY_AWS_ACCESS_KEY_ID }}
MANIFEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.MANIFEST_READ_ONLY_AWS_SECRET_ACCESS_KEY }}
structure-test:
name: Test Docker Image Structure
runs-on: ubuntu-latest
Expand Down
10 changes: 0 additions & 10 deletions docs/components/broker_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ Connect to a messaging broker and receive messages from it. The component will o
component_name: <user-supplied-name>
component_module: broker_input
component_config:
broker_type: <string>
broker_url: <string>
broker_username: <string>
broker_password: <string>
broker_vpn: <string>
broker_queue_name: <string>
temporary_queue: <string>
broker_subscriptions: <string>
Expand All @@ -22,11 +17,6 @@ component_config:

| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| broker_type | True | | Type of broker (Solace, MQTT, etc.) |
| broker_url | True | | Broker URL (e.g. tcp://localhost:55555) |
| broker_username | True | | Client username for broker |
| broker_password | True | | Client password for broker |
| broker_vpn | True | | Client VPN for broker |
| broker_queue_name | False | | Queue name for broker, if not provided it will use a temporary queue |
| temporary_queue | False | False | Whether to create a temporary queue that will be deleted after disconnection, defaulted to True if broker_queue_name is not provided |
| broker_subscriptions | True | | Subscriptions for broker |
Expand Down
10 changes: 0 additions & 10 deletions docs/components/broker_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ Connect to a messaging broker and send messages to it. Note that this component
component_name: <user-supplied-name>
component_module: broker_output
component_config:
broker_type: <string>
broker_url: <string>
broker_username: <string>
broker_password: <string>
broker_vpn: <string>
payload_encoding: <string>
payload_format: <string>
propagate_acknowledgements: <string>
Expand All @@ -23,11 +18,6 @@ component_config:

| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| broker_type | True | | Type of broker (Solace, MQTT, etc.) |
| broker_url | True | | Broker URL (e.g. tcp://localhost:55555) |
| broker_username | True | | Client username for broker |
| broker_password | True | | Client password for broker |
| broker_vpn | True | | Client VPN for broker |
| payload_encoding | False | utf-8 | Encoding for the payload (utf-8, base64, gzip, none) |
| payload_format | False | json | Format for the payload (json, yaml, text) |
| propagate_acknowledgements | False | True | Propagate acknowledgements from the broker to the previous components |
Expand Down
14 changes: 14 additions & 0 deletions docs/components/broker_request_response.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ component_config:
payload_format: <string>
response_topic_prefix: <string>
response_topic_suffix: <string>
response_topic_insertion_expression: <string>
response_queue_prefix: <string>
user_properties_reply_topic_key: <string>
user_properties_reply_metadata_key: <string>
request_expiry_ms: <integer>
streaming: <string>
streaming_complete_expression: <string>
streaming: <string>
streaming_complete_expression: <string>
streaming: <string>
streaming_complete_expression: <string>
```

| Parameter | Required | Default | Description |
Expand All @@ -34,10 +41,17 @@ component_config:
| payload_format | False | json | Format for the payload (json, yaml, text) |
| response_topic_prefix | False | reply | Prefix for reply topics |
| response_topic_suffix | False | | Suffix for reply topics |
| response_topic_insertion_expression | False | | Expression to insert the reply topic into the request message. If not set, the reply topic will only be added to the request_response_metadata. The expression uses the same format as other data expressions: (e.g input.payload:myObj.replyTopic). If there is no object type in the expression, it will default to 'input.payload'. |
| response_queue_prefix | False | reply-queue | Prefix for reply queues |
| user_properties_reply_topic_key | False | __solace_ai_connector_broker_request_response_topic__ | Key to store the reply topic in the user properties. Start with : for nested object |
| user_properties_reply_metadata_key | False | __solace_ai_connector_broker_request_reply_metadata__ | Key to store the reply metadata in the user properties. Start with : for nested object |
| request_expiry_ms | False | 60000 | Expiry time for cached requests in milliseconds |
| streaming | False | | The response will arrive in multiple pieces. If True, the streaming_complete_expression must be set and will be used to determine when the last piece has arrived. |
| streaming_complete_expression | False | | The source expression to determine when the last piece of a streaming response has arrived. |
| streaming | False | | The response will arrive in multiple pieces. If True, the streaming_complete_expression must be set and will be used to determine when the last piece has arrived. |
| streaming_complete_expression | False | | The source expression to determine when the last piece of a streaming response has arrived. |
| streaming | False | | The response will arrive in multiple pieces. If True, the streaming_complete_expression must be set and will be used to determine when the last piece has arrived. |
| streaming_complete_expression | False | | The source expression to determine when the last piece of a streaming response has arrived. |


## Component Input Schema
Expand Down
2 changes: 2 additions & 0 deletions docs/components/error_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ component_name: <user-supplied-name>
component_module: error_input
component_config:
max_rate: <string>
max_queue_depth: <string>
```

| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| max_rate | False | None | Maximum rate of errors to process per second. Any errors above this rate will be dropped. If not set, all errors will be processed. |
| max_queue_depth | False | 1000 | Maximum number of messages that can be queued in the input queue.If the queue is full, the new message is dropped. |



Expand Down
4 changes: 4 additions & 0 deletions docs/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
| [langchain_chat_model](langchain_chat_model.md) | Provide access to all the LangChain chat models via configuration |
| [langchain_chat_model_with_history](langchain_chat_model_with_history.md) | A chat model based on LangChain that includes keeping per-session history of the conversation. Note that this component will only take the first system message and the first human message in the messages array. |
| [langchain_embeddings](langchain_embeddings.md) | Provide access to all the LangChain Text Embeddings components via configuration |
| [langchain_split_text](langchain_split_text.md) | Split a long text into smaller parts using the LangChain text splitter module |
| [langchain_vector_store_delete](langchain_vector_store_delete.md) | This component allows for entries in a LangChain Vector Store to be deleted. This is needed for the continued maintenance of the vector store. Due to the nature of langchain vector stores, you need to specify an embedding component even though it is not used in this component. |
| [langchain_vector_store_embedding_index](langchain_vector_store_embedding_index.md) | Use LangChain Vector Stores to index text for later semantic searches. This will take text, run it through an embedding model and then store it in a vector database. |
| [langchain_vector_store_embedding_search](langchain_vector_store_embedding_search.md) | Use LangChain Vector Stores to search a vector store with a semantic search. This will take text, run it through an embedding model with a query embedding and then find the closest matches in the store. |
| [litellm_chat_model](litellm_chat_model.md) | LiteLLM chat component |
| [litellm_chat_model_with_history](litellm_chat_model_with_history.md) | LiteLLM model handler component with conversation history |
| [litellm_embeddings](litellm_embeddings.md) | Embed text using a LiteLLM model |
| [message_filter](message_filter.md) | A filtering component. This will apply a user configurable expression. If the expression evaluates to True, the message will be passed on. If the expression evaluates to False, the message will be discarded. If the message is discarded, any previous components that require an acknowledgement will be acknowledged. |
| [mongo_base](mongo_base.md) | Base MongoDB database component |
| [mongo_insert](mongo_insert.md) | Inserts data into a MongoDB database. |
| [mongo_search](mongo_search.md) | Searches a MongoDB database. |
| [openai_chat_model](openai_chat_model.md) | OpenAI chat model component |
| [openai_chat_model_with_history](openai_chat_model_with_history.md) | OpenAI chat model component with conversation history |
| [parser](parser.md) | Parse input from the given type to output type. |
Expand Down
6 changes: 6 additions & 0 deletions docs/components/langchain_chat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ component_config:
langchain_module: <string>
langchain_class: <string>
langchain_component_config: <string>
llm_mode: <string>
stream_to_flow: <string>
stream_batch_size: <string>
llm_response_format: <string>
```

Expand All @@ -19,6 +22,9 @@ component_config:
| langchain_module | True | | The chat model module - e.g. 'langchain_openai.chat_models' |
| langchain_class | True | | The chat model class to use - e.g. ChatOpenAI |
| langchain_component_config | True | | Model specific configuration for the chat model. See documentation for valid parameter names. |
| llm_mode | False | | The mode for streaming results: 'none' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| stream_to_flow | False | | Name the flow to stream the output to - this must be configured for llm_mode='stream'. |
| stream_batch_size | False | 15 | The minimum number of words in a single streaming result. Default: 15. |
| llm_response_format | False | | The response format for this LLM request. This can be 'json', 'yaml', or 'text'. If set to 'json' or 'yaml', the response will be parsed by the appropriate parser and the fields will be available in the response object. If set to 'text', the response will be returned as a string. |


Expand Down
6 changes: 6 additions & 0 deletions docs/components/langchain_chat_model_with_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ component_config:
langchain_module: <string>
langchain_class: <string>
langchain_component_config: <string>
llm_mode: <string>
stream_to_flow: <string>
stream_batch_size: <string>
llm_response_format: <string>
history_max_turns: <string>
history_max_message_size: <string>
Expand All @@ -27,6 +30,9 @@ component_config:
| langchain_module | True | | The chat model module - e.g. 'langchain_openai.chat_models' |
| langchain_class | True | | The chat model class to use - e.g. ChatOpenAI |
| langchain_component_config | True | | Model specific configuration for the chat model. See documentation for valid parameter names. |
| llm_mode | False | | The mode for streaming results: 'none' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| stream_to_flow | False | | Name the flow to stream the output to - this must be configured for llm_mode='stream'. |
| stream_batch_size | False | 15 | The minimum number of words in a single streaming result. Default: 15. |
| llm_response_format | False | | The response format for this LLM request. This can be 'json', 'yaml', or 'text'. If set to 'json' or 'yaml', the response will be parsed by the appropriate parser and the fields will be available in the response object. If set to 'text', the response will be returned as a string. |
| history_max_turns | False | 20 | The maximum number of turns to keep in the history. If not set, the history will be limited to 20 turns. |
| history_max_message_size | False | 1000 | The maximum amount of characters to keep in a single message in the history. |
Expand Down
42 changes: 42 additions & 0 deletions docs/components/langchain_split_text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# LangChainTextSplitter

Split a long text into smaller parts using the LangChain text splitter module

## Configuration Parameters

```yaml
component_name: <user-supplied-name>
component_module: langchain_split_text
component_config:
langchain_module: <string>
langchain_class: <string>
langchain_component_config: <string>
```

| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| langchain_module | True | | The text split module - e.g. 'langchain_text_splitters' |
| langchain_class | True | | The text split class to use - e.g. TokenTextSplitter |
| langchain_component_config | True | | Model specific configuration for the text splitting. See documentation for valid parameter names.https://python.langchain.com/docs/how_to/split_by_token/#nltk |


## Component Input Schema

```
{
text: <string>
}
```
| Field | Required | Description |
| --- | --- | --- |
| text | True | |


## Component Output Schema

```
[
<string>,
...
]
```
18 changes: 11 additions & 7 deletions docs/components/litellm_chat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ component_config:
load_balancer: <string>
embedding_params: <string>
temperature: <string>
set_response_uuid_in_user_properties: <boolean>
timeout: <string>
retry_policy: <string>
allowed_fails_policy: <string>
stream_to_flow: <string>
stream_to_next_component: <string>
llm_mode: <string>
stream_batch_size: <string>
set_response_uuid_in_user_properties: <boolean>
history_max_turns: <string>
history_max_time: <string>
history_max_turns: <string>
history_max_time: <string>
stream_to_flow: <string>
Expand All @@ -31,13 +32,14 @@ component_config:
| load_balancer | False | | Add a list of models to load balancer. |
| embedding_params | False | | LiteLLM model parameters. The model, api_key and base_url are mandatory.find more models at https://docs.litellm.ai/docs/providersfind more parameters at https://docs.litellm.ai/docs/completion/input |
| temperature | False | 0.7 | Sampling temperature to use |
| set_response_uuid_in_user_properties | False | False | Whether to set the response_uuid in the user_properties of the input_message. This will allow other components to correlate streaming chunks with the full response. |
| timeout | False | 60 | Request timeout in seconds |
| retry_policy | False | | Retry policy for the load balancer. Find more at https://docs.litellm.ai/docs/routing#cooldowns |
| allowed_fails_policy | False | | Allowed fails policy for the load balancer. Find more at https://docs.litellm.ai/docs/routing#cooldowns |
| stream_to_flow | False | | Name the flow to stream the output to - this must be configured for llm_mode='stream'. This is mutually exclusive with stream_to_next_component. |
| stream_to_next_component | False | False | Whether to stream the output to the next component in the flow. This is mutually exclusive with stream_to_flow. |
| llm_mode | False | none | The mode for streaming results: 'sync' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| llm_mode | False | none | The mode for streaming results: 'none' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| stream_batch_size | False | 15 | The minimum number of words in a single streaming result. Default: 15. |
| set_response_uuid_in_user_properties | False | False | Whether to set the response_uuid in the user_properties of the input_message. This will allow other components to correlate streaming chunks with the full response. |
| history_max_turns | False | 10 | Maximum number of conversation turns to keep in history |
| history_max_time | False | 3600 | Maximum time to keep conversation history (in seconds) |
| history_max_turns | False | 10 | Maximum number of conversation turns to keep in history |
| history_max_time | False | 3600 | Maximum time to keep conversation history (in seconds) |
| stream_to_flow | False | | Name the flow to stream the output to - this must be configured for llm_mode='stream'. This is mutually exclusive with stream_to_next_component. |
Expand All @@ -57,6 +59,7 @@ component_config:
},
...
],
stream: <boolean>,
clear_history_but_keep_depth: <integer>
}
```
Expand All @@ -65,6 +68,7 @@ component_config:
| messages | True | |
| messages[].role | True | |
| messages[].content | True | |
| stream | False | Whether to stream the response - overwrites llm_mode |
| clear_history_but_keep_depth | False | Clear history but keep the last N messages. If 0, clear all history. If not set, do not clear history. |


Expand Down
18 changes: 11 additions & 7 deletions docs/components/litellm_chat_model_with_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ component_config:
load_balancer: <string>
embedding_params: <string>
temperature: <string>
set_response_uuid_in_user_properties: <boolean>
timeout: <string>
retry_policy: <string>
allowed_fails_policy: <string>
stream_to_flow: <string>
stream_to_next_component: <string>
llm_mode: <string>
stream_batch_size: <string>
set_response_uuid_in_user_properties: <boolean>
history_max_turns: <string>
history_max_time: <string>
history_max_turns: <string>
history_max_time: <string>
```
Expand All @@ -27,13 +28,14 @@ component_config:
| load_balancer | False | | Add a list of models to load balancer. |
| embedding_params | False | | LiteLLM model parameters. The model, api_key and base_url are mandatory.find more models at https://docs.litellm.ai/docs/providersfind more parameters at https://docs.litellm.ai/docs/completion/input |
| temperature | False | 0.7 | Sampling temperature to use |
| set_response_uuid_in_user_properties | False | False | Whether to set the response_uuid in the user_properties of the input_message. This will allow other components to correlate streaming chunks with the full response. |
| timeout | False | 60 | Request timeout in seconds |
| retry_policy | False | | Retry policy for the load balancer. Find more at https://docs.litellm.ai/docs/routing#cooldowns |
| allowed_fails_policy | False | | Allowed fails policy for the load balancer. Find more at https://docs.litellm.ai/docs/routing#cooldowns |
| stream_to_flow | False | | Name the flow to stream the output to - this must be configured for llm_mode='stream'. This is mutually exclusive with stream_to_next_component. |
| stream_to_next_component | False | False | Whether to stream the output to the next component in the flow. This is mutually exclusive with stream_to_flow. |
| llm_mode | False | none | The mode for streaming results: 'sync' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| llm_mode | False | none | The mode for streaming results: 'none' or 'stream'. 'stream' will just stream the results to the named flow. 'none' will wait for the full response. |
| stream_batch_size | False | 15 | The minimum number of words in a single streaming result. Default: 15. |
| set_response_uuid_in_user_properties | False | False | Whether to set the response_uuid in the user_properties of the input_message. This will allow other components to correlate streaming chunks with the full response. |
| history_max_turns | False | 10 | Maximum number of conversation turns to keep in history |
| history_max_time | False | 3600 | Maximum time to keep conversation history (in seconds) |
| history_max_turns | False | 10 | Maximum number of conversation turns to keep in history |
| history_max_time | False | 3600 | Maximum time to keep conversation history (in seconds) |

Expand All @@ -49,6 +51,7 @@ component_config:
},
...
],
stream: <boolean>,
clear_history_but_keep_depth: <integer>
}
```
Expand All @@ -57,6 +60,7 @@ component_config:
| messages | True | |
| messages[].role | True | |
| messages[].content | True | |
| stream | False | Whether to stream the response - overwrites llm_mode |
| clear_history_but_keep_depth | False | Clear history but keep the last N messages. If 0, clear all history. If not set, do not clear history. |


Expand Down
Loading