fix: update terminology from 'multimodal recognition' to 'OCR text recognition'
This commit is contained in:
parent
95d8f03c48
commit
ff2d2bf290
346
worker.js
346
worker.js
@ -267,7 +267,8 @@ async function recognizeImage(token, imageId, request) {
|
|||||||
console.error('Prompt解码错误:', error);
|
console.error('Prompt解码错误:', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultPrompt = '请识别图片中的内容,注意以下要求:\n' +
|
const defaultPrompt =
|
||||||
|
'不要输出任何额外的解释或说明,禁止输出例如:识别内容、以上内容已严格按照要求进行格式化和转换等相关无意义的文字!' + '请识别图片中的内容,注意以下要求:\n' +
|
||||||
'对于数学公式和普通文本:\n' +
|
'对于数学公式和普通文本:\n' +
|
||||||
'1. 所有数学公式和数学符号都必须使用标准的LaTeX格式\n' +
|
'1. 所有数学公式和数学符号都必须使用标准的LaTeX格式\n' +
|
||||||
'2. 行内公式使用单个$符号包裹,如:$x^2$\n' +
|
'2. 行内公式使用单个$符号包裹,如:$x^2$\n' +
|
||||||
@ -281,8 +282,7 @@ async function recognizeImage(token, imageId, request) {
|
|||||||
'2. 忽略干扰线和噪点\n' +
|
'2. 忽略干扰线和噪点\n' +
|
||||||
'3. 注意区分相似字符,如0和O、1和l、2和Z等\n' +
|
'3. 注意区分相似字符,如0和O、1和l、2和Z等\n' +
|
||||||
'4. 验证码通常为4-6位字母数字组合\n\n' +
|
'4. 验证码通常为4-6位字母数字组合\n\n' +
|
||||||
'不要输出任何额外的解释或说明';
|
'';
|
||||||
|
|
||||||
const response = await fetch('https://chat.qwenlm.ai/api/chat/completions', {
|
const response = await fetch('https://chat.qwenlm.ai/api/chat/completions', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@ -1074,205 +1074,205 @@ function getHTML() {
|
|||||||
' justify-content: center;',
|
' justify-content: center;',
|
||||||
' align-items: center;',
|
' align-items: center;',
|
||||||
' }',
|
' }',
|
||||||
' .footer-content {',
|
' .footer-content {',
|
||||||
' text-align: center;',
|
' text-align: center;',
|
||||||
' width: 100%;',
|
' width: 100%;',
|
||||||
' }',
|
' }',
|
||||||
' .powered-by {',
|
' .powered-by {',
|
||||||
' color: #7f8c8d;',
|
' color: #7f8c8d;',
|
||||||
' font-size: 0.9rem;',
|
' font-size: 0.9rem;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .powered-by a {',
|
' .powered-by a {',
|
||||||
' color: #3498db;',
|
' color: #3498db;',
|
||||||
' text-decoration: none;',
|
' text-decoration: none;',
|
||||||
' transition: color 0.3s ease;',
|
' transition: color 0.3s ease;',
|
||||||
' font-weight: 500;',
|
' font-weight: 500;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .powered-by a:hover {',
|
' .powered-by a:hover {',
|
||||||
' color: #2980b9;',
|
' color: #2980b9;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .powered-by {',
|
' .powered-by {',
|
||||||
' color: #7f8c8d;',
|
' color: #7f8c8d;',
|
||||||
' font-size: 0.9rem;',
|
' font-size: 0.9rem;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .powered-by a {',
|
' .powered-by a {',
|
||||||
' color: #3498db;',
|
' color: #3498db;',
|
||||||
' text-decoration: none;',
|
' text-decoration: none;',
|
||||||
' transition: color 0.3s ease;',
|
' transition: color 0.3s ease;',
|
||||||
' font-weight: 500;',
|
' font-weight: 500;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .powered-by a:hover {',
|
' .powered-by a:hover {',
|
||||||
' color: #2980b9;',
|
' color: #2980b9;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' /* 输入控件组样式 */',
|
' /* 输入控件组样式 */',
|
||||||
' .input-controls {',
|
' .input-controls {',
|
||||||
' margin-top: 15px;',
|
' margin-top: 15px;',
|
||||||
' width: 100%;',
|
' width: 100%;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .button-group {',
|
' .button-group {',
|
||||||
' display: flex;',
|
' display: flex;',
|
||||||
' gap: 10px;',
|
' gap: 10px;',
|
||||||
' margin-top: 10px;',
|
' margin-top: 10px;',
|
||||||
' justify-content: center;',
|
' justify-content: center;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #urlInput {',
|
' #urlInput {',
|
||||||
' width: 100%;',
|
' width: 100%;',
|
||||||
' padding: 10px;',
|
' padding: 10px;',
|
||||||
' border: 1px solid #dcdde1;',
|
' border: 1px solid #dcdde1;',
|
||||||
' border-radius: 8px;',
|
' border-radius: 8px;',
|
||||||
' resize: none;',
|
' resize: none;',
|
||||||
' font-size: 14px;',
|
' font-size: 14px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .github-link {',
|
' .github-link {',
|
||||||
' position: fixed;',
|
' position: fixed;',
|
||||||
' right: 150px;',
|
' right: 150px;',
|
||||||
' top: 20px;',
|
' top: 20px;',
|
||||||
' background: #333;',
|
' background: #333;',
|
||||||
' color: white;',
|
' color: white;',
|
||||||
' border: none;',
|
' border: none;',
|
||||||
' padding: 10px;',
|
' padding: 10px;',
|
||||||
' border-radius: 50%;',
|
' border-radius: 50%;',
|
||||||
' cursor: pointer;',
|
' cursor: pointer;',
|
||||||
' z-index: 1001;',
|
' z-index: 1001;',
|
||||||
' width: 40px;',
|
' width: 40px;',
|
||||||
' height: 40px;',
|
' height: 40px;',
|
||||||
' display: flex;',
|
' display: flex;',
|
||||||
' align-items: center;',
|
' align-items: center;',
|
||||||
' justify-content: center;',
|
' justify-content: center;',
|
||||||
' transition: background 0.3s ease;',
|
' transition: background 0.3s ease;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .github-link:hover {',
|
' .github-link:hover {',
|
||||||
' background: #24292e;',
|
' background: #24292e;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .github-icon {',
|
' .github-icon {',
|
||||||
' width: 24px;',
|
' width: 24px;',
|
||||||
' height: 24px;',
|
' height: 24px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .cookie-input-container {',
|
' .cookie-input-container {',
|
||||||
' margin-bottom: 15px;',
|
' margin-bottom: 15px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #cookieInput {',
|
' #cookieInput {',
|
||||||
' width: 100%;',
|
' width: 100%;',
|
||||||
' padding: 12px;',
|
' padding: 12px;',
|
||||||
' border: 2px solid #e9ecef;',
|
' border: 2px solid #e9ecef;',
|
||||||
' border-radius: 8px;',
|
' border-radius: 8px;',
|
||||||
' font-size: 0.95rem;',
|
' font-size: 0.95rem;',
|
||||||
' resize: vertical;',
|
' resize: vertical;',
|
||||||
' min-height: 120px;',
|
' min-height: 120px;',
|
||||||
' font-family: monospace;',
|
' font-family: monospace;',
|
||||||
' line-height: 1.4;',
|
' line-height: 1.4;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #cookieInput:focus {',
|
' #cookieInput:focus {',
|
||||||
' outline: none;',
|
' outline: none;',
|
||||||
' border-color: #3498db;',
|
' border-color: #3498db;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .cookie-info {',
|
' .cookie-info {',
|
||||||
' background: #f8f9fa;',
|
' background: #f8f9fa;',
|
||||||
' padding: 12px;',
|
' padding: 12px;',
|
||||||
' border-radius: 8px;',
|
' border-radius: 8px;',
|
||||||
' margin-bottom: 15px;',
|
' margin-bottom: 15px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .cookie-info p {',
|
' .cookie-info p {',
|
||||||
' margin: 0;',
|
' margin: 0;',
|
||||||
' color: #2c3e50;',
|
' color: #2c3e50;',
|
||||||
' font-size: 0.9rem;',
|
' font-size: 0.9rem;',
|
||||||
' margin-bottom: 8px;', // 添加底部间距
|
' margin-bottom: 8px;', // 添加底部间距
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .cookie-info p:last-child {',
|
' .cookie-info p:last-child {',
|
||||||
' margin-bottom: 0;', // 最后一个p元素不需要底部间距
|
' margin-bottom: 0;', // 最后一个p元素不需要底部间距
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .token-expiry {',
|
' .token-expiry {',
|
||||||
' color: #7f8c8d;',
|
' color: #7f8c8d;',
|
||||||
' font-size: 0.85rem;',
|
' font-size: 0.85rem;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .token-expiry.expired {',
|
' .token-expiry.expired {',
|
||||||
' color: #e74c3c;',
|
' color: #e74c3c;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #currentTokenDisplay {',
|
' #currentTokenDisplay {',
|
||||||
' color: #3498db;',
|
' color: #3498db;',
|
||||||
' font-family: monospace;',
|
' font-family: monospace;',
|
||||||
' word-break: break-all;',
|
' word-break: break-all;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
// 添加获取cookie按钮样式
|
// 添加获取cookie按钮样式
|
||||||
' .get-cookie-link {',
|
' .get-cookie-link {',
|
||||||
' position: fixed;',
|
' position: fixed;',
|
||||||
' left: 150px;', // 放在github图标左边
|
' left: 150px;', // 放在github图标左边
|
||||||
' top: 22px;',
|
' top: 22px;',
|
||||||
' background: #2ecc71;', // 使用不同的颜色区分
|
' background: #2ecc71;', // 使用不同的颜色区分
|
||||||
' color: white;',
|
' color: white;',
|
||||||
' border: none;',
|
' border: none;',
|
||||||
' padding: 8px 15px;',
|
' padding: 8px 15px;',
|
||||||
' border-radius: 5px;',
|
' border-radius: 5px;',
|
||||||
' cursor: pointer;',
|
' cursor: pointer;',
|
||||||
' z-index: 1001;',
|
' z-index: 1001;',
|
||||||
' text-decoration: none;',
|
' text-decoration: none;',
|
||||||
' font-size: 14px;',
|
' font-size: 14px;',
|
||||||
' transition: background 0.3s ease;',
|
' transition: background 0.3s ease;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .get-cookie-link:hover {',
|
' .get-cookie-link:hover {',
|
||||||
' background: #27ae60;',
|
' background: #27ae60;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .advanced-mode-toggle {',
|
' .advanced-mode-toggle {',
|
||||||
' display: flex;',
|
' display: flex;',
|
||||||
' align-items: center;',
|
' align-items: center;',
|
||||||
' margin-bottom: 15px;',
|
' margin-bottom: 15px;',
|
||||||
' padding: 10px;',
|
' padding: 10px;',
|
||||||
' background: #f8f9fa;',
|
' background: #f8f9fa;',
|
||||||
' border-radius: 8px;',
|
' border-radius: 8px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .advanced-mode-toggle input[type="checkbox"] {',
|
' .advanced-mode-toggle input[type="checkbox"] {',
|
||||||
' margin-right: 10px;',
|
' margin-right: 10px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .prompt-container {',
|
' .prompt-container {',
|
||||||
' display: none;', // 默认隐藏
|
' display: none;', // 默认隐藏
|
||||||
' margin-bottom: 15px;',
|
' margin-bottom: 15px;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' .prompt-container.show {',
|
' .prompt-container.show {',
|
||||||
' display: block;',
|
' display: block;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #promptInput {',
|
' #promptInput {',
|
||||||
' width: 100%;',
|
' width: 100%;',
|
||||||
' padding: 12px;',
|
' padding: 12px;',
|
||||||
' border: 2px solid #e9ecef;',
|
' border: 2px solid #e9ecef;',
|
||||||
' border-radius: 8px;',
|
' border-radius: 8px;',
|
||||||
' font-size: 0.95rem;',
|
' font-size: 0.95rem;',
|
||||||
' resize: vertical;',
|
' resize: vertical;',
|
||||||
' min-height: 120px;',
|
' min-height: 120px;',
|
||||||
' font-family: monospace;',
|
' font-family: monospace;',
|
||||||
' line-height: 1.4;',
|
' line-height: 1.4;',
|
||||||
' }',
|
' }',
|
||||||
|
|
||||||
' #promptInput:focus {',
|
' #promptInput:focus {',
|
||||||
' outline: none;',
|
' outline: none;',
|
||||||
' border-color: #3498db;',
|
' border-color: #3498db;',
|
||||||
' }',
|
' }',
|
||||||
'</style>',
|
'</style>',
|
||||||
'</head>',
|
'</head>',
|
||||||
'<body>',
|
'<body>',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user