Skip to content

Commit 410b750

Browse files
committed
Readme update
1 parent 6306e7f commit 410b750

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ require 'chatgpt'
6666
# Initialize with API key
6767
client = ChatGPT::Client.new(ENV['OPENAI_API_KEY'])
6868

69-
# Simple chat completion
69+
# Chat API (Recommended for GPT-3.5-turbo, GPT-4)
7070
response = client.chat([
7171
{ role: "user", content: "What is Ruby?" }
7272
])
7373

7474
puts response.dig("choices", 0, "message", "content")
75+
76+
# Completions API (For GPT-3.5-turbo-instruct)
77+
response = client.completions("What is Ruby?")
78+
puts response.dig("choices", 0, "text")
79+
7580
```
7681

7782
## Configuration

0 commit comments

Comments
 (0)