Class Completion

  • All Implemented Interfaces:

    
    public final class Completion
    
                        
    • Constructor Detail

    • Method Detail

      • id

         final String id()

        Unique object identifier.

        The format and length of IDs may change over time.

      • completion

         final String completion()

        The resulting completion up to and excluding the stop sequences.

      • model

         final Model model()

        The model that will complete your prompt.

        See models for additional details and options.

      • stopReason

         final Optional<String> stopReason()

        The reason that we stopped.

        This may be one the following values:

        • "stop_sequence": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model

        • "max_tokens": we exceeded max_tokens_to_sample or the model's maximum

      • _type

         final JsonValue _type()

        Object type.

        For Text Completions, this is always "completion".

        Expected to always return the following:

        JsonValue.from("completion")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • _id

         final JsonField<String> _id()

        Returns the raw JSON value of id.

        Unlike id, this method doesn't throw if the JSON field has an unexpected type.

      • _model

         final JsonField<Model> _model()

        Returns the raw JSON value of model.

        Unlike model, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final Completion 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.

      • builder

         final static Completion.Builder builder()

        Returns a mutable builder for constructing an instance of Completion.

        The following fields are required:

        .id()
        .completion()
        .model()
        .stopReason()