Skip to content

Commit

Permalink
fix wrong escape in graphql api call for qa (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
krokoko authored Oct 26, 2023
1 parent c69063c commit 9a54723
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def run_qa_agent_from_single_document_no_memory(input_params):
status_variables['jobstatus'] = 'Done'
status_variables['answer'] = llm_answer_base64_string
status_variables['question'] = input_params['question']
status_variables['sources'] = filename
status_variables['sources'] = [filename]
send_job_status(status_variables)

response = {'question': input_params['question'], 'answer': answer, 'sources': input_params['filename'], 'filename': input_params['filename']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def send_job_status(variables):

query = """
mutation updateQAJobStatus {
updateQAJobStatus (jobstatus: \"$jobstatus\", jobid: $jobid, answer: \""""+answer+"""\", question: \""""+question+"""\", filename: \"$filename\", sources: $sources)
updateQAJobStatus (jobstatus: \"$jobstatus\", jobid: \"$jobid\", answer: \""""+answer+"""\", question: \""""+question+"""\", filename: \"$filename\", sources: $sources)
{
jobstatus,
jobid,
Expand All @@ -95,7 +95,7 @@ def send_job_status(variables):

query = query.replace("$jobstatus", variables['jobstatus'])
query = query.replace("$filename", variables['filename'])
query = query.replace("$jobid", str(variables['jobid']))
query = query.replace("$jobid", variables['jobid'])
query = query.replace("$sources", str(variables['sources']).replace("\'", "\""))

request = {'query':query}
Expand Down

0 comments on commit 9a54723

Please sign in to comment.