Fidelity Chauke
03/20/2026, 5:28 PMtaskType parameter (RETRIEVAL_DOCUMENT, RETRIEVAL_QUERY, CODE_RETRIEVAL_QUERY, etc.) that changes the embedding output depending on the use case. From what I can tell, Koog's Embedder interface only exposes embed(text: String) — no way to pass taskType through.
I ended up writing a custom Embedder implementation that calls the Gemini REST API directly with taskType included. Works fine, but wanted to check:
1. Am I missing something? Is there a way to pass taskType that I haven't found?
2. If not, is this something being considered for a future release?
For context, Google's docs are pretty clear that taskType matters for retrieval quality — using RETRIEVAL_DOCUMENT for indexing vs RETRIEVAL_QUERY for search gives noticeably better results than omitting it.
Happy to share my workaround or open a GitHub issue if that's more useful. Still fairly new to Koog so apologies if I've overlooked something obvious!Sergei Pestrikov
03/31/2026, 1:28 PMtaskType for now unfortunately, but there is an open PR https://github.com/JetBrains/koog/pull/1715 (with GoogleGenaiEmbeddingProvider that can accept EmbedContentConfig with the taskType). Hopefully, this PR will be included in the upcoming release.
I also created a task about it - https://youtrack.jetbrains.com/issue/KG-780Fidelity Chauke
03/31/2026, 1:30 PM