File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 48
48
A chat session instance can be created to simplify managing the state of a back
49
49
and forth conversation with the ChatGPT API. Note that chat state is stored
50
50
locally in memory, each new message is appended to the list of messages, and
51
- the output is automatically appended to the list for the next request.
51
+ the output is automatically appended to the list for the next request.
52
52
53
53
``` lua
54
54
local openai = require (" openai" )
@@ -161,6 +161,16 @@ Sends a request to the `/completions` endpoint.
161
161
Returns HTTP status, response object, and output headers. The response object
162
162
will be decoded from JSON if possible, otherwise the raw string is returned.
163
163
164
+ ##### ` client:embedding(input, opts) `
165
+
166
+ Sends a request to the ` /embeddings ` endpoint.
167
+
168
+ - ` input ` : A single string or an array of strings
169
+ - ` opts ` : Additional options for the completion, passed directly to the API (eg. model) https://platform.openai.com/docs/api-reference/embeddings
170
+
171
+ Returns HTTP status, response object, and output headers. The response object
172
+ will be decoded from JSON if possible, otherwise the raw string is returned.
173
+
164
174
#### ChatSession
165
175
166
176
This class manages chat sessions and history with the OpenAI API. Typically
You can’t perform that action at this time.
0 commit comments