Skip to content

Commit cd69e95

Browse files
committed
allow setting response format via the opts stored on chat client
1 parent 7ac2445 commit cd69e95

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ local: build
1111

1212
lint:
1313
moonc -l openai
14+
15+
tags::
16+
moon-tags $$(git ls-files openai/ | grep -i '\.moon$$') > $@

openai/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local VERSION = "1.4.0"
1+
local VERSION = "1.4.1"
22
local ltn12 = require("ltn12")
33
local cjson = require("cjson")
44
local unpack = table.unpack or unpack
@@ -142,7 +142,8 @@ do
142142
functions = self.functions,
143143
model = self.opts.model,
144144
temperature = self.opts.temperature,
145-
stream = stream_callback and true or nil
145+
stream = stream_callback and true or nil,
146+
response_format = self.opts.response_format
146147
}, stream_callback)
147148
if status ~= 200 then
148149
local err_msg = "Bad status: " .. tostring(status)

openai/init.moon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "1.4.0"
1+
VERSION = "1.4.1"
22

33
ltn12 = require "ltn12"
44
cjson = require "cjson"
@@ -171,6 +171,7 @@ class ChatSession
171171
model: @opts.model
172172
temperature: @opts.temperature
173173
stream: stream_callback and true or nil
174+
response_format: @opts.response_format
174175
}, stream_callback
175176

176177
if status != 200

0 commit comments

Comments
 (0)