-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from ytkg/add-model-option
Add model option to config
- Loading branch information
Showing
7 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { OpenAI } from "../deps.ts"; | ||
import { ChatCompletion } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Model } from "../types.d.ts"; | ||
|
||
interface CustomChatCompletion extends ChatCompletion { | ||
error: { | ||
|
@@ -10,7 +11,7 @@ interface CustomChatCompletion extends ChatCompletion { | |
export const getCommitMessageSuggestion = async ( | ||
openaiAccessToken: string, | ||
diffText: string, | ||
model: "gpt-3.5-turbo" | "gpt-4", | ||
model: Model, | ||
): Promise<string> => { | ||
const openAI = new OpenAI(openaiAccessToken); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type Model = "gpt-3.5-turbo" | "gpt-4"; | ||
|
||
export type Config = { | ||
api_key?: string; | ||
model?: Model; | ||
[key: string]: string | undefined; | ||
}; |