Abhaykoul commited on
Commit
6a46ed8
1 Parent(s): 79b31ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -4,8 +4,8 @@ from flask import Flask, jsonify, request
4
  import google.generativeai as palm
5
  app = Flask(__name__)
6
 
7
- @app.route('/search2', methods=['POST'])
8
- def WEBScout_search2():
9
  data = request.get_json()
10
  if 'query' not in data:
11
  return jsonify({'error': 'Query parameter missing'})
@@ -19,21 +19,21 @@ def WEBScout_search2():
19
  break
20
  responses.append(r)
21
  return jsonify(responses)
22
- @app.route('/search', methods=['POST'])
23
-
24
- def WEBScout2_search():
25
- data = request.get_json()
26
- if 'query' not in data:
27
- return jsonify({'error': 'Query parameter missing'})
28
-
29
- query = data['query']
30
- WEBS_instance = WEBS() # Instantiate WEBS without context manager
31
- responses = []
32
- for i, r in enumerate(WEBS_instance.text(query, region='wt-wt', safesearch='off', timelimit='y')):
33
- if i == 10: # Limiting the results to 10
34
- break
35
- responses.append(r)
36
- return jsonify(responses)
37
 
38
  @app.route('/mws', methods=['POST'])
39
  def WEBScout_search():
 
4
  import google.generativeai as palm
5
  app = Flask(__name__)
6
 
7
+ @app.route('/search', methods=['POST'])
8
+ def WEBScout_search():
9
  data = request.get_json()
10
  if 'query' not in data:
11
  return jsonify({'error': 'Query parameter missing'})
 
19
  break
20
  responses.append(r)
21
  return jsonify(responses)
22
+ # @app.route('/search', methods=['POST'])
23
+
24
+ # def WEBScout2_search():
25
+ # data = request.get_json()
26
+ # if 'query' not in data:
27
+ # return jsonify({'error': 'Query parameter missing'})
28
+
29
+ # query = data['query']
30
+ # WEBS_instance = WEBS() # Instantiate WEBS without context manager
31
+ # responses = []
32
+ # for i, r in enumerate(WEBS_instance.text(query, region='wt-wt', safesearch='off', timelimit='y')):
33
+ # if i == 10: # Limiting the results to 10
34
+ # break
35
+ # responses.append(r)
36
+ # return jsonify(responses)
37
 
38
  @app.route('/mws', methods=['POST'])
39
  def WEBScout_search():