classifier

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SegmentInfo

type SegmentInfo struct {
	Label    string // "prompt" | "code" | "log"
	Text     string // 段文本
	TempPath string // 存储到 @temp 的路径(code/log),prompt 段为空
}

SegmentInfo 分类段信息,供调用方持久化。

func ClassifyAndTransform

func ClassifyAndTransform(session *structs.Chats, msg string) (string, []SegmentInfo, error)

ClassifyAndTransform 对用户消息进行语义分类并转换:

  • prompt 段:保留原文本
  • code 段:保存到 @temp/prompt/code-{id},原文本后追加 [path:@temp/prompt/code-{id}]
  • log 段:保存到 @temp/prompt/log-{id},整个替换为 [path:@temp/prompt/log-{id}]

code 和 log 段存储时不创建 Traces 记录,不会自动注入 LLM 上下文。 返回转换后的消息文本和段信息列表。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL