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

842 aws bedrock connector #2832

Merged
merged 7 commits into from
Jul 18, 2024
Merged

842 aws bedrock connector #2832

merged 7 commits into from
Jul 18, 2024

Conversation

mathias-vandaele
Copy link
Contributor

@mathias-vandaele mathias-vandaele commented Jul 10, 2024

@mathias-vandaele mathias-vandaele self-assigned this Jul 10, 2024
@mathias-vandaele mathias-vandaele requested a review from a team as a code owner July 10, 2024 15:30
@mathias-vandaele mathias-vandaele marked this pull request as draft July 10, 2024 15:31
@mathias-vandaele mathias-vandaele changed the title DRAFT: 842 aws bedrock connector 842 aws bedrock connector Jul 10, 2024
Comment on lines 18 to 22
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Copy link
Contributor

Choose a reason for hiding this comment

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

Dont we inherit it from the parent?

inputVariables = {"authentication", "configuration", "action", "data"},
type = "io.camunda:aws-bedrock:1")
@ElementTemplate(
id = "io.camunda.connectors.AWSBEDROCK.v1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
id = "io.camunda.connectors.AWSBEDROCK.v1",
id = "io.camunda.connectors.aws.bedrock.v1",

connectors/aws/pom.xml Outdated Show resolved Hide resolved
Comment on lines 11 to 36
public class PreviousMessage {
private String message;
private ConversationRole role;

public PreviousMessage(String message, ConversationRole role) {
this.message = message;
this.role = role;
}

public PreviousMessage() {}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public ConversationRole getRole() {
return role;
}

public void setRole(ConversationRole role) {
this.role = role;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create a simple data record like this:

public record Message(String text, String role) {}

We should try to avoid serializing external data models like in this case ConversationRole.


import software.amazon.awssdk.services.bedrockruntime.model.ConversationRole;

public class PreviousMessage {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be converted to a record ?

binding = @TemplateProperty.PropertyBinding(name = "data.messagesHistory"))
@Valid
@JsonSetter(nulls = Nulls.SKIP)
private List<PreviousMessage> messagesHistory = new ArrayList<>();
Copy link
Contributor

@sbuettner sbuettner Jul 11, 2024

Choose a reason for hiding this comment

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

What about messages?

binding = @TemplateProperty.PropertyBinding(name = "data.newMessage"))
@Valid
@NotBlank
private String newMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

nextMessage?

Copy link
Contributor

@sbuettner sbuettner left a comment

Choose a reason for hiding this comment

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

Great work, some minor comments.

@mathias-vandaele mathias-vandaele marked this pull request as ready for review July 11, 2024 14:58
@mathias-vandaele mathias-vandaele force-pushed the 842-aws-bedrock-connector branch from a2cf9b6 to 4273b14 Compare July 11, 2024 15:01
@ElementTemplate.PropertyGroup(id = "invokeModel", label = "Invoke Model"),
@ElementTemplate.PropertyGroup(id = "converse", label = "Converse"),
},
documentationRef = "https://docs.camunda.io/docs/",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this needs to be update with the future doc link

johnBgood
johnBgood previously approved these changes Jul 12, 2024
Copy link
Collaborator

@johnBgood johnBgood left a comment

Choose a reason for hiding this comment

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

Minor comments, LGTM 🥇

import software.amazon.awssdk.services.bedrockruntime.model.Message;

@TemplateSubType(id = "converse", label = "Converse")
public final class ConverseData implements RequestData {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's keep in my that if we don't override toString we might leak information from nextMessage or the previous messages.
Not sure it's an issue for this connector, it's more a FYI :) We usually do that for credentials etc

@mathias-vandaele mathias-vandaele added this pull request to the merge queue Jul 18, 2024
Merged via the queue into main with commit 9ec4e07 Jul 18, 2024
4 checks passed
@mathias-vandaele mathias-vandaele deleted the 842-aws-bedrock-connector branch July 18, 2024 09:23
chillleader pushed a commit that referenced this pull request Aug 7, 2024
* feat(aws-bedrock): new outbound connector implementation for aws bedrock

* feat(aws-bedrock): new outbound connector implementation for aws bedrock (checkpoint 2)

* feat(aws-bedrock): new outbound connector implementation for aws bedrock (checkpoint 3)

* feat(aws-bedrock): setting application.properties as it was before  (checkpoint 4)

* feat(aws-bedrock): fix comments from PR (checkpoint 5)

* feat(aws-bedrock): fix indent  (checkpoint 6)

* feat(aws-bedrock): fix last minor comment (checkpoint 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants