update main
This commit is contained in:
parent
111aa883e4
commit
7cc20f555c
10
main.py
10
main.py
@ -389,7 +389,7 @@ SECOND image = outfit_photo (outfit reference).
|
|||||||
cand = response.candidates[0]
|
cand = response.candidates[0]
|
||||||
finish_reason = getattr(cand, "finish_reason", None)
|
finish_reason = getattr(cand, "finish_reason", None)
|
||||||
print(f"[DEBUG] Finish reason: {finish_reason}")
|
print(f"[DEBUG] Finish reason: {finish_reason}")
|
||||||
print(f"[DEBUG] Safety ratings: {getattr(cand, "safety_ratings", None)}")
|
print(f"[DEBUG] Safety ratings: {getattr(cand, 'safety_ratings', None)}")
|
||||||
|
|
||||||
if hasattr(cand, "content") and getattr(cand.content, "parts", None):
|
if hasattr(cand, "content") and getattr(cand.content, "parts", None):
|
||||||
print(f"[DEBUG] Parts in first candidate ({len(cand.content.parts)} total):")
|
print(f"[DEBUG] Parts in first candidate ({len(cand.content.parts)} total):")
|
||||||
@ -436,10 +436,10 @@ SECOND image = outfit_photo (outfit reference).
|
|||||||
safety_ratings = cand.safety_ratings
|
safety_ratings = cand.safety_ratings
|
||||||
if safety_ratings:
|
if safety_ratings:
|
||||||
blocked = [
|
blocked = [
|
||||||
f"{getattr(r, "category", "unknown")}"
|
f"{getattr(r, 'category', 'unknown')}"
|
||||||
for r in safety_ratings
|
for r in safety_ratings
|
||||||
if hasattr(r, "blocked") and getattr(r, "blocked", False)
|
if hasattr(r, "blocked") and getattr(r, "blocked", False)
|
||||||
]
|
]
|
||||||
if blocked:
|
if blocked:
|
||||||
message += f" Safety blocked: {', '.join(blocked)}"
|
message += f" Safety blocked: {', '.join(blocked)}"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user