File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 11import path from 'path' ;
2+ import OpenAI from 'openai' ;
23import { Pinecone } from '@pinecone-database/pinecone' ;
34import { getEmbedding } from '../../../../stacks/openai/getEmbedding' ;
45import { readExplainFiles } from '../lib/utils' ;
56import { BoilerplateMetadata } from '../lib/types' ;
67import { combineSkeleton } from '../../createSkeleton' ;
7- import { openai } from '../openai/construct' ;
88
99const pinecone = new Pinecone ( {
1010 apiKey : process . env . PINECONE_API_KEY as string ,
1111 environment : process . env . PINECONE_ENVIRONMENT as string ,
1212} ) ;
1313
14+ const openai = new OpenAI ( {
15+ apiKey : process . env . OPENAI_API_KEY ,
16+ } ) ;
17+
1418interface OutputType {
1519 nearestBoilerplate : BoilerplateMetadata | BoilerplateMetadata [ ] | null ;
1620 integration : string ;
Original file line number Diff line number Diff line change 1- import { openai } from './construct' ;
1+ import OpenAI from 'openai' ;
2+
3+ const openai = new OpenAI ( {
4+ apiKey : process . env . OPENAI_API_KEY as string ,
5+ } ) ;
26
37export async function openAIQueryBoilerplate ( prompt : string ) : Promise < string > {
48 // this function generates some text given a prompt and return the exact text
Original file line number Diff line number Diff line change 1+ import OpenAI from 'openai' ;
12import { Pinecone } from '@pinecone-database/pinecone' ;
23import { BoilerplateMetadata } from '../../lib/types' ;
34import { boilerplateExpert , furtherEngineering , userAsk } from './prompts' ;
4- import { openai } from '../../openai/construct' ;
5+
6+ const openai = new OpenAI ( {
7+ apiKey : process . env . OPENAI_APY_KEY ,
8+ } ) ;
59
610const pinecone = new Pinecone ( {
711 apiKey : process . env . PINECONE_API_KEY as string ,
You can’t perform that action at this time.
0 commit comments