Skip to content

Commit 0f8335a

Browse files
committed
api_key instead of api_token
1 parent 3022094 commit 0f8335a

File tree

25 files changed

+27
-27
lines changed

25 files changed

+27
-27
lines changed

packages/inference/src/snippets/getInferenceSnippets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ function replaceAccessTokenPlaceholder(
444444
snippet.includes("https://router.huggingface.co") || // explicit routed request => use $HF_TOKEN
445445
provider == "hf-inference" // hf-inference provider => use $HF_TOKEN
446446
? "HF_TOKEN"
447-
: provider.toUpperCase().replace("-", "_") + "_API_TOKEN"; // e.g. "REPLICATE_API_TOKEN"
447+
: provider.toUpperCase().replace("-", "_") + "_API_KEY"; // e.g. "REPLICATE_API_KEY"
448448

449449
// Replace the placeholder with the env variable
450450
if (language === "sh") {
@@ -464,7 +464,7 @@ function replaceAccessTokenPlaceholder(
464464
);
465465
snippet = snippet.replace(
466466
`"Key ${ACCESS_TOKEN_PLACEHOLDER}"`,
467-
`f"Key {os.environ['${accessTokenEnvVar}']}"` // e.g. f"Key {os.environ['FAL_AI_API_TOKEN']}"
467+
`f"Key {os.environ['${accessTokenEnvVar}']}"` // e.g. f"Key {os.environ['FAL_AI_API_KEY']}"
468468
);
469469
} else if (language === "js") {
470470
snippet = snippet.replace(
@@ -477,7 +477,7 @@ function replaceAccessTokenPlaceholder(
477477
);
478478
snippet = snippet.replace(
479479
`Authorization: "Key ${ACCESS_TOKEN_PLACEHOLDER}",`,
480-
`Authorization: \`Key $\{process.env.${accessTokenEnvVar}}\`,` // e.g. Authorization: `Key ${process.env.FAL_AI_API_TOKEN}`,
480+
`Authorization: \`Key $\{process.env.${accessTokenEnvVar}}\`,` // e.g. Authorization: `Key ${process.env.FAL_AI_API_KEY}`,
481481
);
482482
}
483483
return snippet;

packages/tasks-gen/snippets-fixtures/conversational-llm-non-stream/js/openai/0.together.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { OpenAI } from "openai";
22

33
const client = new OpenAI({
44
baseURL: "https://api.together.xyz/v1",
5-
apiKey: process.env.TOGETHER_API_TOKEN,
5+
apiKey: process.env.TOGETHER_API_KEY,
66
});
77

88
const chatCompletion = await client.chat.completions.create({

packages/tasks-gen/snippets-fixtures/conversational-llm-non-stream/python/openai/0.together.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
client = OpenAI(
55
base_url="https://api.together.xyz/v1",
6-
api_key=os.environ["TOGETHER_API_TOKEN"],
6+
api_key=os.environ["TOGETHER_API_KEY"],
77
)
88

99
completion = client.chat.completions.create(

packages/tasks-gen/snippets-fixtures/conversational-llm-non-stream/python/requests/0.together.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
API_URL = "https://api.together.xyz/v1/chat/completions"
55
headers = {
6-
"Authorization": f"Bearer {os.environ['TOGETHER_API_TOKEN']}",
6+
"Authorization": f"Bearer {os.environ['TOGETHER_API_KEY']}",
77
}
88

99
def query(payload):

packages/tasks-gen/snippets-fixtures/conversational-llm-non-stream/sh/curl/0.together.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
curl https://api.together.xyz/v1/chat/completions \
2-
-H "Authorization: Bearer $TOGETHER_API_TOKEN" \
2+
-H "Authorization: Bearer $TOGETHER_API_KEY" \
33
-H 'Content-Type: application/json' \
44
-d '{
55
"messages": [

packages/tasks-gen/snippets-fixtures/conversational-llm-stream/js/openai/0.together.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { OpenAI } from "openai";
22

33
const client = new OpenAI({
44
baseURL: "https://api.together.xyz/v1",
5-
apiKey: process.env.TOGETHER_API_TOKEN,
5+
apiKey: process.env.TOGETHER_API_KEY,
66
});
77

88
const stream = await client.chat.completions.create({

packages/tasks-gen/snippets-fixtures/conversational-llm-stream/python/openai/0.together.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
client = OpenAI(
55
base_url="https://api.together.xyz/v1",
6-
api_key=os.environ["TOGETHER_API_TOKEN"],
6+
api_key=os.environ["TOGETHER_API_KEY"],
77
)
88

99
stream = client.chat.completions.create(

packages/tasks-gen/snippets-fixtures/conversational-llm-stream/python/requests/0.together.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
API_URL = "https://api.together.xyz/v1/chat/completions"
66
headers = {
7-
"Authorization": f"Bearer {os.environ['TOGETHER_API_TOKEN']}",
7+
"Authorization": f"Bearer {os.environ['TOGETHER_API_KEY']}",
88
}
99

1010
def query(payload):

packages/tasks-gen/snippets-fixtures/conversational-llm-stream/sh/curl/0.together.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
curl https://api.together.xyz/v1/chat/completions \
2-
-H "Authorization: Bearer $TOGETHER_API_TOKEN" \
2+
-H "Authorization: Bearer $TOGETHER_API_KEY" \
33
-H 'Content-Type: application/json' \
44
-d '{
55
"messages": [

packages/tasks-gen/snippets-fixtures/conversational-vlm-non-stream/js/huggingface.js/0.fireworks-ai.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { InferenceClient } from "@huggingface/inference";
22

3-
const client = new InferenceClient(process.env.FIREWORKS_AI_API_TOKEN);
3+
const client = new InferenceClient(process.env.FIREWORKS_AI_API_KEY);
44

55
const chatCompletion = await client.chatCompletion({
66
provider: "fireworks-ai",

0 commit comments

Comments
 (0)