mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-13 12:47:41 +08:00
feat: Implement admin settings UI, enhance admin authentication with password hashing, and add new streaming runtime logic for Claude and OpenAI adapters with extensive compatibility tests.
This commit is contained in:
8
tests/compat/expected/sse_fragments_append.json
Normal file
8
tests/compat/expected/sse_fragments_append.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parts": [
|
||||
{"text": "思考中", "type": "thinking"},
|
||||
{"text": "结论", "type": "text"}
|
||||
],
|
||||
"finished": false,
|
||||
"new_type": "text"
|
||||
}
|
||||
5
tests/compat/expected/sse_nested_finished.json
Normal file
5
tests/compat/expected/sse_nested_finished.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"parts": [],
|
||||
"finished": true,
|
||||
"new_type": "text"
|
||||
}
|
||||
8
tests/compat/expected/sse_split_tool_json.json
Normal file
8
tests/compat/expected/sse_split_tool_json.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parts": [
|
||||
{"text": "{\"", "type": "text"},
|
||||
{"text": "tool_calls\":[{\"name\":\"read_file\",\"input\":{\"path\":\"README.MD\"}}]}", "type": "text"}
|
||||
],
|
||||
"finished": false,
|
||||
"new_type": "text"
|
||||
}
|
||||
7
tests/compat/expected/token_cases.json
Normal file
7
tests/compat/expected/token_cases.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"cases": [
|
||||
{"name": "ascii_short", "tokens": 1},
|
||||
{"name": "cjk", "tokens": 3},
|
||||
{"name": "mixed", "tokens": 4}
|
||||
]
|
||||
}
|
||||
3
tests/compat/expected/toolcalls_fenced_json.json
Normal file
3
tests/compat/expected/toolcalls_fenced_json.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"calls": []
|
||||
}
|
||||
5
tests/compat/expected/toolcalls_unknown_name.json
Normal file
5
tests/compat/expected/toolcalls_unknown_name.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"calls": [
|
||||
{"name": "unknown_tool", "input": {"x": 1}}
|
||||
]
|
||||
}
|
||||
12
tests/compat/fixtures/sse_chunks/fragments_append.json
Normal file
12
tests/compat/fixtures/sse_chunks/fragments_append.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"chunk": {
|
||||
"p": "response/fragments",
|
||||
"o": "APPEND",
|
||||
"v": [
|
||||
{"type": "THINK", "content": "思考中"},
|
||||
{"type": "RESPONSE", "content": "结论"}
|
||||
]
|
||||
},
|
||||
"thinking_enabled": true,
|
||||
"current_type": "thinking"
|
||||
}
|
||||
10
tests/compat/fixtures/sse_chunks/nested_finished.json
Normal file
10
tests/compat/fixtures/sse_chunks/nested_finished.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"chunk": {
|
||||
"p": "response",
|
||||
"v": [
|
||||
{"p": "status", "v": "FINISHED"}
|
||||
]
|
||||
},
|
||||
"thinking_enabled": false,
|
||||
"current_type": "text"
|
||||
}
|
||||
11
tests/compat/fixtures/sse_chunks/split_tool_json.json
Normal file
11
tests/compat/fixtures/sse_chunks/split_tool_json.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"chunk": {
|
||||
"p": "response",
|
||||
"v": [
|
||||
{"p": "response/content", "v": "{\""},
|
||||
{"p": "response/content", "v": "tool_calls\":[{\"name\":\"read_file\",\"input\":{\"path\":\"README.MD\"}}]}"}
|
||||
]
|
||||
},
|
||||
"thinking_enabled": false,
|
||||
"current_type": "text"
|
||||
}
|
||||
7
tests/compat/fixtures/token_cases.json
Normal file
7
tests/compat/fixtures/token_cases.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"cases": [
|
||||
{"name": "ascii_short", "text": "abcd"},
|
||||
{"name": "cjk", "text": "你好世界"},
|
||||
{"name": "mixed", "text": "Hello 你好世界"}
|
||||
]
|
||||
}
|
||||
4
tests/compat/fixtures/toolcalls/fenced_json.json
Normal file
4
tests/compat/fixtures/toolcalls/fenced_json.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"text": "```json\n{\"tool_calls\":[{\"name\":\"read_file\",\"input\":{\"path\":\"README.MD\"}}]}\n```",
|
||||
"tool_names": ["read_file"]
|
||||
}
|
||||
4
tests/compat/fixtures/toolcalls/unknown_name.json
Normal file
4
tests/compat/fixtures/toolcalls/unknown_name.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"text": "{\"tool_calls\":[{\"name\":\"unknown_tool\",\"input\":{\"x\":1}}]}",
|
||||
"tool_names": ["read_file"]
|
||||
}
|
||||
Reference in New Issue
Block a user