Skip to content
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

[fix] better json parsing in openai.py to be compatible with more GPTs #913

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leohearts
Copy link

Try the best to get an json object from GPT responses, since other gpt apis (here as moonshot) may not support json mode.

AutoBangumi     | [2025-02-03 22:14:20] WARNING:  Cannot parse result ```json
AutoBangumi     | {
AutoBangumi     |   "title_en": "The Weakest Skill 'Master of Skills' ~About the Skill Fruit That Can Be Eaten Infinitely (Death If Eaten Once)~",
AutoBangumi     |   "title_zh": "最弱技能《果实大师》~关于能无限食用技能果实(吃了就会死)这件事~",
AutoBangumi     |   "title_jp": "",
AutoBangumi     |   "season": 1,
AutoBangumi     |   "season_raw": "",
AutoBangumi     |   "episode": 1,
AutoBangumi     |   "sub": "CHT",
AutoBangumi     |   "group": "",
AutoBangumi     |   "resolution": "1080P",
AutoBangumi     |   "source": "AVC AAC"
AutoBangumi     | }
AutoBangumi     | ``` as python dict.

Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auto-bangumi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 2:22pm

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.

1 participant