This commit is contained in:
2025-12-04 13:03:28 +08:00
parent edeaff8a9e
commit 1000c635da
3 changed files with 15 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ export class AIUtils {
* @param str 包含 JSON 的字符串
* @returns 解析后的对象或 null
*/
extractJsonFromMarkdown(str: string): any | null {
static extractJsonFromMarkdown(str: string): any | null {
// Try to extract JSON from ```json ... ```
const jsonRegex = /```json\s*([\s\S]*?)\s*```/;
const match = str.match(jsonRegex);