Update main.py
Browse files
main.py
CHANGED
@@ -62,8 +62,8 @@ def gpt_with_google_search(prompt):
|
|
62 |
|
63 |
class Linlada(BaseModel):
|
64 |
prompt: str
|
65 |
-
web_access: str =
|
66 |
-
model: str =
|
67 |
|
68 |
|
69 |
|
@@ -73,10 +73,10 @@ def linlada(request: Linlada):
|
|
73 |
model = request.model
|
74 |
web_access = request.web_access
|
75 |
llm = G4F(model=model)
|
76 |
-
if web_access == "
|
77 |
-
chat = llm(prompt)
|
78 |
-
else:
|
79 |
chat = gpt_with_google_search(prompt)
|
|
|
|
|
80 |
return chat
|
81 |
|
82 |
|
|
|
62 |
|
63 |
class Linlada(BaseModel):
|
64 |
prompt: str
|
65 |
+
web_access: str = True
|
66 |
+
model: str = 'gpt-3.5-turbo'
|
67 |
|
68 |
|
69 |
|
|
|
73 |
model = request.model
|
74 |
web_access = request.web_access
|
75 |
llm = G4F(model=model)
|
76 |
+
if web_access == "True":
|
|
|
|
|
77 |
chat = gpt_with_google_search(prompt)
|
78 |
+
else:
|
79 |
+
chat = llm(prompt)
|
80 |
return chat
|
81 |
|
82 |
|