Skip to content

Commit

Permalink
fix: remove OPENAI_KEY presence extra checks (configParser check is e…
Browse files Browse the repository at this point in the history
…nough)
  • Loading branch information
incerta committed May 26, 2023
1 parent 0ba6522 commit 23257e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
9 changes: 0 additions & 9 deletions src/commands/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { spinner, intro, outro, text, isCancel } from '@clack/prompts';
import { cyan, green } from 'kolorist';
import { generateCompletion, readData } from '../helpers/completion';
import { parseAssert } from '../prompt';
import { KnownError } from '../helpers/error';
import { getConfig } from '../helpers/config';
import { streamToIterable } from '../helpers/stream-to-iterable';
import { ChatCompletionRequestMessage } from 'openai';
Expand All @@ -20,14 +19,6 @@ export default command(
await getConfig();
const chatHistory: ChatCompletionRequestMessage[] = [];

if (!key) {
throw new KnownError(
i18n.t(
'Please set your OpenAI API key via `ai config set OPENAI_KEY=<your token>`'
)
);
}

console.log('');
intro(i18n.t('Starting new conversation'));
const prompt = async () => {
Expand Down
8 changes: 0 additions & 8 deletions src/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ export async function prompt({
} = await getConfig();
const skipCommandExplanation = silentMode || SILENT_MODE;

if (!key) {
throw new KnownError(
i18n.t(
'Please set your OpenAI API key via `ai config set OPENAI_KEY=<your token>`'
)
);
}

console.log('');
p.intro(`${cyan(`${projectName}`)}`);

Expand Down

0 comments on commit 23257e8

Please sign in to comment.