Skip to content

Commit 6fa9534

Browse files
committed
Updated README.md
1 parent 85a5661 commit 6fa9534

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,22 @@ LLM output is fuzzy. Define quality like this:
130130

131131
```python
132132
import os
133+
133134
from openai import OpenAI
134135

135-
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
136+
client = OpenAI(
137+
api_key=os.environ.get("OPENAI_API_KEY"),
138+
)
136139

137140
response = client.chat.completions.create(
138-
messages=[
139-
{
140-
"content": "You are a concise technical writer.",
141-
"role": "system"
142-
},
143-
{
144-
"content": "Explain what a vector database is in simple terms.",
145-
"role": "user"
146-
}
147-
],
148-
model="gpt-4",
141+
model="gpt-4o",
142+
messages=[
143+
{"role": "system", "content": "You are a concise technical writer."},
144+
{
145+
"role": "user",
146+
"content": "Explain what a vector database is in simple terms.",
147+
},
148+
],
149149
)
150150

151151
print(response.choices[0].message.content)

0 commit comments

Comments
 (0)