Skip to content

Commit f2db47d

Browse files
Inference: Swap Python and Bash code block order (#1618)
Description ----------- Reorders the code blocks to be Python first then Bash instead of vice-versa. This is more consistent with the embedded code examples in the UI and our expected user preference. <!-- preview-links-comment --> 📄 **[View preview links for changed pages](#1618 (comment)
1 parent 56344f7 commit f2db47d

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

content/en/guides/inference/api-reference.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,6 @@ To create a chat completion, provide:
4343
- A model ID from the [available models]({{< relref "models" >}})
4444

4545
{{< tabpane text=true >}}
46-
{{% tab header="Bash" value="bash" %}}
47-
48-
```bash
49-
curl https://api.inference.wandb.ai/v1/chat/completions \
50-
-H "Content-Type: application/json" \
51-
-H "Authorization: Bearer <your-api-key>" \
52-
-H "OpenAI-Project: <your-team>/<your-project>" \
53-
-d '{
54-
"model": "<model-id>",
55-
"messages": [
56-
{ "role": "system", "content": "You are a helpful assistant." },
57-
{ "role": "user", "content": "Tell me a joke." }
58-
]
59-
}'
60-
```
61-
62-
{{% /tab %}}
6346
{{% tab header="Python" value="python" %}}
6447

6548
```python
@@ -89,6 +72,23 @@ response = client.chat.completions.create(
8972
print(response.choices[0].message.content)
9073
```
9174

75+
{{% /tab %}}
76+
{{% tab header="Bash" value="bash" %}}
77+
78+
```bash
79+
curl https://api.inference.wandb.ai/v1/chat/completions \
80+
-H "Content-Type: application/json" \
81+
-H "Authorization: Bearer <your-api-key>" \
82+
-H "OpenAI-Project: <your-team>/<your-project>" \
83+
-d '{
84+
"model": "<model-id>",
85+
"messages": [
86+
{ "role": "system", "content": "You are a helpful assistant." },
87+
{ "role": "user", "content": "Tell me a joke." }
88+
]
89+
}'
90+
```
91+
9292
{{% /tab %}}
9393
{{< /tabpane >}}
9494

@@ -125,16 +125,6 @@ The API returns responses in OpenAI-compatible format:
125125
Get all available models and their IDs. Use this to select models dynamically or check what's available.
126126

127127
{{< tabpane text=true >}}
128-
{{% tab header="Bash" value="bash" %}}
129-
130-
```bash
131-
curl https://api.inference.wandb.ai/v1/models \
132-
-H "Content-Type: application/json" \
133-
-H "Authorization: Bearer <your-api-key>" \
134-
-H "OpenAI-Project: <your-team>/<your-project>"
135-
```
136-
137-
{{% /tab %}}
138128
{{% tab header="Python" value="python" %}}
139129

140130
```python
@@ -152,6 +142,16 @@ for model in response.data:
152142
print(model.id)
153143
```
154144

145+
{{% /tab %}}
146+
{{% tab header="Bash" value="bash" %}}
147+
148+
```bash
149+
curl https://api.inference.wandb.ai/v1/models \
150+
-H "Content-Type: application/json" \
151+
-H "Authorization: Bearer <your-api-key>" \
152+
-H "OpenAI-Project: <your-team>/<your-project>"
153+
```
154+
155155
{{% /tab %}}
156156
{{< /tabpane >}}
157157

0 commit comments

Comments
 (0)