{
  "version": "2.0",
  "metadata": {
    "apiVersion": "2023-07-26",
    "endpointPrefix": "bedrock-agent-runtime",
    "jsonVersion": "1.1",
    "protocol": "rest-json",
    "serviceFullName": "Agents for Amazon Bedrock Runtime",
    "serviceId": "Bedrock Agent Runtime",
    "signatureVersion": "v4",
    "signingName": "bedrock",
    "uid": "bedrock-agent-runtime-2023-07-26"
  },
  "operations": {
    "InvokeAgent": {
      "http": {
        "requestUri": "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text",
        "responseCode": 200
      },
      "input": {
        "type": "structure",
        "required": [
          "agentId",
          "agentAliasId",
          "sessionId",
          "inputText"
        ],
        "members": {
          "sessionState": {
            "type": "structure",
            "members": {
              "sessionAttributes": {
                "type": "map",
                "key": {},
                "value": {}
              },
              "promptSessionAttributes": {
                "type": "map",
                "key": {},
                "value": {}
              }
            }
          },
          "agentId": {
            "location": "uri",
            "locationName": "agentId"
          },
          "agentAliasId": {
            "location": "uri",
            "locationName": "agentAliasId"
          },
          "sessionId": {
            "location": "uri",
            "locationName": "sessionId"
          },
          "endSession": {
            "type": "boolean"
          },
          "enableTrace": {
            "type": "boolean"
          },
          "inputText": {
            "type": "string",
            "sensitive": true
          }
        }
      },
      "output": {
        "type": "structure",
        "required": [
          "completion",
          "contentType",
          "sessionId"
        ],
        "members": {
          "completion": {
            "type": "structure",
            "members": {
              "chunk": {
                "type": "structure",
                "members": {
                  "bytes": {
                    "type": "blob",
                    "sensitive": true
                  },
                  "attribution": {
                    "type": "structure",
                    "members": {
                      "citations": {
                        "shape": "Sg"
                      }
                    }
                  }
                },
                "event": true,
                "sensitive": true
              },
              "trace": {
                "type": "structure",
                "members": {
                  "agentId": {},
                  "agentAliasId": {},
                  "sessionId": {},
                  "trace": {
                    "type": "structure",
                    "members": {
                      "preProcessingTrace": {
                        "type": "structure",
                        "members": {
                          "modelInvocationInput": {
                            "shape": "Sw"
                          },
                          "modelInvocationOutput": {
                            "type": "structure",
                            "members": {
                              "traceId": {},
                              "parsedResponse": {
                                "type": "structure",
                                "members": {
                                  "rationale": {
                                    "shape": "S1a"
                                  },
                                  "isValid": {
                                    "type": "boolean"
                                  }
                                },
                                "sensitive": true
                              }
                            },
                            "sensitive": true
                          }
                        },
                        "sensitive": true,
                        "union": true
                      },
                      "orchestrationTrace": {
                        "type": "structure",
                        "members": {
                          "rationale": {
                            "type": "structure",
                            "members": {
                              "traceId": {},
                              "text": {
                                "shape": "S1a"
                              }
                            },
                            "sensitive": true
                          },
                          "invocationInput": {
                            "type": "structure",
                            "members": {
                              "traceId": {},
                              "invocationType": {},
                              "actionGroupInvocationInput": {
                                "type": "structure",
                                "members": {
                                  "actionGroupName": {
                                    "type": "string",
                                    "sensitive": true
                                  },
                                  "verb": {
                                    "type": "string",
                                    "sensitive": true
                                  },
                                  "apiPath": {
                                    "type": "string",
                                    "sensitive": true
                                  },
                                  "parameters": {
                                    "shape": "S1j"
                                  },
                                  "requestBody": {
                                    "type": "structure",
                                    "members": {
                                      "content": {
                                        "type": "map",
                                        "key": {},
                                        "value": {
                                          "shape": "S1j"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "knowledgeBaseLookupInput": {
                                "type": "structure",
                                "members": {
                                  "text": {
                                    "type": "string",
                                    "sensitive": true
                                  },
                                  "knowledgeBaseId": {
                                    "type": "string",
                                    "sensitive": true
                                  }
                                }
                              }
                            },
                            "sensitive": true
                          },
                          "observation": {
                            "type": "structure",
                            "members": {
                              "traceId": {},
                              "type": {},
                              "actionGroupInvocationOutput": {
                                "type": "structure",
                                "members": {
                                  "text": {
                                    "type": "string",
                                    "sensitive": true
                                  }
                                }
                              },
                              "knowledgeBaseLookupOutput": {
                                "type": "structure",
                                "members": {
                                  "retrievedReferences": {
                                    "shape": "Sn"
                                  }
                                }
                              },
                              "finalResponse": {
                                "type": "structure",
                                "members": {
                                  "text": {
                                    "type": "string",
                                    "sensitive": true
                                  }
                                }
                              },
                              "repromptResponse": {
                                "type": "structure",
                                "members": {
                                  "text": {},
                                  "source": {
                                    "type": "string",
                                    "sensitive": true
                                  }
                                },
                                "sensitive": true
                              }
                            },
                            "sensitive": true
                          },
                          "modelInvocationInput": {
                            "shape": "Sw"
                          }
                        },
                        "sensitive": true,
                        "union": true
                      },
                      "postProcessingTrace": {
                        "type": "structure",
                        "members": {
                          "modelInvocationInput": {
                            "shape": "Sw"
                          },
                          "modelInvocationOutput": {
                            "type": "structure",
                            "members": {
                              "traceId": {},
                              "parsedResponse": {
                                "type": "structure",
                                "members": {
                                  "text": {
                                    "type": "string",
                                    "sensitive": true
                                  }
                                },
                                "sensitive": true
                              }
                            },
                            "sensitive": true
                          }
                        },
                        "sensitive": true,
                        "union": true
                      },
                      "failureTrace": {
                        "type": "structure",
                        "members": {
                          "traceId": {},
                          "failureReason": {
                            "type": "string",
                            "sensitive": true
                          }
                        },
                        "sensitive": true
                      }
                    },
                    "sensitive": true,
                    "union": true
                  }
                },
                "event": true,
                "sensitive": true
              },
              "internalServerException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 500
                },
                "exception": true,
                "fault": true
              },
              "validationException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 400,
                  "senderFault": true
                },
                "exception": true
              },
              "resourceNotFoundException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 404,
                  "senderFault": true
                },
                "exception": true
              },
              "serviceQuotaExceededException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 400,
                  "senderFault": true
                },
                "exception": true
              },
              "throttlingException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 429,
                  "senderFault": true
                },
                "exception": true
              },
              "accessDeniedException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 403,
                  "senderFault": true
                },
                "exception": true
              },
              "conflictException": {
                "type": "structure",
                "members": {
                  "message": {}
                },
                "error": {
                  "httpStatusCode": 409,
                  "senderFault": true
                },
                "exception": true
              },
              "dependencyFailedException": {
                "type": "structure",
                "members": {
                  "message": {},
                  "resourceName": {}
                },
                "error": {
                  "httpStatusCode": 424,
                  "senderFault": true
                },
                "exception": true
              },
              "badGatewayException": {
                "type": "structure",
                "members": {
                  "message": {},
                  "resourceName": {}
                },
                "error": {
                  "httpStatusCode": 502
                },
                "exception": true,
                "fault": true
              }
            },
            "eventstream": true
          },
          "contentType": {
            "location": "header",
            "locationName": "x-amzn-bedrock-agent-content-type"
          },
          "sessionId": {
            "location": "header",
            "locationName": "x-amz-bedrock-agent-session-id"
          }
        },
        "payload": "completion"
      }
    },
    "Retrieve": {
      "http": {
        "requestUri": "/knowledgebases/{knowledgeBaseId}/retrieve",
        "responseCode": 200
      },
      "input": {
        "type": "structure",
        "required": [
          "knowledgeBaseId",
          "retrievalQuery"
        ],
        "members": {
          "knowledgeBaseId": {
            "location": "uri",
            "locationName": "knowledgeBaseId"
          },
          "retrievalQuery": {
            "type": "structure",
            "required": [
              "text"
            ],
            "members": {
              "text": {}
            },
            "sensitive": true
          },
          "retrievalConfiguration": {
            "type": "structure",
            "required": [
              "vectorSearchConfiguration"
            ],
            "members": {
              "vectorSearchConfiguration": {
                "type": "structure",
                "required": [
                  "numberOfResults"
                ],
                "members": {
                  "numberOfResults": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "nextToken": {}
        }
      },
      "output": {
        "type": "structure",
        "required": [
          "retrievalResults"
        ],
        "members": {
          "retrievalResults": {
            "type": "list",
            "member": {
              "type": "structure",
              "required": [
                "content"
              ],
              "members": {
                "content": {
                  "shape": "Sp"
                },
                "location": {
                  "shape": "Sq"
                },
                "score": {
                  "type": "double"
                }
              }
            },
            "sensitive": true
          },
          "nextToken": {}
        }
      }
    },
    "RetrieveAndGenerate": {
      "http": {
        "requestUri": "/retrieveAndGenerate",
        "responseCode": 200
      },
      "input": {
        "type": "structure",
        "required": [
          "input"
        ],
        "members": {
          "sessionId": {},
          "input": {
            "type": "structure",
            "required": [
              "text"
            ],
            "members": {
              "text": {}
            },
            "sensitive": true
          },
          "retrieveAndGenerateConfiguration": {
            "type": "structure",
            "required": [
              "type"
            ],
            "members": {
              "type": {},
              "knowledgeBaseConfiguration": {
                "type": "structure",
                "required": [
                  "knowledgeBaseId",
                  "modelArn"
                ],
                "members": {
                  "knowledgeBaseId": {},
                  "modelArn": {}
                }
              }
            }
          },
          "sessionConfiguration": {
            "type": "structure",
            "required": [
              "kmsKeyArn"
            ],
            "members": {
              "kmsKeyArn": {}
            }
          }
        }
      },
      "output": {
        "type": "structure",
        "required": [
          "sessionId",
          "output"
        ],
        "members": {
          "sessionId": {},
          "output": {
            "type": "structure",
            "required": [
              "text"
            ],
            "members": {
              "text": {}
            },
            "sensitive": true
          },
          "citations": {
            "shape": "Sg"
          }
        }
      }
    }
  },
  "shapes": {
    "Sg": {
      "type": "list",
      "member": {
        "type": "structure",
        "members": {
          "generatedResponsePart": {
            "type": "structure",
            "members": {
              "textResponsePart": {
                "type": "structure",
                "members": {
                  "text": {},
                  "span": {
                    "type": "structure",
                    "members": {
                      "start": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "retrievedReferences": {
            "shape": "Sn"
          }
        }
      }
    },
    "Sn": {
      "type": "list",
      "member": {
        "type": "structure",
        "members": {
          "content": {
            "shape": "Sp"
          },
          "location": {
            "shape": "Sq"
          }
        }
      }
    },
    "Sp": {
      "type": "structure",
      "required": [
        "text"
      ],
      "members": {
        "text": {}
      }
    },
    "Sq": {
      "type": "structure",
      "required": [
        "type"
      ],
      "members": {
        "type": {},
        "s3Location": {
          "type": "structure",
          "members": {
            "uri": {}
          }
        }
      }
    },
    "Sw": {
      "type": "structure",
      "members": {
        "traceId": {},
        "text": {
          "type": "string",
          "sensitive": true
        },
        "type": {},
        "inferenceConfiguration": {
          "type": "structure",
          "members": {
            "temperature": {
              "type": "float"
            },
            "topP": {
              "type": "float"
            },
            "topK": {
              "type": "integer"
            },
            "maximumLength": {
              "type": "integer"
            },
            "stopSequences": {
              "type": "list",
              "member": {}
            }
          }
        },
        "overrideLambda": {},
        "promptCreationMode": {},
        "parserMode": {}
      },
      "sensitive": true
    },
    "S1a": {
      "type": "string",
      "sensitive": true
    },
    "S1j": {
      "type": "list",
      "member": {
        "type": "structure",
        "members": {
          "name": {},
          "type": {},
          "value": {}
        }
      }
    }
  }
}