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
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
+
7
18
## Install
8
19
9
20
Install using LuaRocks:
@@ -134,15 +145,21 @@ it. By default, the completion is appended to the history.
134
145
Sends a request to the `/chat/completions` endpoint.
135
146
136
147
-`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
138
149
-`chunk_callback`: A function to be called for parsed streaming output when `stream = true` is passed to `opts`.
139
150
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
+
140
154
##### `client:completion(prompt, opts)`
141
155
142
156
Sends a request to the `/completions` endpoint.
143
157
144
158
-`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.
0 commit comments