@@ -25,7 +25,10 @@ static ModelInfo()
2525 // https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb
2626 s_modelMap = new ( StringComparer . OrdinalIgnoreCase )
2727 {
28- [ "o1" ] = new ( tokenLimit : 200_000 , encoding : Gpt4oEncoding ) ,
28+ [ "o1" ] = new ( tokenLimit : 200_000 , encoding : Gpt4oEncoding , reasoning : true ) ,
29+ [ "o3" ] = new ( tokenLimit : 200_000 , encoding : Gpt4oEncoding , reasoning : true ) ,
30+ [ "o4-mini" ] = new ( tokenLimit : 200_000 , encoding : Gpt4oEncoding , reasoning : true ) ,
31+ [ "gpt-4.1" ] = new ( tokenLimit : 1_047_576 , encoding : Gpt4oEncoding ) ,
2932 [ "gpt-4o" ] = new ( tokenLimit : 128_000 , encoding : Gpt4oEncoding ) ,
3033 [ "gpt-4" ] = new ( tokenLimit : 8_192 ) ,
3134 [ "gpt-4-32k" ] = new ( tokenLimit : 32_768 ) ,
@@ -45,7 +48,7 @@ static ModelInfo()
4548 } ;
4649 }
4750
48- private ModelInfo ( int tokenLimit , string encoding = null )
51+ private ModelInfo ( int tokenLimit , string encoding = null , bool reasoning = false )
4952 {
5053 TokenLimit = tokenLimit ;
5154 _encodingName = encoding ?? Gpt34Encoding ;
@@ -54,6 +57,7 @@ private ModelInfo(int tokenLimit, string encoding = null)
5457 // See https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb
5558 TokensPerMessage = 3 ;
5659 TokensPerName = 1 ;
60+ Reasoning = reasoning ;
5761 }
5862
5963 private readonly string _encodingName ;
@@ -62,6 +66,7 @@ private ModelInfo(int tokenLimit, string encoding = null)
6266 internal int TokenLimit { get ; }
6367 internal int TokensPerMessage { get ; }
6468 internal int TokensPerName { get ; }
69+ internal bool Reasoning { get ; }
6570 internal Tokenizer Encoding
6671 {
6772 get {
0 commit comments