Comments (5)
@marclelamy can you post the details of the error that you are seeing (from the console/terminal)?
from ai.
Oh my bad I forgot to paste it.
Unhandled Rejection: u [AI_TypeValidationError]: Type validation failed: Value: {"id":"gen-lp658zQbL7YL6jCo6i3lEFrScqa6","model":"meta-llama/llama-3.1-8b-instruct","object":"chat.completion.chunk","created":1723594224,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"logprobs":{"tokens":null,"token_logprobs":null,"top_logprobs":null,"text_offset":null}}]}.
Error message: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"code": "invalid_type",
"expected": "array",
"received": "undefined",
"path": [
"choices",
0,
"logprobs",
"content"
],
"message": "Required"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"error"
],
"message": "Required"
}
],
"name": "ZodError"
}
],
"path": [],
"message": "Invalid input"
}
]
at s (/var/task/.next/server/app/page.js:191:7946)
at o (/var/task/.next/server/app/page.js:191:8223)
... 5 lines matching cause stack trace ...
at ensureIsPromise (node:internal/webstreams/util:192:19)
at writableStreamDefaultControllerProcessWrite (node:internal/webstreams/writablestream:1109:5)
at writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:1224:5) {
cause: t [ZodError]: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"code": "invalid_type",
"expected": "array",
"received": "undefined",
"path": [
"choices",
0,
"logprobs",
"content"
],
"message": "Required"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"error"
],
"message": "Required"
}
],
"name": "ZodError"
}
],
"path": [],
"message": "Invalid input"
}
]
at get error [as error] (/var/task/.next/server/app/page.js:204:83823)
at Object.validate (/var/task/.next/server/app/page.js:191:7820)
at s (/var/task/.next/server/app/page.js:191:7888)
at o (/var/task/.next/server/app/page.js:191:8223)
at Object.transform (/var/task/.next/server/app/page.js:191:11245)
at ensureIsPromise (node:internal/webstreams/util:192:19)
at transformStreamDefaultControllerPerformTransform (node:internal/webstreams/transformstream:505:18)
at transformStreamDefaultSinkWriteAlgorithm (node:internal/webstreams/transformstream:555:10)
at Object.write (node:internal/webstreams/transformstream:360:14)
at ensureIsPromise (node:internal/webstreams/util:192:19) {
issues: [ [Object] ],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
errors: [ [Object] ]
},
value: {
id: 'gen-lp658zQbL7YL6jCo6i3lEFrScqa6',
model: 'meta-llama/llama-3.1-8b-instruct',
object: 'chat.completion.chunk',
created: 1723594224,
choices: [ [Object] ]
}
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
from ai.
from ai.
it seems that the an error response chunk is incorrectly parsed. this is provider specific.
which provider are you using? can you add your provider initialization code (in particular if you are using the openai provider with a non-openai service)?
from ai.
Related Issues (20)
- Make VercelAI SDK tracing fully compatible with OTEL GenAI semantic conventions
- structuredOutput fails if schemas use `.optional()` or `.nullish()`, should be `.nullable()`. HOT 2
- Zod schema for CoreMessage
- Overloading error from Antrophic API doesn't seem to be handled HOT 4
- Edge Runtime: convertToCoreMessages() fails to process base64 image data, unlike in local development HOT 22
- Google Gemini AI: toolChoice doesn't work HOT 2
- AI State History Not Updating HOT 1
- feat: ability to define fallback model / provider
- feat: add exponential backoff to avoid rate limits HOT 1
- Add `onGeneration` hook and refactor `onFinish` in `useChat`
- generateObject in Vercel SDK AI does not properly catch JSONParseError in Next.js HOT 3
- Errors when transpiling HOT 3
- Tool-use is incorrect when using Vercel AI SDK (OpenAI Provider) HOT 5
- structuredOutputs doesn't work with generateText and streamText HOT 2
- Message prompt for image should support OpenAI syntax or warn user HOT 5
- Support prompt caching HOT 3
- Override maxToolRoundtrips per tool call HOT 1
- createStructuredFewShot prompt helper
- Error processing an error response HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ai.