-
Notifications
You must be signed in to change notification settings - Fork 271
Ollama support for file attachments #1221
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
Conversation
Qodana for JVM1170 new problems were found
@@ Code coverage @@
+ 72% total lines covered
16829 lines analyzed, 12196 lines covered
# Calculated according to the filters of your coverage tool☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
aozherelyeva
left a comment
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.
LGTM, thanks!
tiginamaria
left a comment
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.
Looks nice, thank you!
Just make a small adjustment to make content collection ordered please
|
|
||
| var textAttachments = "" | ||
|
|
||
| parts.forEach { part -> |
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.
Let's join this parts.forEach with one in line 63 and aggregate the text part content and file part content in order in the parts list using string builder.
So just simply replace empty case with append ContentPart.Text -> { // append } and move ContentPart.File up and append file content to the same builder.
The order may be important here as we could create prompt like text { In file following file count A }, file { AAA }, text { In file following file count B }, file { BBBB } so me need them to follow the order in the resulting 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.
Problem is - code above collects parts for images and it passes them to images field. Unfortunately t's not allowed to pass anything other than base64 images, and I'm not sure it's the proper way to pass text files content.
And there is no separate field for other files, according to API docs
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.
Sure, I understand the reason why it's done like this, but we can still join the content in the right order and get rid of second forEach
tiginamaria
left a comment
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.
Looks nice, thank you!
Qodana for JVM1170 new problems were found
@@ Code coverage @@
+ 72% total lines covered
16823 lines analyzed, 12196 lines covered
# Calculated according to the filters of your coverage tool☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
Motivation and Context
Breaking Changes
Type of the changes
Checklist
developas the base branchAdditional steps for pull requests adding a new feature