AI summary of summaries can throw an exception

Open
#263 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
ai, backend

Research direction

Start with the gene-summary response parsing path identified by the org.json stack trace and reproduce the malformed response shown in the issue. Check how missing dataset_ids and nonsensical topic content are handled; done should include a decided behavior for invalid AI responses and coverage for the reported failure.

Written by the indexing model from the issue text.

Description

bug

Response doesn't follow schema! No dataset_ids!

java.lang.RuntimeException: Error parsing JSON response for gene summary.  Raw response string:
{"headline":"Expression Patterns Across Developmental Stages in <i>Plasmodium falciparum</i>","one_paragraph_summary":"<strong>Overview of gene expressi
on across experiments:</strong> <ul><li>Numerous transcriptomic studies demonstrate this gene's significant stage-specific expression during the intraer
ythrocytic development cycle of <i>Plasmodium falciparum</i>.</li><li>High expression levels are often observed during early stages like rings and early
 trophozoites, with some experiments highlighting peaks during the trophozoite or schizont stages depending on assay type and condition.</li><li>In spor
ozoite vs. asexual transcriptomes, differences in expression suggest lifecycle-stage-specific regulation tied to functional roles in parasite developmen
t or survival mechanisms.</li></ul> Overall, these patterns strongly suggest this gene plays critical roles in specific lifecycle transitions, potential
ly marker or effector pathways for survival or virulence.","topics":[{"headline":"Stationary Phase and IntrDevelopmental Cycles of <i>Plasmodium falcipa
rum</i>","one_sentence_summary":"Stragin highlighting potential highlights appear designates transitional.distributional simplistic corelationsinterpret
ation therapy output. functional"},{"headline":"Sexual stage-cohorted","one_sentence_summary":"The apparent targeted phased increase across sexable]{car
aligncovery."}]}

Caused by: org.json.JSONException: JSONObject["dataset_ids"] not found.
        at org.json.JSONObject.get(JSONObject.java:652) ~[json-20250107.jar:?]

Also that seems to be nonsense!?! (sorry about the newlines)

Dominant language
Perl
Stars
3
Forks
1
Avg merge
1d 21h
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VEuPathDB/ApiCommonWebsite

All issues in VEuPathDB/ApiCommonWebsite

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.