-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AI: Support OpenAI o1-preview model. v5.15.22
- Loading branch information
Showing
5 changed files
with
182 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,3 +140,4 @@ __pycache__ | |
/.*.txt | ||
/*.txt | ||
.tmp | ||
__debug_bin* |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2022-2024 Winlin | ||
// | ||
// SPDX-License-Identifier: MIT | ||
package main | ||
|
||
import "strings" | ||
|
||
func gptModelSupportSystem(model string) bool { | ||
if strings.HasPrefix(model, "o1-") { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
func gptModelSupportStream(model string) bool { | ||
if strings.HasPrefix(model, "o1-") { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
func gptModelSupportMaxTokens(model string, maxTokens int) int { | ||
if strings.HasPrefix(model, "o1-") { | ||
return 0 | ||
} | ||
return maxTokens | ||
} | ||
|
||
func gptModelSupportTemperature(model string, temperature float32) float32 { | ||
if strings.HasPrefix(model, "o1-") { | ||
return 0.0 | ||
} | ||
return temperature | ||
} |
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