Skip to content

Commit 8d7fd5c

Browse files
committed
more updates to readme
1 parent 52ee1c8 commit 8d7fd5c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Bindings to the OpenAI HTTP API for Lua. Compatible with any socket library
44
that supports the LuaSocket request interface. Compatible with OpenResty using
55
[`lapis.nginx.http`](https://leafo.net/lapis/reference/utilities.html#making-http-requests).
66

7+
<details>
8+
<summary>AI Generated Disclaimer</summary>
9+
10+
Although this library was written by hand, large portions of the documentation
11+
and the test suite were fully generated by ChatGPT 4 by pasting the source code
12+
of the entire library in as a prompt and asking to generate documentation and
13+
tests. The final output was edited for clarity and syntax (in cases where GPT4
14+
struggled writing MoonScript)
15+
16+
</details>
17+
718
## Install
819

920
Install using LuaRocks:
@@ -134,15 +145,21 @@ it. By default, the completion is appended to the history.
134145
Sends a request to the `/chat/completions` endpoint.
135146

136147
- `messages`: An array of message objects.
137-
- `opts`: Additional options for the chat, such as model and temperature.
148+
- `opts`: Additional options for the chat, passed directly to the API (eg. model, temperature, etc.) https://platform.openai.com/docs/api-reference/chat
138149
- `chunk_callback`: A function to be called for parsed streaming output when `stream = true` is passed to `opts`.
139150

151+
Returns HTTP status, response object, and output headers. The response object
152+
will be decoded from JSON if possible, otherwise the raw string is returned.
153+
140154
##### `client:completion(prompt, opts)`
141155

142156
Sends a request to the `/completions` endpoint.
143157

144158
- `prompt`: The prompt for the completion.
145-
- `opts`: Additional options for the completion.
159+
- `opts`: Additional options for the completion, passed directly to the API (eg. model, temperature, etc.) https://platform.openai.com/docs/api-reference/completions
160+
161+
Returns HTTP status, response object, and output headers. The response object
162+
will be decoded from JSON if possible, otherwise the raw string is returned.
146163

147164
#### ChatSession
148165

0 commit comments

Comments
 (0)