All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Workers AI - New conversion options for Markdown Conversion

4mo ago

Source

CloudflareWorkers AI - New conversion options for Markdown Conversioncloudflare.com
Snippet from the RSS feed
You can now customize how the Markdown Conversion service processes different file types by passing a conversionOptions object. Available options: Images : Set the language for AI-generated image descriptions HTML : Use CSS selectors to extract specific content, or provide a hostname to resolve relative links PDF : Exclude metadata from the output Use the env.AI binding: JavaScript await env . AI . toMarkdown ( { name : "page.html" , blob : new Blob ([ html ]) }, { conversionOptions : { html : { cssSelector : "article.content" }, image : { descriptionLanguage : "es" }, }, }, ) ; TypeScript await env . AI . toMarkdown ( { name : "page.html" , blob : new Blob ([ html ]) }, { conversionOptions : { html : { cssSelector : "article.content" }, image : { descriptionLanguage : "es" }, }, }, ) ; Or call the REST API: curl \ -H 'Authorization: Bearer {API_TOKEN}' \ -F '[email protected]' \ -F 'conversionOptions={"html": {"cssSelector": "article.content"}}' For more details, refer to Conversion Options .

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.