mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution] Disable streaming when RAG Alerts is on (#173566)
This commit is contained in:
parent
40b354958f
commit
1a78fed75d
2 changed files with 23 additions and 1 deletions
|
@ -133,6 +133,28 @@ describe('API tests', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('calls the actions connector api with invoke when assistantStreamingEnabled is true when assistantLangChain is false and alerts is true', async () => {
|
||||
const testProps: FetchConnectorExecuteAction = {
|
||||
...fetchConnectorArgs,
|
||||
assistantLangChain: false,
|
||||
alerts: true,
|
||||
};
|
||||
|
||||
await fetchConnectorExecuteAction(testProps);
|
||||
|
||||
expect(mockHttp.fetch).toHaveBeenCalledWith(
|
||||
'/internal/elastic_assistant/actions/connector/foo/_execute',
|
||||
{
|
||||
body: '{"params":{"subActionParams":{"model":"gpt-4","messages":[{"role":"user","content":"This is a test"}],"n":1,"stop":null,"temperature":0.2},"subAction":"invokeAI"},"assistantLangChain":false}',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
signal: undefined,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('returns API_ERROR when the response status is error and langchain is on', async () => {
|
||||
(mockHttp.fetch as jest.Mock).mockResolvedValue({ status: 'error' });
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ export const fetchConnectorExecuteAction = async ({
|
|||
// tracked here: https://github.com/elastic/security-team/issues/7363
|
||||
// In part 3 I will make enhancements to langchain to introduce streaming
|
||||
// Once implemented, invokeAI can be removed
|
||||
const isStream = assistantStreamingEnabled && !assistantLangChain;
|
||||
const isStream = assistantStreamingEnabled && !assistantLangChain && !alerts;
|
||||
const optionalRequestParams = getOptionalRequestParams({
|
||||
alerts,
|
||||
alertsIndexPattern,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue