Workers AI - Plain text output for Markdown Conversion
Markdown Conversion service now supports a new plain text output format option. Set output.format to "text" to receive content with Markdown syntax removed, while the default "markdown" format remains unchanged for backward compatibility.
The Markdown Conversion service now supports a new output conversion option that controls the format of the converted content.
Set output.format to text to receive plain text with Markdown syntax removed. The default value is markdown, so existing conversions are unchanged.
Use the env.AI binding:
await env.AI.toMarkdown(
{ name: "page.html", blob: new Blob([html]) },
{
conversionOptions: {
output: { format: "text" },
},
},
); await env.AI.toMarkdown(
{ name: "page.html", blob: new Blob([html]) },
{
conversionOptions: {
output: { format: "text" },
},
},
);
Or call the REST API:
curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/tomarkdown \
-H 'Authorization: Bearer {API_TOKEN}' \
-F 'files=@index.html' \
-F 'conversionOptions={"output": {"format": "text"}}'
When you request text output, the format field of each result is set to text. For more details, refer to Conversion Options.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.