mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 15:01:24 +00:00
getApiKeyFromEnv -> getEnvApiKey
This commit is contained in:
parent
bf022d2581
commit
9f97f0c8da
8 changed files with 16 additions and 53 deletions
|
|
@ -6,7 +6,7 @@ import {
|
|||
type ThinkingLevel,
|
||||
} from "@google/genai";
|
||||
import { calculateCost } from "../models.js";
|
||||
import { getApiKeyFromEnv } from "../stream.js";
|
||||
import { getEnvApiKey } from "../stream.js";
|
||||
import type {
|
||||
Api,
|
||||
AssistantMessage,
|
||||
|
|
@ -61,7 +61,7 @@ export const streamGoogle: StreamFunction<"google-generative-ai"> = (
|
|||
};
|
||||
|
||||
try {
|
||||
const apiKey = options?.apiKey || getApiKeyFromEnv(model.provider) || "";
|
||||
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
||||
const client = createClient(model, apiKey);
|
||||
const params = buildParams(model, context, options);
|
||||
const googleStream = await client.models.generateContentStream(params);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue