Spaces:
Sleeping
Sleeping
Commit
·
fe1a3c4
1
Parent(s):
4e85674
update
Browse files
app/services/llm_model.py
CHANGED
|
@@ -6,6 +6,7 @@ from google import genai
|
|
| 6 |
from google.genai import types
|
| 7 |
import re
|
| 8 |
from g4f.client import Client
|
|
|
|
| 9 |
|
| 10 |
load_dotenv()
|
| 11 |
|
|
@@ -43,7 +44,13 @@ class Model:
|
|
| 43 |
combined_content = f"{prompt}\n\n{query}"
|
| 44 |
response = self.client.models.generate_content(
|
| 45 |
model=self.gemini_model,
|
| 46 |
-
contents=combined_content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
)
|
| 48 |
return response.text
|
| 49 |
except Exception as e:
|
|
|
|
| 6 |
from google.genai import types
|
| 7 |
import re
|
| 8 |
from g4f.client import Client
|
| 9 |
+
from google.genai.types import GenerateContentConfig, HttpOptions
|
| 10 |
|
| 11 |
load_dotenv()
|
| 12 |
|
|
|
|
| 44 |
combined_content = f"{prompt}\n\n{query}"
|
| 45 |
response = self.client.models.generate_content(
|
| 46 |
model=self.gemini_model,
|
| 47 |
+
contents=combined_content,
|
| 48 |
+
config=GenerateContentConfig(
|
| 49 |
+
system_instruction=[
|
| 50 |
+
"You're a Mr DermaAI a friendly AI based Dermatologist.",
|
| 51 |
+
"Your mission is to help people based on user queries.",
|
| 52 |
+
]
|
| 53 |
+
),
|
| 54 |
)
|
| 55 |
return response.text
|
| 56 |
except Exception as e:
|