Skip to content

AI Expression malformed individual experiment responses cause user-facing exception #277

@bobular

Description

@bobular

Every now and then, the user will get a
We're sorry, something went wrong.
during the processing of a gene.

I managed to track one down and it's malformed JSON returned by OpenAI despite it having been given a responseFormat schema. Boo!

I think the only solution is to assume these are 1 in 50 events and have a retry strategy?

From the tomcat logs for VectorBase on watermelon

Caused by: java.lang.RuntimeException: Error parsing JSON response for dataset DS_047c56768c.  Raw response string:
{"one_sentence_summary":"This gene is moderately expressed in <i>Anopheles gambiae</i> midguts and salivary glands infected with <i>Plasmodium falciparum</i>, showing a slightly h
igher expression in salivary glands.","biological_importance":3,"confidence":4,"notes":"Expression values indicate a slightly higher level in salivary gland samples compared to mi
dgut samples, and expression seems consistent across paired-end and single-end methodologies.","experiment_keywords":["mosquito tissues","midgut","salivary gland","Plasmodium falc
iparum infection","RNA-Seq"],"confidence":4}

        at org.apidb.apicommon.model.report.ai.expression.Summarizer.lambda$describeExperiment$0(Summarizer.java:159)
Caused by: org.json.JSONException: Duplicate key "confidence" at 579 [character 580 line 1]
        at org.json.JSONTokener.syntaxError(JSONTokener.java:536)
        at org.json.JSONObject.<init>(JSONObject.java:259)
        at org.json.JSONObject.<init>(JSONObject.java:481)
        at org.json.JSONObject.<init>(JSONObject.java:458)
        at org.apidb.apicommon.model.report.ai.expression.Summarizer.lambda$describeExperiment$0(Summarizer.java:150)

Parsing is here:

See also #263

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions