-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add ES function API test #187465
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
buildkite test this |
proxy.close(); | ||
} | ||
|
||
export function foo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keeping you on your toes :D Good catch!
Thanks for adding these! |
@@ -22,11 +22,10 @@ export function getContextFunctionRequestIfNeeded( | |||
.slice(indexOfLastUserMessage) | |||
.some((message) => message.message.name === CONTEXT_FUNCTION_NAME); | |||
|
|||
if (hasContextSinceLastUserMessage) { | |||
const isLastMessageFunctionRequest = !!last(messages)?.message.function_call?.name; | |||
if (hasContextSinceLastUserMessage || isLastMessageFunctionRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgieselaar Does this change look ok to you? Before we'd inject the context request immediately after other function requests effectively overwriting them. This changes fixes that but I'm not sure if it causes problems to context function request injection in some cases
|
||
// if a function request is at the very end, close the stream to consumer | ||
// without persisting or updating the conversation. we need to wait | ||
// on the function response to have a valid conversation | ||
const isFunctionRequest = lastMessage.message.function_call?.name; | ||
const isFunctionRequest = !!lastMessage?.message.function_call?.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cast to bool
@@ -335,13 +335,12 @@ export class ObservabilityAIAssistantClient { | |||
const initialMessagesWithAddedMessages = | |||
messagesWithUpdatedSystemMessage.concat(addedMessages); | |||
|
|||
const lastMessage = | |||
initialMessagesWithAddedMessages[initialMessagesWithAddedMessages.length - 1]; | |||
const lastMessage = last(initialMessagesWithAddedMessages); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use utility for improved readability
⏳ Build in-progress
History
|
Related to elastic#180787 (cherry picked from commit 4504088)
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
15 similar comments
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Related to #180787