Skip to content

Instantly share code, notes, and snippets.

View bizrockman's full-sized avatar

Danny Gerst bizrockman

View GitHub Profile
{
"openapi": "3.0.3",
"info": {
"title": "Context7 Documentation API",
"description": "Search programming libraries and retrieve up-to-date documentation and code examples. Use search_libraries first to resolve a library name to a Context7 library ID, then use query_documentation to fetch relevant docs.",
"version": "2.0.0",
"contact": {
"name": "Context7",
"url": "https://context7.com"
}
"""
Supabase RLS (Row Level Security) Audit Script
================================================
Testet ob die RLS-Policies einer Supabase-Instanz korrekt konfiguriert sind.
Verwendet nur den öffentlich sichtbaren anon-Key (kein Service-Key nötig).
"""
import httpx
import json
import sys
@bizrockman
bizrockman / llm_utils.py
Last active August 20, 2025 19:59
Adjustment to llm_utils of the tau2 Benchmark, to utilize new models and llm abilitites
import json
import os
import re
from typing import Any, Optional
import litellm
from litellm import completion, completion_cost
from litellm.caching.caching import Cache
from litellm.main import ModelResponse, Usage
from loguru import logger
@bizrockman
bizrockman / tau2_summarizer.py
Created August 15, 2025 00:02
A simple script to give a summarization of a tau2 run
#!/usr/bin/env python3
"""
tau2_summarizer.py
------------------
Summarize Tau²-Bench result files (JSON) for Dual-Control, Retail runs.
- Reads a Tau² result JSON (created via `--save-to ...`)
- Aggregates per-task token usage and durations
- Computes Pass@1, totals, and normalized "per interaction" metrics (Dual = 2 * tasks)
- Optionally computes costs if prices are provided (USD per 1M tokens for input/output)
@bizrockman
bizrockman / llm_utils.py
Created August 14, 2025 23:33
Adjusted only to be run with GLM-4.5 in tau2
import json
import os
import re
from typing import Any, Optional
import litellm
from litellm import completion, completion_cost
from litellm.caching.caching import Cache
from litellm.main import ModelResponse, Usage
from loguru import logger
@bizrockman
bizrockman / context7_openapi_llm_friendly.json
Created July 10, 2025 16:13
LLM friendly OpenAPI Spec for Context7
{
"openapi": "3.0.0",
"info": {
"title": "Context7 API",
"version": "1.0.0",
"description": "LLM-optimized interface for accessing Context7 developer documentation."
},
"servers": [
{
"url": "https://context7.com/api/v1"
@bizrockman
bizrockman / appwrite_get_documents.py
Last active October 25, 2024 09:16
Basic Call to get all documents
from appwrite.client import Client
from appwrite.services.databases import Databases
from appwrite.services.storage import Storage
from appwrite.query import Query
...
app_database = Databases(appwrite_client)
result = database.list_documents(
database_id=database_id,
@bizrockman
bizrockman / main.py
Last active October 25, 2024 09:09
Create an appwrite Client in Python
from appwrite.client import Client
from dotenv import load_dotenv
def init_appwrite_client() -> Client:
'''
Init Appwrite client and return Databases object
'''
client = Client()
client.set_endpoint(os.getenv("APPWRITE_ENDPOINT"))
client.set_project(os.getenv("APPWRITE_PROJECT_ID"))
import os
from openai import OpenAI
import json
import re
import hashlib
import random
from tqdm import tqdm
from dotenv import load_dotenv
load_dotenv()
@bizrockman
bizrockman / autogen_openai_assistant.py
Created July 21, 2024 12:16
AutoGen - OpenAI Assistant
import os
from autogen import UserProxyAgent
from autogen.agentchat.contrib.gpt_assistant_agent import GPTAssistantAgent
os.environ["AUTOGEN_USE_DOCKER"] = "False"
config_list = [
{
"model": "gpt-4o",
"api_key": "sk-..."
}