Files
fil/docs/snippets/elixir/utils/token_reduction.md

16 lines
361 B
Markdown
Raw Normal View History

2026-06-01 23:40:55 +02:00
<!-- snippet:syntax-only -->
```elixir
config_json =
Jason.encode!(%{
"token_reduction" => %{
"mode" => "moderate",
"preserve_important_words" => true
}
})
{:ok, json} = Kreuzberg.extract_file_async("document.pdf", nil, config_json)
result = Jason.decode!(json)
IO.puts("Content length: #{String.length(result["content"] || "")}")
```