Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,8 +47,8 @@ def full_analysis(video_file_path, user_observations):
|
|
| 47 |
2. If YES: respond with JSON keys "device_type", "condition" (from "unusable", "poor", "functional", "good", "excellent"), and "reason".
|
| 48 |
3. If NO: respond with JSON key "device_type" starting with "Invalid: ".
|
| 49 |
"""
|
| 50 |
-
model_name = "gemini-
|
| 51 |
-
config = types.GenerateContentConfig(temperature=
|
| 52 |
contents = [uploaded_file, prompt]
|
| 53 |
response = GEMINI_CLIENT.models.generate_content(model=f"models/{model_name}", contents=contents, config=config)
|
| 54 |
parsed_json = json.loads(response.text)
|
|
|
|
| 47 |
2. If YES: respond with JSON keys "device_type", "condition" (from "unusable", "poor", "functional", "good", "excellent"), and "reason".
|
| 48 |
3. If NO: respond with JSON key "device_type" starting with "Invalid: ".
|
| 49 |
"""
|
| 50 |
+
model_name = "gemini-2.5-flash" # Using a reliable public model
|
| 51 |
+
config = types.GenerateContentConfig(temperature=1.0, response_mime_type="application/json")
|
| 52 |
contents = [uploaded_file, prompt]
|
| 53 |
response = GEMINI_CLIENT.models.generate_content(model=f"models/{model_name}", contents=contents, config=config)
|
| 54 |
parsed_json = json.loads(response.text)
|