Skip to content

feat. More OpenAI format API support, Sound Effect System#6

Open
orangeZSCB wants to merge 12 commits intoAkagawaTsurunaki:mainfrom
orangeZSCB:main
Open

feat. More OpenAI format API support, Sound Effect System#6
orangeZSCB wants to merge 12 commits intoAkagawaTsurunaki:mainfrom
orangeZSCB:main

Conversation

@orangeZSCB
Copy link
Copy Markdown
Contributor

如题,我把 OpenAI 格式的 API 适配给做了,现在你可以使用任何一家的支持 OpenAI 格式 API 的 api provider 来用多模态大模型来用 ocr 模块啦!

rt,僅需在 system_prompt 合適位置中添加以下内容即可
```
      ## 音效系统
      你可以在回答中任意位置插入音效标记,格式为:`{"sound_effect_id": "xxx"}`
      音效会在对应位置播放,适用于增强表达效果。例如:"哈哈{"sound_effect_id": "bruh"}你真逗!"

      可用的音效 ID:
      (填寫你的 resources/static/sounds/effect 目錄下不含後綴的 mp3 文件名,以逗號和空格分隔。)

      使用建议:
      - **在需要强调或搞笑的时候使用**
      - **非必要不玩音效,只有被观众触发了才要放音效**
      - 音效会在对应位置播放,不影响文字内容
```
@orangeZSCB orangeZSCB changed the title feat. More OpenAI format API support (img_cap, ocr, vid_cap) feat. More OpenAI format API support, Sound Effect System Jan 20, 2026
@orangeZSCB
Copy link
Copy Markdown
Contributor Author

(添加 feature)
rt,僅需在 system_prompt 合適位置中添加以下内容即可

      ## 音效系统
      你可以在回答中任意位置插入音效标记,格式为:`{"sound_effect_id": "xxx"}`
      音效会在对应位置播放,适用于增强表达效果。例如:"哈哈{"sound_effect_id": "bruh"}你真逗!"

      可用的音效 ID:
      (填寫你的 resources/static/sounds/effect 目錄下不含後綴的 mp3 文件名,以逗號和空格分隔。)

      使用建议:
      - **在需要强调或搞笑的时候使用**
      - **非必要不玩音效,只有被观众触发了才要放音效**
      - 音效会在对应位置播放,不影响文字内容

@AkagawaTsurunaki
Copy link
Copy Markdown
Owner

@orangeZSCB,感谢您的贡献,现在代码审查后进行了如下的更改:

  1. Other_OpenAI_Format 更名 OtherOpenAIFormat
  2. openai_ocr.py 中移除了不优雅的 markdown 标记判断,改用正则表达式;
  3. openai_ocr.pyRegionResult 没有遵循入参格式,已经修改;
  4. 应该使用 loguru 而不是 logging
  5. 将音效模块放到 services/sound_effect 文件夹下;
  6. 更新了文档。

然而,由于我没有 OpenAI 相关的测试账号,如果您能够对现在修改后的代码进行测试,就可以合并到 main 分支中了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants