This commit is contained in:
15
docs/snippets/elixir/utils/token_reduction.md
Normal file
15
docs/snippets/elixir/utils/token_reduction.md
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- 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"] || "")}")
|
||||
```
|
||||
Reference in New Issue
Block a user