ai
ai copied to clipboard
Error calling tools on Gemini
Description
Been doing test with tools now that it's working as expected. No issues with OpenAI.
But the same request now with Gemini return a very long and convoluted error that I am unsure what it's all about. This is a simple web query, here returning news about New Zealand.
Error: failed to pipe response
at pipeToNodeResponse (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/pipe-readable.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async sendResponse (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/send-response.js:40:13)
at async doRender (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:1389:25)
at async cacheEntry.responseCache.get.routeKind (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:1581:28)
at async DevServer.renderToResponseWithComponentsImpl (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:1489:28)
at async DevServer.renderPageComponent (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:1913:24)
at async DevServer.renderToResponseImpl (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:1951:32)
at async DevServer.pipeImpl (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:917:25)
at async NextNodeServer.handleCatchallRenderRequest (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/next-server.js:272:17)
at async DevServer.handleRequestImpl (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/base-server.js:813:17)
at async /home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/dev/next-dev-server.js:339:20
at async Span.traceAsyncFn (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/trace/trace.js:154:20)
at async DevServer.handleRequest (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
at async invokeRender (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/lib/router-server.js:173:21)
at async handleRequest (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/lib/router-server.js:350:24)
at async requestHandlerImpl (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/lib/router-server.js:374:13)
at async Server.requestListener (/home/ubuntu/dev/chatbot-ui/node_modules/next/dist/server/lib/start-server.js:141:13) {
[cause]: APICallError [AI_APICallError]: Invalid value at 'contents[2].parts[0].function_response.response' (type.googleapis.com/google.protobuf.Struct), "{"searchParameters":{"q":"New Zealand headlines","type":"search","engine":"google"},"organic":[{"title":"NZ Herald: Breaking & Latest New Zealand News - NZ Herald","link":"https://www.nzherald.co.nz/","snippet":"Get the latest breaking news, analysis and opinion from NZ and around the world, including politics, business, sport, entertainment, travel and more.","sitelinks":[{"title":"New Zealand","link":"https://www.nzherald.co.nz/nz/"},{"title":"Sport","link":"https://www.nzherald.co.nz/sport/"},{"title":"Rugby news and live scores","link":"https://www.nzherald.co.nz/sport/rugby/"},{"title":"World","link":"https://www.nzherald.co.nz/world/"}],"position":1},{"title":"Stuff: Latest breaking news | New Zealand","link":"https://www.stuff.co.nz/","snippet":"Blaze in school in Kenya kills 17 students · Australian TV presenter announces cancer diagnosis on air · Delaying of Chatham Islands supply ship 'a kick in the ...","sitelinks":[{"title":"Nz News","link":"https://www.stuff.co.nz/nz-news"},{"title":"Sport","link":"https://www.stuff.co.nz/sport"},{"title":"The new cheapest EV in New...","link":"https://www.stuff.co.nz/motoring/350379479/falling-dominoes-new-cheapest-ev-new-zealand-fiat"},{"title":"World News","link":"https://www.stuff.co.nz/world-news"}],"position":2},{"title":"Local & Breaking New Zealand News - Stay Informed With NZ Herald","link":"https://www.nzherald.co.nz/nz/","snippet":"Get the latest local and breaking news, updates, opinion and insights from across New Zealand. News worth knowing - NZ Herald - your source for NZ news.","sitelinks":[{"title":"How to contact the New...","link":"https://www.nzherald.co.nz/nz/contacts/F4YMBP62TM5TYX34NV3XCMBKJU/"},{"title":"New thunderstorm warning for...","link":"https://www.nzherald.co.nz/nz/temporary-30kmh-speed-limit-in-place-for-sh1-through-northlands-brynderwyn-hills/5ZCSY37J5FGA5B6BEXKNBWKJXM/"},{"title":"Sign In","link":"https://www.nzherald.co.nz/nz/2/"},{"title":"Crime News","link":"https://www.nzherald.co.nz/nz/crime/"}],"position":3},{"title":"New Zealand | The Guardian","link":"https://www.theguardian.com/world/newzealand","snippet":"New Zealand's Māori King Tuheitia dies aged 69 · America's Cup: New Zealand boat is damaged during crane lift out of water · UN chief to push for more climate ...","position":4},{"title":"New Zealand - 1News","link":"https://www.1news.co.nz/new-zealand/","snippet":"Driver has 'teeth knocked out' in alleged assault on Auckland bus. Police said it was alerted to the incident in Avondale at about 10.17am on Saturday.","position":5},{"title":"NZ News and Latest Headlines | Yahoo News New Zealand","link":"https://nz.news.yahoo.com/","snippet":"News · Top stories · Port star Butters hospitalised after finals flop · 'Passport to a good life': high-tech TAFE funds boost · Teen school shooting suspect ...","position":6},{"title":"New Zealand - BBC News","link":"https://www.bbc.com/news/topics/cz4pr2gd8v2t","snippet":"New Zealand hikes tourist tax prompting warning. The south Pacific country's tourism industry warns the increased entry fee is a barrier to visitors.","attributes":{"Missing":"headlines | Show results with:headlines"},"position":7},{"title":"New Zealand news - 9News - Latest updates and breaking news today","link":"https://www.9news.com.au/new-zealand","snippet":"New Zealand news headlines · Concerns for Australian tourist potentially missing in New Zealand · New Zealand woman found dead on beach a victim of foul play, ...","position":8},{"title":"New Zealand - AP News","link":"https://apnews.com/hub/new-zealand","snippet":"Springboks rally late to beat All Blacks 31-27 for third straight time · South Africa has cracked New Zealand late to win a gripping contest 31-27 at Ellis Park ...","attributes":{"Missing":"headlines | Show results with:headlines"},"position":9},{"title":"New Zealand | RNZ News","link":"https://www.rnz.co.nz/news/national","snippet":"Featured New Zealand stories · Daughter claims she should get more from her father's will than her siblings · Man arrested, charged with murder in Grey Lynn ...","sitelinks":[{"title":"Pacific News","link":"https://www.rnz.co.nz/international/pacific-news"},{"title":"World","link":"https://www.rnz.co.nz/news/world"},{"title":"Auckland Region","link":"https://www.rnz.co.nz/tags/Auckland%20Region"},{"title":"Health","link":"https://www.rnz.co.nz/tags/health"}],"position":10}],"peopleAlsoAsk":[{"question":"What's the latest news in New Zealand today?","snippet":"Rogue local blocks outsiders from entering remote village. ...\nStrong winds, rain expected for large parts of country. ...\nCovid vaccines and new variants: What you need to know. ...\nNerves aplenty for All Blacks young and old. ...\nTrump hush money sentencing delayed until after election. ...\nLocals probed in search after Auckland shooting.","title":"RNZ - NZ News, Current Affairs, Audio On Demand","link":"https://www.rnz.co.nz/"},{"question":"What are the current threats to New Zealand?","snippet":"Who Poses a Threat? The NZSIS is focused on threats to New Zealand's national security. These include threats from foreign interference, espionage, violent extremism and terrorism.","title":"New Zealand's Security Threat Environment","link":"https://www.nzsis.govt.nz/assets/NZSIS-Documents/New-Zealands-Security-Threat-Environment-2024.pdf"},{"question":"Is New Zealand still down under?","snippet":"The term Down Under is a colloquialism differently construed to refer to Australia and New Zealand, or the Pacific island countries collectively. The term originally referred solely to Australia and gradually expanded in scope.","title":"Down Under - Wikipedia","link":"https://en.wikipedia.org/wiki/Down_Under"},{"question":"What are they renaming New Zealand?","snippet":"Peters called Aotearoa a \"name with no historical credibility\". As of August 2022 the petition gained over 21,000 signatures. By early June 2022, Te Pāti Māori's petition to rename New Zealand \"Aotearoa\" had received over 70,000 signatures. On 2 June, the petition was submitted before Parliament's committee.","title":"Aotearoa - Wikipedia","link":"https://en.wikipedia.org/wiki/Aotearoa"}],"relatedSearches":[{"query":"Latest breaking news today"},{"query":"NZ Herald"},{"query":"Stuff NZ"},{"query":"New Zealand news today earthquake"},{"query":"Stuff news"},{"query":"Latest breaking news today world"},{"query":"herald - breaking news"},{"query":"Newshub latest news"}],"credits":1}"
at eval (webpack-internal:///(rsc)/./node_modules/@ai-sdk/provider-utils/dist/index.mjs:463:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async postToApi (webpack-internal:///(rsc)/./node_modules/@ai-sdk/provider-utils/dist/index.mjs:370:28)
at async GoogleGenerativeAILanguageModel.doStream (webpack-internal:///(rsc)/./node_modules/@ai-sdk/google/dist/index.mjs:380:50)
at async fn (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:3604:23)
at async eval (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:333:22)
at async _retryWithExponentialBackoff (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:163:12)
at async startRoundtrip (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:3569:13)
at async Object.flush (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:3890:21) {
cause: undefined,
url: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?alt=sse',
requestBodyValues: {
generationConfig: [Object],
contents: [Array],
systemInstruction: [Object],
safetySettings: undefined,
tools: [Object],
toolConfig: [Object],
cachedContent: undefined
},
statusCode: 400,
responseHeaders: {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-length': '14391',
'content-type': 'text/event-stream',
date: 'Sat, 07 Sep 2024 20:32:02 GMT',
server: 'scaffolding on HTTPServer2',
'server-timing': 'gfet4t7; dur=64',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
responseBody: '{\n' +
' "error": {\n' +
' "code": 400,\n' +
` "message": "Invalid value at 'contents[2].parts[0].function_response.response' (type.googleapis.com/google.protobuf.Struct), \\"{\\"searchParameters\\":{\\"q\\":\\"New Zealand headlines\\",\\"type\\":\\"search\\",\\"engine\\":\\"google\\"},\\"organic\\":[{\\"title\\":\\"NZ Herald: Breaking & Latest New Zealand News - NZ Herald\\",\\"link\\":\\"https://www.nzherald.co.nz/\\",\\"snippet\\":\\"Get the latest breaking news, analysis and opinion from NZ and around the world, including politics, business, sport, entertainment, travel and more.\\",\\"sitelinks\\":[{\\"title\\":\\"New Zealand\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/\\"},{\\"title\\":\\"Sport\\",\\"link\\":\\"https://www.nzherald.co.nz/sport/\\"},{\\"title\\":\\"Rugby news and live scores\\",\\"link\\":\\"https://www.nzherald.co.nz/sport/rugby/\\"},{\\"title\\":\\"World\\",\\"link\\":\\"https://www.nzherald.co.nz/world/\\"}],\\"position\\":1},{\\"title\\":\\"Stuff: Latest breaking news | New Zealand\\",\\"link\\":\\"https://www.stuff.co.nz/\\",\\"snippet\\":\\"Blaze in school in Kenya kills 17 students · Australian TV presenter announces cancer diagnosis on air · Delaying of Chatham Islands supply ship 'a kick in the ...\\",\\"sitelinks\\":[{\\"title\\":\\"Nz News\\",\\"link\\":\\"https://www.stuff.co.nz/nz-news\\"},{\\"title\\":\\"Sport\\",\\"link\\":\\"https://www.stuff.co.nz/sport\\"},{\\"title\\":\\"The new cheapest EV in New...\\",\\"link\\":\\"https://www.stuff.co.nz/motoring/350379479/falling-dominoes-new-cheapest-ev-new-zealand-fiat\\"},{\\"title\\":\\"World News\\",\\"link\\":\\"https://www.stuff.co.nz/world-news\\"}],\\"position\\":2},{\\"title\\":\\"Local & Breaking New Zealand News - Stay Informed With NZ Herald\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/\\",\\"snippet\\":\\"Get the latest local and breaking news, updates, opinion and insights from across New Zealand. News worth knowing - NZ Herald - your source for NZ news.\\",\\"sitelinks\\":[{\\"title\\":\\"How to contact the New...\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/contacts/F4YMBP62TM5TYX34NV3XCMBKJU/\\"},{\\"title\\":\\"New thunderstorm warning for...\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/temporary-30kmh-speed-limit-in-place-for-sh1-through-northlands-brynderwyn-hills/5ZCSY37J5FGA5B6BEXKNBWKJXM/\\"},{\\"title\\":\\"Sign In\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/2/\\"},{\\"title\\":\\"Crime News\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/crime/\\"}],\\"position\\":3},{\\"title\\":\\"New Zealand | The Guardian\\",\\"link\\":\\"https://www.theguardian.com/world/newzealand\\",\\"snippet\\":\\"New Zealand's Māori King Tuheitia dies aged 69 · America's Cup: New Zealand boat is damaged during crane lift out of water · UN chief to push for more climate ...\\",\\"position\\":4},{\\"title\\":\\"New Zealand - 1News\\",\\"link\\":\\"https://www.1news.co.nz/new-zealand/\\",\\"snippet\\":\\"Driver has 'teeth knocked out' in alleged assault on Auckland bus. Police said it was alerted to the incident in Avondale at about 10.17am on Saturday.\\",\\"position\\":5},{\\"title\\":\\"NZ News and Latest Headlines | Yahoo News New Zealand\\",\\"link\\":\\"https://nz.news.yahoo.com/\\",\\"snippet\\":\\"News · Top stories · Port star Butters hospitalised after finals flop · 'Passport to a good life': high-tech TAFE funds boost · Teen school shooting suspect ...\\",\\"position\\":6},{\\"title\\":\\"New Zealand - BBC News\\",\\"link\\":\\"https://www.bbc.com/news/topics/cz4pr2gd8v2t\\",\\"snippet\\":\\"New Zealand hikes tourist tax prompting warning. The south Pacific country's tourism industry warns the increased entry fee is a barrier to visitors.\\",\\"attributes\\":{\\"Missing\\":\\"headlines | Show results with:headlines\\"},\\"position\\":7},{\\"title\\":\\"New Zealand news - 9News - Latest updates and breaking news today\\",\\"link\\":\\"https://www.9news.com.au/new-zealand\\",\\"snippet\\":\\"New Zealand news headlines · Concerns for Australian tourist potentially missing in New Zealand · New Zealand woman found dead on beach a victim of foul play, ...\\",\\"position\\":8},{\\"title\\":\\"New Zealand - AP News\\",\\"link\\":\\"https://apnews.com/hub/new-zealand\\",\\"snippet\\":\\"Springboks rally late to beat All Blacks 31-27 for third straight time · South Africa has cracked New Zealand late to win a gripping contest 31-27 at Ellis Park ...\\",\\"attributes\\":{\\"Missing\\":\\"headlines | Show results with:headlines\\"},\\"position\\":9},{\\"title\\":\\"New Zealand | RNZ News\\",\\"link\\":\\"https://www.rnz.co.nz/news/national\\",\\"snippet\\":\\"Featured New Zealand stories · Daughter claims she should get more from her father's will than her siblings · Man arrested, charged with murder in Grey Lynn ...\\",\\"sitelinks\\":[{\\"title\\":\\"Pacific News\\",\\"link\\":\\"https://www.rnz.co.nz/international/pacific-news\\"},{\\"title\\":\\"World\\",\\"link\\":\\"https://www.rnz.co.nz/news/world\\"},{\\"title\\":\\"Auckland Region\\",\\"link\\":\\"https://www.rnz.co.nz/tags/Auckland%20Region\\"},{\\"title\\":\\"Health\\",\\"link\\":\\"https://www.rnz.co.nz/tags/health\\"}],\\"position\\":10}],\\"peopleAlsoAsk\\":[{\\"question\\":\\"What's the latest news in New Zealand today?\\",\\"snippet\\":\\"Rogue local blocks outsiders from entering remote village. ...\\\\nStrong winds, rain expected for large parts of country. ...\\\\nCovid vaccines and new variants: What you need to know. ...\\\\nNerves aplenty for All Blacks young and old. ...\\\\nTrump hush money sentencing delayed until after election. ...\\\\nLocals probed in search after Auckland shooting.\\",\\"title\\":\\"RNZ - NZ News, Current Affairs, Audio On Demand\\",\\"link\\":\\"https://www.rnz.co.nz/\\"},{\\"question\\":\\"What are the current threats to New Zealand?\\",\\"snippet\\":\\"Who Poses a Threat? The NZSIS is focused on threats to New Zealand's national security. These include threats from foreign interference, espionage, violent extremism and terrorism.\\",\\"title\\":\\"New Zealand's Security Threat Environment\\",\\"link\\":\\"https://www.nzsis.govt.nz/assets/NZSIS-Documents/New-Zealands-Security-Threat-Environment-2024.pdf\\"},{\\"question\\":\\"Is New Zealand still down under?\\",\\"snippet\\":\\"The term Down Under is a colloquialism differently construed to refer to Australia and New Zealand, or the Pacific island countries collectively. The term originally referred solely to Australia and gradually expanded in scope.\\",\\"title\\":\\"Down Under - Wikipedia\\",\\"link\\":\\"https://en.wikipedia.org/wiki/Down_Under\\"},{\\"question\\":\\"What are they renaming New Zealand?\\",\\"snippet\\":\\"Peters called Aotearoa a \\\\\\"name with no historical credibility\\\\\\". As of August 2022 the petition gained over 21,000 signatures. By early June 2022, Te Pāti Māori's petition to rename New Zealand \\\\\\"Aotearoa\\\\\\" had received over 70,000 signatures. On 2 June, the petition was submitted before Parliament's committee.\\",\\"title\\":\\"Aotearoa - Wikipedia\\",\\"link\\":\\"https://en.wikipedia.org/wiki/Aotearoa\\"}],\\"relatedSearches\\":[{\\"query\\":\\"Latest breaking news today\\"},{\\"query\\":\\"NZ Herald\\"},{\\"query\\":\\"Stuff NZ\\"},{\\"query\\":\\"New Zealand news today earthquake\\"},{\\"query\\":\\"Stuff news\\"},{\\"query\\":\\"Latest breaking news today world\\"},{\\"query\\":\\"herald - breaking news\\"},{\\"query\\":\\"Newshub latest news\\"}],\\"credits\\":1}\\"",\n` +
' "status": "INVALID_ARGUMENT",\n' +
' "details": [\n' +
' {\n' +
' "@type": "type.googleapis.com/google.rpc.BadRequest",\n' +
' "fieldViolations": [\n' +
' {\n' +
' "field": "contents[2].parts[0].function_response.response",\n' +
` "description": "Invalid value at 'contents[2].parts[0].function_response.response' (type.googleapis.com/google.protobuf.Struct), \\"{\\"searchParameters\\":{\\"q\\":\\"New Zealand headlines\\",\\"type\\":\\"search\\",\\"engine\\":\\"google\\"},\\"organic\\":[{\\"title\\":\\"NZ Herald: Breaking & Latest New Zealand News - NZ Herald\\",\\"link\\":\\"https://www.nzherald.co.nz/\\",\\"snippet\\":\\"Get the latest breaking news, analysis and opinion from NZ and around the world, including politics, business, sport, entertainment, travel and more.\\",\\"sitelinks\\":[{\\"title\\":\\"New Zealand\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/\\"},{\\"title\\":\\"Sport\\",\\"link\\":\\"https://www.nzherald.co.nz/sport/\\"},{\\"title\\":\\"Rugby news and live scores\\",\\"link\\":\\"https://www.nzherald.co.nz/sport/rugby/\\"},{\\"title\\":\\"World\\",\\"link\\":\\"https://www.nzherald.co.nz/world/\\"}],\\"position\\":1},{\\"title\\":\\"Stuff: Latest breaking news | New Zealand\\",\\"link\\":\\"https://www.stuff.co.nz/\\",\\"snippet\\":\\"Blaze in school in Kenya kills 17 students · Australian TV presenter announces cancer diagnosis on air · Delaying of Chatham Islands supply ship 'a kick in the ...\\",\\"sitelinks\\":[{\\"title\\":\\"Nz News\\",\\"link\\":\\"https://www.stuff.co.nz/nz-news\\"},{\\"title\\":\\"Sport\\",\\"link\\":\\"https://www.stuff.co.nz/sport\\"},{\\"title\\":\\"The new cheapest EV in New...\\",\\"link\\":\\"https://www.stuff.co.nz/motoring/350379479/falling-dominoes-new-cheapest-ev-new-zealand-fiat\\"},{\\"title\\":\\"World News\\",\\"link\\":\\"https://www.stuff.co.nz/world-news\\"}],\\"position\\":2},{\\"title\\":\\"Local & Breaking New Zealand News - Stay Informed With NZ Herald\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/\\",\\"snippet\\":\\"Get the latest local and breaking news, updates, opinion and insights from across New Zealand. News worth knowing - NZ Herald - your source for NZ news.\\",\\"sitelinks\\":[{\\"title\\":\\"How to contact the New...\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/contacts/F4YMBP62TM5TYX34NV3XCMBKJU/\\"},{\\"title\\":\\"New thunderstorm warning for...\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/temporary-30kmh-speed-limit-in-place-for-sh1-through-northlands-brynderwyn-hills/5ZCSY37J5FGA5B6BEXKNBWKJXM/\\"},{\\"title\\":\\"Sign In\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/2/\\"},{\\"title\\":\\"Crime News\\",\\"link\\":\\"https://www.nzherald.co.nz/nz/crime/\\"}],\\"position\\":3},{\\"title\\":\\"New Zealand | The Guardian\\",\\"link\\":\\"https://www.theguardian.com/world/newzealand\\",\\"snippet\\":\\"New Zealand's Māori King Tuheitia dies aged 69 · America's Cup: New Zealand boat is damaged during crane lift out of water · UN chief to push for more climate ...\\",\\"position\\":4},{\\"title\\":\\"New Zealand - 1News\\",\\"link\\":\\"https://www.1news.co.nz/new-zealand/\\",`... 4359 more characters,
isRetryable: false,
data: { error: [Object] },
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_APICallError)]: true
}
}
Code example
const result = await streamText({
model: languageModel,
messages: messages,
tools: vercelAITools,
temperature: chatSettings.temperature,
maxTokens: chatSettings.maxTokens ?? 4096,
maxToolRoundtrips: 3,
onFinish({ finishReason, usage, response, toolCalls, toolResults, experimental_providerMetadata }) {
storeResponseInfo(chatSettings.model, responseId, finishReason, usage, response, toolCalls,
experimental_providerMetadata)
},
})
Additional context
No response