From 7ca188dcdc9e98e3222a05a160006c76c1b84862 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 2 Feb 2025 13:25:24 +0300 Subject: Feat: code block copy; model update; [WIP:broke tables] --- tools.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tools.go') diff --git a/tools.go b/tools.go index 8fda0ab..94c1b16 100644 --- a/tools.go +++ b/tools.go @@ -9,11 +9,13 @@ import ( ) var ( - toolCallRE = regexp.MustCompile(`__tool_call__\s*([\s\S]*?)__tool_call__`) - quotesRE = regexp.MustCompile(`(".*?")`) - starRE = regexp.MustCompile(`(\*.*?\*)`) - thinkRE = regexp.MustCompile(`(.*?)`) - // codeBlokRE = regexp.MustCompile(`(\x60\x60\x60.*?\x60\x60\x60)`) + toolCallRE = regexp.MustCompile(`__tool_call__\s*([\s\S]*?)__tool_call__`) + quotesRE = regexp.MustCompile(`(".*?")`) + starRE = regexp.MustCompile(`(\*.*?\*)`) + thinkRE = regexp.MustCompile(`(.*?)`) + codeBlockRE = regexp.MustCompile(`(?s)\x60{3}(?:.*?)\n(.*?)\n\s*\x60{3}\s*`) + // codeBlockRE = regexp.MustCompile("```\s*([\s\S]*?)```") + // codeBlockRE = regexp.MustCompile(`(\x60\x60\x60.*?\x60\x60\x60)`) basicSysMsg = `Large Language Model that helps user with any of his requests.` toolSysMsg = `You're a helpful assistant. # Tools -- cgit v1.2.3