ENF News Bot
Automated News Bot
- Joined
- Apr 15, 2022
- Messages
- 2,591
The Markdown Conversion service now supports a new
Set
Use the
Or call the REST API:
When you request text output, the
Continue reading...
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:
Code:
await env.AI.toMarkdown(
{ name: "page.html", blob: new Blob([html]) },
{
conversionOptions: {
output: { format: "text" },
},
},
);
Code:
await env.AI.toMarkdown(
{ name: "page.html", blob: new Blob([html]) },
{
conversionOptions: {
output: { format: "text" },
},
},
);
Or call the REST API:
Code:
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.Continue reading...