#kotlin#agentframework#agentic_ai#agents#ai#aiagentframework#android_ai#anthropic#generative_ai#java#jvm#kotlin#ktor#llm#mcp#ollama#openai#spring
Koog is a Kotlin-based open-source framework that helps you build AI agents fully in Kotlin, making it easy to create smart assistants that can use tools, manage complex tasks, and remember past interactions. It supports multiple AI models like OpenAI and Google, runs on many platforms (JVM, JavaScript, iOS), and offers features like real-time streaming, custom tools, and efficient memory use. Koog also provides debugging tools, flexible workflows, and scales from simple chatbots to enterprise systems. Using Koog lets you develop powerful, maintainable AI agents quickly and naturally within the Kotlin ecosystem, benefiting your projects with speed, flexibility, and strong integration options.
https://github.com/JetBrains/koog
🚀 Вышел стабильный JavaScript движок от Google для Android
Новая стабильная библиотека Jetpack JavaScript Engine позволит разработчикам выполнять JS код в изолированной и ограниченной среде.
class MainActivity : ComponentActivity() {
// Теперь nullable, без lateinit
private var jsSandbox: JavaScriptSandbox? = null
private var jsIsolate: JavaScriptIsolate? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!JavaScriptSandbox.isSupported()) {
Log.e("JS", "JavaScriptSandbox не поддерживается")
return
}
lifecycleScope.launch {
// Создаём и сохраняем в nullable-поле
jsSandbox = JavaScriptSandbox
.createConnectedInstanceAsync(applicationContext)
.await()
jsIsolate = jsSandbox?.createIsolate()
// При выполнении гарантируем, что jsIsolate != null
val result: String = jsIsolate
?.evaluateJavaScriptAsync(JS_SCRIPT_SCRING)
?.await()
?: "Ошибка: isolate не инициализирован"
Log.d("JS", "Результат выполнения: $result")
}
}
override fun onDestroy() {
super.onDestroy()
// Закрываем только если не null
jsIsolate?.close()
jsSandbox?.close()
}
}
#jetpack#js