16 lines
361 B
Markdown
16 lines
361 B
Markdown
|
|
<!-- 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"] || "")}")
|
||
|
|
```
|