Mercurial Hosting > lang
comparison src/lib/ai/Ai.luan @ 5:a970b7a01a74
start ai
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 16 Jul 2025 15:08:14 -0600 |
parents | 78708fa556a0 |
children | 025bb19b65b1 |
comparison
equal
deleted
inserted
replaced
4:b1adec083e44 | 5:a970b7a01a74 |
---|---|
1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
2 local error = Luan.error | 2 local error = Luan.error |
3 local ipairs = Luan.ipairs or error() | |
3 | 4 |
4 | 5 |
5 local Ai = {} | 6 local Ai = {} |
6 | 7 |
7 local ai = "dummy" | 8 local ais = {"chatgpt"} |
8 | 9 local files = {"Chat.luan"} |
9 function Ai.require_ai(file) | 10 for _, ai in ipairs(ais) do |
10 return require("site:/private/lib/ai/"..ai.."/"..file) | 11 local mods = {} |
12 local dir = "site:/lib/ai/"..ai.."/" | |
13 for _, file in ipairs(files) do | |
14 mods[file] = require(dir..file) | |
15 end | |
16 Ai[ai] = mods | |
11 end | 17 end |
12 | 18 |
13 return Ai | 19 return Ai |