OpenRouter with Gemini 3 pro #2423
Replies: 2 comments
-
|
We recently merged a PR that allows "extra" fields to be persisted through to the chat buffer and handled accordingly. I did recently add support for Gemini 3 in the Gemini adapter. I'm working on a PR to allow Gemini 3 for Copilot which will be making use of "extra". |
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much for the update and for all the recent work on this! For my use case, if not "GitHub copilot", I mainly stick with OpenRouter because it's very convenient for testing different models quickly. I shared my attempt here in case someone has a cleaner or more idiomatic approach. Here's an example of the OpenRouter response shape I m seeing: tools = {
calls = { {
_index = 0,
extra_content = {
google = {
thought_signature = ""
}
},
["function"] = {
arguments = '{}',
name = "insert_edit_into_file"
},
id = "tool_insert_edit_into_file_vfVzp3FHRj2YbximS8yM",
type = "function"
}, {
_index = 1,
["function"] = {
arguments = '{}',
name = "insert_edit_into_file"
},
id = "tool_insert_edit_into_file_CD6A02dUmI8X7Z7AIl69",
type = "function"
}, {
_index = 2,
["function"] = {
arguments = '{}',
name = "insert_edit_into_file"
},
id = "tool_insert_edit_into_file_J2xLTAzOS3QeFTlcE70E",
type = "function"
} }
}Thanks again for your work on this really appreciate it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Updated: 5/12/2025 - Now it handle reasoning correctly.
I've been using OpenRouter quite a lot recently, and since I wanted to try Gemini 3 Pro which requires an additional
thought_signaturefor fcuntion calling I noticed that OpenRouter handles reasoning a bit differently.From what I understand, the current OpenAI adapter doesn't extract
reasoning_detailsfrom responses and also stripsextra_contentwhen building requests. Because of that, it seems we may need to rebuildchat_outputandform_messagesfor full compatibility.If anyone has a cleaner or more elegant solution, I d really appreciate if you can share it!
Below is a working OpenRouter adapter:
Thank you
edit1: correct some code and indentation
edit2: add note
Beta Was this translation helpful? Give feedback.
All reactions