MCPcopy Create free account
hub / github.com/aurora-develop/aurora / normalize

Function normalize

internal/toolcall/parser.go:141–147  ·  view source on GitHub ↗

normalize 把模型常见的标签变体( 、 等)统一为 / 。

(s string)

Source from the content-addressed store, hash-verified

139// normalize 把模型常见的标签变体(<tool_calls>、<tool call> 等)统一为
140// <tool_call> / </tool_call>。
141func normalize(s string) string {
142 s = toolCallsOpenRe.ReplaceAllString(s, StartTag)
143 s = toolCallsCloseRe.ReplaceAllString(s, EndTag)
144 s = toolCallAltOpenRe.ReplaceAllString(s, StartTag)
145 s = toolCallAltCloseRe.ReplaceAllString(s, EndTag)
146 return s
147}
148
149var (
150 toolCallsOpenRe = regexp.MustCompile(`(?i)<tool_calls>`)

Callers 1

FeedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected