Package genlayer.std.eq_principles#

Warning

This is an internal module

genlayer.std.eq_principles.eq_principle_prompt_comparative(fn: Callable[[], Any], principle: str) str[source]#

Comparative equivalence principle that utilizes NLP for verifying that results are equivalent

Parameters:
  • fn (Callable[[], Any]) – function that does all the job

  • principle (str) – principle with which equivalence will be evaluated in the validator

Return type:

str

Note

As leader results are encoded as calldata, format() is used for string representation. However, operating on strings by yourself is more safe in general

Note

supports .lazy() version, which will return Lazy

genlayer.std.eq_principles.eq_principle_prompt_non_comparative(fn: Callable[[], str], *, task: str, criteria: str) str[source]#

Non-comparative equivalence principle that must cover most common use cases

Both leader and validator finish their execution via NLP, that is used to perform task on input. Leader just executes this task, but the validator checks if task was performed with integrity. This principle is useful when task is subjective

Note

supports .lazy() version, which will return Lazy

Return type:

str

genlayer.std.eq_principles.eq_principle_strict_eq(fn: Callable[[], T]) T[source]#

Comparative equivalence principle that checks for strict equality

Parameters:

fn (Callable[[], T]) – functions to perform an action

Return type:

T

Note

supports .lazy() version, which will return Lazy