Add 'pi' command alias and fix getApiKey import
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
MessageParam,
|
||||
} from "@anthropic-ai/sdk/resources/messages.js";
|
||||
import { calculateCost } from "../models.js";
|
||||
import { getApiKey } from "../stream.js";
|
||||
import type {
|
||||
Api,
|
||||
AssistantMessage,
|
||||
@@ -111,8 +112,8 @@ export const streamAnthropic: StreamFunction<"anthropic-messages"> = (
|
||||
};
|
||||
|
||||
try {
|
||||
const apiKey = options?.apiKey ?? getApiKey(model.provider);
|
||||
const { client, isOAuthToken } = createClient(model, apiKey);
|
||||
const apiKey = options?.apiKey ?? getApiKey(model.provider) ?? "";
|
||||
const { client, isOAuthToken } = createClient(model, apiKey);
|
||||
const params = buildParams(model, context, isOAuthToken, options);
|
||||
const anthropicStream = client.messages.stream({ ...params, stream: true }, { signal: options?.signal });
|
||||
stream.push({ type: "start", partial: output });
|
||||
|
||||
Reference in New Issue
Block a user