feat: write tools output also to output file if defined; fix XouTube transcript ' character

This commit is contained in:
Eugen Eisler
2024-10-30 13:50:45 +01:00
parent 3ec4d274c4
commit e17b96d864
5 changed files with 15 additions and 7 deletions

View File

@@ -191,6 +191,14 @@ func (o *Flags) IsChatRequest() (ret bool) {
return
}
func (o *Flags) WriteOutput(message string) (err error) {
fmt.Println(message)
if o.Output != "" {
err = CreateOutputFile(message, o.Output)
}
return
}
func AppendMessage(message string, newMessage string) (ret string) {
if message != "" {
ret = message + "\n" + newMessage