Class CreateEvalCompletionsRunDataSource.InputMessages
-
- All Implemented Interfaces:
public final class CreateEvalCompletionsRunDataSource.InputMessagesUsed when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie,
item.input_trajectory), or a template with variable references to theitemnamespace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCreateEvalCompletionsRunDataSource.InputMessages.VisitorAn interface that defines how to map each variant of InputMessages to a value of type T.
public final classCreateEvalCompletionsRunDataSource.InputMessages.Templatepublic final classCreateEvalCompletionsRunDataSource.InputMessages.ItemReference
-
Method Summary
-
-
Method Detail
-
template
final Optional<CreateEvalCompletionsRunDataSource.InputMessages.Template> template()
-
itemReference
final Optional<CreateEvalCompletionsRunDataSource.InputMessages.ItemReference> itemReference()
-
isTemplate
final Boolean isTemplate()
-
isItemReference
final Boolean isItemReference()
-
asTemplate
final CreateEvalCompletionsRunDataSource.InputMessages.Template asTemplate()
-
asItemReference
final CreateEvalCompletionsRunDataSource.InputMessages.ItemReference asItemReference()
-
accept
final <T extends Any> T accept(CreateEvalCompletionsRunDataSource.InputMessages.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 = inputMessages.accept(new InputMessages.Visitor<Optional<String>>() { @Override public Optional<String> visitTemplate(Template template) { return Optional.of(template.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final CreateEvalCompletionsRunDataSource.InputMessages 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.
-
ofTemplate
final static CreateEvalCompletionsRunDataSource.InputMessages ofTemplate(CreateEvalCompletionsRunDataSource.InputMessages.Template template)
-
ofItemReference
final static CreateEvalCompletionsRunDataSource.InputMessages ofItemReference(CreateEvalCompletionsRunDataSource.InputMessages.ItemReference itemReference)
-
-
-
-