-
Notifications
You must be signed in to change notification settings - Fork 2
feat(OCR): 添加基于大模型的OCR作为PaddleOCR的替代方案 #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
9c45b75
fd02e16
33c89b3
b8431f8
8505808
0ce76ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,17 @@ static Env() { | |
| } | ||
| try { | ||
| var config = JsonConvert.DeserializeObject<Config>(File.ReadAllText(Path.Combine(WorkDir, "Config.json"))); | ||
| BaseUrl = config.BaseUrl; | ||
| IsLocalAPI = config.IsLocalAPI; | ||
| EnableLocalBotAPI = config.EnableLocalBotAPI; | ||
| TelegramBotApiId = config.TelegramBotApiId; | ||
| TelegramBotApiHash = config.TelegramBotApiHash; | ||
| LocalBotApiPort = config.LocalBotApiPort; | ||
| if (config.EnableLocalBotAPI) { | ||
| BaseUrl = $"http://127.0.0.1:{config.LocalBotApiPort}"; | ||
| IsLocalAPI = true; | ||
| } else { | ||
| BaseUrl = config.BaseUrl; | ||
| IsLocalAPI = config.IsLocalAPI; | ||
| } | ||
| BotToken = config.BotToken; | ||
| AdminId = config.AdminId; | ||
| EnableAutoOCR = config.EnableAutoOCR; | ||
|
|
@@ -44,6 +53,10 @@ static Env() { | |
| public static readonly long AdminId; | ||
| public static readonly bool EnableAutoOCR; | ||
| public static readonly bool EnableAutoASR; | ||
| public static readonly bool EnableLocalBotAPI; | ||
| public static readonly string TelegramBotApiId; | ||
| public static readonly string TelegramBotApiHash; | ||
| public static readonly int LocalBotApiPort; | ||
| public static readonly string WorkDir; | ||
| public static readonly int TaskDelayTimeout; | ||
| public static readonly bool SameServer; | ||
|
|
@@ -70,6 +83,10 @@ public class Config { | |
| public bool EnableAutoASR { get; set; } = false; | ||
| //public string WorkDir { get; set; } = "/data/TelegramSearchBot"; | ||
| public bool IsLocalAPI { get; set; } = false; | ||
| public bool EnableLocalBotAPI { get; set; } = false; | ||
| public string TelegramBotApiId { get; set; } | ||
| public string TelegramBotApiHash { get; set; } | ||
| public int LocalBotApiPort { get; set; } = 8081; | ||
|
Comment on lines
+86
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if documentation exists and mentions these new config options
fd -t f -e md . Docs/ 2>/dev/null | head -5
rg -l "EnableLocalBotAPI|TelegramBotApiId|TelegramBotApiHash|LocalBotApiPort" Docs/ 2>/dev/null || echo "No documentation found for new config fields"Repository: ModerRAS/TelegramSearchBot Length of output: 268 Update documentation in New persistent configuration fields ( 🤖 Prompt for AI Agents |
||
| public bool SameServer { get; set; } = false; | ||
| public int TaskDelayTimeout { get; set; } = 1000; | ||
| public string OllamaModelName { get; set; } = "qwen2.5:72b-instruct-q2_K"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy step may fail if both cache miss and build fail.
The copy step runs unconditionally, but
telegram-bot-api-bin\telegram-bot-api.exeonly exists if the cache was hit OR the build succeeded. If the build step fails (e.g., network issue cloning, CMake error), this step will fail the workflow.Consider adding an
ifcondition or combining with the build step.🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents