package llm

import (
	"context"
)

// RunTranslate renders a short English explanation into Simplified Chinese. It
// is a one-shot Complete (the result seeds the Ask Petal bubble), kept at a low
// temperature so the translation is faithful rather than creative. Output is
// trimmed of any stray surrounding quotes the model may add.
func RunTranslate(ctx context.Context, client LLMClient, text string) (string, error) {
	out, err := client.Complete(ctx, CompletionRequest{
		Messages:          TranslateMessages(text),
		MaxTokens:         512,
		Temperature:       0.2,
		TopP:              0.9,
		RepetitionPenalty: 1.1,
	})
	if err != nil {
		return "", err
	}
	return cleanRewrite(out), nil
}
