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] Fix null pointer in function definition #203344

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Dec 6, 2024

Closes #201713

@sorenlouv sorenlouv requested review from a team as code owners December 6, 2024 20:25
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Dec 6, 2024
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

github-actions bot commented Dec 6, 2024

🤖 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!)

.map((fn) => [fn.name, { description: fn.description, schema: fn.parameters }])
[...actions, ...esqlFunctions].map((fn) => [
fn.name,
{ description: fn.description, schema: fn.parameters } as ToolDefinition,
Copy link
Member Author

Choose a reason for hiding this comment

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

@pgayvallet @arturoliduena actions.parameters is typed as ToolSchema whereas esqlFunctions is typed as CompatibleJSONSchema. This gives some incompatibilities when merging the types so I had to do type assertion.

Is the plan to get rid of CompatibleJSONSchema in favor of ToolSchema?

Copy link
Member Author

Choose a reason for hiding this comment

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

CompatibleJSONSchema is defined here

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the plan to get rid of CompatibleJSONSchema in favor of ToolSchema?

I think that question is on your side? CompatibleJSONSchema is a o11y assistant type, ToolSchema is an inference plugin's type. You're more than welcome, and encouraged, to drop your own types in favor of the inference framework's, but that's not really my call, is it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in that case it's mostly a question for @arturoliduena

Copy link
Contributor

Choose a reason for hiding this comment

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

I’m also in favor of moving towards using the inference plugin’s types when possible,as it supports a more consistent approach across plugins. However, I had a similar conversation with @dgieselaar and at the moment we agree on keeping o11y assistant types:

#199286 (comment)

Ideally we encapsulate the event type from the inference client here, and convert it into ChatCompletionChunkEvent. We should eventually completely drop ChatCompletionChunkEvent in favor of the inference plugin's types, but that means that we need to make changes in many places, and there's some stuff that isn't supported yet by the Inference plugin's types. Until that happens, I think we should limit the blast radius and stick to our own types where we can - which should be everywhere except for the implementation of this function, I think.

@sorenlouv sorenlouv added release_note:fix backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) v8.16.0 v8.17.0 labels Dec 6, 2024
@sorenlouv sorenlouv changed the title [Obs AI Assistant] Fix null pointer in fn def [Obs AI Assistant] Fix null pointer in function definition Dec 9, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 9, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 8d865c6
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-203344-8d865c6dd542

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
observabilityAIAssistantApp 237.9KB 237.9KB +32.0B
searchAssistant 160.2KB 160.2KB +32.0B
total +64.0B

History

@sorenlouv sorenlouv merged commit 1d9ca1e into elastic:main Dec 9, 2024
9 checks passed
@sorenlouv sorenlouv deleted the fix-null-pointer-fn-params branch December 9, 2024 14:00
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.x

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

@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17
8.x

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 203344

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 9, 2024
…03344) (#203435)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Obs AI Assistant] Fix null pointer in function definition
(#203344)](#203344)

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

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

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-09T14:00:05Z","message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.16.0","v8.17.0"],"title":"[Obs
AI Assistant] Fix null pointer in function
definition","number":203344,"url":"https://github.com/elastic/kibana/pull/203344","mergeCommit":{"message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203344","number":203344,"mergeCommit":{"message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Søren Louv-Jansen <[email protected]>
kibanamachine added a commit that referenced this pull request Dec 9, 2024
…3344) (#203436)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Obs AI Assistant] Fix null pointer in function definition
(#203344)](#203344)

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

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

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-09T14:00:05Z","message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.16.0","v8.17.0"],"title":"[Obs
AI Assistant] Fix null pointer in function
definition","number":203344,"url":"https://github.com/elastic/kibana/pull/203344","mergeCommit":{"message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203344","number":203344,"mergeCommit":{"message":"[Obs
AI Assistant] Fix null pointer in function definition
(#203344)\n\nCloses
#201713","sha":"1d9ca1ebf66f4cb8a367de8a8854d40dd4789ec8"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Søren Louv-Jansen <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
@sorenlouv
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.16

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 11, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

15 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 6, 2025
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:fix Team:Obs AI Assistant Observability AI Assistant v8.16.0 v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug when using the event editor with Azure OpenAI connector on Elastic Cloud
7 participants