-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(doc handle): documentation handling for bedrock #3751
feat(doc handle): documentation handling for bedrock #3751
Conversation
7cb6e55
to
b4c6bf5
Compare
...rs/aws/aws-bedrock/src/main/java/io/camunda/connector/aws/bedrock/mapper/DocumentMapper.java
Fixed
Show fixed
Hide fixed
b4c6bf5
to
27f5854
Compare
27f5854
to
203f6de
Compare
...rs/aws/aws-bedrock/src/main/java/io/camunda/connector/aws/bedrock/mapper/DocumentMapper.java
Dismissed
Show dismissed
Hide dismissed
|
||
private MessageMapper createMessageMapper() { | ||
var bedrockContentMapper = new BedrockContentMapper(new DocumentMapper()); | ||
return new MessageMapper(bedrockContentMapper); |
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.
So we are not returning the new Message and the history but only the history ?
That requires changes in the documentation, and is it what is expected ?
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.
Yes and Yes ))
I described this in the documentation pr
.toList(); | ||
var messageMapper = createMessageMapper(); | ||
var bedrockContentMapper = messageMapper.getBedrockContentMapper(); | ||
this.messagesHistory.add(prepareNewBedrockMessage(bedrockContentMapper)); |
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.
Having prepareNewBedrockMessage
be part of MessageMapper would be clearer
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.
make sense, I will do ))
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.
done
203f6de
to
0c1e39a
Compare
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.
A few comments only great work!
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.
probably done but just in case: remember the webmodeler pr :)
|
||
public class DocumentMapper { | ||
|
||
public static final String UNSUPPORTED_DOC_TYPE_MSG = "Unsupported document type: "; |
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.
could be "Unsupported document type: {}"
and then in the logger.debug(UNSUPPORTED_DOC_TYPE_MSG, fileType)
fileType = fileType.isEmpty() ? FileUtil.defineType(contentType) : fileType; | ||
} catch (MimeTypeException e) { | ||
String errorMsg = UNSUPPORTED_CONTENT_TYPE_MSG + contentType; | ||
LOGGER.debug(errorMsg); |
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 have the context, but are we sure it's only a debug level message? not even warn ?
import java.util.Objects; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BedrockContent { |
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.
this can be a record
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class BedrockMessage { |
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.
this can be a record
|
||
public static String defineType(String contentType) throws MimeTypeException { | ||
MimeTypes mimeTypes = MimeTypes.getDefaultMimeTypes(); | ||
String extension = mimeTypes.forName(contentType).getExtension(); |
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.
can mimeTypes.forName(contentType)
throw an exception? if so shouldn't we handle it properly and wrap it?
QA testing done.
if this is intended, maybe this needs to be mentioned in the documentation
|
@DenovVasil Can you make use of "Object" as the type and figure out whether its a single object document or multiple ones in the Connector? |
We can provide a list of documents on the API bedrock, so for me this is expected behavior. |
The documentation states that the documents are a list. |
Description
Added document handling for bedrock.
documentation PR
e2e PR
demo link
Related issues
https://github.com/camunda/team-connectors/issues/969