@@ -349,16 +349,21 @@ Constructor for the ResponsesChatSession.
349349 - ` tools ` : Array of tool definitions
350350 - ` previous_response_id ` : Resume from a previous response
351351
352- ##### ` session:send(input, stream_callback ) `
352+ ##### ` session:send(input, opts={} ) `
353353
354354Sends input and returns the response, maintaining conversation state
355355automatically.
356356
357357- ` input ` : A string or array of message objects.
358- - ` stream_callback ` : Optional function for streaming responses.
358+ - ` opts ` : (optional) A table of per-request overrides. For backward
359+ compatibility, a function can be passed instead and will be treated as
360+ ` {stream_callback = fn} ` .
361+ - ` stream_callback ` : Optional function for streaming responses.
362+ - Any other Responses API parameter (e.g. ` tool_choice ` , ` model ` ) to
363+ override the session default for this request.
359364
360- Returns a response object on success ( or accumulated text string when
361- streaming). On failure, returns ` nil ` , an error message, and the raw response.
365+ Returns a response object on success, or accumulated text when streaming. On
366+ failure, returns ` nil ` , an error message, and the raw response.
362367
363368Response objects have helper methods:
364369- ` response:get_output_text() ` : Extract all text content as a string
@@ -385,8 +390,8 @@ Lower-level method to create a response with additional options.
385390- ` opts ` : Additional options (model, temperature, tools, previous_response_id, etc.)
386391- ` stream_callback ` : Optional function for streaming responses.
387392
388- Returns a response object on success. On failure, returns ` nil ` , an error
389- message, and the raw response.
393+ Returns a response object on success, or accumulated text when streaming. On
394+ failure, returns ` nil ` , an error message, and the raw response.
390395
391396#### ChatSession
392397
724729 error (" Unknown function: " .. name )
725730end
726731```
727-
0 commit comments