A2aGrpcClient

class A2aGrpcClient @JvmOverloads constructor(tokenSource: AuthTokenSource, channelProvider: A2aChannelProvider? = null)

Thin auth layer for A2A gRPC calls. All token validity and refresh decisions are delegated to the AuthTokenSource; this class only attaches the bearer token and retries once on UNAUTHENTICATED.

callWithAuth works without a channel; RPC helpers (sendStreaming, sendMessage, cancelTask) require an A2aChannelProvider.

Constructors

Link copied to clipboard
constructor(otvSdkClient: OtvSdkClient, channelProvider: A2aChannelProvider? = null)
constructor(tokenSource: AuthTokenSource, channelProvider: A2aChannelProvider? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun <T> callWithAuth(locale: String? = null, call: suspend (authMetadata: Metadata) -> T): T

Runs call with authorization: Bearer <token>, x-language and x-device-types metadata. locale is the language of the user's input (see localeHeaderValue); the device locale when null.

Link copied to clipboard
suspend fun cancelTask(tenant: String, taskId: String, locale: String? = null): <Error class: unknown class>

CancelTask with auth and a single UNAUTHENTICATED retry.

Link copied to clipboard
suspend fun sendMessage(request: <Error class: unknown class>, locale: String? = null): <Error class: unknown class>

Unary SendMessage with auth and a single UNAUTHENTICATED retry.

Link copied to clipboard
fun sendStreaming(request: <Error class: unknown class>, timeoutMs: Long? = null, locale: String? = null): Flow<<Error class: unknown class>>

Opens a server-streaming SendStreamingMessage call and emits each response in arrival order.