mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-16 12:36:07 +00:00
🐛 fix: Update Responses search tool to web_search (#9354)
* ✨ feat: 更新搜索工具为 web_search
* Update index.test.ts
This commit is contained in:
@@ -249,7 +249,7 @@ describe('LobeOpenAI', () => {
|
||||
});
|
||||
|
||||
describe('responses.handlePayload', () => {
|
||||
it('should add web_search_preview tool when enabledSearch is true', async () => {
|
||||
it('should add web_search tool when enabledSearch is true', async () => {
|
||||
const payload = {
|
||||
messages: [{ content: 'Hello', role: 'user' as const }],
|
||||
model: 'gpt-4o', // 使用常规模型,通过 enabledSearch 触发 responses API
|
||||
@@ -263,7 +263,7 @@ describe('LobeOpenAI', () => {
|
||||
const createCall = (instance['client'].responses.create as Mock).mock.calls[0][0];
|
||||
expect(createCall.tools).toEqual([
|
||||
{ type: 'function', name: 'test', description: 'test' },
|
||||
{ type: 'web_search_preview' },
|
||||
{ type: 'web_search' },
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
||||
? [
|
||||
...(tools || []),
|
||||
{
|
||||
type: 'web_search_preview',
|
||||
type: 'web_search',
|
||||
...(oaiSearchContextSize && {
|
||||
search_context_size: oaiSearchContextSize,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user