Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncDoclingResponse ¶
type Client ¶
type Client struct {
ClientConfig *ClientConfig `json:"client_config"`
}
func NewClientFromURL ¶
func NewClientFromURL(clientConfig *ClientConfig) *Client
func (*Client) ConvertFile ¶
func (c *Client) ConvertFile( ctx context.Context, fileURL string, doclingConfig DoclingConfig, ) (*AsyncDoclingResponse, error)
func (*Client) GetConvertedFile ¶
func (c *Client) GetConvertedFile(ctx context.Context, taskID string) (TaskStatus, *DoclingResponse, error)
type ClientConfig ¶
type DoclingConfig ¶
type DoclingConfig struct {
FromFormats []string `json:"from_formats"`
ToFormats []string `json:"to_formats"`
ImageExportMode string `json:"image_export_mode"`
DoOCR bool `json:"do_ocr"`
ForceOCR bool `json:"force_ocr"`
OCREngine string `json:"ocr_engine,omitempty"`
OCRLang []string `json:"ocr_lang"`
OCRPreset string `json:"ocr_preset,omitempty"`
PDFBackend string `json:"pdf_backend"`
Pipeline string `json:"pipeline,omitempty"`
TableMode string `json:"table_mode"`
TableCellMatching *bool `json:"table_cell_matching,omitempty"`
DoTableStructure *bool `json:"do_table_structure,omitempty"`
IncludeImages *bool `json:"include_images,omitempty"`
ImagesScale *float64 `json:"images_scale,omitempty"`
DoCodeEnrichment bool `json:"do_code_enrichment,omitempty"`
DoFormulaEnrichment bool `json:"do_formula_enrichment,omitempty"`
DoPictureClassification bool `json:"do_picture_classification,omitempty"`
DoPictureDescription bool `json:"do_picture_description,omitempty"`
DoChartExtraction bool `json:"do_chart_extraction,omitempty"`
PictureDescriptionAreaThreshold *float64 `json:"picture_description_area_threshold,omitempty"`
DocumentTimeout *float64 `json:"document_timeout,omitempty"`
PageRange []int `json:"page_range,omitempty"`
MdPageBreakPlaceholder string `json:"md_page_break_placeholder,omitempty"`
AbortOnError bool `json:"abort_on_error"`
}
+kubebuilder:object:generate=true
func (*DoclingConfig) DeepCopy ¶
func (in *DoclingConfig) DeepCopy() *DoclingConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoclingConfig.
func (*DoclingConfig) DeepCopyInto ¶
func (in *DoclingConfig) DeepCopyInto(out *DoclingConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DoclingRequestPayload ¶
type DoclingRequestPayload struct {
Options *DoclingConfig `json:"options"`
Sources []DoclingSource `json:"sources"`
}
type DoclingResponse ¶
type DoclingResponse struct {
Document DoclingResponseDocument `json:"document"`
Status TaskStatus `json:"status"`
ProcessingTime float64 `json:"processing_time"`
Errors []string `json:"errors"`
}
type DoclingResponseDocument ¶
type DoclingSource ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusPending TaskStatus = "pending" // this is returned by /v1/status/poll and /v1/result endpoint TaskStatusStarted TaskStatus = "started" // this is returned by /v1/status/poll and /v1/result endpoint TaskStatusSuccess TaskStatus = "success" // this is returned by /v1/status/poll and /v1/result endpoint TaskStatusFailure TaskStatus = "failure" // this is returned by /v1/status/poll and /v1/result endpoint TaskStatusPartialSuccess TaskStatus = "partial_success" // this is only returned by /v1/result endpoint TaskStatusSkipped TaskStatus = "skipped" // this is only returned by /v1/result endpoint SemaphoreAcquireError = "failed to acquire docling semaphore" SemaphorePanicError = "semaphore: released more than held" )
type TaskStatusResponse ¶
type TaskStatusResponse struct {
TaskID string `json:"task_id"`
TaskStatus TaskStatus `json:"task_status"`
TaskPosition int `json:"task_position"`
ErrorMessage string `json:"error_message,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.