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

[Generative AI] Connector cleanup #166960

Open
stephmilovic opened this issue Sep 21, 2023 · 1 comment
Open

[Generative AI] Connector cleanup #166960

stephmilovic opened this issue Sep 21, 2023 · 1 comment

Comments

@stephmilovic
Copy link
Contributor

stephmilovic commented Sep 21, 2023

With the introduction of the AWS Bedrock connector, there are a few areas that need cleanup between the 2 generative ai connector types: gen-ai and .bedrock. I'd have done these changes in the original PR but it was already getting big, so in the interest of smaller PRs...

1. .gen-ai naming

When we first created the Generative AI connector, we put the OpenAI APIs under the "Generative AI" naming as we had 2 provider types for Generative AI, both OpenAI. Now that we have another connector type that does Generative AI, this naming does not make sense: (please note this screenshot does not have the updated bedrock logo)
Screenshot 2023-09-21 at 9 12 02 AM

I updated the connector type name in my bedrock PR, but there are directories and files that should be renamed as well.

I do not think that we should update the connector id of '.gen-ai' for migration purposes... WDYT @elastic/response-ops-execution ?

2. GeneralConnectorFeatureId to GenerativeAIConnectorFeatureId

We did not quite know what category the Generative AI connector fit into. But if we rename as proposed in step 1, OpenAI connector and the new AWS Bedrock connector, to me it makes sense this category should be called

3. Fix runApi body

I'm not sure why I did it like this, but runApi expects body to be a stringified object. This is leading us to access the properties via multiple unsafe JSON.parse calls: ex 1, ex 2. This can be simply avoided by runApi validating a body object instead of a string, and stringifying before sending off to the API

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants