Skip to content

InferenceConfiguration is null in ChatConversationHandlerFunction event argument #3067

@owieboy

Description

@owieboy

Environment information

$ npx ampx info
System:
  OS: macOS 15.7.1
  CPU: (12) arm64 Apple M3 Pro
  Memory: 197.69 MB / 18.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.21.1 - /Users/oscardelapena/.nvm/versions/node/v22.21.1/bin/node
  Yarn: 1.22.22 - /Users/oscardelapena/.nvm/versions/node/v22.21.1/bin/yarn
  npm: 10.9.4 - /Users/oscardelapena/.nvm/versions/node/v22.21.1/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/ai-constructs: Not Found
  @aws-amplify/auth-construct: Not Found
  @aws-amplify/backend: Not Found
  @aws-amplify/backend-ai: Not Found
  @aws-amplify/backend-auth: Not Found
  @aws-amplify/backend-cli: Not Found
  @aws-amplify/backend-data: Not Found
  @aws-amplify/backend-deployer: Not Found
  @aws-amplify/backend-function: Not Found
  @aws-amplify/backend-output-schemas: Not Found
  @aws-amplify/backend-output-storage: Not Found
  @aws-amplify/backend-secret: Not Found
  @aws-amplify/backend-storage: Not Found
  @aws-amplify/cli-core: Not Found
  @aws-amplify/client-config: Not Found
  @aws-amplify/data-construct: Not Found
  @aws-amplify/data-schema: Not Found
  @aws-amplify/deployed-backend-client: Not Found
  @aws-amplify/form-generator: Not Found
  @aws-amplify/model-generator: Not Found
  @aws-amplify/platform-core: Not Found
  @aws-amplify/plugin-types: Not Found
  @aws-amplify/sandbox: Not Found
  @aws-amplify/schema-generator: Not Found
  @aws-cdk/toolkit-lib: Not Found
  aws-amplify: Not Found
  aws-cdk-lib: Not Found
  typescript: Not Found
npm warn exec The following package was not found and will be installed: [email protected]
No AWS environment variables
No CDK environment variables

Describe the bug

This is my data/resources.ts schema definition

Image.

I wanted to use this inferenceConfiguration values. I was looking into the codes and found that this should be present in the event object for the Bedrock invocation to use the values.

const { modelId, systemPrompt, inferenceConfiguration } =
.

However, upon looking at CloudWatch logs, I see

inferenceConfiguration: null

And below is the full log message, truncated for readabiligy

{
  "conversationId": "2ebfce5d-4b54-43e5-8dbf-2f717760eb3d",
  "currentMessageId": "534b8f13-fa53-402f-aa10-21fd16bd7ce8",
  "responseMutation": {
    "name": "createAssistantResponseStreamChat",
    "inputTypeName": "CreateConversationMessageChatAssistantStreamingInput",
    "selectionSet": "associatedUserMessageId contentBlockDeltaIndex contentBlockDoneAtIndex contentBlockIndex contentBlockText contentBlockToolUse { toolUseId name input } conversationId id stopReason owner errors { errorType message } p"
  },
  "graphqlApiEndpoint": "https://a5gjknxec5agtgmgzzdwjo6oqq.appsync-api.us-east-1.amazonaws.com/graphql",
  "modelConfiguration": {
    "modelId": "anthropic.claude-3-5-sonnet-20240620-v1:0",
    "systemPrompt":  "<my system prompt>.",
    "inferenceConfiguration": null  // ⚠️ THIS IS THE BUG - Should contain { temperature: 0, maxTokens: 4096 }
  },
  "request": {
    "headers": {
      "authorization": "[REDACTED TOKEN]",
      "x-amz-user-agent": "aws-amplify/6.15.8 ai/5 framework/1 md/amplify-graphql-conversation-transformer#1.1.12"
    }
  },
  "messageHistoryQuery": {
    "getQueryName": "getConversationMessageChat",
    "getQueryInputTypeName": "ID",
    "listQueryName": "listConversationMessageChats",
    "listQueryInputTypeName": "ModelConversationMessageChatFilterInput",
    "listQueryLimit": null
  },
  "toolsConfiguration": {
    "dataTools": [
      {
        // Your processRequest dataTool is here
        // (collapsed in the log output)
      }
    ],
    "clientTools": null
  },
  "streamResponse": true
}

Reproduction steps

Use inferenceConfiguration in a.conversation schema definition.
The inferenceConfiguration is null in the event object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions