diff --git a/openai-core/src/commonMain/kotlin/com.aallam.openai.api/run/RunStepDetails.kt b/openai-core/src/commonMain/kotlin/com.aallam.openai.api/run/RunStepDetails.kt index 2c7220a7..12601951 100644 --- a/openai-core/src/commonMain/kotlin/com.aallam.openai.api/run/RunStepDetails.kt +++ b/openai-core/src/commonMain/kotlin/com.aallam.openai.api/run/RunStepDetails.kt @@ -47,8 +47,8 @@ public data class MessageCreation( public data class ToolCallStepDetails( /** * An array of tool calls the run step was involved in. - * These can be associated with one of three types of tools: - * [ToolCallStep.CodeInterpreter], [ToolCallStep.RetrievalTool], or [ToolCallStep.FunctionTool]. + * These can be associated with one of four types of tools: + * [ToolCallStep.CodeInterpreter], [ToolCallStep.RetrievalTool], [ToolCallStep.FunctionTool], or [ToolCallStep.FileSearchTool]. */ @SerialName("tool_calls") public val toolCalls: List? = null, ) : RunStepDetails @@ -98,6 +98,20 @@ public sealed interface ToolCallStep { */ @SerialName("function") public val function: FunctionToolCallStep, ) : ToolCallStep + + @BetaOpenAI + @Serializable + @SerialName("file_search") + public data class FileSearchTool( + /** + * The ID of the tool call object. + */ + @SerialName("id") public val id: ToolCallStepId, + /** + * The options and results of the file search. + */ + @SerialName("file_search") public val fileSearch: FileSearchToolCallStep, + ) : ToolCallStep } @BetaOpenAI @@ -119,6 +133,53 @@ public data class FunctionToolCallStep( @SerialName("output") public val output: String? = null, ) +@BetaOpenAI +@Serializable +public data class FileSearchToolCallStep( + /** + * The configured options for ranking. + */ + @SerialName("ranking_options") public val rankingOptions: FileSearchToolCallRankingOptions, + + /** + * The returned results of the file search, ordered by score. + */ + @SerialName("results") public val results: List, +) + +@BetaOpenAI +@Serializable +public data class FileSearchToolCallRankingOptions( + /** + * The configured ranker. + */ + @SerialName("ranker") public val ranker: String, + + /** + * The configured score threshold. + */ + @SerialName("score_threshold") public val scoreThreshold: Double, +) + +@BetaOpenAI +@Serializable +public data class FileSearchToolCallResult( + /** + * The ID of the file object. + */ + @SerialName("file_id") public val fileId: FileId, + + /** + * The original filename of the file object. + */ + @SerialName("file_name") public val fileName: String, + + /** + * The score given to the provided result. + */ + @SerialName("score") public val score: Double, +) + @BetaOpenAI @Serializable public data class CodeInterpreterToolCall(