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

[Security AI Assistant] Changing chat related internal APIs to become public #188139

Merged

Conversation

YulNaumenko
Copy link
Contributor

@YulNaumenko YulNaumenko commented Jul 11, 2024

Summary

In this PR Security Gen AI related APIs are changed from internal to public.

Conversations APIs:

  • POST/PUT/GET/DELETE "/api/security_ai_assistant/current_user/conversations/{id}"
  • GET "/api/security_ai_assistant/current_user/conversations/_find"

Prompts APIs:

  • POST "/api/security_ai_assistant/prompts/_bulk_action"
  • GET "/api/security_ai_assistant/current_user/conversations/_find"

Anonymization APIs:

  • POST "/api/security_ai_assistant/anonymization_fields/_bulk_action"
  • GET "/api/security_ai_assistant/anonymization_fields/_find"

@YulNaumenko YulNaumenko added release_note:skip Skip the PR/issue when compiling release notes v8.15.0 labels Jul 11, 2024
@YulNaumenko YulNaumenko self-assigned this Jul 11, 2024
@YulNaumenko YulNaumenko requested a review from a team as a code owner July 11, 2024 17:12
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/elastic-assistant-common 336 337 +1

Async chunks

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

id before after diff
securitySolution 16.3MB 16.3MB +23.0B
Unknown metric groups

API count

id before after diff
@kbn/elastic-assistant-common 362 363 +1

History

cc @YulNaumenko

@spong
Copy link
Member

spong commented Jul 12, 2024

This isn't from your change set here (so just commenting on behavior here), but on a fresh install (with pre-configured connector at least), it looks like we're not automatically selecting a default System Prompt. Changing the conversation or clicking New Chat does though:

image

Comment on lines +17 to +21
export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/{id}/messages`;

export const ELASTIC_AI_ASSISTANT_CHAT_COMPLETE_URL = `${ELASTIC_AI_ASSISTANT_URL}/chat/complete`;

export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL}/_bulk_action`;
export const ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_INTERNAL_CONVERSATIONS_URL}/_bulk_action`;
Copy link
Member

Choose a reason for hiding this comment

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

Ok, so main conversation routes are now public, but bulk actions and append messages remain internal then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've chat with @peluja1012 about that and decided to keep it this way for now.

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Checked out, code reviewed, and smoke tested locally -- LGTM!

@YulNaumenko YulNaumenko merged commit 1d5cf48 into elastic:main Jul 12, 2024
35 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 12, 2024
… public (elastic#188139)

## Summary

In this PR Security Gen AI related APIs are changed from internal to
public.

Conversations APIs:
- POST/PUT/GET/DELETE
`"/api/security_ai_assistant/current_user/conversations/{id}"`
- GET `"/api/security_ai_assistant/current_user/conversations/_find"`

Prompts APIs:

- POST `"/api/security_ai_assistant/prompts/_bulk_action"`
- GET `"/api/security_ai_assistant/current_user/conversations/_find"`

Anonymization APIs:

- POST `"/api/security_ai_assistant/anonymization_fields/_bulk_action"`
- GET `"/api/security_ai_assistant/anonymization_fields/_find"`

(cherry picked from commit 1d5cf48)
@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 Jul 12, 2024
… become public (#188139) (#188260)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Security AI Assistant] Changing chat related internal APIs to become
public (#188139)](#188139)

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

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

<!--BACKPORT [{"author":{"name":"Yuliia
Naumenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-12T19:23:09Z","message":"[Security
AI Assistant] Changing chat related internal APIs to become public
(#188139)\n\n## Summary\r\n\r\nIn this PR Security Gen AI related APIs
are changed from internal to\r\npublic.\r\n\r\nConversations APIs:\r\n-
POST/PUT/GET/DELETE\r\n`\"/api/security_ai_assistant/current_user/conversations/{id}\"`\r\n-
GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nPrompts
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/prompts/_bulk_action\"`\r\n- GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nAnonymization
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/anonymization_fields/_bulk_action\"`\r\n-
GET
`\"/api/security_ai_assistant/anonymization_fields/_find\"`","sha":"1d5cf48a9700ee769f64256c23278fcfd8cecc5d","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.15.0","v8.16.0"],"title":"[Security
AI Assistant] Changing chat related internal APIs to become
public","number":188139,"url":"https://github.com/elastic/kibana/pull/188139","mergeCommit":{"message":"[Security
AI Assistant] Changing chat related internal APIs to become public
(#188139)\n\n## Summary\r\n\r\nIn this PR Security Gen AI related APIs
are changed from internal to\r\npublic.\r\n\r\nConversations APIs:\r\n-
POST/PUT/GET/DELETE\r\n`\"/api/security_ai_assistant/current_user/conversations/{id}\"`\r\n-
GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nPrompts
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/prompts/_bulk_action\"`\r\n- GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nAnonymization
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/anonymization_fields/_bulk_action\"`\r\n-
GET
`\"/api/security_ai_assistant/anonymization_fields/_find\"`","sha":"1d5cf48a9700ee769f64256c23278fcfd8cecc5d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188139","number":188139,"mergeCommit":{"message":"[Security
AI Assistant] Changing chat related internal APIs to become public
(#188139)\n\n## Summary\r\n\r\nIn this PR Security Gen AI related APIs
are changed from internal to\r\npublic.\r\n\r\nConversations APIs:\r\n-
POST/PUT/GET/DELETE\r\n`\"/api/security_ai_assistant/current_user/conversations/{id}\"`\r\n-
GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nPrompts
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/prompts/_bulk_action\"`\r\n- GET
`\"/api/security_ai_assistant/current_user/conversations/_find\"`\r\n\r\nAnonymization
APIs:\r\n\r\n- POST
`\"/api/security_ai_assistant/anonymization_fields/_bulk_action\"`\r\n-
GET
`\"/api/security_ai_assistant/anonymization_fields/_find\"`","sha":"1d5cf48a9700ee769f64256c23278fcfd8cecc5d"}}]}]
BACKPORT-->

Co-authored-by: Yuliia Naumenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants