Download the PHP package gawrys/counterparty-ai without Composer
On this page you can find all versions of the php package gawrys/counterparty-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package counterparty-ai
Counterparty AI
Optional AI-assisted risk research for the
Counterparty Verification toolkit. It
plugs into the same RiskStrategy seam as the rule-based default and adds qualitative,
advisory context using an LLM with native tool use.
⚠️ The AI never decides hard pass/fail. It consumes the finished verification report as ground truth, grounds every claim in a tool's source URL (no source → inconclusive), and forces human review below a confidence threshold. Output is advisory only.
A separate package on purpose: prompts change often and must not bump the core's version.
Features
AiRiskStrategy- a drop-inRiskStrategy; PSR-16 cached by counterparty + report + prompt version to bound cost.- Native tool use (function calling) - the model invokes
registry_lookup,web_searchandverification_report; the provider executes them and feeds results back, looping until the findings JSON is returned. - Two reference providers over PSR-18, no SDK -
AnthropicResearchProvider,OpenAiResearchProvider. Adding another LLM is oneAbstractAiResearchProvidersubclass. - Structured output, validated - force JSON, parse, validate, retry; malformed output is never trusted.
- Deterministic test kit -
FakeAiResearchProvider, recorded cassettes and an in-memory PSR-16 cache, so tests run offline.
Installation
Usage
Switching LLM is a one-line change (OpenAiResearchProvider), or implement
AbstractAiResearchProvider::complete() for any other backend. Removing this package never
breaks the rule-based default - the core has no dependency on it.
See the documentation for prompts, grounding rules and writing custom tools.
Testing
Changelog
See CHANGELOG.md.
Contributing & Security
Pull requests welcome. Report security issues privately - see SECURITY.md.
Credits
License
The MIT License (MIT). See LICENSE.
All versions of counterparty-ai with dependencies
gawrys/counterparty-core Version ^0.1
psr/simple-cache Version ^2.0 || ^3.0
psr/log Version ^2.0 || ^3.0