mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-13 23:45:08 -05:00
## CHANGES - Add suppress-think flag to hide thinking blocks - Configure customizable start and end thinking tags - Strip thinking content from final response output - Update streaming logic to respect suppress-think setting - Add YAML configuration support for thinking options - Implement StripThinkBlocks utility function for content filtering - Add comprehensive tests for thinking suppression functionality
20 lines
473 B
Go
20 lines
473 B
Go
package domain
|
|
|
|
import "testing"
|
|
|
|
func TestStripThinkBlocks(t *testing.T) {
|
|
input := "<think>internal</think>\n\nresult"
|
|
got := StripThinkBlocks(input, "<think>", "</think>")
|
|
if got != "result" {
|
|
t.Errorf("expected %q, got %q", "result", got)
|
|
}
|
|
}
|
|
|
|
func TestStripThinkBlocksCustomTags(t *testing.T) {
|
|
input := "[[t]]hidden[[/t]] visible"
|
|
got := StripThinkBlocks(input, "[[t]]", "[[/t]]")
|
|
if got != "visible" {
|
|
t.Errorf("expected %q, got %q", "visible", got)
|
|
}
|
|
}
|