Skip to content

Commit

Permalink
feat: add gpt-3.5-turbo-1106
Browse files Browse the repository at this point in the history
  • Loading branch information
chhoumann committed Nov 7, 2023
1 parent 14669c8 commit c9a3caf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ai/AIAssistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { makeNoticeHandler } from "./makeNoticeHandler";
import { getModelMaxTokens } from "./getModelMaxTokens";

export const getTokenCount = (text: string, model: Model) => {
// gpt-3.5-turbo-16k is a special case - it isn't in the library list yet. Same with gpt-4-1106-preview.
// gpt-3.5-turbo-16k is a special case - it isn't in the library list yet. Same with gpt-4-1106-preview and gpt-3.5-turbo-1106.
let m = model === "gpt-3.5-turbo-16k" ? "gpt-3.5-turbo" : model;
m = m === "gpt-4-1106-preview" ? "gpt-4" : m;
m = m === "gpt-3.5-turbo-1106" ? "gpt-3.5-turbo" : m;

return encodingForModel(m).encode(text).length;
};
Expand Down
2 changes: 2 additions & 0 deletions src/ai/getModelMaxTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export function getModelMaxTokens(model: Model) {
return 8192;
case "gpt-3.5-turbo-16k":
return 16384;
case "gpt-3.5-turbo-1106":
return 16385;
case "gpt-4-1106-preview":
return 128000;
case "gpt-4-32k":
Expand Down
2 changes: 1 addition & 1 deletion src/ai/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const models = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-1106-preview", "gpt-4-32k", "text-davinci-003"] as const;
export const models = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-1106-preview", "gpt-4-32k", "text-davinci-003"] as const;
export const models_and_ask_me = [...models, "Ask me"] as const;
export type Model = typeof models[number];
export type Models_And_Ask_Me = typeof models_and_ask_me[number];

1 comment on commit c9a3caf

@vercel
Copy link

@vercel vercel bot commented on c9a3caf Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

quickadd – ./

quickadd-git-master-chrisbbh.vercel.app
quickadd.obsidian.guide
quickadd-chrisbbh.vercel.app

Please sign in to comment.