UntilDot commited on
Commit
ef23a8f
·
verified ·
1 Parent(s): fd347d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from flask import Flask, render_template, request, jsonify
2
- from llm.agents import query_all_llms
3
  from llm.aggregator import aggregate_responses
4
  import os
5
  import dotenv
@@ -23,8 +23,8 @@ def chat():
23
  return jsonify({"error": "Empty prompt."}), 400
24
 
25
  try:
26
- # Step 1: Query all agents asynchronously
27
- agent_outputs = query_all_llms(user_input, settings)
28
 
29
  # Step 2: Aggregate responses with LLM #4
30
  final_response = aggregate_responses(agent_outputs, settings)
@@ -35,4 +35,4 @@ def chat():
35
  return jsonify({"error": str(e)}), 500
36
 
37
  if __name__ == "__main__":
38
- app.run(host="0.0.0.0", port=7860, debug=False) # Hugging Face uses port 7860
 
1
  from flask import Flask, render_template, request, jsonify
2
+ from llm.agents import query_all_llms_sync
3
  from llm.aggregator import aggregate_responses
4
  import os
5
  import dotenv
 
23
  return jsonify({"error": "Empty prompt."}), 400
24
 
25
  try:
26
+ # Step 1: Query all agents synchronously
27
+ agent_outputs = query_all_llms_sync(user_input, settings)
28
 
29
  # Step 2: Aggregate responses with LLM #4
30
  final_response = aggregate_responses(agent_outputs, settings)
 
35
  return jsonify({"error": str(e)}), 500
36
 
37
  if __name__ == "__main__":
38
+ app.run(host="0.0.0.0", port=7860, debug=False)