File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,20 @@ A developer-friendly Lua interface for working with multiple generative AI provi
24
24
``` lua
25
25
local AI = require (" src.ai" )
26
26
27
- local ai = AI .new (" <YOUR_API_KEY>" , " https://api.openai.com/v1/chat/completions" )
27
+ local client = AI .new (" <YOUR_API_KEY>" , " https://api.openai.com/v1/chat/completions" )
28
28
```
29
29
30
30
### Minimal
31
31
32
32
``` lua
33
- local chat = ai :chat (" gpt-4o-mini" )
33
+ local chat = client :chat (" gpt-4o-mini" )
34
34
print (chat :say (" Hello, world!" ))
35
35
```
36
36
37
37
### Streaming
38
38
39
39
``` lua
40
- local chat = ai :chat (" gpt-4o-mini" , { settings = { stream = true } })
40
+ local chat = client :chat (" gpt-4o-mini" , { settings = { stream = true } })
41
41
chat :say (" Hello, world!" )
42
42
```
43
43
@@ -56,7 +56,7 @@ local json_object = {
56
56
schema = npc_schema ,
57
57
}
58
58
59
- local chat = ai :chat (" gpt-4o-mini" , { settings = { json = json_object } })
59
+ local chat = client :chat (" gpt-4o-mini" , { settings = { json = json_object } })
60
60
print (chat :say (" Create a powerful wizard called Torben." ))
61
61
```
62
62
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ local endpoint = "https://api.openai.com/v1/chat/completions"
25
25
local model = " gpt-4o-mini"
26
26
27
27
local function main ()
28
- local ai = AI .new (api_key , endpoint )
29
- local chat = ai :chat (model , {
28
+ local client = AI .new (api_key , endpoint )
29
+ local chat = client :chat (model , {
30
30
system_prompt = " Respond extremely briefly." ,
31
31
settings = {
32
32
stream = false ,
You can’t perform that action at this time.
0 commit comments