(20241218) E-Mails now get a vendor/client tag when AI thinks the message is from one of those entities.

This commit is contained in:
2024-12-18 14:09:14 +05:30
parent b42da0dacb
commit 0a336c0938
2 changed files with 35 additions and 10 deletions
+6
View File
@@ -40,6 +40,7 @@ from pydantic import BaseModel, Field, field_validator, PastDatetime, AwareDatet
from typing import Optional, Literal, Union, List, Any
# My utils:
from utils_v2.string import json
from utils_v2.string import regex
from utils_v2.date_time import date_time
@@ -233,6 +234,11 @@ class LLMOutput(BaseModel):
"invocationId": self.invocationId
}
@property
def json(self) -> dict | list | None:
try: return json.from_string(self.output)
except: return None
# *****************************************************************************************************************
# ***** ****