Class RunRetrieveResponse.DataSource
-
- All Implemented Interfaces:
public final class RunRetrieveResponse.DataSourceInformation about the run's data source.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRunRetrieveResponse.DataSource.VisitorAn interface that defines how to map each variant of DataSource to a value of type T.
public final classRunRetrieveResponse.DataSource.ResponsesA ResponsesRunDataSource object describing a model sampling configuration.
-
Method Summary
Modifier and Type Method Description final Optional<CreateEvalJsonlRunDataSource>jsonl()A JsonlRunDataSource object with that specifies a JSONL file that matches the eval final Optional<CreateEvalCompletionsRunDataSource>completions()A CompletionsRunDataSource object describing a model sampling configuration. final Optional<RunRetrieveResponse.DataSource.Responses>responses()A ResponsesRunDataSource object describing a model sampling configuration. final BooleanisJsonl()final BooleanisCompletions()final BooleanisResponses()final CreateEvalJsonlRunDataSourceasJsonl()A JsonlRunDataSource object with that specifies a JSONL file that matches the eval final CreateEvalCompletionsRunDataSourceasCompletions()A CompletionsRunDataSource object describing a model sampling configuration. final RunRetrieveResponse.DataSource.ResponsesasResponses()A ResponsesRunDataSource object describing a model sampling configuration. final Optional<JsonValue>_json()final <T extends Any> Taccept(RunRetrieveResponse.DataSource.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RunRetrieveResponse.DataSourcevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RunRetrieveResponse.DataSourceofJsonl(CreateEvalJsonlRunDataSource jsonl)A JsonlRunDataSource object with that specifies a JSONL file that matches the eval final static RunRetrieveResponse.DataSourceofCompletions(CreateEvalCompletionsRunDataSource completions)A CompletionsRunDataSource object describing a model sampling configuration. final static RunRetrieveResponse.DataSourceofResponses(RunRetrieveResponse.DataSource.Responses responses)A ResponsesRunDataSource object describing a model sampling configuration. -
-
Method Detail
-
jsonl
final Optional<CreateEvalJsonlRunDataSource> jsonl()
A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
-
completions
final Optional<CreateEvalCompletionsRunDataSource> completions()
A CompletionsRunDataSource object describing a model sampling configuration.
-
responses
final Optional<RunRetrieveResponse.DataSource.Responses> responses()
A ResponsesRunDataSource object describing a model sampling configuration.
-
isCompletions
final Boolean isCompletions()
-
isResponses
final Boolean isResponses()
-
asJsonl
final CreateEvalJsonlRunDataSource asJsonl()
A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
-
asCompletions
final CreateEvalCompletionsRunDataSource asCompletions()
A CompletionsRunDataSource object describing a model sampling configuration.
-
asResponses
final RunRetrieveResponse.DataSource.Responses asResponses()
A ResponsesRunDataSource object describing a model sampling configuration.
-
accept
final <T extends Any> T accept(RunRetrieveResponse.DataSource.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = dataSource.accept(new DataSource.Visitor<Optional<String>>() { @Override public Optional<String> visitJsonl(CreateEvalJsonlRunDataSource jsonl) { return Optional.of(jsonl.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RunRetrieveResponse.DataSource validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofJsonl
final static RunRetrieveResponse.DataSource ofJsonl(CreateEvalJsonlRunDataSource jsonl)
A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
-
ofCompletions
final static RunRetrieveResponse.DataSource ofCompletions(CreateEvalCompletionsRunDataSource completions)
A CompletionsRunDataSource object describing a model sampling configuration.
-
ofResponses
final static RunRetrieveResponse.DataSource ofResponses(RunRetrieveResponse.DataSource.Responses responses)
A ResponsesRunDataSource object describing a model sampling configuration.
-
-
-
-