#typescript#12_factor#12_factor_agents#agents#ai#context_window#framework#llms#memory#orchestration#prompt_engineering#rag
The 12-Factor Agents are a set of proven principles to build reliable, scalable, and maintainable AI applications powered by large language models (LLMs). They help you combine the creativity of AI with the stability of traditional software by managing prompts, context, tool calls, error handling, and human collaboration effectively. Instead of relying solely on complex frameworks, you can apply these modular concepts to improve your existing products quickly and reach high-quality AI performance for real users. This approach makes AI software easier to develop, debug, and scale, ensuring it works well in production environments[1][3][5].
https://github.com/humanlayer/12-factor-agents
🚀 Вышел стабильный 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