All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.trueangle.knative.lambda.runtime.events.BedrockAgentEvent.kt Maven / Gradle / Ivy

package io.github.trueangle.knative.lambda.runtime.events

import kotlinx.serialization.*

@Serializable
data class BedrockAgentRequest(
    @SerialName("messageVersion") val messageVersion: String,
    @SerialName("agent") val agent: Agent?,
    @SerialName("sessionId") val sessionId: String?,
    @SerialName("sessionAttributes") val sessionAttributes: Map?,
    @SerialName("promptSessionAttributes") val promptSessionAttributes: Map?,
    @SerialName("inputText") val inputText: String?,
    @SerialName("apiPath") val apiPath: String?,
    @SerialName("actionGroup") val actionGroup: String?,
    @SerialName("httpMethod") val httpMethod: HTTPRequest.Method?,
    @SerialName("parameters") val parameters: List?,
    @SerialName("requestBody") val requestBody: RequestBody?
) {
    @Serializable
    data class Agent(
        @SerialName("alias") val alias: String,
        @SerialName("name") val name: String,
        @SerialName("version") val version: String,
        @SerialName("id") val id: String
    )

    @Serializable
    data class Parameter(
        @SerialName("name") val name: String,
        @SerialName("type") val type: String,
        @SerialName("value") val value: String
    )

    @Serializable
    data class RequestBody(
        @SerialName("content") val content: Map
    ) {
        @Serializable
        data class Content(
            @SerialName("properties") val properties: List
        )
    }
}

@Serializable
sealed class HTTPRequest {
    @Serializable
    enum class Method {
        @SerialName("GET")
        GET,
        @SerialName("POST")
        POST,
        @SerialName("PUT")
        PUT,
        @SerialName("DELETE")
        DELETE,
        @SerialName("PATCH")
        PATCH,
        @SerialName("OPTIONS")
        OPTIONS,
        @SerialName("HEAD")
        HEAD
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy