Skip to content

Commit

Permalink
feat(engine): support gpt-4 (briansunter#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
briansunter authored Mar 15, 2023
1 parent 27054d5 commit 49d2e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function openAI(

const openai = new OpenAIApi(configuration);
try {
if (engine.startsWith("gpt-3.5")) {
if (engine.startsWith("gpt-3.5") || engine.startsWith("gpt-4")) {
const inputMessages:ChatCompletionRequestMessage[] = [{ role: "user", content: input }];
if (openAiOptions.chatPrompt && openAiOptions.chatPrompt.length > 0) {
inputMessages.unshift({ role: "system", content: openAiOptions.chatPrompt });
Expand Down

0 comments on commit 49d2e36

Please sign in to comment.