ソースを参照

Add the o1 model

Matt Rubens 1 年間 前
コミット
0aa5f1fb85
2 ファイル変更9 行追加0 行削除
  1. 1 0
      src/api/providers/openai-native.ts
  2. 8 0
      src/shared/api.ts

+ 1 - 0
src/api/providers/openai-native.ts

@@ -24,6 +24,7 @@ export class OpenAiNativeHandler implements ApiHandler {
 
 	async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream {
 		switch (this.getModel().id) {
+			case "o1":
 			case "o1-preview":
 			case "o1-mini": {
 				// o1 doesnt support streaming, non-1 temp, or system prompt

+ 8 - 0
src/shared/api.ts

@@ -481,6 +481,14 @@ export type OpenAiNativeModelId = keyof typeof openAiNativeModels
 export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4o"
 export const openAiNativeModels = {
 	// don't support tool use yet
+	"o1": {
+		maxTokens: 100_000,
+		contextWindow: 200_000,
+		supportsImages: true,
+		supportsPromptCache: false,
+		inputPrice: 15,
+		outputPrice: 60,
+	},
 	"o1-preview": {
 		maxTokens: 32_768,
 		contextWindow: 128_000,