severity1 / custom-amazon-bedrock-agent-action

custom-amazon-bedrock-agent-action is a GitHub Action that uses Amazon Bedrock Agent to analyze code changes in pull requests and provide detailed feedback.
MIT License
25 stars 1 forks source link

invokeAgent fails when using an alias with Knoweldgebase #16

Closed severity1 closed 2 months ago

severity1 commented 2 months ago

Getting the error below whenever I switch to an agent alias id that uses a knowledgebase

Error: [2024-09-02T02:37:15.179Z] Error: Failed to invoke Bedrock agent: Invalid input or configuration provided. Check the input and Knowledge Base configuration and try your request again.
Response received:
{
    "$metadata": {
        "httpStatusCode": 200,
        "requestId": "xyz",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "contentType": "application/json",
    "sessionId": "2048468516-12",
    "memoryId": "2048468516-12",
    "completion": {
        "options": {
            "messageStream": {
                "options": {
                    "inputStream": {},
                    "decoder": {
                        "headerMarshaller": {},
                        "messageBuffer": [],
                        "isEndOfStream": false
                    }
                }
            }
        }
    }
}
severity1 commented 2 months ago

Example of success:

{
    "$metadata": {
        "httpStatusCode": 200,
        "requestId": "abc",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "contentType": "application/json",
    "sessionId": "2048468516-12",
    "memoryId": "2048468516-12",
    "completion": {
        "options": {
            "messageStream": {
                "options": {
                    "inputStream": {},
                    "decoder": {
                        "headerMarshaller": {},
                        "messageBuffer": [],
                        "isEndOfStream": false
                    }
                }
            }
        }
    }
}