Skip to content

Commit

Permalink
feat: add gpt-4-1106-preview to AI Assistant (128k context, fresher k…
Browse files Browse the repository at this point in the history
…nowledge, cheapter than gpt-4!)
  • Loading branch information
chhoumann committed Nov 6, 2023
1 parent feae0a8 commit f404425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/ai/AIAssistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ 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
const m = model === "gpt-3.5-turbo-16k" ? "gpt-3.5-turbo" : model;
// gpt-3.5-turbo-16k is a special case - it isn't in the library list yet. Same with gpt-4-1106-preview.
let m = model === "gpt-3.5-turbo-16k" ? "gpt-3.5-turbo" : model;
m = model === "gpt-4-1106-preview" ? "gpt-4" : model;

Check failure on line 16 in src/ai/AIAssistant.ts

View workflow job for this annotation

GitHub Actions / Release (18)

Type '"gpt-3.5-turbo" | "gpt-3.5-turbo-16k" | "gpt-4" | "gpt-4-32k" | "text-davinci-003"' is not assignable to type '"gpt-3.5-turbo" | "gpt-4" | "gpt-4-1106-preview" | "gpt-4-32k" | "text-davinci-003"'.

return encodingForModel(m).encode(text).length;

Check failure on line 18 in src/ai/AIAssistant.ts

View workflow job for this annotation

GitHub Actions / Release (18)

Argument of type '"gpt-3.5-turbo" | "gpt-4" | "gpt-4-1106-preview" | "gpt-4-32k" | "text-davinci-003"' is not assignable to parameter of type 'TiktokenModel'.
};
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-32k", "text-davinci-003"] as const;
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_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 f404425

@vercel
Copy link

@vercel vercel bot commented on f404425 Nov 6, 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.