What does this mean when I used workers AI? ``{"httpCode":500,"message":"TypeError: Cannot read pro

What does this mean when I used workers AI?

{"httpCode":500,"message":"TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')","name":"AiError"}

This is the code that's triggering it:

const payload =  {
                    messages: messages.map((msg) => ({
                        role: msg.role,
                        content: msg.content,
                    })),
                    response_format: {
                        type: 'json_schema',
                        schema: {
                            type: 'object',
                            properties: {
                                tournament: {
                                    type: 'string',
                                    enum: possibleTournaments,
                                },
                                round: {
                                    type: 'integer',
                                    minimum: 1,
                                },
                                flight: {
                                    type: ['integer', 'null'],
                                    minimum: 1,
                                },
                            },
                            required: ['tournament', 'round', 'flight'],
                            additionalProperties: false,
                        },
                    },
                }

                //console.log(payload)

                let response = await env.AI.run("@cf/meta/llama-3-8b-instruct", {
                    ...payload,
                });

                /// just send the raw response back as json

                return new Response(JSON.stringify(response), {
                    headers: {
                        'Content-Type': 'application/json',
                    },
                });
Was this page helpful?