File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4848A chat session instance can be created to simplify managing the state of a back
4949and forth conversation with the ChatGPT API. Note that chat state is stored
5050locally 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.
5252
5353``` lua
5454local openai = require (" openai" )
@@ -161,6 +161,16 @@ Sends a request to the `/completions` endpoint.
161161Returns HTTP status, response object, and output headers. The response object
162162will be decoded from JSON if possible, otherwise the raw string is returned.
163163
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+
164174#### ChatSession
165175
166176This class manages chat sessions and history with the OpenAI API. Typically
You can’t perform that action at this time.
0 commit comments