Method: OpenAI::Internal::Type::Converter#dump
- Defined in:
- lib/openai/internal/type/converter.rb
#dump(value, state:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/openai/internal/type/converter.rb', line 40 def dump(value, state:) case value in Array value.map { OpenAI::Internal::Type::Unknown.dump(_1, state: state) } in Hash value.transform_values { OpenAI::Internal::Type::Unknown.dump(_1, state: state) } in OpenAI::Internal::Type::BaseModel value.class.dump(value, state: state) in StringIO value.string in Pathname | IO state[:can_retry] = false if value.is_a?(IO) OpenAI::FilePart.new(value) in OpenAI::FilePart state[:can_retry] = false if value.content.is_a?(IO) value else value end end |