Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type Environment = {
AXIOM_TOKEN: string;
AXIOM_ORG_ID: string;
AXIOM_DATASET: string;

// Helicone
HELICONE_API_KEY: string;
};

export const getEnv = <K extends keyof Environment>(key: K): Environment[K] => {
Expand Down
11 changes: 10 additions & 1 deletion source/services/openai/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ export const MAX_NUM_TOKENS_16K = 16383;
export const GPT35_MODEL = 'gpt-3.5-turbo-16k-0613';
export const GPT4_MODEL = 'gpt-4-0613';

const configuration = new Configuration({ apiKey: getEnv('OPENAI_API_KEY') });
const configuration = new Configuration({
apiKey: getEnv('OPENAI_API_KEY'),
basePath: 'https://oai.hconeai.com/v1',
baseOptions: {
headers: {
'Helicone-Auth': `Bearer ${getEnv('HELICONE_API_KEY')}`,
'Helicone-Property-App': getEnv('ENVIRONMENT')
}
}
});

export const openai = new OpenAIApi(configuration);