这是indexloc提供的服务,不要输入任何密码
Skip to content

add ToolCallFileSearch class to hold the file search results #68

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

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ToolCall {
* For now, this is always going to be an empty object.
*/
@JsonProperty("file_search")
Map<String, String> fileSearch;
ToolCallFileSearch fileSearch;

ToolCallFunction function;
}
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;
}
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;
}
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;
}