Add prompt-based picture command
This commit is contained in:
@@ -90,6 +90,20 @@ func TestParseCommand(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPictureGenerationInstruction(t *testing.T) {
|
||||
instruction := pictureGenerationInstruction("generate a blue cube")
|
||||
for _, want := range []string{"Telegram /pic command", "built-in image generation", "generate a blue cube"} {
|
||||
if !strings.Contains(instruction, want) {
|
||||
t.Fatalf("instruction missing %q in %q", want, instruction)
|
||||
}
|
||||
}
|
||||
for _, unwanted := range []string{"/home", "repo/playground"} {
|
||||
if strings.Contains(instruction, unwanted) {
|
||||
t.Fatalf("instruction contains non-portable text %q: %q", unwanted, instruction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSplitAssistantMessageSegmentsWithPhotoDirective(t *testing.T) {
|
||||
photoPath := filepath.Join(string(filepath.Separator), "workspace", "photo.jpg")
|
||||
text := fmt.Sprintf("before\n<!-- telegram-photo {\"path\":%q,\"caption\":\"hello\"} -->\nafter", photoPath)
|
||||
|
||||
Reference in New Issue
Block a user