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

Gemini Connector Assistant Integration #184741

Merged
merged 171 commits into from
Jun 17, 2024

Conversation

rohanxz
Copy link
Contributor

@rohanxz rohanxz commented Jun 4, 2024

Summary

Note: This PR is an extention to the connector PR which is now merged.

  1. Implements invokeAI and invokeStream subactions for the Gemini connector.
  2. The invokeStream subaction handles standardizing the assistant stream request to Gemini formats, and parses the response to a simple string for the consumer to stream.
  3. Adds token tracking for Gemini, streaming invokeStream and non streaming invokeAI responses.

Testing

  1. Create Gemini connector with the provided credentials
select_connector configure_connector
  1. Ensure Knowledge base and Alerts are disabled
disable_knowledgebase
  1. Turn on streaming
enable_streaming
  1. Send a message to the connector. Test that:
  • response streams
  • "Stop generating" button works
  • "Regenerate" button works
stop_generating regenerate
  1. The streaming response should follow the below pattern.
streaming_response
  1. Turn off streaming and send a message to the assistant. Observe the non streaming response.
non_streaming
  1. Navigate to the token tracking dashboard.
token_dashboard_link
  1. Observe if it represents the prompt and completion tokens accurately.
promt+completion total_tokens

honeyn303 and others added 30 commits April 10, 2024 15:01
@stephmilovic
Copy link
Contributor

buildkite test this

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

buildkite test this

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

buildkite test this

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

buildkite test this

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks to the Google team for their hard work implementing the connector in the security assistant!

@stephmilovic
Copy link
Contributor

buildkite test this

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

buildkite test this

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

RO changes LGTM - noted we could move some of the lib modules to a gen_ai-ish directory, so we're not flagged for review on them.

Also, obligatory ask: I assume none of these sub-actions will be queued, and so don't have to suffer through intermediate releases - still all used "live"?

@@ -256,6 +256,7 @@ describe('getGenAiTokenTracking', () => {
})
);
});

Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we should create a gen_ai subdirectory here, and set CODE_OWNERS so we don't need to review. Or move to a package.

Copy link
Contributor

Choose a reason for hiding this comment

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

I will do in a different PR! Will link soon...

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume none of these sub-actions will be queued, and so don't have to suffer through intermediate releases - still all used "live"?

That's correct!

@stephmilovic
Copy link
Contributor

buildkite test this

@stephmilovic
Copy link
Contributor

@elasticmachine merge upstream

@stephmilovic
Copy link
Contributor

buildkite test this

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 17, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #24 / Cloud Security Posture Test adding Cloud Security Posture Integrations CNVM CNVM AWS Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 13.6MB 13.6MB +617.0B
stackConnectors 567.4KB 567.1KB -253.0B
total +364.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
stackConnectors 53.4KB 53.5KB +54.0B

History

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

@stephmilovic stephmilovic merged commit a9f5375 into elastic:main Jun 17, 2024
45 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-deploy Create or update a Cloud deployment 💝community Feature:Security Assistant Security Assistant release_note:enhancement Team:Security Generative AI Security Generative AI v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants