Skip to content

Commit

Permalink
ref: remove default value for temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
yiblet committed Feb 1, 2025
1 parent c6054d3 commit a780e7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ask_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ chmod -R 644 /path/to/directory/
type askCmd struct {
Question []string `arg:"positional"`
MaxTokens int `arg:"--tokens,-t" default:"0" help:"the maximum amount of tokens allowed in the output"`
Temperature float32 `arg:"--temp" default:"0.7"`
Temperature *float32 `arg:"--temp"`
Bash bool `arg:"--bash" help:"output only valid bash"`
Model string `arg:"--model,-m" help:"set openai model"`
Attach []string `arg:"--attach,-a,separate" help:"attach additional files at the end of the message. pass '-' to pass in stdin"`
Expand Down Expand Up @@ -148,7 +148,7 @@ func (args *askCmd) Execute(ctx context.Context, config *config) error {
err = aiStream(ctx, client, aiStreamInput{
Messages: messages,
MaxTokens: args.MaxTokens,
Temperature: &args.Temperature,
Temperature: args.Temperature,
Model: model,
Timeout: 2 * time.Minute,
}, func(message string) error {
Expand Down
14 changes: 7 additions & 7 deletions chat_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
)

type chatCmd struct {
File string `arg:"required,positional" help:"the input chat file, if you pass - the command will read from stdin"`
Write *string `arg:"positional" help:"the output chat file, if you pass - the output will be the same as input"`
MaxTokens int `arg:"--tokens,-t" default:"0" help:"the maximum amount of tokens allowed in the output"`
Temperature float32 `-arg:"--temp" default:"0.7"`
Color bool `default:"false"`
Model string `arg:"--model,-m" help:"set openai model"`
File string `arg:"required,positional" help:"the input chat file, if you pass - the command will read from stdin"`
Write *string `arg:"positional" help:"the output chat file, if you pass - the output will be the same as input"`
MaxTokens int `arg:"--tokens,-t" default:"0" help:"the maximum amount of tokens allowed in the output"`
Temperature *float32 `-arg:"--temp"`
Color bool `default:"false"`
Model string `arg:"--model,-m" help:"set openai model"`
}

// appendChatFile appends a new chat response to the specified file.
Expand Down Expand Up @@ -163,7 +163,7 @@ func (args *chatCmd) Execute(ctx context.Context, config *config) error {
err = aiStream(ctx, client, aiStreamInput{
Messages: messages,
MaxTokens: args.MaxTokens,
Temperature: &args.Temperature,
Temperature: args.Temperature,
Model: model,
Timeout: 2 * time.Minute,
}, func(message string) error {
Expand Down

0 comments on commit a780e7e

Please sign in to comment.