Skip to content

Instantly share code, notes, and snippets.

View DiTo97's full-sized avatar

Federico Minutoli DiTo97

View GitHub Profile
# /// script
# dependencies = [
# "openai-agents",
# ]
# ///
import asyncio
import json
from dataclasses import dataclass
from typing import Sequence, AsyncGenerator
@DiTo97
DiTo97 / AGENTS.md.reviewer.md
Created January 7, 2026 20:59
The configuration file for the AI reviewer of AGENTS.md file definitions.
name description tools
agents-md-reviewer
Analyzes and optimizes AGENTS.md files and their docs following best practices for AI coding agents
read
search
edit

You are an expert AGENTS.md reviewer and optimizer. Your role is to analyze repository AGENTS.md files and their supporting documentation (AGENTS-docs folder), then optimize them according to proven best practices for AI coding agent configuration.

Core Principles

@DiTo97
DiTo97 / e2e_embeddings_pipeline.py
Last active January 8, 2026 01:36
end-to-end pipeline for hard-negative mining, Sentence-Transformers training, and evaluation
# /// script
# dependencies = [
# "sentence-transformers>=2.6.0",
# "datasets",
# "rank-bm25",
# "faiss-cpu",
# "tqdm",
# "torch",
# ]
# ///
@DiTo97
DiTo97 / mappamia.py
Last active December 30, 2025 15:03
CLI tool generating SVG maps of any country with Google Maps-style pin markers.
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "aiohttp",
# "geopandas",
# "geopy",
# "matplotlib",
# "rich",
# "scipy",
# "svgpath2mpl",
@DiTo97
DiTo97 / safeasyncio.py
Last active January 7, 2026 18:10
A collection of utilities for safely executing asynchronous coroutines
import asyncio
import atexit
import functools
import threading
from typing import Any, Callable, Coroutine, ParamSpec
P = ParamSpec("P")
@DiTo97
DiTo97 / sampling_methods_for_evaluation.py
Last active December 14, 2025 04:09
efficient and reliable sampling methodologies for pass@k and pass^k evaluation
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "scipy>1,<2",
# ]
# ///
import math
import random
from dataclasses import dataclass, field
@DiTo97
DiTo97 / a2a_distributed_queue.py
Last active October 18, 2025 15:18
A2A event queue and queue manager using Redis
import asyncio
import json
import logging
import uuid
import redis.asyncio as redis
from a2a.server.events.event_queue import EventQueue
from a2a.server.events.queue_manager import (
NoTaskQueue,
@DiTo97
DiTo97 / !telemetry.py
Last active October 18, 2025 15:26
OpenTelemetry tracing utilities for any library.
"""OpenTelemetry tracing utilities for any library.
This module provides decorators to simplify the integration of OpenTelemetry
tracing into Python applications. It offers `trace_function` for instrumenting
individual functions (both synchronous and asynchronous) and `trace_class`
for instrumenting multiple methods within a class.
The tracer is initialized with the module name and version defined by
`INSTRUMENTING_MODULE` ('<module>') and
`INSTRUMENTING_MODULE_VERSION` ('<version>').
import asyncio
import json
import os
import re
import typing
import uuid
from contextlib import contextmanager
from typing import Any
import numpy as np
@DiTo97
DiTo97 / !database.py
Last active March 13, 2025 02:16
A feature-rich database model for use with SQLAlchemy's ORM abstraction
import typing
from uuid import UUID, uuid4
from datetime import datetime, timezone
from functools import partial
from typing import Any
from pydantic import BaseModel
from sqlalchemy import select, func, sql
from sqlalchemy.dialects.mysql import insert as mysql_insert
from sqlalchemy.dialects.postgresql import insert as postgres_insert