NewChatMsgParser creates a new iterative parser
(input string, isPartial bool)
| 48 | |
| 49 | // NewChatMsgParser creates a new iterative parser |
| 50 | func 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 |
| 64 | func generateHealingMarker(input string) string { |
no test coverage detected