@@ -20,6 +20,10 @@ export async function POST(req: Request) {
2020 if ( model . provider === 'anthropic' ) {
2121 modelName = anthropic ( model . value ) ;
2222
23+ tools = {
24+ web_search : anthropic . tools . webSearch_20250305 ( { } ) ,
25+ } ;
26+
2327 if ( reasoningEffort === 'none' ) {
2428 providerOptions = {
2529 anthropic : {
@@ -50,6 +54,10 @@ export async function POST(req: Request) {
5054 } else if ( model . provider === 'google' ) {
5155 modelName = google ( model . value ) ;
5256
57+ tools = {
58+ google_search : google . tools . googleSearch ( { } ) ,
59+ } ;
60+
5361 providerOptions = {
5462 google : {
5563 thinkingConfig : {
@@ -63,8 +71,7 @@ export async function POST(req: Request) {
6371
6472 if ( ! ( reasoningEffort === 'none' && model . value === 'gpt-5-mini' ) ) {
6573 tools = {
66- web_search_preview : openai . tools . webSearchPreview ( {
67- // optional configuration:
74+ web_search : openai . tools . webSearch ( {
6875 searchContextSize : 'high' ,
6976 userLocation : {
7077 type : 'approximate' ,
@@ -89,7 +96,7 @@ export async function POST(req: Request) {
8996 try {
9097 const result : StreamTextResult < any , any > = streamText ( {
9198 model : modelName ,
92- messages : convertToModelMessages ( messages ) ,
99+ messages : await convertToModelMessages ( messages ) ,
93100 system : `When presenting any code examples or data tables, always use Markdown code fences.
94101- Code: wrap with triple backticks and specify the language (e.g., \`\`\`python, \`\`\`rust). Never show code outside fences.
95102- Tables: wrap GitHub-flavored Markdown tables inside \`\`\`markdown fences.
0 commit comments