geometor.arcprize.solvers.gemini_logger

class geometor.arcprize.solvers.gemini_logger.Indexer(output_dir: str, puzzle_id: str, timestamp: str)[source]

Bases: object

Manages the creation and updating of session, puzzle, and main index files.

update_session_results()[source]

Generate and update session results summary.

update_indices()[source]

Update all indices including results summary.

class geometor.arcprize.solvers.gemini_logger.Logger(output_dir: str, puzzle_id: str, timestamp: str)[source]

Bases: object

save_response(response: dict, call_count: int)[source]

Save raw response data as JSON.

save_grid_image(grid_image, call_count: int, context: str) Path[source]

Save a grid image with deduplication.

parameters

grid_image :

PIL Image to save

call_count :

Current call number

context :

Image context (e.g., ‘example_1_input’, ‘working’)

returns

rel_pathPath

Relative path to the image file

write_rst_log(log_list: list, log_type: str, call_count: int, usage_data=None, description='')[source]

Write log as RST file and handle any images.

parameters

log_listlist

The list of log content parts (strings, images, etc.)

log_typestr

The type of log (e.g., “prompt”, “response”)

call_countint

The call count for naming the log file

usage_datadict, optional

Data related to model usage (e.g., token counts, timing)

log_error(error_message: str, context: str = '')[source]

Log an error message to a file.

parameters

error_messagestr

The error message to be logged.

contextstr

Additional context or history information to provide.