Skip to content

Commit c3a6666

Browse files
EQtHerringtonDarkholme
authored andcommitted
fix: syntax highlighting for code diffs
1 parent ae227a6 commit c3a6666

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

website/catalog/python/migrate-openai-sdk.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ def index():
6161
<!-- use // [!code --] and // [!code ++] to annotate diff -->
6262
```python
6363
import os
64-
import openai //[!code --]
65-
from openai import Client //[!code ++]
64+
import openai // [!code --]
65+
from openai import Client // [!code ++]
6666
from flask import Flask, jsonify
6767

6868
app = Flask(__name__)
69-
openai.api_key = os.getenv("OPENAI_API_KEY") //[!code --]
70-
client = Client(os.getenv("OPENAI_API_KEY")) //[!code ++]
69+
openai.api_key = os.getenv("OPENAI_API_KEY") // [!code --]
70+
client = Client(os.getenv("OPENAI_API_KEY")) // [!code ++]
7171

7272
@app.route("/chat", methods=("POST"))
7373
def index():
7474
animal = request.form["animal"]
75-
response = openai.Completion.create( //[!code --]
76-
response = client.completions.create( //[!code ++]
75+
response = openai.Completion.create( // [!code --]
76+
response = client.completions.create( // [!code ++]
7777
model="text-davinci-003",
7878
prompt=generate_prompt(animal),
7979
temperature=0.6,
@@ -82,4 +82,4 @@ def index():
8282
```
8383
8484
### Contributed by
85-
[Herrington Darkholme](https://twitter.com/hd_nvim), inspired by [Morgante](https://twitter.com/morgantepell/status/1721668781246750952) from [grit.io](https://www.grit.io/)
85+
[Herrington Darkholme](https://twitter.com/hd_nvim), inspired by [Morgante](https://twitter.com/morgantepell/status/1721668781246750952) from [grit.io](https://www.grit.io/)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy