mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 04:04:05 +00:00
getApiKeyFromEnv -> getEnvApiKey
This commit is contained in:
parent
bf022d2581
commit
9f97f0c8da
8 changed files with 16 additions and 53 deletions
|
|
@ -5,7 +5,7 @@ import type {
|
|||
MessageParam,
|
||||
} from "@anthropic-ai/sdk/resources/messages.js";
|
||||
import { calculateCost } from "../models.js";
|
||||
import { getApiKeyFromEnv } from "../stream.js";
|
||||
import { getEnvApiKey } from "../stream.js";
|
||||
import type {
|
||||
Api,
|
||||
AssistantMessage,
|
||||
|
|
@ -114,7 +114,7 @@ export const streamAnthropic: StreamFunction<"anthropic-messages"> = (
|
|||
};
|
||||
|
||||
try {
|
||||
const apiKey = options?.apiKey ?? getApiKeyFromEnv(model.provider) ?? "";
|
||||
const apiKey = options?.apiKey ?? getEnvApiKey(model.provider) ?? "";
|
||||
const { client, isOAuthToken } = createClient(model, apiKey, options?.interleavedThinking ?? true);
|
||||
const params = buildParams(model, context, isOAuthToken, options);
|
||||
const anthropicStream = client.messages.stream({ ...params, stream: true }, { signal: options?.signal });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue