MCPcopy Create free account
hub / github.com/astercloud/aster / analyzeSections

Method analyzeSections

pkg/agent/prompt_optimizer.go:253–267  ·  view source on GitHub ↗

analyzeSections 分析段落

(prompt string)

Source from the content-addressed store, hash-verified

251
252// analyzeSections 分析段落
253func (c *EnhancedPromptCompressor) analyzeSections(prompt string) []string {
254 // 按双换行分割
255 sections := strings.Split(prompt, "\n\n")
256
257 // 过滤空段落
258 var result []string
259 for _, s := range sections {
260 trimmed := strings.TrimSpace(s)
261 if trimmed != "" {
262 result = append(result, trimmed)
263 }
264 }
265
266 return result
267}
268
269// scoreSections 评分段落
270func (c *EnhancedPromptCompressor) scoreSections(sections []string, preserveSections []string) []ScoredSection {

Callers 1

compressSimpleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected