perf(*): 创作工作台 - 优化首页按需加载与画布交互并修复历史迁移冲突
This commit is contained in:
1 parent
165b4443ab
commit
58f01d1eb6
107 files changed
+3025
-1089
No files matched your search
@@ -489,6 +489,25 @@ data: [DONE]
|
||||
}
|
||||
}
|
||||
|
||||
func TestTextThinkingOptionsAndReasoningParsing(t *testing.T) {
|
||||
input := canvasGenerationInput{TextOptions: canvasTextOptions{Thinking: true}}
|
||||
responsesBody := map[string]interface{}{}
|
||||
applyTextThinking(responsesBody, input, "responses")
|
||||
reasoning, _ := responsesBody["reasoning"].(map[string]interface{})
|
||||
if reasoning["effort"] != "medium" || reasoning["summary"] != "auto" {
|
||||
t.Fatalf("responses reasoning options = %#v", reasoning)
|
||||
}
|
||||
chatBody := map[string]interface{}{}
|
||||
applyTextThinking(chatBody, input, "chat-completion")
|
||||
if chatBody["reasoning_effort"] != "medium" {
|
||||
t.Fatalf("chat reasoning options = %#v", chatBody)
|
||||
}
|
||||
result, err := parseAgentToolPayload(map[string]interface{}{"choices": []interface{}{map[string]interface{}{"message": map[string]interface{}{"content": "正文", "reasoning_content": "推理摘要"}}}}, "chat-completion")
|
||||
if err != nil || result["text"] != "正文" || result["reasoning"] != "推理摘要" {
|
||||
t.Fatalf("parsed reasoning result = %#v, err = %v", result, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStreamingAgentParserReassemblesChatToolCallsAcrossChunks(t *testing.T) {
|
||||
var deltas strings.Builder
|
||||
parser := newStreamingAgentParser("chat-completion", func(delta string) {
|
||||
|
||||
Reference in new issue
Block a user