cloudflare / cloudflare/ai

AI.toMarkdown() model used & dashboard improvements

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
345
Avg merge
13h 31m
Merged PRs (30d)
1

Description

Hey folks

I'm using the `toMarkdown()` to convert PDFs, and I noticed there were tokens in the output, and that on the AI dashboard I had some usage.

In the result from the API, would it be possible to indicate which model has been used to convert to markdown (so that I can track the token usage and price in my analytic suite)

```ts
{
"name": "somatosensory.pdf",
"mimeType": "application/pdf",
"format": "markdown",
"tokens": 926,
"data": "...",
"model": "@cf/meta/llama-3.2-1b-instruct" // Good
"tokens_price": 0.027 // even better
},
```

cheers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.