Skip to main content

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

Project description

fabricatio-judge

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Build Tool: uv

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 using either pip or uv:

pip install fabricatio[judge]
# or
uv pip install fabricatio[judge]

For a full installation that includes this package and all other components of fabricatio:

pip install fabricatio[full]
# or
uv 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

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.12-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fabricatio_judge-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_judge-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4c887b938007baae5ea73d78ffcba539d1c2724a756e8c880b955b78ccdcdc31
MD5 49e0a351a5b773441695e4c7613841fa
BLAKE2b-256 f07d6cfdc25ff23b4691cce5fb67739f0c85107b659bd94e5808016da752548a

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