Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add completions guides
  • Loading branch information
logankilpatrick authored Sep 6, 2023
commit ecadab42f0fae3124d91e0787c2c45b80c6e74eb
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=[{"rol
print(completion.choices[0].message.content)
```

You can learn more in our [chat completions guide](https://platform.openai.com/docs/guides/gpt/chat-completions-api).

### Completions

Text models such as `babbage-002` or `davinci-002` (and our [legacy completions models](https://platform.openai.com/docs/deprecations/deprecation-history)) can be called using the completions endpoint.
Expand All @@ -83,6 +85,8 @@ completion = openai.Completion.create(model="davinci-002", prompt="Hello world")
print(completion.choices[0].text)
```

You can learn more in our [completions guide](https://platform.openai.com/docs/guides/gpt/completions-api).

### Embeddings

Embeddings are designed to measure the similarity or relevance between text strings. To get an embedding for a text string, you can use the embeddings method as follows in Python:
Expand Down