Documentation
¶
Overview ¶
LLM facilities.
Index ¶
- func EscapeMarkdownLatex(markdown string) string
- func MustTagExtractor(tag string) tagContentExtractor
- func ParseLLMJsonAs[T any](s string) (T, error)
- func ParseThink(m string) (thought string, answer string)
- func PrettifyMarkdownDoc(markdown string) string
- func TagExtractor(tag string) (tagContentExtractor, error)
- func ToCsvTxt(srcPath string, separator ...string) (string, error)
- type MsgDelta
- type SSEAction
- type SSEPiper
- func (s *SSEPiper[D]) Listen() func(e sse.Event) (stop bool, err error)
- func (s *SSEPiper[D]) OnAction(f func(s SSEAction) error)
- func (s *SSEPiper[D]) OnData(f func(d D) error)
- func (s *SSEPiper[D]) OnMessage(f func(delta string, accumulated string) error)
- func (s *SSEPiper[D]) PushAction(inb interface{ ... }, m SSEAction)
- func (s *SSEPiper[D]) PushData(inb interface{ ... }, m D)
- func (s *SSEPiper[D]) PushMsg(inb interface{ ... }, m string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeMarkdownLatex ¶ added in v0.4.9
func MustTagExtractor ¶
func MustTagExtractor(tag string) tagContentExtractor
Extract content in <tag>...</tag>.
func ParseLLMJsonAs ¶ added in v0.4.3
func ParseThink ¶ added in v0.4.2
Parse </think> tag.
thought contains anything before the </think> tag, including the </think> tag itself.
answer contains anything after the </think> tag.
func PrettifyMarkdownDoc ¶ added in v0.4.9
func TagExtractor ¶
Extract content in <tag>${content}</tag>.
The content between the tags must not include xml closing tags, e.g., </xxx>.
Types ¶
type MsgDelta ¶
type MsgDelta struct {
// contains filtered or unexported fields
}
func NewMsgDelta ¶
func NewMsgDelta() *MsgDelta
type SSEAction ¶ added in v0.4.11
func (SSEAction) UnmarshalParam ¶ added in v0.4.11
type SSEPiper ¶ added in v0.4.11
type SSEPiper[D any] struct { // contains filtered or unexported fields }
func NewSSEPiper ¶ added in v0.4.11
func (*SSEPiper[D]) PushAction ¶ added in v0.4.11
Click to show internal directories.
Click to hide internal directories.