Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tokt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
<jvmTarget>${java.version}</jvmTarget>
<args>
<arg>-opt-in=kotlin.time.ExperimentalTime</arg>
<!-- Required by adk-kotlin.version before 2.0, which removes these markers. -->
<arg>-opt-in=com.google.adk.kt.annotations.ExperimentalLiveApi</arg>
<arg>-opt-in=com.google.adk.kt.annotations.ExperimentalWorkflowApi</arg>
</args>
</configuration>
<executions>
Expand Down
3 changes: 0 additions & 3 deletions tokt/src/main/kotlin/com/google/adk/tokt/KtRunnerToJava.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalLiveApi::class)

package com.google.adk.tokt

import com.google.adk.agents.LiveRequestQueue
Expand All @@ -25,7 +23,6 @@ import com.google.adk.artifacts.BaseArtifactService as JavaArtifactService
import com.google.adk.artifacts.InMemoryArtifactService as JavaInMemoryArtifactService
import com.google.adk.events.Event as JavaEvent
import com.google.adk.kt.agents.LiveRequestQueue as KtLiveRequestQueue
import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.logging.LoggerFactory
import com.google.adk.kt.models.RealtimeInput
import com.google.adk.kt.runners.Runner as KtRunner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalLiveApi::class)

package com.google.adk.tokt.adapters

import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.logging.LoggerFactory
import com.google.adk.kt.models.ContentInput
import com.google.adk.kt.models.LiveConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.adk.tokt.adapters

import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.models.LiveConnection
import com.google.adk.kt.models.LlmCapabilities
import com.google.adk.kt.models.LlmRequest
Expand Down Expand Up @@ -74,7 +73,6 @@ internal class JavaModelToKt(
.flowOn(dispatcher)

// A Java connect may block: run it on dispatcher, and close what it opens if the caller gave up.
@OptIn(ExperimentalLiveApi::class)
override suspend fun connect(request: LlmRequest): LiveConnection {
if (
request.liveConnectConfig.realtimeInputConfig?.automaticActivityDetection?.disabled == true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.google.adk.kt.agents.LiveRunConfig as KtLiveRunConfig
import com.google.adk.kt.agents.RunConfig as KtRunConfig
import com.google.adk.kt.agents.StreamingMode as KtStreamingMode
import com.google.adk.kt.agents.ToolExecutionMode as KtToolExecutionMode
import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.types.AudioTranscriptionConfig as KtAudioTranscriptionConfig
import com.google.adk.kt.types.Modality as KtModality
import com.google.genai.types.Modality as GenaiModality
Expand Down Expand Up @@ -107,7 +106,6 @@ internal object RunConfigCodec {
* honor, as [fromJava] does, but ignores `saveInputBlobsAsArtifacts`, which ADK Java's own live
* run never reads.
*/
@OptIn(ExperimentalLiveApi::class)
fun fromJavaLive(config: JavaRunConfig): KtRunConfig {
val output = config.outputAudioTranscription()
val input = config.inputAudioTranscription()
Expand Down
12 changes: 1 addition & 11 deletions tokt/src/test/kotlin/com/google/adk/tokt/KtRunnerInteropTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalLiveApi::class)

package com.google.adk.tokt

import com.google.adk.agents.BaseAgent as JavaBaseAgent
Expand All @@ -41,8 +39,6 @@ import com.google.adk.kt.agents.RunConfig as KtRunConfig
import com.google.adk.kt.agents.StreamingMode as KtStreamingMode
import com.google.adk.kt.agents.ToolExecutionMode as KtToolExecutionMode
import com.google.adk.kt.agents.TypedData
import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.annotations.ExperimentalWorkflowApi
import com.google.adk.kt.annotations.FrameworkInternalApi
import com.google.adk.kt.apps.App as KtApp
import com.google.adk.kt.callbacks.AfterModelCallback as KtAfterModelCallback
Expand Down Expand Up @@ -636,7 +632,6 @@ class KtRunnerInteropTest {
}

/** A workflow node that emits [output] as its output and counts its runs. */
@OptIn(ExperimentalWorkflowApi::class)
private class EmittingKtNode(override val name: String, private val output: Any) : KtNode {
var runs = 0
private set
Expand All @@ -648,15 +643,13 @@ class KtRunnerInteropTest {
}

/** A workflow node that asks the user for input, which pauses the workflow. */
@OptIn(ExperimentalWorkflowApi::class)
private class AskingKtNode(override val name: String, private val interruptId: String) : KtNode {
override fun runNode(context: KtContext, nodeInput: Any?): Flow<Any?> = flow {
emit(KtRequestInput(interruptId = interruptId, message = "Approve?"))
}
}

/** A workflow node that selects [route] and emits no output. */
@OptIn(ExperimentalWorkflowApi::class)
private class RoutingKtNode(override val name: String, private val route: KtRoute) : KtNode {
override fun runNode(context: KtContext, nodeInput: Any?): Flow<Any?> = flow {
context.routes = listOf(route)
Expand Down Expand Up @@ -1178,7 +1171,6 @@ class KtRunnerInteropTest {
}

@Test
@OptIn(ExperimentalWorkflowApi::class)
fun ktRunner_workflowThroughAnAdaptedJavaSessionService_reloadsNodeInfoOutputAndRoute() =
runBlocking {
// A resumed workflow reads these fields back, so the Java store must keep each one.
Expand Down Expand Up @@ -1219,7 +1211,6 @@ class KtRunnerInteropTest {
}

@Test
@OptIn(ExperimentalWorkflowApi::class)
fun ktRunner_workflowResumedThroughAnAdaptedJavaSessionService_replaysFinishedNodes() =
runBlocking {
// The answering turn reloads the session from the Java store, so prep must replay from it.
Expand Down Expand Up @@ -1262,7 +1253,7 @@ class KtRunnerInteropTest {
}

@Test
@OptIn(ExperimentalWorkflowApi::class, FrameworkInternalApi::class)
@OptIn(FrameworkInternalApi::class)
fun asJavaRunner_workflowOutputs_reachJavaCodeAsJavaTypes() {
// Java callers and Java session services read these events, so outputs must use Java types.
val sessions = JavaInMemorySessionService()
Expand Down Expand Up @@ -1326,7 +1317,6 @@ class KtRunnerInteropTest {
* Runs a workflow whose agent node calls [tool] once, with [plugin] installed, and returns which
* of the nodes behind the routes "yes" and "no" ran.
*/
@OptIn(ExperimentalWorkflowApi::class)
private suspend fun routedNodesAfter(
tool: KtBaseTool,
plugin: JavaBasePlugin? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalLiveApi::class)

package com.google.adk.tokt.adapters

import com.google.adk.kt.agents.LiveRequestQueue as KtLiveRequestQueue
import com.google.adk.kt.agents.LlmAgent as KtLlmAgent
import com.google.adk.kt.annotations.ExperimentalLiveApi
import com.google.adk.kt.models.LlmRequest as KtLlmRequest
import com.google.adk.kt.models.LlmResponse as KtLlmResponse
import com.google.adk.kt.models.RealtimeInput as KtRealtimeInput
Expand Down
Loading