-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ToolCallFileSearch class to hold the file search results
- Loading branch information
Showing
4 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
api/src/main/java/com/theokanning/openai/assistants/run/ToolCallFileSearch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.theokanning.openai.assistants.run; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.theokanning.openai.assistants.assistant.FileSearchRankingOptions; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ToolCallFileSearch { | ||
/** | ||
* The ranking options for the file search. | ||
*/ | ||
@JsonProperty("ranking_options") | ||
private FileSearchRankingOptions rankingOptions; | ||
|
||
/** | ||
* The results of the file search. | ||
*/ | ||
private List<ToolCallFileSearchResult> results; | ||
} |
37 changes: 37 additions & 0 deletions
37
api/src/main/java/com/theokanning/openai/assistants/run/ToolCallFileSearchResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.theokanning.openai.assistants.run; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ToolCallFileSearchResult { | ||
/** | ||
* The ID of the file that result was found in. | ||
*/ | ||
@JsonProperty("file_id") | ||
private String fileId; | ||
|
||
/** | ||
* The name of the file that result was found in. | ||
*/ | ||
@JsonProperty("file_name") | ||
private String fileName; | ||
|
||
/** | ||
* The score of the result. All values must be a floating point number between 0 and 1. | ||
*/ | ||
private Double score; | ||
|
||
/** | ||
* The content of the result that was found. The content is only included if requested via the include query parameter. | ||
*/ | ||
private List<ToolCallFileSearchResultContent> content; | ||
} |
22 changes: 22 additions & 0 deletions
22
api/src/main/java/com/theokanning/openai/assistants/run/ToolCallFileSearchResultContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.theokanning.openai.assistants.run; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ToolCallFileSearchResultContent { | ||
/** | ||
* The type of the content. | ||
*/ | ||
private String type; | ||
|
||
/** | ||
* The text content of the file. | ||
*/ | ||
private String text; | ||
} |