Update ff.py
Browse files
ff.py
CHANGED
|
@@ -7,9 +7,15 @@ import g4f
|
|
| 7 |
|
| 8 |
import os
|
| 9 |
token=os.environ.get("TOKEN")
|
| 10 |
-
from bardapi import Bard as bd
|
| 11 |
|
|
|
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
from g4f import Provider, models
|
| 14 |
from langchain.llms.base import LLM
|
| 15 |
|
|
@@ -72,10 +78,12 @@ def gpt(prompt):
|
|
| 72 |
return "Veuillez saisir une question."
|
| 73 |
|
| 74 |
|
| 75 |
-
answer = res(prompt)
|
| 76 |
|
| 77 |
-
print(
|
| 78 |
-
|
|
|
|
|
|
|
| 79 |
|
| 80 |
def gpt_francais(french_prompt,choix,autheur):
|
| 81 |
|
|
@@ -193,12 +201,12 @@ def mariam_web(pro):
|
|
| 193 |
return "Veuillez saisir une question."
|
| 194 |
|
| 195 |
t_pro = " agis en tant q'ia appele mariam et creer par youssouf. ton role est uniquement d'assister. reponds a cette question: " + pro
|
| 196 |
-
response = g4f.ChatCompletion.create(model=g4f.models.default,messages=[{"role": "user", "content":t_pro}],provider=Bard,cookies={"__Secure-1PSID":"dQg91CxO8uBxZRm-6QpOx-8nik1XlC9TzWoIfOpsOlcNAYgeZSG6NJ-2A3y3dmp_hRzGrA.", "__Secure-1PSIDCC": "ACA-OxPnUrZhljKXHrtQcTO2xpYdxfaM9N0oLe34ghl6Su3BHjrZs6TK35gWLxgPMngVENiK9Q"},auth=True)
|
| 197 |
|
| 198 |
#bard = bd(token=token)
|
| 199 |
#response = bard.get_answer(t_pro)['content']
|
| 200 |
print(" web::",pro)
|
| 201 |
-
return
|
| 202 |
|
| 203 |
|
| 204 |
def mariam_chimi(chi,im):
|
|
|
|
| 7 |
|
| 8 |
import os
|
| 9 |
token=os.environ.get("TOKEN")
|
|
|
|
| 10 |
|
| 11 |
+
import google.generativeai as genai
|
| 12 |
|
| 13 |
+
genai.configure(
|
| 14 |
+
api_key=token
|
| 15 |
+
)
|
| 16 |
+
model = genai.GenerativeModel(
|
| 17 |
+
model_name='gemini-pro'
|
| 18 |
+
)
|
| 19 |
from g4f import Provider, models
|
| 20 |
from langchain.llms.base import LLM
|
| 21 |
|
|
|
|
| 78 |
return "Veuillez saisir une question."
|
| 79 |
|
| 80 |
|
| 81 |
+
#answer = res(prompt)
|
| 82 |
|
| 83 |
+
print(prompt)
|
| 84 |
+
response = model.generate_content(prompt)
|
| 85 |
+
print(response.text)
|
| 86 |
+
return response.text
|
| 87 |
|
| 88 |
def gpt_francais(french_prompt,choix,autheur):
|
| 89 |
|
|
|
|
| 201 |
return "Veuillez saisir une question."
|
| 202 |
|
| 203 |
t_pro = " agis en tant q'ia appele mariam et creer par youssouf. ton role est uniquement d'assister. reponds a cette question: " + pro
|
| 204 |
+
#response = g4f.ChatCompletion.create(model=g4f.models.default,messages=[{"role": "user", "content":t_pro}],provider=Bard,cookies={"__Secure-1PSID":"dQg91CxO8uBxZRm-6QpOx-8nik1XlC9TzWoIfOpsOlcNAYgeZSG6NJ-2A3y3dmp_hRzGrA.", "__Secure-1PSIDCC": "ACA-OxPnUrZhljKXHrtQcTO2xpYdxfaM9N0oLe34ghl6Su3BHjrZs6TK35gWLxgPMngVENiK9Q"},auth=True)
|
| 205 |
|
| 206 |
#bard = bd(token=token)
|
| 207 |
#response = bard.get_answer(t_pro)['content']
|
| 208 |
print(" web::",pro)
|
| 209 |
+
return "Non disponible pour l'instant."
|
| 210 |
|
| 211 |
|
| 212 |
def mariam_chimi(chi,im):
|