From eee5e83d329fa9a19cf04ba290102ea650aca580 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 20 Aug 2025 22:45:41 +0300 Subject: Feat: bot to write for any char in chat (completion only) --- llm.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'llm.go') diff --git a/llm.go b/llm.go index 05874a1..4cef914 100644 --- a/llm.go +++ b/llm.go @@ -92,7 +92,11 @@ func (lcp LlamaCPPeer) FormMsg(msg, role string, resume bool) (io.Reader, error) prompt := strings.Join(messages, "\n") // strings builder? if !resume { - botMsgStart := "\n" + cfg.AssistantRole + ":\n" + botPersona := cfg.AssistantRole + if cfg.WriteNextMsgAsCompletionAgent != "" { + botPersona = cfg.WriteNextMsgAsCompletionAgent + } + botMsgStart := "\n" + botPersona + ":\n" prompt += botMsgStart } if cfg.ThinkUse && !cfg.ToolUse { @@ -234,7 +238,11 @@ func (ds DeepSeekerCompletion) FormMsg(msg, role string, resume bool) (io.Reader prompt := strings.Join(messages, "\n") // strings builder? if !resume { - botMsgStart := "\n" + cfg.AssistantRole + ":\n" + botPersona := cfg.AssistantRole + if cfg.WriteNextMsgAsCompletionAgent != "" { + botPersona = cfg.WriteNextMsgAsCompletionAgent + } + botMsgStart := "\n" + botPersona + ":\n" prompt += botMsgStart } if cfg.ThinkUse && !cfg.ToolUse { @@ -376,7 +384,11 @@ func (or OpenRouterCompletion) FormMsg(msg, role string, resume bool) (io.Reader prompt := strings.Join(messages, "\n") // strings builder? if !resume { - botMsgStart := "\n" + cfg.AssistantRole + ":\n" + botPersona := cfg.AssistantRole + if cfg.WriteNextMsgAsCompletionAgent != "" { + botPersona = cfg.WriteNextMsgAsCompletionAgent + } + botMsgStart := "\n" + botPersona + ":\n" prompt += botMsgStart } if cfg.ThinkUse && !cfg.ToolUse { -- cgit v1.2.3