#✅ - Maximum call stack size exceeded

14 messages · Page 1 of 1 (latest)

quiet shale
#

I've tried adding AI to my application but the sandbox deployment fails with the following error:

Failed to instantiate data construct
Caused By: Maximum call stack size exceeded

I noticed this happens only when I use the tools: option. Here is the troublesome schema:

chat: a
      .conversation({
        aiModel: a.ai.model('Claude 3.5 Sonnet'),
        systemPrompt:
          "You are an assistant.",
        inferenceConfiguration: {
          temperature: 0.2,
          topP: 0.2,
          maxTokens: 1000,
        },
         tools: [
           a.ai.dataTool({
             name: 'UserQuery',
             description: 'Searches for User records',
             model: a.ref('User'),
             modelOperation: 'list',
           }),
         ],
      })
      .authorization((allow) => allow.owner()),

if I remove the tools block then the resource is deployed successfully.

hazy ivy
#

Hi @quiet shale , that's strange. I just copy/pasted that conversation into a test app and it deployed successfully.

can you confirm you are using the latest versions of @aws-amplify/backend, @aws-amplify/backend-cli and @aws-amplify/data-schema?

quiet shale
#

Hi @hazy ivy , yes

"@aws-amplify/backend": "^1.8.0",
"@aws-amplify/backend-cli": "^1.4.2",
"@aws-amplify/data-schema": "^1.16.1",
#

perhaps this is region related? It failed for me in eu-west-2 and eu-west-3

hazy ivy
#

could be. i deployed to us-east-1

#

hard to tell with a a call stack size error

#

usually that's caused by a circular reference in the schema

quiet shale
#

I'm struggling to reproduce it constantly because I also get errors about enums that I use in my models like Caused By: Could not find type definition for TeamDepartment

hazy ivy
#

would you be able to share the full schema?

#

seems like i'd need other models to compile and see if it results in similar errors

quiet shale
#

I'll share it if I can reproduce it but for now I don't get that error anymore. We can close this and I'll reopen it if it happens again. Sorry for the trouble!

hazy ivy
#

no worries! i'll keep an eye out 🙂

long lanceBOT
#

✅ - Maximum call stack size exceeded

long lanceBOT