Skip to content

Commit

Permalink
docs: improve openai example
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed May 12, 2023
1 parent d69bc94 commit 22cb80a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ const openai = new OpenAIApi(configuration);

const completion = await openai.createCompletion({
model: "text-davinci-003",
// when using the openai drop-in replacement, the prompt is passed to
// the OpenAI API as-is and the prompt CMS + templating is not used
prompt: "Hello World, my name is Alice!",
// you need to add your project id
// you need to add your project id to be able to track
// the usage and responses of the OpenAI requests
projectId: "xxx-xxx-xxx-xxx-xxx",
});
console.log(completion.data.choices[0].text);
Expand Down

0 comments on commit 22cb80a

Please sign in to comment.