build(agent): new-agents-4#58ba63 iteration
This commit is contained in:
parent
fe22020238
commit
a0ce9d2217
|
|
@ -0,0 +1,61 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .primitives import LocalProblem, SharedVariables, PlanDelta, DualVariables, PrivacyBudget, AuditLog, GraphOfContractsRegistry
|
||||
|
||||
|
||||
def sample_local_problem() -> LocalProblem:
|
||||
return LocalProblem(
|
||||
id="lp-demo",
|
||||
domain="equities",
|
||||
assets=["AAPL", "MSFT"],
|
||||
objective="minimize expected cost",
|
||||
constraints={"max_risk": 0.05},
|
||||
)
|
||||
|
||||
|
||||
def sample_shared_variables() -> SharedVariables:
|
||||
return SharedVariables(
|
||||
forecasts={"AAPL": 150.0, "MSFT": 300.0},
|
||||
priors={"AAPL": 149.5, "MSFT": 299.5},
|
||||
version=1,
|
||||
)
|
||||
|
||||
|
||||
def sample_plan_delta() -> PlanDelta:
|
||||
return PlanDelta(
|
||||
delta={"action": "rebalance", "targets": {"AAPL": 100}},
|
||||
timestamp=0.0,
|
||||
author="toy-simulator",
|
||||
contract_id="lp-demo",
|
||||
signature=None,
|
||||
)
|
||||
|
||||
|
||||
def sample_dual_variables() -> DualVariables:
|
||||
return DualVariables(lambda_latency=0.0, lambda_fees=0.0)
|
||||
|
||||
|
||||
def sample_privacy_budget() -> PrivacyBudget:
|
||||
return PrivacyBudget(budget=1.0, expiry=None)
|
||||
|
||||
|
||||
def sample_audit_log() -> AuditLog:
|
||||
import time
|
||||
return AuditLog(entry="demo", signer="toy-signer", timestamp=time.time(), contract_id="lp-demo", version=1)
|
||||
|
||||
|
||||
def sample_registry() -> GraphOfContractsRegistry:
|
||||
reg = GraphOfContractsRegistry()
|
||||
reg.register("adapter-demo", "v0.1")
|
||||
return reg
|
||||
|
||||
|
||||
__all__ = [
|
||||
"sample_local_problem",
|
||||
"sample_shared_variables",
|
||||
"sample_plan_delta",
|
||||
"sample_dual_variables",
|
||||
"sample_privacy_budget",
|
||||
"sample_audit_log",
|
||||
"sample_registry",
|
||||
]
|
||||
Loading…
Reference in New Issue