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

[Obs AI Assistant] Remove TokenCountEvent #209549

Merged
merged 11 commits into from
Feb 20, 2025

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Feb 4, 2025

Closes #205479

This filters out the ChatCompletionTokenCountEvent from the inference plugin. This greatly simplifies handling ChatCompletion events in the Obs AI Assistant.

@sorenlouv sorenlouv marked this pull request as ready for review February 4, 2025 14:14
@sorenlouv sorenlouv requested a review from a team as a code owner February 4, 2025 14:14
Comment on lines -80 to +76
withLatestFrom(withoutTokenCount$),
withLatestFrom(shared.pipe(filterChunkEvents())),
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we still need this? I think so but the previous naming was confusing.

@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Feb 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@sorenlouv sorenlouv added backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes labels Feb 4, 2025
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

nextEvents$,
title$.pipe(filter((value): value is TokenCountEvent => typeof value !== 'string'))
).pipe(extractTokenCount()),
nextEvents$.pipe(extractMessages()),
Copy link
Member

Choose a reason for hiding this comment

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

much better!

@sorenlouv sorenlouv enabled auto-merge (squash) February 20, 2025 15:26
@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 20, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 9fc91d6
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-209549-9fc91d619d57

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
observabilityAIAssistant 383 382 -1

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
observabilityAIAssistant 30 28 -2

Page load bundle

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

id before after diff
observabilityAIAssistant 38.3KB 38.0KB -309.0B
Unknown metric groups

API count

id before after diff
observabilityAIAssistant 385 384 -1

History

@sorenlouv sorenlouv merged commit c4826bd into elastic:main Feb 20, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.0

https://github.com/elastic/kibana/actions/runs/13441645174

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 20, 2025
Closes elastic#205479

This filters out the `ChatCompletionTokenCountEvent` from the inference
plugin. This greatly simplifies handling ChatCompletion events in the
Obs AI Assistant.

(cherry picked from commit c4826bd)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.0

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 Feb 20, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Obs AI Assistant] Remove TokenCountEvent
(#209549)](#209549)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"soren.louv@elastic.co"},"sourceCommit":{"committedDate":"2025-02-20T17:59:19Z","message":"[Obs
AI Assistant] Remove TokenCountEvent (#209549)\n\nCloses
https://github.com/elastic/kibana/issues/205479\n\nThis filters out the
`ChatCompletionTokenCountEvent` from the inference\nplugin. This greatly
simplifies handling ChatCompletion events in the\nObs AI
Assistant.","sha":"c4826bdfbfb88a31b455d2647e0268f8ffb4299f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:Obs
AI Assistant","ci:project-deploy-observability","v9.1.0"],"title":"[Obs
AI Assistant] Remove
TokenCountEvent","number":209549,"url":"https://github.com/elastic/kibana/pull/209549","mergeCommit":{"message":"[Obs
AI Assistant] Remove TokenCountEvent (#209549)\n\nCloses
https://github.com/elastic/kibana/issues/205479\n\nThis filters out the
`ChatCompletionTokenCountEvent` from the inference\nplugin. This greatly
simplifies handling ChatCompletion events in the\nObs AI
Assistant.","sha":"c4826bdfbfb88a31b455d2647e0268f8ffb4299f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209549","number":209549,"mergeCommit":{"message":"[Obs
AI Assistant] Remove TokenCountEvent (#209549)\n\nCloses
https://github.com/elastic/kibana/issues/205479\n\nThis filters out the
`ChatCompletionTokenCountEvent` from the inference\nplugin. This greatly
simplifies handling ChatCompletion events in the\nObs AI
Assistant.","sha":"c4826bdfbfb88a31b455d2647e0268f8ffb4299f"}}]}]
BACKPORT-->

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] Remove custom token count event
4 participants