haystack-core-integrations icon indicating copy to clipboard operation
haystack-core-integrations copied to clipboard

feat: bedrock converse

Open FloRul opened this issue 1 year ago • 9 comments

Related Issues

#977

Proposed Changes:

Added a new converse generator, some other utility classes have been added to facilitate its use such as ConverseMessage or ToolConfig

How did you test it?

unit test and manual testing mostly

Checklist

FloRul avatar Sep 07 '24 03:09 FloRul

Following this, it looks great ! Thank you

lambda-science avatar Sep 09 '24 09:09 lambda-science

@silvanocerza It seems like the AWS region is not assigned in the CI. I had the same issues in my previous PR.

FloRul avatar Sep 09 '24 13:09 FloRul

@FloRul PR from forks can't have access to repository secrets. Those tests should be skipped if the necessary secrets are not found, see this as an example.

silvanocerza avatar Sep 09 '24 13:09 silvanocerza

Why do we need a new converse generator? Isn't it akin to a chat generator that we already have? Shouldn't we update that?

It seems like all the abstractions added are extremely similar to existing ones for chat generators. 🤔

silvanocerza avatar Sep 12 '24 12:09 silvanocerza

Why do we need a new converse generator? Isn't it akin to a chat generator that we already have? Shouldn't we update that?

It seems like all the abstractions added are extremely similar to existing ones for chat generators. 🤔

That is a fair point, the thing with the current bedrock chat is that it relies on adpaters, would it be more logic to consider converse its own adapter ? Keeping in mind that aws seems to aim at converse being the main point of entry for bedrock inference api.

FloRul avatar Sep 13 '24 02:09 FloRul

That is a fair point, the thing with the current bedrock chat is that it relies on adpaters, would it be more logic to consider converse its own adapter ? Keeping in mind that aws seems to aim at converse being the main point of entry for bedrock inference api.

I would consider converse its own adapter. If AWS goes all in with this kind of common API we can ditch completely the adapter concepts too. That's less code to maintain. :)

Maybe the best approach would be to ditch the adapters for those models that support the new Converse API, that should work right?

silvanocerza avatar Sep 16 '24 10:09 silvanocerza

The idea behind adding a new generator was because of the standardization, which results in a richer output from the generator as well as facilitating the multimodal integration. I think trying to put the implementation in the former ChatGenerator would either not be retrocompatible or making it lose all the benefits this implementation tries to provide: easier tool calling, multimodal integration and richer output.

FloRul avatar Sep 17 '24 15:09 FloRul

We already have a standard and that is the ChatMessage. Adding all the classes from utils.py goes against that.

This Component will be extremely hard to use in any existing Pipelines in place of other generators also. The ConverseMessage is a completely new type that no other Component returns as output nor expects as input. It would be completely isolated.

That's why I'm advocating to use the existing interfaces and types.

silvanocerza avatar Sep 18 '24 13:09 silvanocerza

Ok @silvanocerza I'll look into that.

FloRul avatar Oct 03 '24 17:10 FloRul

Superseded by #1219

anakin87 avatar Dec 10 '24 14:12 anakin87