Replies: 1 comment
-
Hi @amavashev. Have you taken a look at this ConversationV2Demo.java code? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Example code to do File search using thread request?
Is this the correct snippet?
ThreadMessageRequest.ThreadMessageRequestBuilder request = ThreadMessageRequest.builder()
.role(ThreadMessageRole.USER);
FileResponse fileResponse = (FileResponse) uploadToVectorStore(fileName);
List<Attachment.AttachmentTool> tools = new ArrayList<>();
tools.add(Attachment.AttachmentTool.FILE_SEARCH);
List attachments = new ArrayList<>();
attachments.add(new Attachment(fileResponse.getId(), tools));
request.attachments(attachments);
Print out of the thread request when its all setup:
ThreadMessageRequest.ThreadMessageRequestBuilder(role=USER, content=[ContentPart.ContentPartText(text=whats this file?)], attachments=[Attachment(fileId=file-KRjYryEg5wxrKfoUikPb3R, tools=[Attachment.AttachmentTool(type=FILE_SEARCH)])], metadata=null)
Beta Was this translation helpful? Give feedback.
All reactions