Module: OpenAI::Models::EmbeddingCreateParams::Input

Extended by:
Internal::Type::Union
Defined in:
lib/openai/models/embedding_create_params.rb

Overview

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.

Constant Summary collapse

StringArray =
OpenAI::Internal::Type::ArrayOf[String]
IntegerArray =
OpenAI::Internal::Type::ArrayOf[Integer]
ArrayOfToken2DArray =
OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::ArrayOf[Integer]]

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, type_info

Class Method Details

.variantsArray(String, Array<String>, Array<Integer>, Array<Array<Integer>>)

Returns:

  • (Array(String, Array<String>, Array<Integer>, Array<Array<Integer>>))


# File 'lib/openai/models/embedding_create_params.rb', line 96