code editor: Agent Studio improvement iteration 3 for contract-clock-studio-v1. Goa
This commit is contained in:
2
a2a.yaml
2
a2a.yaml
@@ -1,5 +1,5 @@
|
|||||||
name: contract-clock-studio-v1
|
name: contract-clock-studio-v1
|
||||||
version: 0.1.3
|
version: 0.1.4
|
||||||
entrypoint: agent:ContractClockStudioV1
|
entrypoint: agent:ContractClockStudioV1
|
||||||
expose:
|
expose:
|
||||||
public: false
|
public: false
|
||||||
|
|||||||
10
agent.py
10
agent.py
@@ -43,6 +43,11 @@ ALLOWED_BROWSER_MEDIA_TYPES = (
|
|||||||
"application/octet-stream",
|
"application/octet-stream",
|
||||||
)
|
)
|
||||||
DATE_RE = re.compile(r"\b(20\d{2}-\d{2}-\d{2})\b")
|
DATE_RE = re.compile(r"\b(20\d{2}-\d{2}-\d{2})\b")
|
||||||
|
RENEWAL_DATE_RE = re.compile(
|
||||||
|
r"\brenew(?:s|al|ed|ing)?\b[^.\n;]{0,160}\b(?:on|as\s+of|effective|date|until|through)\s+"
|
||||||
|
r"(20\d{2}-\d{2}-\d{2})\b",
|
||||||
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
RENEWAL_RE = re.compile(r"\brenew(?:s|al|ed|ing)?\b", re.IGNORECASE)
|
RENEWAL_RE = re.compile(r"\brenew(?:s|al|ed|ing)?\b", re.IGNORECASE)
|
||||||
NOTICE_RE = re.compile(
|
NOTICE_RE = re.compile(
|
||||||
r"(?:at\s+least\s+)?(?P<days>\d{1,3})\s+days?\s+(?:written\s+)?notice",
|
r"(?:at\s+least\s+)?(?P<days>\d{1,3})\s+days?\s+(?:written\s+)?notice",
|
||||||
@@ -71,7 +76,7 @@ class ContractClockStudioV1(A2AAgent[ContractClockStudioV1Config, PlatformUserAu
|
|||||||
"contracts, saves user-scoped timelines, and reopens them in a packed "
|
"contracts, saves user-scoped timelines, and reopens them in a packed "
|
||||||
"one-page studio."
|
"one-page studio."
|
||||||
)
|
)
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
|
|
||||||
config_model = ContractClockStudioV1Config
|
config_model = ContractClockStudioV1Config
|
||||||
auth_model = PlatformUserAuth
|
auth_model = PlatformUserAuth
|
||||||
@@ -230,13 +235,10 @@ def _tenant_key(ctx: RunContext[PlatformUserAuth]) -> str | None:
|
|||||||
auth = getattr(ctx, "auth", None)
|
auth = getattr(ctx, "auth", None)
|
||||||
user_id = getattr(auth, "user_id", None)
|
user_id = getattr(auth, "user_id", None)
|
||||||
sub = (getattr(auth, "sub", None) or "").strip()
|
sub = (getattr(auth, "sub", None) or "").strip()
|
||||||
email = (getattr(auth, "email", None) or "").strip().lower()
|
|
||||||
if user_id is not None:
|
if user_id is not None:
|
||||||
return f"user:{user_id}"
|
return f"user:{user_id}"
|
||||||
if sub:
|
if sub:
|
||||||
return f"user:{sub}"
|
return f"user:{sub}"
|
||||||
if email:
|
|
||||||
return f"user:{email}"
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user