Skip to content

fix: correctly pass poe web_search via extra_body when built-in search is enabled#13434

Merged
DeJeune merged 2 commits intoCherryHQ:mainfrom
kovsu:fix-##13305
Mar 13, 2026
Merged

fix: correctly pass poe web_search via extra_body when built-in search is enabled#13434
DeJeune merged 2 commits intoCherryHQ:mainfrom
kovsu:fix-##13305

Conversation

@kovsu
Copy link
Copy Markdown
Collaborator

@kovsu kovsu commented Mar 13, 2026

Fix #13305

https://creator.poe.com/docs/external-applications/openai-compatible-api#using-custom-parameters-with-extra_body

import OpenAI from "openai";

const client = new OpenAI({
    apiKey: process.env.POE_API_KEY,
    baseURL: "https://api.poe.com/v1",
});

// Example: Using web search and thinking level with Gemini models
const response = await client.chat.completions.create({
    model: "Gemini-3-Pro",
    messages: [{ role: "user", content: "What are the latest developments in quantum computing?" }],
    extra_body: {
        web_search: true,
        thinking_level: "high"
    }
});

...providerOptions,
...webSearchParams
}
providerOptions = merge({}, providerOptions, webSearchParams)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// reasoning.ts
if (isOpenAIReasoningModel(model)) {
      return {
        extra_body: {
          reasoning_effort: reasoningEffort === 'auto' ? 'medium' : reasoningEffort
        }
      }
    }

如果 providerOptions 和 webSearchParams 都有 extra_body 这个参,使用... 就没有合并起来而是 webSearchParams 覆盖了 providerOptions。所以这里我们使用 lodash 提供的 merge 方法。

Copy link
Copy Markdown
Collaborator

@EurFelux EurFelux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test case in option.test.ts for poe provider?

@EurFelux
Copy link
Copy Markdown
Collaborator

EurFelux commented Mar 13, 2026

Note

This comment was translated by Claude.

Perhaps it's time to migrate Poe to the Responses API


Original Content

也许应该为Poe迁移到 Responses API 了

@kovsu
Copy link
Copy Markdown
Collaborator Author

kovsu commented Mar 13, 2026

Perhaps it's time to migrate Poe to the Responses API

I’m glad to do it in a separate PR

@EurFelux
Copy link
Copy Markdown
Collaborator

Perhaps it's time to migrate Poe to the Responses API

I’m glad to do it in a separate PR

That will help a lot, thank you! :)

@DeJeune DeJeune merged commit 4aef249 into CherryHQ:main Mar 13, 2026
11 checks passed
kangfenmao pushed a commit that referenced this pull request Mar 13, 2026
…h is enabled (#13434)

Fix #13305 

>
https://creator.poe.com/docs/external-applications/openai-compatible-api#using-custom-parameters-with-extra_body

```js
import OpenAI from "openai";

const client = new OpenAI({
    apiKey: process.env.POE_API_KEY,
    baseURL: "https://api.poe.com/v1",
});

// Example: Using web search and thinking level with Gemini models
const response = await client.chat.completions.create({
    model: "Gemini-3-Pro",
    messages: [{ role: "user", content: "What are the latest developments in quantum computing?" }],
    extra_body: {
        web_search: true,
        thinking_level: "high"
    }
});
```

```release-note
fix(poe): correctly pass poe web_search via extra_body when built-in search is enabled
```
@kovsu kovsu deleted the fix-##13305 branch March 13, 2026 09:23
@kangfenmao kangfenmao mentioned this pull request Mar 14, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Model Built-in Web Search fails for Poe API models due to missing extra_body parameter mapping

3 participants