Skip to main content

fabricatio-judge extends the Fabricatio ecosystem to provide advanced judgment capabilities for LLM-driven applications.

Project description

fabricatio-judge

A Python module for evidence-based decision making in LLM applications.

📦 Installation

This package is part of the fabricatio monorepo and can be installed as an optional dependency:

pip install fabricatio[judge]

Or install all components:

pip install fabricatio[full]

🔍 Overview

Provides the AdvancedJudge class for structured judgment tasks, using collected evidence to determine a final boolean The AdvancedJudge class is the core of this module. It uses a structured approach to collect and analyze evidence. It can handle different types of evidence, such as text, numerical data, and expert opinions. The evidence is then used to make a binary decision (true or false) based on predefined rules and algorithms. verdict.

Key Features:

  • Asynchronous judgment execution Asynchronous judgment execution allows the module to perform multiple judgment tasks simultaneously without blocking the main thread. This is particularly useful in applications where real - time responses are required. For example, in a chatbot application, the judge can evaluate multiple user queries concurrently, improving the overall performance and responsiveness.
  • Evidence tracking (affirmative & denying) The evidence tracking feature keeps a record of both affirmative and denying evidence. Affirmative evidence supports the positive outcome of the judgment, while denying evidence supports the negative outcome. This helps in making more informed decisions and provides transparency in the judgment process. For example, in a legal application, the judge can track the evidence presented by both the prosecution and the defense.
  • Integration with Fabricatio agent framework The integration with the Fabricatio agent framework allows the AdvancedJudge class to communicate and collaborate with other agents in the system. It can receive evidence from other agents, share its judgment results, and participate in complex workflows. This enables the creation of more sophisticated and intelligent applications. For example, in a multi - agent system for project management, the judge can interact with agents responsible for task management and resource allocation.
  • Extensible for custom logic The module is designed to be extensible, allowing users to implement custom logic. Users can subclass the AdvancedJudge class and override its methods to add their own rules and algorithms. This provides flexibility and adaptability to different application requirements. For example, in a domain - specific application, users can define their own evidence evaluation criteria and decision - making processes.

🧩 Usage

from fabricatio.capabilities import EvidentlyJudge

The
`EvidentlyJudge`


class is imported from the `fabricatio.capabilities` module.It provides a set of methods for evidence collection, analysis, and judgment.To use it, you can create an instance of the class and call its methods to perform judgment tasks.


from fabricatio.models import JudgeMent

The
`JudgeMent`
model
represents
the
result
of
a
judgment
task.It
contains
attributes
such as the
final
verdict(a
boolean
value) and additional
information
about
the
judgment
process, such as the
evidence
used and the
decision - making
steps.


class MyJudge(EvidentlyJudge):
    pass  # Implement custom logic if needed


async def evaluate():
    judge = MyJudge()
    result: JudgeMent = await judge.evidently_judge("Is water wet?")
    The
    `evidently_judge`
    method is used
    to
    perform
    a
    judgment
    task.It
    takes
    a
    question or a
    statement as input and returns
    a
    `JudgeMent`
    object.In
    this
    example, the
    judge
    will
    collect
    evidence
    related
    to
    the
    question
    "Is water wet?" and make
    a
    decision
    based
    on
    the
    available
    evidence.
    print(f"Verdict: {result.final_judgement}")

📁 Structure

fabricatio-judge/
├── capabilities/     - Judgment logic (`AdvancedJudge`)
└── models/           - Judgment output model (`JudgeMent`)

📄 License

MIT – see LICENSE

GitHub: github.com/Whth/fabricatio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_judge-0.1.10-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file fabricatio_judge-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for fabricatio_judge-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a2c3ac88bc29abb306297687dd2dc16c096357242f9594ee14d928c1d095bdc6
MD5 90fad93c8720f9b2820dec8182087d43
BLAKE2b-256 acc94260cea1f773e660be2ee2ad8bbccc4444bcf78da40c54537c9289800855

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page