mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 16:01:05 +00:00
getApiKeyFromEnv -> getEnvApiKey
This commit is contained in:
parent
bf022d2581
commit
9f97f0c8da
8 changed files with 16 additions and 53 deletions
|
|
@ -11,7 +11,7 @@ import type {
|
|||
ResponseReasoningItem,
|
||||
} from "openai/resources/responses/responses.js";
|
||||
import { calculateCost } from "../models.js";
|
||||
import { getApiKeyFromEnv } from "../stream.js";
|
||||
import { getEnvApiKey } from "../stream.js";
|
||||
import type {
|
||||
Api,
|
||||
AssistantMessage,
|
||||
|
|
@ -82,7 +82,7 @@ export const streamOpenAIResponses: StreamFunction<"openai-responses"> = (
|
|||
|
||||
try {
|
||||
// Create OpenAI client
|
||||
const apiKey = options?.apiKey || getApiKeyFromEnv(model.provider) || "";
|
||||
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
||||
const client = createClient(model, context, apiKey);
|
||||
const params = buildParams(model, context, options);
|
||||
const openaiStream = await client.responses.create(params, { signal: options?.signal });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue