Class: ContextDev::Models::ParseHandleParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/context_dev/models/parse_handle_params.rb,
sig/context_dev/models/parse_handle_params.rbs

Overview

See Also:

  • ContextDev::Resources::Parse#handle

Defined Under Namespace

Modules: Extension, IncludeImages, IncludeLinks, Ocr, ShortenBase64Images, UseMainContentOnly, Zdr Classes: Pdf

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::ContextDev

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize(end_: nil, start: nil) ⇒ Object

Some parameter documentations has been truncated, see Pdf for more details.

PDF page-range options as a JSON object, e.g. 2, "end": 5.

Parameters:

  • end_ (Integer) (defaults to: nil)

    Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus

  • start (Integer) (defaults to: nil)

    First 1-based PDF page to parse. When omitted, parsing starts at the first page.



# File 'lib/context_dev/models/parse_handle_params.rb', line 84

Instance Attribute Details

#bodyPathname, ...

Parameters:

  • value (ContextDev::Internal::file_input)

Returns:



13
# File 'lib/context_dev/models/parse_handle_params.rb', line 13

required :body, ContextDev::Internal::Type::FileInput

#clientString?

Optional client identifier used for usage attribution.

Parameters:

  • (String)

Returns:

  • (String, nil)


19
# File 'lib/context_dev/models/parse_handle_params.rb', line 19

optional :client, String

#extensionSymbol, ...

Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.



26
# File 'lib/context_dev/models/parse_handle_params.rb', line 26

optional :extension, enum: -> { ContextDev::ParseHandleParams::Extension }

#include_imagesBoolean, ...

Include image references in Markdown output

Returns:



32
# File 'lib/context_dev/models/parse_handle_params.rb', line 32

optional :include_images, union: -> { ContextDev::ParseHandleParams::IncludeImages }

Preserve hyperlinks in Markdown output

Returns:



38
# File 'lib/context_dev/models/parse_handle_params.rb', line 38

optional :include_links, union: -> { ContextDev::ParseHandleParams::IncludeLinks }

#ocrBoolean, ...

When true for PDF inputs, detect and OCR images embedded in the selected pages, inserting recognized text at each image's position in page reading order while preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. When false, all OCR is disabled, including the automatic scanned-PDF fallback.

Returns:



47
# File 'lib/context_dev/models/parse_handle_params.rb', line 47

optional :ocr, union: -> { ContextDev::ParseHandleParams::Ocr }

#pdfContextDev::Models::ParseHandleParams::Pdf?

PDF page-range options as a JSON object, e.g. 2, "end": 5.



53
# File 'lib/context_dev/models/parse_handle_params.rb', line 53

optional :pdf, -> { ContextDev::ParseHandleParams::Pdf }

#shorten_base64_imagesBoolean, ...

Shorten base64-encoded image data in the Markdown output



59
# File 'lib/context_dev/models/parse_handle_params.rb', line 59

optional :shorten_base64_images, union: -> { ContextDev::ParseHandleParams::ShortenBase64Images }

#tagsArray<String>?

Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


67
# File 'lib/context_dev/models/parse_handle_params.rb', line 67

optional :tags, ContextDev::Internal::Type::ArrayOf[String]

#use_main_content_onlyBoolean, ...

Extract only the main content from HTML-like inputs



73
# File 'lib/context_dev/models/parse_handle_params.rb', line 73

optional :use_main_content_only, union: -> { ContextDev::ParseHandleParams::UseMainContentOnly }

#zdrSymbol, ...

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.



82
# File 'lib/context_dev/models/parse_handle_params.rb', line 82

optional :zdr, enum: -> { ContextDev::ParseHandleParams::Zdr }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/parse_handle_params.rb', line 188

Instance Method Details

#to_hash{

Returns:

  • ({)


96
# File 'sig/context_dev/models/parse_handle_params.rbs', line 96

def to_hash: -> {