You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+94-2Lines changed: 94 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,7 +222,7 @@ The `openai` module returns a table with the following fields:
222
222
-`OpenAI`: A client for sending requests to the OpenAI API.
223
223
-`new`: An alias to `OpenAI` to create a new instance of the OpenAI client
224
224
-`ChatSession`: A class for managing chat sessions and history with the OpenAI API.
225
-
-`VERSION = "1.1.0"`: The current version of the library
225
+
-`VERSION = "1.5.0"`: The current version of the library
226
226
227
227
### Classes
228
228
@@ -236,7 +236,7 @@ Constructor for the OpenAI client.
236
236
237
237
-`api_key`: Your OpenAI API key.
238
238
-`config`: An optional table of configuration options, with the following shape:
239
-
-`http_provider`: A string specifying the HTTP module name used for requests, or `nil`. If not provided, the library will automatically use "lapis.nginx.http" in an ngx environment, or "ssl.https" otherwise.
239
+
-`http_provider`: A string specifying the HTTP module name used for requests, or `nil`. If not provided, the library will automatically use "lapis.nginx.http" in an ngx environment, or "socket.http" otherwise.
240
240
241
241
```lua
242
242
localopenai=require("openai")
@@ -251,6 +251,18 @@ abstraction over the chat completions API that stores the chat history. You can
251
251
append new messages to the history and request completions to be generated from
252
252
it. By default, the completion is appended to the history.
253
253
254
+
##### `client:new_responses_chat_session(...)`
255
+
256
+
Creates a new ResponsesChatSession instance for the Responses API. Similar to
257
+
ChatSession but uses OpenAI's Responses API which handles conversation state
258
+
server-side via `previous_response_id`.
259
+
260
+
-`opts`: Optional configuration table
261
+
-`model`: Model to use (defaults to client's default_model)
262
+
-`instructions`: System instructions for the conversation
263
+
-`tools`: Array of tool definitions
264
+
-`previous_response_id`: Resume from a previous response
0 commit comments