Llm Input

Module to convert problems to and from LLM input.

new_problem_from_llm_aux_output(initial_problem, aux_output, aux_tag)
Return type:

JGEXFormulation

problem_to_llm_input(problem, aux_tag, rng=None, max_attempts=200)

Convert a problem to a string that can be used as input for the LLM.

Parameters:
  • problem (JGEXFormulation) – The problem to convert.

  • aux_tag (str) – The tag to use for the aux clauses.

  • rng (Generator | None) – The random number generator to use.

  • max_attempts (int) – The maximum number of attempts to make for building the problem.

Return type:

str

problem_to_llm_input_without_predicates(problem)
Return type:

str

class TrainingDatapoint(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

aux_io: list[AuxTrainingDatapoint]

Aux input and output.

proof_output: str

Proof to predict.

classmethod from_proof_data(setup_data, proof_data, aux_tag)
Return type:

Self

classmethod from_proof_data_aux_combinations(setup_data, proof_data, aux_tag)
Return type:

Self

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class AuxTrainingDatapoint(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

input: str

Setup and given aux clauses plus the goal.

aux_output: str

Aux constructions plus theirs predicates to predict.

classmethod from_setup_data(setup_data, aux_tag)
Return type:

Self

classmethod from_setup_data_aux_combinations(setup_data, aux_tag)
Return type:

list[Self]

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].