Skip to content

Add a convert from URL server side rendered route#615

Merged
vishnoianil merged 1 commit intoinstructlab:mainfrom
nerdalert:url-conversion
Mar 4, 2025
Merged

Add a convert from URL server side rendered route#615
vishnoianil merged 1 commit intoinstructlab:mainfrom
nerdalert:url-conversion

Conversation

@nerdalert
Copy link
Member

@nerdalert nerdalert commented Feb 25, 2025

  • Provides the client side a server side route to send docling conversion requests from a URL source rather than file file sources.

Example usage from the client side:

const res = await fetch('/api/native/convert-http', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    options: {
      from_formats: ['docx', 'pptx', 'html', 'image', 'pdf', 'asciidoc', 'md', 'xlsx'],
      to_formats: ['md'],
      image_export_mode: 'placeholder',
      table_mode: 'fast',
      abort_on_error: false,
      return_as_file: false,
      do_table_structure: true,
      include_images: false
    },
    http_sources: [{ url: 'https://arxiv.org/pdf/2206.01062' }]
  })
});

cc/ @jeff-phillips-18

- Provides the client side a server side route to send docling
conversion requests from a URL source rather than file file sources.

Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
@vishnoianil
Copy link
Member

@nerdalert PR looks good to me. I think convert functions are specific to docling, and used by both github and native mode, so I think we should move convert and convert-http both out native to /api or /api/docling/? wdyt?

Copy link
Member

@vishnoianil vishnoianil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had discussion with brent on this. Keeping this endpoint separate till we get end to end workflow working. Once we have a stable end to end workflow, we can possibly refactor and merge with convert api.

@vishnoianil vishnoianil merged commit 10e1449 into instructlab:main Mar 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants