Enha: replace weird quotes
This commit is contained in:
5
llm.go
5
llm.go
@@ -394,9 +394,10 @@ func (or OpenRouterCompletion) FormMsg(msg, role string, resume bool) (io.Reader
|
|||||||
if cfg.ThinkUse && !cfg.ToolUse {
|
if cfg.ThinkUse && !cfg.ToolUse {
|
||||||
prompt += "<think>"
|
prompt += "<think>"
|
||||||
}
|
}
|
||||||
|
ss := chatBody.MakeStopSlice()
|
||||||
logger.Debug("checking prompt for /completion", "tool_use", cfg.ToolUse,
|
logger.Debug("checking prompt for /completion", "tool_use", cfg.ToolUse,
|
||||||
"msg", msg, "resume", resume, "prompt", prompt)
|
"msg", msg, "resume", resume, "prompt", prompt, "stop_strings", ss)
|
||||||
payload := models.NewOpenRouterCompletionReq(chatBody.Model, prompt, defaultLCPProps, chatBody.MakeStopSlice())
|
payload := models.NewOpenRouterCompletionReq(chatBody.Model, prompt, defaultLCPProps, ss)
|
||||||
data, err := json.Marshal(payload)
|
data, err := json.Marshal(payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("failed to form a msg", "error", err)
|
logger.Error("failed to form a msg", "error", err)
|
||||||
|
|||||||
8
tui.go
8
tui.go
@@ -163,6 +163,14 @@ func strInSlice(s string, sl []string) bool {
|
|||||||
|
|
||||||
func colorText() {
|
func colorText() {
|
||||||
text := textView.GetText(false)
|
text := textView.GetText(false)
|
||||||
|
quoteReplacer := strings.NewReplacer(
|
||||||
|
`”`, `"`,
|
||||||
|
`“`, `"`,
|
||||||
|
`“`, `"`,
|
||||||
|
`”`, `"`,
|
||||||
|
`**`, `*`,
|
||||||
|
)
|
||||||
|
text = quoteReplacer.Replace(text)
|
||||||
// Step 1: Extract code blocks and replace them with unique placeholders
|
// Step 1: Extract code blocks and replace them with unique placeholders
|
||||||
var codeBlocks []string
|
var codeBlocks []string
|
||||||
placeholder := "__CODE_BLOCK_%d__"
|
placeholder := "__CODE_BLOCK_%d__"
|
||||||
|
|||||||
Reference in New Issue
Block a user