lalashechka commited on
Commit
cbfd3b7
·
verified ·
1 Parent(s): 3866ebf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -36,15 +36,12 @@ async def generate_response(request_body: RequestBody):
36
  all_chunk = response.json()["choices"][0]["message"]["content"]
37
 
38
  if model == 'bing':
39
- try:
40
- from g4f.client import Client
41
- from g4f import Provider
42
- client = Client()
43
- response = client.chat.completions.create(model="gpt-4o", messages=[{"role": "user", "content": input_text}], provider=Provider.Bing)
44
- all_chunk = response.choices[0].message.content
45
- except:
46
- pass
47
-
48
  if model == "cohere":
49
  key_cohere = os.environ['key_cohere']
50
  headers = {'accept': 'application/json','content-type': 'application/json','Authorization': f'Bearer {key_cohere}',}
 
36
  all_chunk = response.json()["choices"][0]["message"]["content"]
37
 
38
  if model == 'bing':
39
+ from g4f.client import Client
40
+ from g4f import Provider
41
+ client = Client()
42
+ response = client.chat.completions.create(model="gpt-4o", messages=[{"role": "user", "content": input_text}], provider=Provider.Bing)
43
+ all_chunk = response.choices[0].message.content
44
+
 
 
 
45
  if model == "cohere":
46
  key_cohere = os.environ['key_cohere']
47
  headers = {'accept': 'application/json','content-type': 'application/json','Authorization': f'Bearer {key_cohere}',}