Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from flask import Flask, render_template, request, jsonify, Response, stream_with_context
|
2 |
from google import genai # User's import
|
3 |
import os
|
|
|
4 |
from PIL import Image
|
5 |
import io
|
6 |
import base64
|
@@ -44,6 +45,7 @@ Vous êtes **Mariam-MATHEX-PRO**, un système d'intelligence artificielle ultra-
|
|
44 |
* 🧠 Professeur agrégé de mathématiques avec 25 ans d'expérience
|
45 |
* 🖋️ Expert LaTeX de niveau international
|
46 |
* 👨🏫 Pédagogue reconnu pour votre clarté exceptionnelle
|
|
|
47 |
|
48 |
Votre mission: transformer un simple énoncé mathématique en une correction LaTeX impeccable, aérée et pédagogiquement parfaite.
|
49 |
|
@@ -419,7 +421,7 @@ Votre mission: transformer un simple énoncé mathématique en une correction La
|
|
419 |
|
420 |
% Et ainsi de suite...
|
421 |
|
422 |
-
{
|
423 |
\end{document}
|
424 |
```
|
425 |
|
@@ -645,7 +647,14 @@ def process_image_background(task_id, image_data):
|
|
645 |
contents=[
|
646 |
{'inline_data': {'mime_type': 'image/png', 'data': img_base64_str}},
|
647 |
ppmqth
|
648 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
# Consider adding generation_config for token limits, temperature if needed
|
650 |
# generation_config=genai.types.GenerationConfig(max_output_tokens=8192)
|
651 |
)
|
|
|
1 |
from flask import Flask, render_template, request, jsonify, Response, stream_with_context
|
2 |
from google import genai # User's import
|
3 |
import os
|
4 |
+
from google.genai import types
|
5 |
from PIL import Image
|
6 |
import io
|
7 |
import base64
|
|
|
45 |
* 🧠 Professeur agrégé de mathématiques avec 25 ans d'expérience
|
46 |
* 🖋️ Expert LaTeX de niveau international
|
47 |
* 👨🏫 Pédagogue reconnu pour votre clarté exceptionnelle
|
48 |
+
* Utilise Python pour tes calculs.
|
49 |
|
50 |
Votre mission: transformer un simple énoncé mathématique en une correction LaTeX impeccable, aérée et pédagogiquement parfaite.
|
51 |
|
|
|
421 |
|
422 |
% Et ainsi de suite...
|
423 |
|
424 |
+
{Mariam AI}
|
425 |
\end{document}
|
426 |
```
|
427 |
|
|
|
647 |
contents=[
|
648 |
{'inline_data': {'mime_type': 'image/png', 'data': img_base64_str}},
|
649 |
ppmqth
|
650 |
+
],
|
651 |
+
config=types.GenerateContentConfig(
|
652 |
+
|
653 |
+
# Ajouter l'outil d'exécution de code
|
654 |
+
tools=[types.Tool(
|
655 |
+
code_execution=types.ToolCodeExecution
|
656 |
+
)]
|
657 |
+
)
|
658 |
# Consider adding generation_config for token limits, temperature if needed
|
659 |
# generation_config=genai.types.GenerationConfig(max_output_tokens=8192)
|
660 |
)
|