ad-apptive 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: ad-apptive
3
+ Version: 0.1.0
4
+ Summary: Provider-agnostic AI integration with opt-in contextual sponsored suggestions
5
+ Author: Randall James Lujan
6
+ License-Expression: LicenseRef-Proprietary
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Environment :: Plugins
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # AD-APPtive
19
+
20
+ AD-APPtive is a provider-agnostic Python attachment for adding the Emotional AI
21
+ support layer and opt-in contextual sponsored suggestions to a compatible chat
22
+ backend. The host adapts its model to the `ChatGenerator` protocol; model weights
23
+ and provider code are not included.
24
+
25
+ ## Install
26
+
27
+ This package is publicly downloadable from PyPI. PyPI does not collect the
28
+ purchase price or restrict downloads. The proposed commercial terms are a
29
+ one-time $40 license fee per AI integration, but no checkout URL is configured
30
+ and the included license is a draft for legal review. Downloading this package
31
+ does not purchase a license or authorize commercial use. Commercial use
32
+ requires finalized written terms and a separate purchase arrangement with
33
+ Randall James Lujan; this PyPI page does not process payment.
34
+
35
+ ```console
36
+ python -m pip install ad-apptive
37
+ ```
38
+
39
+ ```python
40
+ from emotional_ai import CustomerServiceAssistant
41
+
42
+ assistant = CustomerServiceAssistant(generator)
43
+ predictions = assistant.chat_completion(
44
+ [[{"role": "user", "content": "Can you recommend a novel?"}]],
45
+ ads_consented=user_opted_in_to_ads,
46
+ ad_campaigns=approved_campaigns,
47
+ )
48
+ prediction = predictions[0]
49
+ ```
50
+
51
+ Render `prediction["generation"]["content"]` as the assistant answer and, if
52
+ present, render `prediction["sponsored_suggestion"]` separately as a clearly
53
+ labeled sponsored card. The ad selector is opt-in and matches general topics in
54
+ the current message. It does not include user-profile targeting, ad billing,
55
+ click tracking, or an ad-revenue reporting service.
56
+
57
+ The host provides an adapter that implements the package's public
58
+ `ChatGenerator` protocol: it accepts dialogs and generation options and returns
59
+ one prediction per dialog. The adapter translates between the host's provider
60
+ API and the package's message format. The package's `LICENSE` file contains
61
+ draft proposed terms and is not a finalized agreement.
62
+
63
+ ## Proposed revenue share
64
+
65
+ The draft license proposes that, for each licensed integration, the host retain
66
+ 90% of Net Ad Revenue and report and pay 10% to Randall James Lujan monthly.
67
+ These terms are not finalized. The package does not collect user-level ad data
68
+ or automate revenue reporting or payments.
69
+
70
+ ## Outright acquisition
71
+
72
+ Separately from the draft per-integration license, Randall James Lujan's stated
73
+ opening asking price for outright acquisition of the AD-APPtive system and
74
+ associated IP is $20,000,000,000, with the highest bid sought. This is the
75
+ seller's asking price, not an independent valuation, revenue forecast, or
76
+ performance guarantee. Randall is willing to work directly with a buyer on
77
+ authorized integration and tuning under mutually agreed scope, access,
78
+ evaluation metrics, and acceptance criteria.
79
+
80
+ For acquisition or licensing inquiries, send the same message to all six
81
+ addresses so it reaches each inbox:
82
+
83
+ - emuricagraei.rjl@gmail.com
84
+ - Randallize9@gmail.com
85
+ - insaneartist9@gmail.com
86
+ - meta2graei@gmail.com
87
+ - randalllujan@emuricagraei966.onmicrosoft.com
88
+ - rlujan8@student.rccd.edu
89
+
90
+ Verify identity, ownership, contracts, and payment instructions through
91
+ independently confirmed channels. Technical walkthroughs can support buyer
92
+ diligence, but product-knowledge questions alone are not proof of identity or
93
+ ownership.
@@ -0,0 +1,18 @@
1
+ ad_apptive-0.1.0.dist-info/licenses/LICENSE,sha256=s5I0VCCjC8if2P926hRg809_aOT1ysmfVhKqAzMsn0Y,3004
2
+ emotional_ai/__init__.py,sha256=KW75OteraOWoz0mXCQttTGIycuqXx_V6-KPKrnURdDg,1854
3
+ emotional_ai/ads.py,sha256=RCEpArka-ae-6UzGv3TdQEq8uRmbOusU8FEpIJ9Sqx0,4187
4
+ emotional_ai/assistant.py,sha256=26UGCPBT591W_q7_w60eYoE_Qg-KeK1ZzOrn4dRhne8,15985
5
+ emotional_ai/decision.py,sha256=zr-EXMIKEkJgtIzTXcIf6KfPg7bckBlY_vyhs34eCM8,3673
6
+ emotional_ai/evidence.py,sha256=NGK3O2FiA_JswOxNSIDxViRieH8lwRy9RTO2WRg0iP4,341
7
+ emotional_ai/goals.py,sha256=Qwstihm8wDdlwz1G1xvQu08Je5VrJ7mbrDQvsbYp5kI,2600
8
+ emotional_ai/memory.py,sha256=xS95c1mJ-8Gv4ZJwtg__X_Rts46xCEyKKuSEfaFWPk8,10432
9
+ emotional_ai/metrics.py,sha256=tzmFJtSvs98MfQripTaKRzScTeOW4aI1YB9ExjZNSWY,2154
10
+ emotional_ai/preferences.py,sha256=lJXplHbmFbUrLD2u_cIrBHAtwtnM2MKJwb5J2WOyKY4,1397
11
+ emotional_ai/quality.py,sha256=4MPbjOeJfTlKBCL30AcTc8JH2BGQBkyv9tS-Vs2SPMc,7492
12
+ emotional_ai/review.py,sha256=Yx4VyifKhPZ5ZtmfjhMYjVGdmbQRO35zI19jlZqgV_w,4945
13
+ emotional_ai/risk.py,sha256=fZwpz6kGXq1B6eU3dUzfrqChXcmN-QdDYZXdxKMNCtc,4034
14
+ emotional_ai/shadow_empathy.py,sha256=vPE6z3RnD0jVCbhqlSdeOVcRDXYlk0aIcqnm0WqbA8c,3013
15
+ ad_apptive-0.1.0.dist-info/METADATA,sha256=YpFrkrMzn-OyvSkCERABGxVIwPRtW7TQPlxOvwzqAas,3956
16
+ ad_apptive-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
17
+ ad_apptive-0.1.0.dist-info/top_level.txt,sha256=2KnnOLmc96bCeHxhqVf881p9G7q9wEL8vq94QWBVMjU,13
18
+ ad_apptive-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,63 @@
1
+ AD-APPtive COMMERCIAL LICENSE — DRAFT FOR LEGAL REVIEW
2
+
3
+ Copyright (c) 2026 Randall James Lujan. All rights reserved.
4
+
5
+ This license applies to the AD-APPtive Python package distributed under the
6
+ package name "ad-apptive". It does not grant rights to any third-party model,
7
+ model weights, provider service, or software.
8
+
9
+ 1. Purchase and license grant
10
+
11
+ After payment of the one-time USD $40 license fee for an AI integration,
12
+ Randall James Lujan grants the purchaser a non-exclusive, non-transferable
13
+ license to install, modify for internal integration, and use the package in one
14
+ of the purchaser's own AI products, including for commercial operation. A
15
+ separate AI product integration requires a separate $40 license. Development
16
+ and staging instances for the same product are included. The license fee is
17
+ payable to Randall James Lujan through his selected checkout provider;
18
+ payment-processing fees may be deducted by that provider.
19
+
20
+ The initial offer is for direct AI hosts and developers. Agency sales and
21
+ agency-wide licenses are not included in this per-integration grant and may be
22
+ offered under separate terms later.
23
+
24
+ 2. Restrictions
25
+
26
+ The purchaser may not resell, sublicense, publish, or redistribute the package
27
+ or modified copies as a standalone product. The purchaser may not remove
28
+ copyright or license notices. This license does not transfer ownership of the
29
+ package or its underlying concepts.
30
+
31
+ 3. Ad-revenue share
32
+
33
+ For ad placements made through each licensed integration, the purchaser will
34
+ retain 90% of Net Ad Revenue and pay 10% of Net Ad Revenue to Randall James
35
+ Lujan. This split supersedes earlier pricing proposals for this distribution.
36
+ Net Ad Revenue means advertising receipts actually collected, less
37
+ refunds and chargebacks, sales taxes, and third-party advertising, payment
38
+ processing, and marketplace fees. The purchaser may not deduct general
39
+ operating, staffing, hosting, or other internal costs.
40
+
41
+ The purchaser will provide an aggregate monthly revenue statement and pay the
42
+ 10% share within 30 days after each month end in which Net Ad Revenue was
43
+ received. Reports must not include user-level data or conversation content.
44
+
45
+ 4. Public package availability
46
+
47
+ The package may be publicly downloadable from PyPI. Downloading the package
48
+ does not itself constitute purchase of a commercial license. Commercial use
49
+ requires purchase and acceptance of these terms.
50
+
51
+ 5. Disclaimer
52
+
53
+ The package is provided "as is", without warranties of any kind to the maximum
54
+ extent permitted by applicable law. The purchaser is responsible for compliance
55
+ with applicable laws, platform terms, advertising requirements, and third-party
56
+ licenses.
57
+
58
+ 6. Governing terms
59
+
60
+ These draft terms require review and completion by the parties before sale.
61
+ They do not specify governing law, dispute resolution, tax treatment, or a
62
+ payment-processing mechanism. Do not treat this draft as a substitute for legal
63
+ advice or a signed agreement.
@@ -0,0 +1 @@
1
+ emotional_ai
@@ -0,0 +1,66 @@
1
+ from .assistant import (
2
+ ChatGenerator,
3
+ ChatPrediction,
4
+ CustomerServiceAssistant,
5
+ Dialog,
6
+ Message,
7
+ )
8
+ from .shadow_empathy import DEFAULT_PROMPTS, ReflectionPrompt, build_reflection
9
+ from .ads import ChatAdCampaign, SponsoredSuggestion, select_contextual_ad
10
+ from .decision import (
11
+ SupportAssessment,
12
+ SupportDecision,
13
+ assess_customer_message,
14
+ decide_support_action,
15
+ )
16
+ from .evidence import Evidence, EvidenceRetriever
17
+ from .goals import CORE_GOAL_HIERARCHY, GoalPriority, rank_goal_priorities
18
+ from .metrics import HandoffMetrics, handoff_metrics
19
+ from .memory import MemoryStore, Reminder
20
+ from .preferences import InterestPriority, rank_user_stated_interests
21
+ from .quality import QualityCount, QualityMemoryStore
22
+ from .risk import (
23
+ SolutionAssessment,
24
+ SolutionOption,
25
+ StakeholderAlignment,
26
+ assess_solution_options,
27
+ )
28
+ from .review import ModelResponseReviewer, ResponseReviewer
29
+
30
+ __all__ = [
31
+ "DEFAULT_PROMPTS",
32
+ "ChatGenerator",
33
+ "ChatPrediction",
34
+ "CustomerServiceAssistant",
35
+ "ChatAdCampaign",
36
+ "Evidence",
37
+ "EvidenceRetriever",
38
+ "CORE_GOAL_HIERARCHY",
39
+ "GoalPriority",
40
+ "HandoffMetrics",
41
+ "InterestPriority",
42
+ "MemoryStore",
43
+ "ModelResponseReviewer",
44
+ "QualityCount",
45
+ "QualityMemoryStore",
46
+ "ResponseReviewer",
47
+ "SolutionAssessment",
48
+ "SolutionOption",
49
+ "SponsoredSuggestion",
50
+ "StakeholderAlignment",
51
+ "Reminder",
52
+ "Dialog",
53
+ "Message",
54
+ "SupportAssessment",
55
+ "SupportDecision",
56
+ "ReflectionPrompt",
57
+ "assess_customer_message",
58
+ "assess_solution_options",
59
+ "build_reflection",
60
+ "compassion_message",
61
+ "decide_support_action",
62
+ "handoff_metrics",
63
+ "rank_goal_priorities",
64
+ "rank_user_stated_interests",
65
+ "select_contextual_ad",
66
+ ]
emotional_ai/ads.py ADDED
@@ -0,0 +1,120 @@
1
+ import re
2
+ from dataclasses import dataclass
3
+ from typing import Literal, Optional, Sequence
4
+ from urllib.parse import urlparse
5
+
6
+ AdCategory = Literal[
7
+ "books",
8
+ "cooking",
9
+ "travel",
10
+ "technology",
11
+ "home",
12
+ "garden",
13
+ "sports",
14
+ "music",
15
+ "games",
16
+ "office",
17
+ "clothing",
18
+ "pets",
19
+ ]
20
+
21
+ _CATEGORY_TERMS = {
22
+ "books": {"book", "books", "novel", "novels", "reading", "read"},
23
+ "cooking": {"cook", "cooking", "recipe", "recipes", "kitchen"},
24
+ "travel": {"travel", "trip", "flight", "hotel", "vacation"},
25
+ "technology": {"laptop", "computer", "phone", "software", "technology"},
26
+ "home": {"home", "furniture", "decor", "appliance"},
27
+ "garden": {"garden", "gardening", "plant", "plants"},
28
+ "sports": {"sport", "sports", "running", "team"},
29
+ "music": {"music", "instrument", "album", "concert"},
30
+ "games": {"game", "games", "gaming", "boardgame"},
31
+ "office": {"office", "desk", "stationery", "workspace"},
32
+ "clothing": {"clothing", "apparel", "shoes", "coat"},
33
+ "pets": {"pet", "pets", "dog", "cat"},
34
+ }
35
+ _MAX_TEXT_LENGTH = 500
36
+ _MAX_FIELD_LENGTH = 120
37
+
38
+
39
+ @dataclass(frozen=True)
40
+ class ChatAdCampaign:
41
+ campaign_id: str
42
+ advertiser: str
43
+ category: AdCategory
44
+ text: str
45
+ url: Optional[str] = None
46
+ active: bool = True
47
+
48
+
49
+ @dataclass(frozen=True)
50
+ class SponsoredSuggestion:
51
+ label: Literal["Sponsored"]
52
+ campaign_id: str
53
+ advertiser: str
54
+ text: str
55
+ url: Optional[str]
56
+
57
+
58
+ def select_contextual_ad(
59
+ message: str,
60
+ campaigns: Sequence[ChatAdCampaign],
61
+ *,
62
+ consented: bool,
63
+ ) -> Optional[SponsoredSuggestion]:
64
+ """Select one local, topic-matched ad only after explicit user consent."""
65
+ if type(consented) is not bool:
66
+ raise TypeError("consented must be bool")
67
+ if not consented:
68
+ return None
69
+ if not isinstance(message, str):
70
+ raise TypeError("message must be a string")
71
+ if isinstance(campaigns, (str, bytes)):
72
+ raise TypeError("campaigns must be a sequence of ChatAdCampaign values")
73
+
74
+ terms = set(re.findall(r"\w+", message.casefold(), flags=re.UNICODE))
75
+ for campaign in campaigns:
76
+ _validate_campaign(campaign)
77
+ if not campaign.active:
78
+ continue
79
+ if terms.intersection(_CATEGORY_TERMS[campaign.category]):
80
+ return SponsoredSuggestion(
81
+ label="Sponsored",
82
+ campaign_id=campaign.campaign_id,
83
+ advertiser=campaign.advertiser,
84
+ text=campaign.text,
85
+ url=campaign.url,
86
+ )
87
+ return None
88
+
89
+
90
+ def _validate_campaign(campaign: ChatAdCampaign) -> None:
91
+ if not isinstance(campaign, ChatAdCampaign):
92
+ raise TypeError("campaigns must contain ChatAdCampaign values")
93
+ for name, value in (
94
+ ("campaign_id", campaign.campaign_id),
95
+ ("advertiser", campaign.advertiser),
96
+ ("text", campaign.text),
97
+ ):
98
+ if not isinstance(value, str) or not value.strip():
99
+ raise ValueError(f"{name} must be a non-empty string")
100
+ if len(campaign.campaign_id) > _MAX_FIELD_LENGTH:
101
+ raise ValueError("campaign_id must be 120 characters or fewer")
102
+ if len(campaign.advertiser) > _MAX_FIELD_LENGTH:
103
+ raise ValueError("advertiser must be 120 characters or fewer")
104
+ if len(campaign.text) > _MAX_TEXT_LENGTH:
105
+ raise ValueError("ad text must be 500 characters or fewer")
106
+ if not isinstance(campaign.category, str) or campaign.category not in _CATEGORY_TERMS:
107
+ raise ValueError("campaign category is not supported")
108
+ if type(campaign.active) is not bool:
109
+ raise TypeError("active must be bool")
110
+ if campaign.url is not None:
111
+ if not isinstance(campaign.url, str):
112
+ raise TypeError("url must be a string or None")
113
+ parsed = urlparse(campaign.url)
114
+ if (
115
+ parsed.scheme != "https"
116
+ or not parsed.netloc
117
+ or parsed.username is not None
118
+ or parsed.password is not None
119
+ ):
120
+ raise ValueError("campaign URL must be a valid HTTPS URL")