LLM now works for Titles

This commit is contained in:
Dmitrii Okunev
2025-04-28 00:41:14 +01:00
parent c64b3b12bb
commit 3c88fcb686
2 changed files with 5 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/facebookincubator/go-belt/tool/logger"
llms "github.com/xaionaro-go/streamctl/pkg/llm"
llmtypes "github.com/xaionaro-go/streamctl/pkg/llm/types"
"github.com/xaionaro-go/streamctl/pkg/secret"
@@ -85,7 +86,9 @@ func (l *llm) updateConfigNoLock(
func (l *llm) Generate(
ctx context.Context,
prompt string,
) (string, error) {
) (_ret string, _err error) {
logger.Debugf(ctx, "Generate(ctx, '%s')", prompt)
defer func() { logger.Debugf(ctx, "/Generate(ctx, '%s'): '%s', %v", prompt, _ret, _err) }()
return xsync.DoA2R2(ctx, &l.locker, l.generateNoLock, ctx, prompt)
}

View File

@@ -1328,7 +1328,7 @@ func (p *Panel) generateAlternativeTextFor(
return "", fmt.Errorf("unable to get StreamD client: %w", err)
}
return streamD.LLMGenerate(ctx, fmt.Sprintf("I'm about to go live on YouTube and Twitch. Suggest %s."))
return streamD.LLMGenerate(ctx, fmt.Sprintf("I'm about to go live on YouTube and Twitch. Suggest %s.", what))
}
func (p *Panel) initMainWindow(