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
2424``` lua
2525local AI = require (" src.ai" )
2626
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" )
2828```
2929
3030### Minimal
3131
3232``` lua
33- local chat = ai :chat (" gpt-4o-mini" )
33+ local chat = client :chat (" gpt-4o-mini" )
3434print (chat :say (" Hello, world!" ))
3535```
3636
3737### Streaming
3838
3939``` lua
40- local chat = ai :chat (" gpt-4o-mini" , { settings = { stream = true } })
40+ local chat = client :chat (" gpt-4o-mini" , { settings = { stream = true } })
4141chat :say (" Hello, world!" )
4242```
4343
@@ -56,7 +56,7 @@ local json_object = {
5656 schema = npc_schema ,
5757}
5858
59- local chat = ai :chat (" gpt-4o-mini" , { settings = { json = json_object } })
59+ local chat = client :chat (" gpt-4o-mini" , { settings = { json = json_object } })
6060print (chat :say (" Create a powerful wizard called Torben." ))
6161```
6262
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ local endpoint = "https://api.openai.com/v1/chat/completions"
2525local model = " gpt-4o-mini"
2626
2727local 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 , {
3030 system_prompt = " Respond extremely briefly." ,
3131 settings = {
3232 stream = false ,
You can’t perform that action at this time.
0 commit comments