File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,9 @@ func bootstrapConfig() {
138138 if viper .IsSet ("openai_model" ) {
139139 openaiModel = viper .Get ("openai_model" ).(string )
140140 }
141-
141+ if viper .IsSet ("summary_prompt" ) {
142+ summaryPrompt = viper .Get ("summary_prompt" ).(string )
143+ }
142144 if viper .IsSet ("summary_feeds" ) {
143145 summaryFeeds := viper .Get ("summary_feeds" )
144146
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var show_images bool
2828var sunrise_sunset bool
2929var myFeeds []RSS
3030var db * sql.DB
31+ var summaryPrompt string
3132
3233type RSS struct {
3334 url string
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ func summarize(text string) string {
3232 return ""
3333 }
3434
35- summaryPrompt := viper . GetString ( "summary_prompt" )
36- if summaryPrompt == "" {
37- summaryPrompt = "Summarize the following text:"
35+ prompt := summaryPrompt
36+ if prompt == "" {
37+ prompt = "Summarize the following text:"
3838 }
3939
4040 clientConfig := openai .DefaultConfig (openaiApiKey )
@@ -53,7 +53,7 @@ func summarize(text string) string {
5353 Messages : []openai.ChatCompletionMessage {
5454 {
5555 Role : openai .ChatMessageRoleAssistant ,
56- Content : summaryPrompt ,
56+ Content : prompt ,
5757 },
5858 {
5959 Role : openai .ChatMessageRoleUser ,
You can’t perform that action at this time.
0 commit comments