cherry-studio/src/renderer/traceWindow.html
SuYao 84e78560f4
refactor: streamline system prompt handling and introduce built-in tools (#7714)
* refactor: streamline system prompt handling and introduce built-in tools

- Removed the static SYSTEM_PROMPT_THRESHOLD from BaseApiClient and replaced it with a constant in constant.ts.
- Updated API clients (AnthropicAPIClient, GeminiAPIClient, OpenAIApiClient, OpenAIResponseAPIClient) to simplify system prompt logic by eliminating unnecessary checks and using new utility functions for prompt building.
- Introduced built-in tools functionality, including a new 'think' tool, to enhance the tool usage experience.
- Refactored ApiService to integrate built-in tools and adjust system prompt modifications accordingly.
- Added utility functions for managing built-in tools in mcp-tools.ts and created a new tools index for better organization.

* refactor(tests): update prompt tests to use new buildSystemPromptWithTools function

- Renamed the function used in prompt tests from buildSystemPrompt to buildSystemPromptWithTools to reflect recent changes in prompt handling.
- Adjusted test cases to ensure compatibility with the updated function, maintaining the integrity of user prompt handling.

* refactor(ApiService, mcp-tools, prompt): enhance tool usage and prompt handling

- Updated ApiService to improve system prompt construction based on tool usage mode, ensuring clearer logic for tool integration.
- Enhanced mcp-tools with a new response structure for the 'think' tool, allowing for better handling of tool responses.
- Expanded prompt utility functions to include detailed instructions for using the 'think' tool, improving user guidance.
- Refactored tests to validate new prompt building logic and tool integration, ensuring robust functionality across scenarios.

* fix: enhance prompt

* feat(McpToolChunkMiddleware): enhance tool call handling with built-in tool support

- Added support for built-in tools in the parseAndCallTools function, allowing for conditional tool invocation based on tool type.
- Implemented a check to return early if the tool call response is null, improving error handling.
2025-07-23 17:27:39 +08:00

42 lines
817 B
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
#root {
flex: 1 1 auto;
background: var(--trace-bg);
}
footer {
height: 36px;
text-align: center;
font-size: 12px;
color: grey;
background: var(--trace-header-bg);
flex-shrink: 0;
line-height: 36px;
position: relative;
z-index: 1;
}
footer p {
margin: 0;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/trace/traceWindow.tsx"></script>
</body>
</html>