MCPcopy Index your code
hub / github.com/mudler/LocalAI / NewChatMsgParser

Function NewChatMsgParser

pkg/functions/iterative_parser.go:50–61  ·  view source on GitHub ↗

NewChatMsgParser creates a new iterative parser

(input string, isPartial bool)

Source from the content-addressed store, hash-verified

48
49// NewChatMsgParser creates a new iterative parser
50func NewChatMsgParser(input string, isPartial bool) *ChatMsgParser {
51 // Generate a unique healing marker (similar to llama.cpp)
52 healingMarker := generateHealingMarker(input)
53
54 return &ChatMsgParser{
55 input: input,
56 isPartial: isPartial,
57 pos: 0,
58 healingMarker: healingMarker,
59 toolCalls: make([]FuncCallResults, 0),
60 }
61}
62
63// generateHealingMarker generates a unique marker that doesn't appear in the input
64func generateHealingMarker(input string) string {

Callers 4

parse_test.goFile · 0.85
ParseJSONIterativeFunction · 0.85
ParseXMLIterativeFunction · 0.85

Calls 1

generateHealingMarkerFunction · 0.85

Tested by

no test coverage detected