Skip to content

Commit c6d52bb

Browse files
author
aandrew-me
committed
Fix null dereference for getWholeText()
1 parent 892b377 commit c6d52bb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Diff for: helper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ func getVersionHistory() {
285285
}
286286
}
287287

288-
func getWholeText(input string) {
288+
func getWholeText(input string, extraOptions structs.ExtraOptions) {
289289
makeRequestAndGetData(input, structs.Params{ApiKey: *apiKey, ApiModel: *apiModel, Provider: *provider, Max_length: *max_length, Temperature: *temperature, Top_p: *top_p, Preprompt: *preprompt, Url: *url}, structs.ExtraOptions{IsGetWhole: true})
290-
checkInputLength(input, *disableInputLimit)
290+
checkInputLength(input, extraOptions.DisableInputLimit)
291291
}
292292

293293
func getLastCodeBlock(markdown string) string {

Diff for: main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/olekukonko/ts"
2323
)
2424

25-
const localVersion = "2.8.1"
25+
const localVersion = "2.8.2"
2626

2727
var bold = color.New(color.Bold)
2828
var boldBlue = color.New(color.Bold, color.FgBlue)
@@ -42,7 +42,7 @@ var top_p *string
4242
var max_length *string
4343
var preprompt *string
4444
var url *string
45-
var logFile *string
45+
var logFile *string
4646
var shouldExecuteCommand *bool
4747
var disableInputLimit *bool
4848

@@ -168,11 +168,11 @@ func main() {
168168
fmt.Fprintln(os.Stderr, `Example: tgpt -w "What is encryption?"`)
169169
os.Exit(1)
170170
}
171-
getWholeText(*preprompt + trimmedPrompt + contextText + pipedInput)
171+
getWholeText(*preprompt+trimmedPrompt+contextText+pipedInput, structs.ExtraOptions{DisableInputLimit: *disableInputLimit})
172172
} else {
173173
formattedInput := getFormattedInputStdin()
174174
fmt.Println()
175-
getWholeText(*preprompt + formattedInput + cleanPipedInput)
175+
getWholeText(*preprompt+formattedInput+cleanPipedInput, structs.ExtraOptions{DisableInputLimit: *disableInputLimit})
176176
}
177177
case *isQuiet:
178178
if len(prompt) > 1 {
@@ -262,7 +262,7 @@ func main() {
262262
if previousMessages == "" {
263263
input = *preprompt + input
264264
}
265-
responseJson, responseTxt := getData(input, structs.Params{
265+
responseJson, responseTxt := getData(input, structs.Params{
266266
PrevMessages: previousMessages,
267267
ThreadID: threadID,
268268
Provider: *provider,

Diff for: providers/phind/phind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func NewRequest(input string, params structs.Params) (*http.Response, error) {
1919
os.Exit(0)
2020
}
2121

22-
model := "Phind Model"
22+
model := "Phind-70B"
2323
if params.ApiModel != "" {
2424
model = params.ApiModel
2525
}

0 commit comments

Comments
 (0)