You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB
Lua

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local autogpt_model = require "luci.model.autogpt"
local m, s, o
m = taskd.docker_map("autogpt", "autogpt", "/usr/libexec/apps/autogpt/autogpt.sh",
translate("AutoGPT"),
translate(" Auto-GPT: An Autonomous GPT-4 Experiment. This program, driven by GPT-4, chains together LLM, to autonomously achieve whatever goal you set.")
.. translate("Official website:") .. ' <a href=\"https://github.com/Significant-Gravitas/Auto-GPT\" target=\"_blank\">https://github.com/Significant-Gravitas/Auto-GPT</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("autogpt status:"))
s:append(Template("autogpt/status"))
s = m:section(TypedSection, "autogpt", translate("Setup"), translate("Refresh to update settings."))
s.addremove = false
s.anonymous = true
-- Config options with their default values
local defaults = {
openai = "3BlbkFdfgs5eahdth5a54ey",
config_path = "./auto_gpt_workspace",
image_name = "significantgravitas/auto-gpt",
mem_back = "json_file",
mem_index = "auto-gpt",
headless = "true",
execute = "true",
chunk_max = "8192",
smart_llm = "gpt-4",
fast_llm = "gpt-3.5-turbo",
fast_token = "4000",
smart_token = "8000",
port = "3000",
}
for option, default_value in pairs(defaults) do
o = s:option(Value, option, translate(option:gsub("_", " "):gsub("^%l", string.upper)))
o.default = default_value
o.rmempty = false
end
local paths, default_path = autogpt_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m