Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.tom.rv2ide.artificial.agents.anthropic.Anthropic
import com.tom.rv2ide.artificial.agents.grok.Grok
import com.tom.rv2ide.artificial.agents.deepseek.DeepSeek
import com.tom.rv2ide.artificial.agents.local.LocalLLM
import com.tom.rv2ide.artificial.agents.custom.CustomEndpoint
import com.tom.rv2ide.artificial.file.FileWriteResult
import com.tom.rv2ide.artificial.parser.SnippetParser
import com.tom.rv2ide.artificial.permissions.AIPermissionManager
Expand Down Expand Up @@ -53,6 +54,7 @@ class AIAgentManager(private val context: Context) {
Grok.registerAgent()
DeepSeek.registerAgent()
LocalLLM.registerAgent()
CustomEndpoint.registerAgent()

permissionManager.setFileWriteEnabled(true)
permissionManager.setRequireConfirmation(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,14 @@ class Agents(ctx: Context) {
private val localllm_models = arrayOf(
"local-model"
)

// custom: model dibaca dari prefs (user ketik bebas). Fallback contoh 9router.
private fun custom_models(): Array<String> {
val m = sp.getString("ai_agent_custom_model", "").trim()
return if (m.isNotBlank()) arrayOf(m) else arrayOf("cbai/deepseek-v4.1-flash", "oc/muse-spark-1.3-contributor-free", "custom-model")
}

val ai_agents = openai_models + claude_models + gemini_models + deepseek_models + grok_models + localllm_models
val ai_agents = openai_models + claude_models + gemini_models + deepseek_models + grok_models + localllm_models + custom_models()

fun getModelsForProvider(providerId: String): Array<String> {
return when(providerId) {
Expand All @@ -154,6 +160,7 @@ class Agents(ctx: Context) {
"deepseek" -> deepseek_models
"grok" -> grok_models
"localllm" -> localllm_models
"custom" -> custom_models()
else -> gemini_models
}
}
Expand All @@ -166,6 +173,7 @@ class Agents(ctx: Context) {
modelName in deepseek_models -> "deepseek"
modelName in grok_models -> "grok"
modelName in localllm_models -> "localllm"
modelName in custom_models() -> "custom"
else -> null
}
}
Expand Down
Loading