Support Gradio 6 Chatbot format and multi-output spaces like tdecae-personal-chatbot
This commit is contained in:
@@ -298,6 +298,13 @@ func TestParseGradioStreamOutput(t *testing.T) {
|
||||
if !frame7.OK || frame7.Content != "Mocked answer" || frame7.Reasoning != "Mocked reasoning" || len(frame7.ToolCalls) != 0 {
|
||||
t.Errorf("unexpected frame7: %+v", frame7)
|
||||
}
|
||||
|
||||
// 8. Gradio 6 Chatbot multi-output format with TextMessage list
|
||||
g6Raw := `["", [{"role": "user", "content": [{"text": "weather in Tokyo?", "type": "text"}]}, {"role": "assistant", "content": [{"text": "<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Tokyo\"}}\n</tool_call>", "type": "text"}]}]]`
|
||||
frame8 := ParseGradioStreamOutput(g6Raw)
|
||||
if !frame8.OK || len(frame8.ToolCalls) != 1 || frame8.ToolCalls[0].Function.Name != "get_weather" {
|
||||
t.Errorf("unexpected frame8: %+v", frame8)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHunyuan3BuildPayload(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user