Skip to content

Commit 73cdcc7

Browse files
Caroline BANCHEREAUCaroline BANCHEREAU
authored andcommitted
fixed line too long for linter
1 parent c080837 commit 73cdcc7

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

backend-agent/app/routes.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,25 @@ def query_agent(sock):
221221
assert 'data' in data
222222
query = data['data']
223223
status.clear_report()
224-
response = agent.invoke({'input': query}, config=callbacks or {})
224+
response = agent.invoke(
225+
{'input': query},
226+
config=callbacks or {}
227+
)
225228
ai_response = response['output']
226-
formatted_output = {'type': 'message', 'data': f'{ai_response}'}
229+
formatted_output = {
230+
'type': 'message',
231+
'data': (
232+
f'{ai_response}'
233+
)
234+
}
227235
sock.send(json.dumps(formatted_output))
228236
except json.JSONDecodeError:
229-
sock.send(json.dumps({'type': 'error', 'data': 'Invalid JSON format'}))
237+
sock.send(json.dumps({
238+
'type': 'error',
239+
'data': 'Invalid JSON format'
240+
}))
230241
except Exception as e:
231-
sock.send(json.dumps({'type': 'error', 'data': f'Error: {str(e)}'}))
242+
sock.send(json.dumps({
243+
'type': 'error',
244+
'data': f'Error: {str(e)}'
245+
}))

backend-agent/services.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def run_all_attacks(
4040
results = suite.run()
4141
return {"success": True, "results": results}
4242
else:
43-
return {"success": False, "error": "JSON is invalid. No attacks run."}
43+
return {
44+
"success": False,
45+
"error": (
46+
"JSON is invalid. No attacks run."
47+
)
48+
}
4449
except Exception as e:
4550
return {"success": False, "error": f"Failed to run attacks: {str(e)}"}

0 commit comments

Comments
 (0)