abintegro 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.
- abintegro/__init__.py +156 -0
- abintegro/__main__.py +16 -0
- abintegro/ai.py +543 -0
- abintegro/audit.py +227 -0
- abintegro/bi.py +667 -0
- abintegro/catalog.py +231 -0
- abintegro/cli.py +1122 -0
- abintegro/config.py +653 -0
- abintegro/connector.py +2527 -0
- abintegro/credentials.py +724 -0
- abintegro/ctx.py +818 -0
- abintegro/errors.py +391 -0
- abintegro/guardrails.py +200 -0
- abintegro/lookup.py +164 -0
- abintegro/manifest.py +474 -0
- abintegro/notifications.py +641 -0
- abintegro/policy.py +169 -0
- abintegro/probe.py +183 -0
- abintegro/py.typed +0 -0
- abintegro/queue.py +216 -0
- abintegro/runner.py +1580 -0
- abintegro/service.py +474 -0
- abintegro/state.py +124 -0
- abintegro/store.py +330 -0
- abintegro/suggestion.py +687 -0
- abintegro/task.py +118 -0
- abintegro/tenant_secret.py +781 -0
- abintegro/testing.py +112 -0
- abintegro/warehouse.py +573 -0
- abintegro/webhooks.py +338 -0
- abintegro-0.1.0.dist-info/METADATA +112 -0
- abintegro-0.1.0.dist-info/RECORD +52 -0
- abintegro-0.1.0.dist-info/WHEEL +5 -0
- abintegro-0.1.0.dist-info/entry_points.txt +2 -0
- abintegro-0.1.0.dist-info/licenses/LICENSE +202 -0
- abintegro-0.1.0.dist-info/top_level.txt +2 -0
- abintegro_ai/__init__.py +108 -0
- abintegro_ai/decisions.py +605 -0
- abintegro_ai/errors.py +38 -0
- abintegro_ai/loop.py +125 -0
- abintegro_ai/metric.py +100 -0
- abintegro_ai/providers/__init__.py +237 -0
- abintegro_ai/providers/_http.py +70 -0
- abintegro_ai/providers/anthropic.py +247 -0
- abintegro_ai/providers/openai.py +237 -0
- abintegro_ai/providers/vertex.py +420 -0
- abintegro_ai/py.typed +0 -0
- abintegro_ai/report.py +272 -0
- abintegro_ai/retry.py +43 -0
- abintegro_ai/schema.py +229 -0
- abintegro_ai/thinking.py +142 -0
- abintegro_ai/types.py +130 -0
abintegro/__init__.py
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""ABIntegro runner SDK.
|
|
2
|
+
|
|
3
|
+
Apache-2.0, AB Software LTD. A runner's own ``connectors/`` and ``tasks/`` use it
|
|
4
|
+
as a dependency and carry no copyleft obligation.
|
|
5
|
+
|
|
6
|
+
Task modules import these names and nothing else (``require_chain`` only when
|
|
7
|
+
one write needs another's result; ``YesNo``, ``Choice`` and ``Score`` only for
|
|
8
|
+
``ctx.decide``)::
|
|
9
|
+
|
|
10
|
+
from abintegro import ctx, parameter, permit, require_chain, task
|
|
11
|
+
from connectors import school, zoom
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@task(id="enrollment_to_zoom", title="Zoom Licences for New Enrolments")
|
|
15
|
+
async def enrollment_to_zoom() -> None:
|
|
16
|
+
# The docstring's first paragraph is the description the app shows.
|
|
17
|
+
for e in await school.enrollments.since(ctx.state.get("cursor")):
|
|
18
|
+
spec = ZoomUserCreate(
|
|
19
|
+
email=e.email,
|
|
20
|
+
first_name=e.first,
|
|
21
|
+
last_name=e.last,
|
|
22
|
+
licences=[parameter("zoom_licence")],
|
|
23
|
+
)
|
|
24
|
+
if permit("users.create_with_licences"):
|
|
25
|
+
await zoom.users.create_with_licences(spec)
|
|
26
|
+
else:
|
|
27
|
+
ctx.suggest("zoom.users.create_with_licences", spec, key=str(e.id))
|
|
28
|
+
ctx.state["cursor"] = e.created_at
|
|
29
|
+
|
|
30
|
+
``ctx.suggest`` takes a business ``key``: the suggestion's identity is derived
|
|
31
|
+
from it.
|
|
32
|
+
|
|
33
|
+
**There is no ``step``.** One connector call is one convergent business action;
|
|
34
|
+
re-running the task repairs a partial failure. A multi-stage process is several
|
|
35
|
+
tasks, handed on by ``ctx.run`` or, through a human, ``ctx.suggest``.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from __future__ import annotations
|
|
39
|
+
|
|
40
|
+
from abintegro_ai.decisions import Choice, Score, YesNo
|
|
41
|
+
from abintegro_ai.report import ChartDataset, KpiMetric, ReportSection, TimelineEvent
|
|
42
|
+
|
|
43
|
+
from .ai import AiResult, AiTurn, Decision
|
|
44
|
+
from .audit import AuditEvent, AuditLog, audit_log
|
|
45
|
+
from .config import (
|
|
46
|
+
ConnectorConfig,
|
|
47
|
+
RunnerConfig,
|
|
48
|
+
TaskConfig,
|
|
49
|
+
TenantConfig,
|
|
50
|
+
TriggerConfig,
|
|
51
|
+
)
|
|
52
|
+
from .ctx import Execution, Handoff, Notice, Proposal, Read, ctx
|
|
53
|
+
from .errors import (
|
|
54
|
+
AbintegroError,
|
|
55
|
+
AiNoAnswer,
|
|
56
|
+
AiNoDecision,
|
|
57
|
+
ChainNotPermitted,
|
|
58
|
+
ConfigurationError,
|
|
59
|
+
ConnectorAuthError,
|
|
60
|
+
ConnectorConflict,
|
|
61
|
+
ConnectorError,
|
|
62
|
+
ConnectorNotFound,
|
|
63
|
+
ConnectorRateLimit,
|
|
64
|
+
ConnectorSchemaDrift,
|
|
65
|
+
ConnectorServerError,
|
|
66
|
+
GuardrailExceeded,
|
|
67
|
+
ManifestViolation,
|
|
68
|
+
OperationDisabled,
|
|
69
|
+
ParameterMissing,
|
|
70
|
+
PolicyDenied,
|
|
71
|
+
ReportRefused,
|
|
72
|
+
SuggestionNotApplicable,
|
|
73
|
+
SuggestionNotDeferrable,
|
|
74
|
+
WriteNotPermitted,
|
|
75
|
+
)
|
|
76
|
+
from .guardrails import ExecutionWindow, Guardrails
|
|
77
|
+
from .lookup import LookupTable
|
|
78
|
+
from .notifications import Notification
|
|
79
|
+
from .policy import parameter, permit, require_chain
|
|
80
|
+
from .queue import Queue, QueueItem
|
|
81
|
+
from .runner import Run, Runner, TickReport
|
|
82
|
+
from .state import TaskState
|
|
83
|
+
from .store import FirestoreStore, MemoryStore, Store
|
|
84
|
+
from .suggestion import Suggestion, SuggestionMessages, Suggestions
|
|
85
|
+
from .task import TaskDefinition, task
|
|
86
|
+
from .webhooks import ReceivedEvent
|
|
87
|
+
|
|
88
|
+
__all__ = [
|
|
89
|
+
"AbintegroError",
|
|
90
|
+
"AiNoAnswer",
|
|
91
|
+
"AiNoDecision",
|
|
92
|
+
"AiResult",
|
|
93
|
+
"AiTurn",
|
|
94
|
+
"AuditEvent",
|
|
95
|
+
"AuditLog",
|
|
96
|
+
"ChainNotPermitted",
|
|
97
|
+
"ChartDataset",
|
|
98
|
+
"Choice",
|
|
99
|
+
"ConfigurationError",
|
|
100
|
+
"ConnectorAuthError",
|
|
101
|
+
"ConnectorConfig",
|
|
102
|
+
"ConnectorConflict",
|
|
103
|
+
"ConnectorError",
|
|
104
|
+
"ConnectorNotFound",
|
|
105
|
+
"ConnectorRateLimit",
|
|
106
|
+
"ConnectorSchemaDrift",
|
|
107
|
+
"ConnectorServerError",
|
|
108
|
+
"Decision",
|
|
109
|
+
"Execution",
|
|
110
|
+
"ExecutionWindow",
|
|
111
|
+
"FirestoreStore",
|
|
112
|
+
"GuardrailExceeded",
|
|
113
|
+
"Guardrails",
|
|
114
|
+
"Handoff",
|
|
115
|
+
"KpiMetric",
|
|
116
|
+
"LookupTable",
|
|
117
|
+
"ManifestViolation",
|
|
118
|
+
"MemoryStore",
|
|
119
|
+
"Notice",
|
|
120
|
+
"Notification",
|
|
121
|
+
"OperationDisabled",
|
|
122
|
+
"ParameterMissing",
|
|
123
|
+
"PolicyDenied",
|
|
124
|
+
"Proposal",
|
|
125
|
+
"Queue",
|
|
126
|
+
"QueueItem",
|
|
127
|
+
"Read",
|
|
128
|
+
"ReceivedEvent",
|
|
129
|
+
"ReportRefused",
|
|
130
|
+
"ReportSection",
|
|
131
|
+
"Run",
|
|
132
|
+
"Runner",
|
|
133
|
+
"RunnerConfig",
|
|
134
|
+
"Score",
|
|
135
|
+
"Store",
|
|
136
|
+
"Suggestion",
|
|
137
|
+
"SuggestionMessages",
|
|
138
|
+
"SuggestionNotApplicable",
|
|
139
|
+
"SuggestionNotDeferrable",
|
|
140
|
+
"Suggestions",
|
|
141
|
+
"TaskConfig",
|
|
142
|
+
"TaskDefinition",
|
|
143
|
+
"TaskState",
|
|
144
|
+
"TenantConfig",
|
|
145
|
+
"TickReport",
|
|
146
|
+
"TimelineEvent",
|
|
147
|
+
"TriggerConfig",
|
|
148
|
+
"WriteNotPermitted",
|
|
149
|
+
"YesNo",
|
|
150
|
+
"audit_log",
|
|
151
|
+
"ctx",
|
|
152
|
+
"parameter",
|
|
153
|
+
"permit",
|
|
154
|
+
"require_chain",
|
|
155
|
+
"task",
|
|
156
|
+
]
|
abintegro/__main__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""``python -m abintegro`` — the form that always works.
|
|
2
|
+
|
|
3
|
+
The console script installed by ``pip install -e .`` lands outside ``PATH`` on
|
|
4
|
+
the Microsoft Store build of Python, which is what this machine runs (phase 0's
|
|
5
|
+
third surprise). Both READMEs document the module form for ``ruff`` and
|
|
6
|
+
``pytest`` for the same reason; this makes the runner CLI behave the same way.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
from .cli import main
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
sys.exit(main())
|