Skip to content

Commit 323f9d0

Browse files
committed
improved examples for embeddings
1 parent 69dcc8d commit 323f9d0

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

openapi.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.0
22
info:
33
title: OpenAI API
44
description: APIs for sampling from and fine-tuning language models
5-
version: '1.0.1'
5+
version: '1.0.2'
66
servers:
77
- url: https://api.openai.com/v1
88
tags:
@@ -1262,7 +1262,6 @@ paths:
12621262
name: Create embeddings
12631263
group: embeddings
12641264
path: create
1265-
beta: true
12661265
examples:
12671266
curl: |
12681267
curl https://api.openai.com/v1/engines/text-similarity-babbage-001/embeddings \
@@ -1275,8 +1274,9 @@ paths:
12751274
import os
12761275
import openai
12771276
openai.api_key = os.getenv("OPENAI_API_KEY")
1278-
openai.Engine(id="text-similarity-babbage-001").embeddings(
1279-
input="The food was delicious and the waiter..."
1277+
openai.Embedding.create(
1278+
input="The food was delicious and the waiter...",
1279+
engine="text-similarity-babbage-001"
12801280
)
12811281
node.js: |
12821282
const { Configuration, OpenAIApi } = require("openai");
@@ -2046,7 +2046,7 @@ components:
20462046
description: |
20472047
Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length.
20482048
2049-
We suggest replacing newlines (`\n`) in your input with a single space, as we have observed inferior results when newlines are present.
2049+
Unless your are embedding code, we suggest replacing newlines (`\n`) in your input with a single space, as we have observed inferior results when newlines are present.
20502050
example: "The quick brown fox jumped over the lazy dog"
20512051
oneOf:
20522052
- type: string
@@ -2222,8 +2222,4 @@ oaiMeta:
22222222
description: |
22232223
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
22242224
2225-
Embeddings is currently in private beta, and we plan to expand access in the near future. Please fill out [this form](https://docs.google.com/forms/d/e/1FAIpQLSdwo9_cQ8d125D_AYtgOSvNJ0JuCBYjUmROkFHrfMnz3lsSCg/viewform) to let us know of your interest.
2226-
2227-
Starting January 24th 2022 at 00:00 UTC, we will begin billing for embedding usage. For more details, see [embeddings pricing](/docs/guides/embeddings/pricing).
2228-
22292225
Related guide: [Embeddings](/docs/guides/embeddings)

0 commit comments

Comments
 (0)