Skip to content

Commit 8bd960d

Browse files
Default temperature to 0
1 parent 3e094a7 commit 8bd960d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/engine/engine.go

+1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (e *Engine) Start(ctx Context, input string) (*Return, error) {
273273
MaxToken: tool.MaxTokens,
274274
JSONResponse: tool.JSONResponse,
275275
Cache: tool.Cache,
276+
Temperature: tool.Temperature,
276277
}
277278

278279
if InternalSystemPrompt != "" {

pkg/openai/client.go

+4
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ func (c *Client) Call(ctx context.Context, messageRequest types.CompletionReques
264264
Temperature: messageRequest.Temperature,
265265
}
266266

267+
if request.Temperature == nil {
268+
request.Temperature = new(float32)
269+
}
270+
267271
if messageRequest.JSONResponse {
268272
request.ResponseFormat = &openai.ChatCompletionResponseFormat{
269273
Type: openai.ChatCompletionResponseFormatTypeJSONObject,

0 commit comments

Comments
 (0)