package router

import (
	v1 "github.com/1Panel-dev/1Panel/agent/app/api/v2"
	"github.com/gin-gonic/gin"
)

type AIToolsRouter struct {
}

func (a *AIToolsRouter) InitRouter(Router *gin.RouterGroup) {
	aiToolsRouter := Router.Group("ai")

	baseApi := v1.ApiGroupApp.BaseApi
	{
		aiToolsRouter.POST("/ollama/close", baseApi.CloseOllamaModel)
		aiToolsRouter.POST("/ollama/model", baseApi.CreateOllamaModel)
		aiToolsRouter.POST("/ollama/model/recreate", baseApi.RecreateOllamaModel)
		aiToolsRouter.POST("/ollama/model/search", baseApi.SearchOllamaModel)
		aiToolsRouter.POST("/ollama/model/sync", baseApi.SyncOllamaModel)
		aiToolsRouter.POST("/ollama/model/load", baseApi.LoadOllamaModelDetail)
		aiToolsRouter.POST("/ollama/model/del", baseApi.DeleteOllamaModel)
		aiToolsRouter.POST("/domain/bind", baseApi.BindDomain)
		aiToolsRouter.POST("/domain/get", baseApi.GetBindDomain)
		aiToolsRouter.POST("/domain/update", baseApi.UpdateBindDomain)

		aiToolsRouter.GET("/gpu/load", baseApi.LoadGpuInfo)
		aiToolsRouter.POST("/gpu/search", baseApi.LoadGPUMonitor)
		aiToolsRouter.GET("/gpu/options", baseApi.GetCPUOptions)

		aiToolsRouter.POST("/mcp/search", baseApi.PageMcpServers)
		aiToolsRouter.POST("/mcp/server/detail", baseApi.LoadMcpServerDetail)
		aiToolsRouter.POST("/mcp/server", baseApi.CreateMcpServer)
		aiToolsRouter.POST("/mcp/server/update", baseApi.UpdateMcpServer)
		aiToolsRouter.POST("/mcp/server/del", baseApi.DeleteMcpServer)
		aiToolsRouter.POST("/mcp/server/op", baseApi.OperateMcpServer)
		aiToolsRouter.POST("/mcp/server/status/sync", baseApi.SyncMcpServerStatus)
		aiToolsRouter.POST("/mcp/server/connection/test", baseApi.TestMcpServerConnection)
		aiToolsRouter.POST("/mcp/domain/bind", baseApi.BindMcpDomain)
		aiToolsRouter.GET("/mcp/domain/get", baseApi.GetMcpBindDomain)
		aiToolsRouter.POST("/mcp/domain/update", baseApi.UpdateMcpBindDomain)

		aiToolsRouter.POST("/tensorrt/search", baseApi.PageTensorRTLLMs)
		aiToolsRouter.POST("/tensorrt/create", baseApi.CreateTensorRTLLM)
		aiToolsRouter.POST("/tensorrt/update", baseApi.UpdateTensorRTLLM)
		aiToolsRouter.POST("/tensorrt/delete", baseApi.DeleteTensorRTLLM)
		aiToolsRouter.POST("/tensorrt/operate", baseApi.OperateTensorRTLLM)

		aiToolsRouter.GET("/accounts/providers", baseApi.GetAgentProviders)
		aiToolsRouter.POST("/accounts", baseApi.CreateAgentAccount)
		aiToolsRouter.POST("/accounts/update", baseApi.UpdateAgentAccount)
		aiToolsRouter.POST("/accounts/search", baseApi.PageAgentAccounts)
		aiToolsRouter.POST("/accounts/counts", baseApi.CountAgentAccountsByProviders)
		aiToolsRouter.POST("/accounts/models", baseApi.GetAgentAccountModels)
		aiToolsRouter.POST("/accounts/models/discover", baseApi.DiscoverAgentAccountModels)
		aiToolsRouter.POST("/accounts/models/create", baseApi.CreateAgentAccountModel)
		aiToolsRouter.POST("/accounts/models/update", baseApi.UpdateAgentAccountModel)
		aiToolsRouter.POST("/accounts/models/delete", baseApi.DeleteAgentAccountModel)
		aiToolsRouter.POST("/accounts/verify", baseApi.VerifyAgentAccount)
		aiToolsRouter.POST("/accounts/delete", baseApi.DeleteAgentAccount)

		aiToolsRouter.POST("/agents", baseApi.CreateAgent)
		aiToolsRouter.POST("/agents/batch/install", baseApi.BatchInstallAgent)
		aiToolsRouter.POST("/agents/batch/upgrade", baseApi.BatchUpgradeAgent)
		aiToolsRouter.POST("/agents/batch/skill/install", baseApi.BatchInstallAgentSkill)
		aiToolsRouter.POST("/agents/batch/operate", baseApi.BatchOperateAgent)
		aiToolsRouter.POST("/agents/search", baseApi.PageAgents)
		aiToolsRouter.POST("/agents/delete/check", baseApi.DeleteCheckAgent)
		aiToolsRouter.POST("/agents/delete", baseApi.DeleteAgent)
		aiToolsRouter.POST("/agents/token/reset", baseApi.ResetAgentToken)
		aiToolsRouter.POST("/agents/remark", baseApi.UpdateAgentRemark)
		aiToolsRouter.POST("/agents/website/bind", baseApi.BindAgentWebsite)
		aiToolsRouter.POST("/agents/website/unbind", baseApi.UnbindAgentWebsite)
		aiToolsRouter.POST("/agents/model/get", baseApi.GetAgentModelConfig)
		aiToolsRouter.POST("/agents/model/update", baseApi.UpdateAgentModelConfig)
		aiToolsRouter.POST("/agents/hermes/chat/sessions", baseApi.GetHermesChatSessions)
		aiToolsRouter.POST("/agents/hermes/chat/sessions/rename", baseApi.RenameHermesChatSession)
		aiToolsRouter.POST("/agents/hermes/chat/sessions/delete", baseApi.DeleteHermesChatSession)
		aiToolsRouter.POST("/agents/overview", baseApi.GetAgentOverview)
		aiToolsRouter.POST("/agents/agent/create", baseApi.CreateAgentRole)
		aiToolsRouter.POST("/agents/agent/delete", baseApi.DeleteAgentRole)
		aiToolsRouter.POST("/agents/agent/bind", baseApi.BindAgentRole)
		aiToolsRouter.POST("/agents/agent/unbind", baseApi.UnbindAgentRole)
		aiToolsRouter.POST("/agents/agent/list", baseApi.GetConfiguredAgentRoles)
		aiToolsRouter.POST("/agents/agent/channels", baseApi.GetAgentRoleChannels)
		aiToolsRouter.POST("/agents/agent/md/list", baseApi.GetAgentRoleMarkdownFiles)
		aiToolsRouter.POST("/agents/agent/md/update", baseApi.UpdateAgentRoleMarkdownFile)
		aiToolsRouter.POST("/agents/channel/feishu/get", baseApi.GetAgentFeishuConfig)
		aiToolsRouter.POST("/agents/channel/feishu/update", baseApi.UpdateAgentFeishuConfig)
		aiToolsRouter.POST("/agents/channel/telegram/get", baseApi.GetAgentTelegramConfig)
		aiToolsRouter.POST("/agents/channel/telegram/update", baseApi.UpdateAgentTelegramConfig)
		aiToolsRouter.POST("/agents/channel/discord/get", baseApi.GetAgentDiscordConfig)
		aiToolsRouter.POST("/agents/channel/discord/update", baseApi.UpdateAgentDiscordConfig)
		aiToolsRouter.POST("/agents/channel/wecom/get", baseApi.GetAgentWecomConfig)
		aiToolsRouter.POST("/agents/channel/wecom/update", baseApi.UpdateAgentWecomConfig)
		aiToolsRouter.POST("/agents/channel/dingtalk/get", baseApi.GetAgentDingTalkConfig)
		aiToolsRouter.POST("/agents/channel/dingtalk/update", baseApi.UpdateAgentDingTalkConfig)
		aiToolsRouter.POST("/agents/channel/weixin/get", baseApi.GetAgentWeixinConfig)
		aiToolsRouter.POST("/agents/channel/weixin/login", baseApi.LoginAgentWeixinChannel)
		aiToolsRouter.POST("/agents/channel/qqbot/get", baseApi.GetAgentQQBotConfig)
		aiToolsRouter.POST("/agents/channel/qqbot/update", baseApi.UpdateAgentQQBotConfig)
		aiToolsRouter.POST("/agents/channel/delete", baseApi.DeleteAgentChannelConfig)
		aiToolsRouter.POST("/agents/plugin/install", baseApi.InstallAgentPlugin)
		aiToolsRouter.POST("/agents/plugin/upgrade", baseApi.UpgradeAgentPlugin)
		aiToolsRouter.POST("/agents/plugin/uninstall", baseApi.UninstallAgentPlugin)
		aiToolsRouter.POST("/agents/plugin/check", baseApi.CheckAgentPlugin)
		aiToolsRouter.POST("/agents/plugins/list", baseApi.ListAgentPlugins)
		aiToolsRouter.POST("/agents/plugins/search", baseApi.SearchAgentPlugins)
		aiToolsRouter.POST("/agents/plugins/install", baseApi.InstallAgentMarketPlugin)
		aiToolsRouter.POST("/agents/plugins/operate", baseApi.OperateAgentPlugin)
		aiToolsRouter.POST("/agents/security/get", baseApi.GetAgentSecurityConfig)
		aiToolsRouter.POST("/agents/security/update", baseApi.UpdateAgentSecurityConfig)
		aiToolsRouter.POST("/agents/other/get", baseApi.GetAgentOtherConfig)
		aiToolsRouter.POST("/agents/other/update", baseApi.UpdateAgentOtherConfig)
		aiToolsRouter.POST("/agents/config-file/get", baseApi.GetAgentConfigFile)
		aiToolsRouter.POST("/agents/config-file/update", baseApi.UpdateAgentConfigFile)
		aiToolsRouter.POST("/agents/skills/list", baseApi.ListAgentSkills)
		aiToolsRouter.POST("/agents/skills/search", baseApi.SearchAgentSkills)
		aiToolsRouter.POST("/agents/skills/update", baseApi.UpdateAgentSkill)
		aiToolsRouter.POST("/agents/skills/install", baseApi.InstallAgentSkill)
		aiToolsRouter.POST("/agents/skills/uninstall", baseApi.UninstallAgentSkill)
		aiToolsRouter.POST("/agents/channel/pairing/approve", baseApi.ApproveAgentChannelPairing)
	}
}
