Thanks to visit codestin.com
Credit goes to github.com

Skip to content

adds examples and readme documentation #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2022

Conversation

ted-at-openai
Copy link
Collaborator

No description provided.

@ted-at-openai ted-at-openai requested a review from BorisPower June 1, 2022 00:50
Copy link
Collaborator

@BorisPower BorisPower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent! I left a few very small nits, but overall great starting doc!

Examples and guides for using the OpenAI API. The examples are broken down into high level capabilities, which are further broken down into use case.
# OpenAI Cookbook

This repository shares example code and example prompts for accomplishing common tasks with the [OpenAI API](https://openai.com/api/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe add something like: "To try these examples yourself, you’ll need an OpenAI account. Create a free account to get started."

README.md Outdated

Beyond the code examples here, you can also learn about the [OpenAI API](https://openai.com/api/) from the following resources:

* Play with GPT-3 in the [OpenAI Playground](https://beta.openai.com/playground)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Play with => Try out

* Read about the API in the [OpenAI Documentation](https://beta.openai.com/docs/introduction)
* Discuss the API in the [OpenAI Community Forum](https://community.openai.com/top?period=monthly)
* Look for help in the [OpenAI Help Center](https://help.openai.com/en/)
* See example prompts in the [OpenAI Examples](https://beta.openai.com/examples)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: People reading this for the first time might not know what a prompt is.

Maybe instead something like "See simple examples in the" ?

README.md Outdated
* Look for help in the [OpenAI Help Center](https://help.openai.com/en/)
* See example prompts in the [OpenAI Examples](https://beta.openai.com/examples)

## Code examples, organized by capability
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code examples, organized by capability => ## Examples, organized by capability

README.md Outdated

## How large language models work

Large language models are functions that map text to text. Given an input string of text, a large language model tries to predict the text that will come next.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth linking here to an external place where we explain this in more detail? Maybe GPT-2 blog https://openai.com/blog/better-language-models/

Also maybe a link to example applications built on top of our api? https://openai.com/blog/gpt-3-apps/

README.md Outdated
### 3. Edit text

#### Use cases
In addition to the normal [completion API endpoint](https://beta.openai.com/docs/api-reference/completions), OpenAI now offers an [edit API endpoint](https://beta.openai.com/docs/api-reference/edits). In contrast to completions, which only take a single text input, edits take two text inputs: the instruction and the text to be modified.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also link to the edit blogpost? https://openai.com/blog/gpt-3-edit-insert/

README.md Outdated

Text:
"""
{text}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe create a short example, like you did for the examples prior, and add a sample output for consistency sake?


Instruction input:
```
translation into French
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> Translate into French

(probably best to show instructions always grammatical and well capitalized)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this is the edit endpoint - you might be right that for diffs different guidelines apply


#### Semantic search

Embeddings can be used for search either by themselves or as a feature in a larger system.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated

## Code Capabilities

Large language models aren't only great at text - they can be great at writing and understanding code too. OpenAI's code model is called Codex and you can read more about it [here](https://openai.com/blog/codex-apps/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition maybe also link to the original codex blog? https://openai.com/blog/openai-codex/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add a sentence regarding codex models not being instruction following, so it needs to rely on few shot examples, or just text completion.

@ted-at-openai ted-at-openai force-pushed the ted/cookbook-updates branch from 0399194 to 5f03c27 Compare June 2, 2022 20:00
@ted-at-openai ted-at-openai force-pushed the ted/cookbook-updates branch from 0c3de0d to fbb20da Compare June 3, 2022 00:03
@ted-at-openai ted-at-openai merged commit 534d8c3 into main Jun 3, 2022
@ted-at-openai ted-at-openai deleted the ted/cookbook-updates branch June 3, 2022 00:05
colin-openai pushed a commit that referenced this pull request Feb 9, 2023
colin-openai pushed a commit that referenced this pull request May 14, 2023
technoplato added a commit to technoplato/openai-cookbook that referenced this pull request Aug 3, 2023
katia-openai pushed a commit that referenced this pull request Feb 29, 2024
sarbazvatanatan pushed a commit to sarbazvatanatan/openai-cookbook that referenced this pull request Apr 16, 2024
focusedbytes referenced this pull request in focusedbytes/openai-cookbook Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants