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

[ResponseOps] Fix Azure Connector Streaming Validation #191552

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Aug 27, 2024

Summary

A Security SDH reported errors in the assistant when using Azure with streaming. I discovered a function getRequestWithStreamOption that intercepts the Azure Open AI request body to set the stream parameter to ensure it is only sent on the Chat API, the Completion API and the Completions Extensions API. However, the function unnecessarily compared the connector URL to both the root url and the route, which led to a bug for the customer. Their URL used a custom domain (not {your-resource}.openai.azure.com) along with being a .au site. As a result, getRequestWithStreamOption deemed the URL invalid, omitted the stream tag from the request, and returned a non-streaming response when a streaming response was expected, causing the error.

By matching only the route instead of the full url, the bug is eliminated.

Note

This bug was reported on 8.14.3. In 8.15, Security solution stopped using the invokeStream subaction and instead uses the invokeAsyncIterator subaction so the bug does not exist for us anymore. However, I still think the fix should go through as other teams may run into the issue if they try to use the invokeStream or streamApi subactions

@stephmilovic stephmilovic added release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Generative AI Security Generative AI v8.16.0 v8.15.1 labels Aug 27, 2024
@stephmilovic stephmilovic requested review from a team as code owners August 27, 2024 19:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@stephmilovic stephmilovic changed the title [Security solution] Fix Azure Connector Streaming Validation [ResponseOps] Fix Azure Connector Streaming Validation Aug 27, 2024
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@stephmilovic stephmilovic merged commit 97b5479 into elastic:main Aug 28, 2024
26 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 28, 2024
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 28, 2024
… (#191639)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[ResponseOps] Fix Azure Connector Streaming Validation
(#191552)](#191552)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2024-08-28T14:04:37Z","message":"[ResponseOps]
Fix Azure Connector Streaming Validation
(#191552)","sha":"97b54795f45d470faa7b0aa7aa14fd4b2277d9d5","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Security Generative
AI","v8.16.0","v8.15.1"],"title":"[ResponseOps] Fix Azure Connector
Streaming
Validation","number":191552,"url":"https://github.com/elastic/kibana/pull/191552","mergeCommit":{"message":"[ResponseOps]
Fix Azure Connector Streaming Validation
(#191552)","sha":"97b54795f45d470faa7b0aa7aa14fd4b2277d9d5"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191552","number":191552,"mergeCommit":{"message":"[ResponseOps]
Fix Azure Connector Streaming Validation
(#191552)","sha":"97b54795f45d470faa7b0aa7aa14fd4b2277d9d5"}},{"branch":"8.15","label":"v8.15.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.1 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants