Skip to content

Commit 8f6e386

Browse files
committed
update readme for embedding call
1 parent 0d7dbf2 commit 8f6e386

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
A chat session instance can be created to simplify managing the state of a back
4949
and forth conversation with the ChatGPT API. Note that chat state is stored
5050
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.
5252

5353
```lua
5454
local openai = require("openai")
@@ -161,6 +161,16 @@ Sends a request to the `/completions` endpoint.
161161
Returns HTTP status, response object, and output headers. The response object
162162
will 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

166176
This class manages chat sessions and history with the OpenAI API. Typically

0 commit comments

Comments
 (0)