File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
3333 enableSearch = true
3434 aliModel = strings .TrimSuffix (aliModel , EnableSearchModelSuffix )
3535 }
36+ if request .TopP >= 1 {
37+ request .TopP = 0.9999
38+ }
3639 return & ChatRequest {
3740 Model : aliModel ,
3841 Input : Input {
@@ -42,6 +45,9 @@ func ConvertRequest(request model.GeneralOpenAIRequest) *ChatRequest {
4245 EnableSearch : enableSearch ,
4346 IncrementalOutput : request .Stream ,
4447 Seed : uint64 (request .Seed ),
48+ MaxTokens : request .MaxTokens ,
49+ Temperature : request .Temperature ,
50+ TopP : request .TopP ,
4551 },
4652 }
4753}
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ type Parameters struct {
1616 Seed uint64 `json:"seed,omitempty"`
1717 EnableSearch bool `json:"enable_search,omitempty"`
1818 IncrementalOutput bool `json:"incremental_output,omitempty"`
19+ MaxTokens int `json:"max_tokens,omitempty"`
20+ Temperature float64 `json:"temperature,omitempty"`
1921}
2022
2123type ChatRequest struct {
You can’t perform that action at this time.
0 commit comments