-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Inference plugin: Add Bedrock model adapter #191434
Conversation
/ci |
c62a666
to
49bb04b
Compare
/ci |
/ci |
/ci |
Pinging @elastic/appex-ai-infra (Team:AI Infra) |
}; | ||
} | ||
// ToolChoiceType.none is not supported by claude. | ||
return undefined; |
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.
in this case, should we append something to the system message?
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.
Yeah, I had it on my TODO and somehow forgot about it, I will add it
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.
case MessageRole.User: | ||
return { | ||
role: 'user' as const, | ||
// content: message.content, |
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.
why commented?
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.
I initially used the content
field for user message, then I decided to use rawContent
(which gets mapped directly to content
in the connector without transformations) for all type of messages.
I just forgot to delete the commented bits, thanks
// before all operations have completed. | ||
let nextPromise = Promise.resolve(); | ||
|
||
async function handleNext(chunkBody: CompletionChunk) { |
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.
I don't think this actually needs to be async (my bad). so we don't need the promise either?
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.
TBH I kept it from your implementation because I wasn't sure what it was doing, so if you confirm it's not needed I absolutely can get rid of it.
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.
toolCallId: chunkBody.content_block.id, | ||
function: { | ||
name: chunkBody.content_block.name, | ||
// the API returns '{}' here, which can't be merged with the deltas... |
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.
hehe
} | ||
error = createInferenceInternalError(message); | ||
} catch (decodeError) { | ||
error = createInferenceInternalError(); |
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.
should we use createInferenceInternalError(decodeError.message)
?
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.
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.
thanks!!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
## Summary Fix regression on `InvokeAIRaw` bedrock subaction introduced by #191434
Summary
Add the
bedrock
(well, bedrock-claude) model adapter for the inference plugin. Also had to perform minor changes on the associated connector to add support for new capabilities.