Commit ·
b34cbc0
1
Parent(s): 72d31a2
fix
Browse files
agent.py
CHANGED
|
@@ -192,15 +192,14 @@ class GeminiAgent:
|
|
| 192 |
max_print_outputs_length=2_000
|
| 193 |
)
|
| 194 |
|
| 195 |
-
def check_token_safety(self, question):
|
| 196 |
-
messages = self.gemini_agent.memory.get_messages()
|
| 197 |
-
count = token_counter(model="gemma3", messages=messages)
|
| 198 |
-
|
| 199 |
-
print(f"📊 Current Context Size: {count} tokens")
|
| 200 |
-
return count
|
| 201 |
-
|
| 202 |
-
|
| 203 |
print(f"✅ Gemini agent initialized with model: {model_id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
def __call__(self, question: str, file_path: Optional[str] = None) -> str:
|
| 206 |
prompt = f"{self.system_prompt}\n\nQuestion: {question}"
|
|
|
|
| 192 |
max_print_outputs_length=2_000
|
| 193 |
)
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
print(f"✅ Gemini agent initialized with model: {model_id}")
|
| 196 |
+
|
| 197 |
+
def check_token_safety(self, question):
|
| 198 |
+
messages = self.gemini_agent.memory.get_messages()
|
| 199 |
+
count = token_counter(model="gemma3", messages=messages)
|
| 200 |
+
|
| 201 |
+
print(f"📊 Current Context Size: {count} tokens")
|
| 202 |
+
return count
|
| 203 |
|
| 204 |
def __call__(self, question: str, file_path: Optional[str] = None) -> str:
|
| 205 |
prompt = f"{self.system_prompt}\n\nQuestion: {question}"
|