forked from osmarks/potatOS
In-browser live demo!
This commit is contained in:
@@ -866,6 +866,7 @@ local function download_files(manifest_data, needed_files)
|
||||
table.insert(fns, function()
|
||||
add_log("downloading %s", file)
|
||||
local url = base_URL .. "/" .. file
|
||||
write "."
|
||||
local h = assert(http.get(url, nil, true))
|
||||
local x = h.readAll()
|
||||
h.close()
|
||||
@@ -873,6 +874,7 @@ local function download_files(manifest_data, needed_files)
|
||||
if (manifest_data.sizes and manifest_data.sizes[file] and manifest_data.sizes[file] ~= #x) or manifest_data.files[file] ~= hexsha then
|
||||
error(("hash mismatch on %s %s (expected %s, got %s)"):format(file, url, manifest_data.files[file], hexsha)) end
|
||||
fwrite(file, x)
|
||||
write "."
|
||||
count = count + 1
|
||||
end)
|
||||
end
|
||||
|
@@ -2338,6 +2338,7 @@ function potatOS.run_assistant_turn(history, executor)
|
||||
local prompt = construct_prompt {fixed_context, history, new_history}
|
||||
local result = potatOS.llm(prompt, 100, {"\n"})
|
||||
local typ, arg = result:match "^([A-Za-z]*): (.*)$"
|
||||
ccemux.echo(textutils.serialise(result))
|
||||
if typ then
|
||||
local arg = arg:gsub("\n$", "")
|
||||
if typ == "Action" or typ == "Assistant" then table.insert(new_history, { typ, arg }) end
|
||||
|
Reference in New Issue
Block a user