File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed
Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 4949 local _class_0
5050 local _base_0 = {
5151 api_base = " https://api.openai.com/v1" ,
52+ default_model = " gpt-4.1" ,
5253 new_chat_session = function (self , ...)
5354 return ChatSession (self , ... )
5455 end ,
8889 local test_messages = types .array_of (test_message )
8990 assert (test_messages (messages ))
9091 local payload = {
91- model = " gpt-3.5-turbo " ,
92+ model = self . default_model ,
9293 messages = messages
9394 }
9495 if opts then
198199 local create_response_stream_filter
199200 create_response_stream_filter = require (" openai.responses" ).create_response_stream_filter
200201 local payload = {
202+ model = self .default_model ,
201203 input = input
202204 }
203205 if opts then
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ consume_json_head = do
6565-- TODO: hadle appending the streaming response to the output
6666class OpenAI
6767 api_base : " https://api.openai.com/v1"
68+ default_model : " gpt-4.1"
6869
6970 -- config: types.shape {
7071 -- http_provider: types.string\describe("HTTP module name used for requests") + types nil
@@ -116,7 +117,7 @@ class OpenAI
116117 assert test_messages messages
117118
118119 payload = {
119- model : " gpt-3.5-turbo "
120+ model : @default_model
120121 : messages
121122 }
122123
@@ -237,7 +238,10 @@ class OpenAI
237238 create_response : ( input, opts= {} , stream_callback= nil ) =>
238239 import create_response_stream_filter from require " openai.responses"
239240
240- payload = { : input }
241+ payload = {
242+ model : @default_model
243+ : input
244+ }
241245
242246 if opts
243247 for k, v in pairs opts
Original file line number Diff line number Diff line change 11local cjson = require (" cjson" )
22local types
33types = require (" tableshape" ).types
4- local DEFAULT_RESPONSES_MODEL = " gpt-4.1-mini"
54local empty = (types [" nil" ] + types .literal (cjson .null )):describe (" nullable" )
65local input_format = types .string + types .array_of (types .partial ({
76 role = types .one_of ({
Original file line number Diff line number Diff line change 11cjson = require " cjson"
22import types from require " tableshape"
33
4- DEFAULT_RESPONSES_MODEL = " gpt-4.1-mini"
5-
64empty = ( types. nil + types. literal( cjson. null)) \ describe " nullable"
75
86-- Schema for validating input parameter which can be string or array of messages
You can’t perform that action at this time.
0 commit comments