We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6306e7f commit 410b750Copy full SHA for 410b750
README.md
@@ -66,12 +66,17 @@ require 'chatgpt'
66
# Initialize with API key
67
client = ChatGPT::Client.new(ENV['OPENAI_API_KEY'])
68
69
-# Simple chat completion
+# Chat API (Recommended for GPT-3.5-turbo, GPT-4)
70
response = client.chat([
71
{ role: "user", content: "What is Ruby?" }
72
])
73
74
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
80
```
81
82
## Configuration
0 commit comments