(20250128) AI summarization bug fix.
This commit is contained in:
@@ -573,8 +573,8 @@ class GmailController(MailController):
|
||||
message = mail_message,
|
||||
prompt_template = self.SENT_MAIL_SUMMARIZATION_PROMPT_TEMPLATE if is_sent else self.RECEIVED_MAIL_SUMMARIZATION_PROMPT_TEMPLATE
|
||||
)
|
||||
ai_json = ai_snippet.json
|
||||
mail_message.aiSnippet = ai_snippet.summary
|
||||
ai_json = ai_snippet.output_json
|
||||
mail_message.aiSnippet["output"] = ai_json["summary"]
|
||||
if ai_json["senderType"] is not None: mail_message.tags.append(ai_json["senderType"])
|
||||
except Exception as exception:
|
||||
|
||||
@@ -259,7 +259,6 @@ class LLMOutput(BaseModel):
|
||||
|
||||
def to_json(self) -> dict:
|
||||
dump = self.model_dump()
|
||||
print("DUMP:", dump)
|
||||
dump["invocationId"] = str(dump["invocationId"])
|
||||
return dump
|
||||
|
||||
|
||||
@@ -196,6 +196,8 @@ class AsyncNimbusWhatsapp:
|
||||
response_json = api_response.json()
|
||||
)
|
||||
|
||||
print("RESPONSE:", json.to_string(api_response.json()))
|
||||
|
||||
# If something goes wrong along the way:
|
||||
except Exception as exception:
|
||||
self.__printer(exception)
|
||||
@@ -217,12 +219,15 @@ if __name__ == "__main__":
|
||||
|
||||
async def main():
|
||||
|
||||
sender = AsyncNimbusWhatsapp(api_key = "2c6175138e964ee8a6adc2af8faab726")
|
||||
# sender = AsyncNimbusWhatsapp(api_key = "2c6175138e964ee8a6adc2af8faab727") # ... TCAOFF 1
|
||||
# sender = AsyncNimbusWhatsapp(api_key = "28ee15ef6df14105a855e8840540a791") # ... TCAOFF 2
|
||||
sender = AsyncNimbusWhatsapp(api_key = "af82dd816b6c42958d052548f40ba5f9") # ... Mr. Gaurav Gupta
|
||||
# sender = AsyncNimbusWhatsapp(api_key = "2b6aa961ad734611b932a8bd54747403") # ... Mr. Sumeet Shirke
|
||||
|
||||
api_result = await sender.send_whatsapp(
|
||||
recipient_number = "919870391155",
|
||||
# message = " ",
|
||||
image_0_url = r"https://cdn.britannica.com/39/226539-050-D21D7721/Portrait-of-a-cat-with-whiskers-visible.jpg"
|
||||
recipient_number = "7972314099",
|
||||
message = f"Hello, Yatmesh ({datetime.datetime.now()})",
|
||||
# image_0_url = r"https://cdn.britannica.com/39/226539-050-D21D7721/Portrait-of-a-cat-with-whiskers-visible.jpg"
|
||||
)
|
||||
print("WHATSAPP API RESULT:", api_result)
|
||||
print("WHATSAPP API RESULT:", json.to_string(api_result.model_dump(), default = str))
|
||||
|
||||
Reference in New Issue
Block a user