Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ai-rqc into test
  • Loading branch information
GuillaumeFalourd committed Apr 23, 2024
2 parents ad020ee + ed51b8a commit c9df3b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def get_execution_status(execution_id, access_token):
answer_str = execution_status['steps'][0]['step_result']['answer']

# Remove the leading and trailing ```json and ``` for correct JSON parsing
answer_str = answer_str.strip('`')[4:].strip()
if answer_str.startswith("```json"):
# Remove the leading ```json and the trailing ```
# This assumes the format is exactly as provided, with newlines as shown
answer_str = answer_str[7:-4].strip()

answer_data = json.loads(answer_str)

Expand Down

0 comments on commit c9df3b5

Please sign in to comment.