Skip to content

Commit

Permalink
docs: fix playground example code formatting #998 (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
Whbbit1999 authored Jan 15, 2025
1 parent e532d30 commit 1b8b7ba
Showing 1 changed file with 17 additions and 42 deletions.
59 changes: 17 additions & 42 deletions apps/www/src/examples/playground/components/CodeViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,23 @@ import {
<div class="grid gap-4">
<div class="rounded-md bg-black p-6">
<pre>
<code class="grid gap-1 text-sm text-muted-foreground [&_span]:h-4">
<span>
<span class="text-sky-300">import</span> os
</span>
<span>
<span class="text-sky-300">import</span> openai
</span>
<span />
<span>
openai.api_key = os.getenv(
<span class="text-green-300">
&quot;OPENAI_API_KEY&quot;
</span>
)
</span>
<span />
<span>response = openai.Completion.create(</span>
<span>
model=
<span class="text-green-300">&quot;davinci&quot;</span>,
</span>
<span>
prompt=<span class="text-amber-300">&quot;&quot;</span>,
</span>
<span>
temperature=<span class="text-amber-300">0.9</span>,
</span>
<span>
max_tokens=<span class="text-amber-300">5</span>,
</span>
<span>
top_p=<span class="text-amber-300">1</span>,
</span>
<span>
frequency_penalty=<span class="text-amber-300">0</span>,
</span>
<span>
presence_penalty=<span class="text-green-300">0</span>,
</span>
<span>)</span>
</code>
</pre>
<code class="grid gap-1 text-sm text-muted-foreground [&_span]:h-4">
<span><span class="text-sky-300">import</span> os </span>
<span><span class="text-sky-300">import</span> openai </span>
<span />
<span>openai.api_key = os.getenv(<span class="text-green-300">&quot;OPENAI_API_KEY&quot;</span>)</span>
<span />
<span>response = openai.Completion.create(</span>
<span> model= <span class="text-green-300">&quot;davinci&quot;</span>,</span>
<span> prompt=<span class="text-amber-300">&quot;&quot;</span>,</span>
<span> temperature=<span class="text-amber-300">0.9</span>,</span>
<span> max_tokens=<span class="text-amber-300">5</span>,</span>
<span> top_p=<span class="text-amber-300">1</span>,</span>
<span> frequency_penalty=<span class="text-amber-300">0</span>,</span>
<span> presence_penalty=<span class="text-green-300">0</span>,</span>
<span>)</span>
</code>
</pre>
</div>
<div>
<p class="text-sm text-muted-foreground">
Expand Down

0 comments on commit 1b8b7ba

Please sign in to comment.