Skip to main content

evoduce (Python)

Client for the Evoduce API. Check a proposed term against your vocabulary and get a proven verdict, or ask a decision and have your own rules answer before a model does.

pip install evoduce
export EVODUCE_API_KEY=evd_...
from evoduce import Client

vocab = {
    "name": "spatial_relations",
    "axes": {"duration": {"values": ["absolute", "temporary"]},
             "type": {"values": ["contact", "proximity", "containment"]}},
    "rules": [{"type": "AXIS_COVERAGE"}, {"type": "REQUIRES_INVERSE"}, {"type": "NO_DUPLICATE"}],
    "predicates": {},
}

with Client() as nse:
    r = nse.verify(vocab, "resting_on", duration="temporary", type="contact")
    if not r.sat:
        print(r.violated_rules, r.counterexample)   # ['REQUIRES_INVERSE'] {...}

    grown = nse.accept(vocab, "resting_on", inverse="supports", duration="temporary", type="contact")
    vocab = grown.vocabulary or vocab                # persist this yourself

Methods: verify, verify_graded, accept, optimize, prove, audit. A neurosymbolic_evaluator.Vocabulary is accepted anywhere a vocabulary dict is. Non-2xx responses raise EvoduceError (.status, .detail, .retry_after); an UNSAT verdict is a normal result with sat=False.

Typed decisions from an NS vocabulary

Pass a vocabulary on a Choice question to use its predicate names as options. The gateway checks account decision rules first, then a model answers when needed. Your Evoduce key is all it needs: model answers are included with it and show in your usage. Confident model answers become observations for that question id's learning policy.

question = {"route": {
    "type": "choice", "instructions": "Which team should handle this ticket?",
    "vocabulary": route_vocabulary,  # dict or neurosymbolic_evaluator.Vocabulary
}}
result = nse.systemone({"category": "refund"}, question)
print(result["answers"]["route"]["choice"], result["evoduce"]["sources"]["route"])
pending = nse.get_policy("route")["learned"]
# Review pending rules, then call nse.approve_policy("route", indexes=[0]).

The same gateway takes OpenAI's Decisions request shape. Questions are a list; a question's name is its question id, and it may carry inline rules:

result = nse.decisions(
    "The package arrived with a broken screen.",
    [{"type": "predicate", "name": "damaged", "instructions": "Does the customer report a damaged item?"}],
)
print(result["answers"][0]["probability"], result["evoduce"]["sources"][0])

To have a provider answer on your own account instead, pass your key for it: upstream_key=jev_api_key to systemone, upstream_key=openai_api_key to decisions. Those answers are not counted against your monthly model answers. After a quiet spell the model can take about a minute to start; a call that arrives while it does raises EvoduceError with status 503 and retry_after set to the seconds to wait.

put_policy sets rules and learning mode. The vocabulary governs allowed terms; a model choice is a judgment, while vocabulary additions use verify or accept.

Metadata

Release files for evoduce 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evoduce 0.1.0
File Size Uploaded Provenance Actions
evoduce-0.1.0.tar.gz 13.4 kB Without provenance Details for evoduce-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for evoduce 0.1.0
File Interpreter ABI Platform Actions
evoduce-0.1.0-py3-none-any.whl Python 3 none any Details for evoduce-0.1.0-py3-none-any.whl

Total release size: 22.8 kB

Release files / evoduce-0.1.0.tar.gz

Download URL evoduce-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
76eeb1c4136d8cd0017b60b5a15669c1a20f27d8b0e4218b0b9c5c01dc1df35e
BLAKE2b-256 checksum
How to use checksums
fbdcd313a91ebebbf5dccdc278850b4bf954c4aad7e11375502a8876b9557189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / evoduce-0.1.0-py3-none-any.whl

Download URL evoduce-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7430265003945b3d6cdac02b23c1b0a7d73cf296e4b9a3fcf7d7d2c6f1e353
BLAKE2b-256 checksum
How to use checksums
1da6ce9d9e948fd8a6031f600a5bd85f9080181a88fe19ccc2b2b0d8f8608b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for evoduce 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page