omni-proof 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omni_proof-0.0.1/.claude/scheduled_tasks.lock +1 -0
- omni_proof-0.0.1/.coverage +0 -0
- omni_proof-0.0.1/.env.example +6 -0
- omni_proof-0.0.1/.github/workflows/ci.yml +47 -0
- omni_proof-0.0.1/.github/workflows/release.yml +65 -0
- omni_proof-0.0.1/.gitignore +15 -0
- omni_proof-0.0.1/CHANGELOG.md +48 -0
- omni_proof-0.0.1/CLAUDE.md +81 -0
- omni_proof-0.0.1/CONTRIBUTING.md +82 -0
- omni_proof-0.0.1/Dockerfile +18 -0
- omni_proof-0.0.1/LICENSE +21 -0
- omni_proof-0.0.1/Makefile +27 -0
- omni_proof-0.0.1/PKG-INFO +363 -0
- omni_proof-0.0.1/README.md +312 -0
- omni_proof-0.0.1/assets/logo.png +0 -0
- omni_proof-0.0.1/docker-compose.yml +22 -0
- omni_proof-0.0.1/docs/superpowers/plans/2026-03-14-brand-extractor.md +1870 -0
- omni_proof-0.0.1/docs/superpowers/specs/2026-03-14-brand-extractor-design.md +416 -0
- omni_proof-0.0.1/plans/causal-multimodal-engine-blueprint.md +565 -0
- omni_proof-0.0.1/plans/research/Causal Inference for Creative Performance.md +155 -0
- omni_proof-0.0.1/plans/research/Researching Ad Creative Attribution Engine.md +346 -0
- omni_proof-0.0.1/plans/specs/layer-1-ingestion.md +90 -0
- omni_proof-0.0.1/plans/specs/layer-2-storage.md +152 -0
- omni_proof-0.0.1/plans/specs/layer-3-causal-engine.md +76 -0
- omni_proof-0.0.1/plans/specs/layer-4-orchestration-rag.md +69 -0
- omni_proof-0.0.1/plans/specs/layer-5-dashboard-generative.md +89 -0
- omni_proof-0.0.1/pyproject.toml +76 -0
- omni_proof-0.0.1/src/omni_proof/__init__.py +30 -0
- omni_proof-0.0.1/src/omni_proof/api/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/api/app.py +54 -0
- omni_proof-0.0.1/src/omni_proof/api/deps.py +10 -0
- omni_proof-0.0.1/src/omni_proof/api/generative_loop.py +44 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/brand.py +68 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/causal.py +36 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/compliance.py +35 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/generative.py +34 -0
- omni_proof-0.0.1/src/omni_proof/api/routes/insights.py +15 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/__init__.py +6 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/asset_processor.py +67 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/conflict_detector.py +166 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/extractor.py +119 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/models.py +88 -0
- omni_proof-0.0.1/src/omni_proof/brand_extraction/pattern_aggregator.py +197 -0
- omni_proof-0.0.1/src/omni_proof/causal/__init__.py +4 -0
- omni_proof-0.0.1/src/omni_proof/causal/base.py +53 -0
- omni_proof-0.0.1/src/omni_proof/causal/dag_builder.py +72 -0
- omni_proof-0.0.1/src/omni_proof/causal/dice_dml/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/causal/dice_dml/counterfactual_generator.py +57 -0
- omni_proof-0.0.1/src/omni_proof/causal/dice_dml/disentangler.py +45 -0
- omni_proof-0.0.1/src/omni_proof/causal/dice_dml/visual_estimator.py +55 -0
- omni_proof-0.0.1/src/omni_proof/causal/estimator.py +101 -0
- omni_proof-0.0.1/src/omni_proof/causal/identifier.py +25 -0
- omni_proof-0.0.1/src/omni_proof/causal/refuter.py +119 -0
- omni_proof-0.0.1/src/omni_proof/causal/results.py +35 -0
- omni_proof-0.0.1/src/omni_proof/config/__init__.py +3 -0
- omni_proof-0.0.1/src/omni_proof/config/constants.py +14 -0
- omni_proof-0.0.1/src/omni_proof/config/settings.py +15 -0
- omni_proof-0.0.1/src/omni_proof/core/__init__.py +5 -0
- omni_proof-0.0.1/src/omni_proof/core/exceptions.py +49 -0
- omni_proof-0.0.1/src/omni_proof/core/interfaces.py +30 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/enums.py +54 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/gemini_client.py +84 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/pipeline.py +36 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/preprocessor.py +62 -0
- omni_proof-0.0.1/src/omni_proof/ingestion/schemas.py +57 -0
- omni_proof-0.0.1/src/omni_proof/orchestration/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/orchestration/compliance_chain.py +57 -0
- omni_proof-0.0.1/src/omni_proof/orchestration/insight_synthesizer.py +69 -0
- omni_proof-0.0.1/src/omni_proof/orchestration/models.py +26 -0
- omni_proof-0.0.1/src/omni_proof/py.typed +0 -0
- omni_proof-0.0.1/src/omni_proof/rag/__init__.py +0 -0
- omni_proof-0.0.1/src/omni_proof/rag/brand_indexer.py +61 -0
- omni_proof-0.0.1/src/omni_proof/rag/brand_retriever.py +53 -0
- omni_proof-0.0.1/src/omni_proof/rag/models.py +33 -0
- omni_proof-0.0.1/src/omni_proof/storage/__init__.py +3 -0
- omni_proof-0.0.1/src/omni_proof/storage/memory_store.py +84 -0
- omni_proof-0.0.1/src/omni_proof/storage/models.py +59 -0
- omni_proof-0.0.1/src/omni_proof/storage/relational_store.py +59 -0
- omni_proof-0.0.1/src/omni_proof/storage/vector_store.py +97 -0
- omni_proof-0.0.1/tests/__init__.py +0 -0
- omni_proof-0.0.1/tests/fixtures/__init__.py +0 -0
- omni_proof-0.0.1/tests/fixtures/synthetic_ads.py +83 -0
- omni_proof-0.0.1/tests/integration/__init__.py +0 -0
- omni_proof-0.0.1/tests/integration/test_api_e2e.py +59 -0
- omni_proof-0.0.1/tests/integration/test_brand_compliance_e2e.py +50 -0
- omni_proof-0.0.1/tests/integration/test_brand_extraction_e2e.py +120 -0
- omni_proof-0.0.1/tests/integration/test_full_pipeline.py +120 -0
- omni_proof-0.0.1/tests/integration/test_generative_loop_e2e.py +62 -0
- omni_proof-0.0.1/tests/integration/test_storage_e2e.py +92 -0
- omni_proof-0.0.1/tests/unit/__init__.py +0 -0
- omni_proof-0.0.1/tests/unit/test_api_routes.py +114 -0
- omni_proof-0.0.1/tests/unit/test_asset_processor.py +161 -0
- omni_proof-0.0.1/tests/unit/test_brand_extraction_models.py +120 -0
- omni_proof-0.0.1/tests/unit/test_brand_extractor.py +143 -0
- omni_proof-0.0.1/tests/unit/test_brand_indexer.py +65 -0
- omni_proof-0.0.1/tests/unit/test_brand_retriever.py +81 -0
- omni_proof-0.0.1/tests/unit/test_compliance_chain.py +87 -0
- omni_proof-0.0.1/tests/unit/test_conflict_detector.py +249 -0
- omni_proof-0.0.1/tests/unit/test_counterfactual_generator.py +50 -0
- omni_proof-0.0.1/tests/unit/test_dag_builder.py +82 -0
- omni_proof-0.0.1/tests/unit/test_disentangler.py +59 -0
- omni_proof-0.0.1/tests/unit/test_enums.py +54 -0
- omni_proof-0.0.1/tests/unit/test_estimator.py +49 -0
- omni_proof-0.0.1/tests/unit/test_gemini_client.py +67 -0
- omni_proof-0.0.1/tests/unit/test_generative_loop.py +49 -0
- omni_proof-0.0.1/tests/unit/test_insight_synthesizer.py +80 -0
- omni_proof-0.0.1/tests/unit/test_memory_store.py +53 -0
- omni_proof-0.0.1/tests/unit/test_pattern_aggregator.py +378 -0
- omni_proof-0.0.1/tests/unit/test_pipeline.py +35 -0
- omni_proof-0.0.1/tests/unit/test_preprocessor.py +74 -0
- omni_proof-0.0.1/tests/unit/test_refuter.py +38 -0
- omni_proof-0.0.1/tests/unit/test_relational_store.py +99 -0
- omni_proof-0.0.1/tests/unit/test_schemas.py +134 -0
- omni_proof-0.0.1/tests/unit/test_storage_models.py +85 -0
- omni_proof-0.0.1/tests/unit/test_vector_store.py +97 -0
- omni_proof-0.0.1/tests/unit/test_visual_estimator.py +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"sessionId":"2ca994de-85ae-4b26-8b4d-cbdaa5f3ac43","pid":22746,"acquiredAt":1773525213679}
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
OMNI_PROOF_GEMINI_API_KEY=your-gemini-api-key
|
|
2
|
+
OMNI_PROOF_PINECONE_API_KEY=your-pinecone-api-key
|
|
3
|
+
OMNI_PROOF_PINECONE_INDEX_HOST=your-index-host.svc.pinecone.io
|
|
4
|
+
OMNI_PROOF_DATABASE_URL=sqlite+aiosqlite:///./omni_proof.db
|
|
5
|
+
OMNI_PROOF_EMBEDDING_DIMENSIONS=3072
|
|
6
|
+
OMNI_PROOF_LOG_LEVEL=INFO
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.11"
|
|
17
|
+
- run: pip install -e ".[dev]"
|
|
18
|
+
- name: Ruff check
|
|
19
|
+
run: ruff check src/ tests/
|
|
20
|
+
- name: Mypy
|
|
21
|
+
run: mypy src/omni_proof/ --ignore-missing-imports
|
|
22
|
+
|
|
23
|
+
test:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
strategy:
|
|
26
|
+
matrix:
|
|
27
|
+
python-version: ["3.11", "3.12"]
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: ${{ matrix.python-version }}
|
|
33
|
+
- run: pip install -e ".[dev]"
|
|
34
|
+
- name: Unit tests with coverage
|
|
35
|
+
run: pytest tests/unit/ -v --tb=short --cov=omni_proof --cov-report=term-missing --cov-fail-under=70
|
|
36
|
+
|
|
37
|
+
integration:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
needs: test
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
- uses: actions/setup-python@v5
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.11"
|
|
45
|
+
- run: pip install -e ".[dev]"
|
|
46
|
+
- name: Integration tests
|
|
47
|
+
run: pytest tests/integration/ -v --tb=short
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
# Only release from main branch
|
|
15
|
+
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event.base_ref == 'refs/heads/main' || github.sha == github.event.repository.default_branch
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Verify tag is on main
|
|
19
|
+
run: |
|
|
20
|
+
git fetch origin main
|
|
21
|
+
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
|
|
22
|
+
echo "ERROR: Tag is not on the main branch. Aborting release."
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
|
|
29
|
+
- name: Install build tools
|
|
30
|
+
run: pip install build
|
|
31
|
+
|
|
32
|
+
- name: Build package
|
|
33
|
+
run: python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload artifacts
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: dist
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
publish:
|
|
42
|
+
needs: build
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
environment: pypi
|
|
45
|
+
steps:
|
|
46
|
+
- name: Download artifacts
|
|
47
|
+
uses: actions/download-artifact@v4
|
|
48
|
+
with:
|
|
49
|
+
name: dist
|
|
50
|
+
path: dist/
|
|
51
|
+
|
|
52
|
+
- name: Publish to PyPI
|
|
53
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
54
|
+
|
|
55
|
+
github-release:
|
|
56
|
+
needs: publish
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
permissions:
|
|
59
|
+
contents: write
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- name: Create GitHub Release
|
|
63
|
+
env:
|
|
64
|
+
GH_TOKEN: ${{ github.token }}
|
|
65
|
+
run: gh release create "${{ github.ref_name }}" --generate-notes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.0.1] - 2026-03-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial project structure with src-layout and pyproject.toml configuration
|
|
12
|
+
- Multimodal ingestion pipeline with Gemini Embedding 2 support
|
|
13
|
+
- Preprocessing for images, video, audio, PDF, and text
|
|
14
|
+
- GeminiClient with retry logic and rate limiting
|
|
15
|
+
- IngestPipeline for end-to-end asset processing
|
|
16
|
+
- Vector storage layer with Pinecone integration
|
|
17
|
+
- Abstract VectorStore interface
|
|
18
|
+
- PineconeVectorStore implementation with namespaces
|
|
19
|
+
- Relational storage with SQLAlchemy 2.0 async
|
|
20
|
+
- Campaign, creative, and performance models
|
|
21
|
+
- Alembic migrations support
|
|
22
|
+
- Causal inference pipeline using DoWhy and EconML
|
|
23
|
+
- DAG builder for causal graph construction
|
|
24
|
+
- DML estimator (LinearDML, CausalForestDML)
|
|
25
|
+
- Refutation tests for sensitivity analysis
|
|
26
|
+
- DICE-DML for visual embedding counterfactuals
|
|
27
|
+
- Orchestration layer
|
|
28
|
+
- ComplianceChain for brand guideline validation
|
|
29
|
+
- InsightSynthesizer for generating actionable recommendations
|
|
30
|
+
- FastAPI-based dashboard API
|
|
31
|
+
- Campaign ingestion endpoint
|
|
32
|
+
- Brand compliance endpoints
|
|
33
|
+
- Causal analysis endpoints
|
|
34
|
+
- Generative prompt builder integration
|
|
35
|
+
- Comprehensive test suite
|
|
36
|
+
- 140 unit tests and 17 integration tests with pytest and pytest-asyncio
|
|
37
|
+
- Integration test scaffolding
|
|
38
|
+
- Development tooling
|
|
39
|
+
- Ruff for linting and formatting
|
|
40
|
+
- Type hints throughout codebase
|
|
41
|
+
- Structured logging with structlog
|
|
42
|
+
|
|
43
|
+
### Dependencies
|
|
44
|
+
- google-genai for Gemini API access
|
|
45
|
+
- pinecone for vector storage
|
|
46
|
+
- dowhy and econml for causal inference
|
|
47
|
+
- fastapi and uvicorn for API layer
|
|
48
|
+
- sqlalchemy and alembic for relational storage
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# OmniProof — AI Assistant Context
|
|
2
|
+
|
|
3
|
+
## Project
|
|
4
|
+
Causal-Multimodal Engine for Creative Performance Attribution using Gemini Embedding 2.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- Python 3.11+, src-layout, pyproject.toml (hatchling)
|
|
8
|
+
- Gemini Embedding 2 (gemini-embedding-2-preview) + Gemini 3.1 Flash Lite
|
|
9
|
+
- Pinecone serverless (vector DB)
|
|
10
|
+
- SQLAlchemy 2.0 async + Alembic (relational DB)
|
|
11
|
+
- DoWhy + EconML (causal inference)
|
|
12
|
+
- FastAPI (API layer)
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
```bash
|
|
16
|
+
pip install -e ".[dev]" # Install
|
|
17
|
+
pytest -v --tb=short # Run all tests (157)
|
|
18
|
+
pytest tests/unit/ -v # Unit tests (140)
|
|
19
|
+
pytest tests/integration/ -v # Integration tests (17)
|
|
20
|
+
ruff check src/ tests/ # Lint
|
|
21
|
+
ruff format src/ tests/ # Format
|
|
22
|
+
mypy src/omni_proof/ --ignore-missing-imports # Type check
|
|
23
|
+
python -m build # Build wheel + sdist
|
|
24
|
+
docker-compose up -d # Start API + PostgreSQL
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Environment Setup
|
|
28
|
+
Required env vars (prefix `OMNI_PROOF_`):
|
|
29
|
+
```bash
|
|
30
|
+
OMNI_PROOF_GEMINI_API_KEY=AIza... # Gemini API
|
|
31
|
+
OMNI_PROOF_PINECONE_API_KEY=pcsk_... # Pinecone
|
|
32
|
+
OMNI_PROOF_PINECONE_INDEX_HOST=https://... # Pinecone index URL
|
|
33
|
+
OMNI_PROOF_DATABASE_URL=sqlite+aiosqlite:///./omni_proof.db # Default
|
|
34
|
+
```
|
|
35
|
+
Causal analysis layer needs no API keys — works with local data only.
|
|
36
|
+
|
|
37
|
+
## Architecture (5 Layers)
|
|
38
|
+
1. **Ingestion** (`src/omni_proof/ingestion/`): AssetPreprocessor + GeminiClient + IngestPipeline
|
|
39
|
+
2. **Storage** (`src/omni_proof/storage/`): PineconeVectorStore + InMemoryVectorStore + RelationalStore
|
|
40
|
+
3. **Causal** (`src/omni_proof/causal/`): DAG builder + DML estimator + refuter + DICE-DML
|
|
41
|
+
4. **Brand & Orchestration** (`src/omni_proof/brand_extraction/`, `src/omni_proof/orchestration/`): BrandExtractor + ComplianceChain + InsightSynthesizer
|
|
42
|
+
5. **API** (`src/omni_proof/api/`): FastAPI routes + GenerativePromptBuilder
|
|
43
|
+
|
|
44
|
+
## Key Patterns
|
|
45
|
+
- All Gemini calls go through GeminiClient (retry + rate limiting)
|
|
46
|
+
- Vector store uses abstract VectorStore interface (Pinecone + InMemory implementations)
|
|
47
|
+
- Causal pipeline: DAG -> Identify -> Estimate (DML) -> Refute
|
|
48
|
+
- DICE-DML for visual embeddings: counterfactual pairs -> disentangle -> estimate
|
|
49
|
+
- Brand compliance: embed asset -> retrieve guidelines (RAG) -> evaluate -> report
|
|
50
|
+
- BrandExtractor: extract structured brand identity from multimodal assets with conflict detection
|
|
51
|
+
|
|
52
|
+
## Gotchas
|
|
53
|
+
- Use `async_sessionmaker` (not `sessionmaker`) for SQLAlchemy async — mypy rejects the sync overload with AsyncEngine
|
|
54
|
+
- `Counter` variables need explicit type annotations (`Counter[str]`) for mypy
|
|
55
|
+
- Gemini `generate_embedding` config dict must be typed `dict[str, Any]` because it mixes `int` and `str` values
|
|
56
|
+
- DAG template values from dicts are `Sequence[str]` — cast with `str()` / `list()` before passing to typed methods
|
|
57
|
+
- `generate_embedding` retry loop needs an explicit `raise` after the loop for mypy return-type satisfaction
|
|
58
|
+
|
|
59
|
+
## Releasing to PyPI
|
|
60
|
+
Tags must be on the `main` branch — the release workflow rejects tags on other branches.
|
|
61
|
+
```bash
|
|
62
|
+
# 1. Update version in pyproject.toml
|
|
63
|
+
# 2. Update CHANGELOG.md (change "Unreleased" to date)
|
|
64
|
+
# 3. Commit, push to main
|
|
65
|
+
git tag v0.1.0
|
|
66
|
+
git push origin v0.1.0
|
|
67
|
+
```
|
|
68
|
+
This triggers `.github/workflows/release.yml` which:
|
|
69
|
+
1. Verifies the tag is on `main`
|
|
70
|
+
2. Builds wheel + sdist
|
|
71
|
+
3. Publishes to PyPI (trusted publisher — no token needed)
|
|
72
|
+
4. Creates a GitHub Release with auto-generated notes
|
|
73
|
+
|
|
74
|
+
**Prerequisites:** Configure [PyPI trusted publishing](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) with owner `navidgh66`, repo `omni_proof`, workflow `release.yml`, environment `pypi`. Also create a `pypi` environment in GitHub repo settings.
|
|
75
|
+
|
|
76
|
+
## Gemini Embedding 2 Limits
|
|
77
|
+
- Video: 80s (with audio) / 120s (without)
|
|
78
|
+
- Audio: 80s max
|
|
79
|
+
- Images: 6 per request
|
|
80
|
+
- PDF: 1 doc, 6 pages
|
|
81
|
+
- Output: 3072 dims (Matryoshka: 128/768/1536/3072)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Contributing to OmniProof
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to OmniProof!
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. Clone the repository:
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/your-org/omni_proof.git
|
|
10
|
+
cd omni_proof
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Install in development mode:
|
|
14
|
+
```bash
|
|
15
|
+
pip install -e ".[dev]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
3. Set up environment variables:
|
|
19
|
+
```bash
|
|
20
|
+
cp .env.example .env
|
|
21
|
+
# Edit .env with your API keys (GEMINI_API_KEY, PINECONE_API_KEY, etc.)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Running Tests
|
|
25
|
+
|
|
26
|
+
Run all tests:
|
|
27
|
+
```bash
|
|
28
|
+
pytest -v --tb=short
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run only unit tests:
|
|
32
|
+
```bash
|
|
33
|
+
pytest tests/unit/ -v
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Run only integration tests:
|
|
37
|
+
```bash
|
|
38
|
+
pytest tests/integration/ -v
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run with coverage:
|
|
42
|
+
```bash
|
|
43
|
+
pytest --cov=src/omni_proof --cov-report=term-missing
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Code Quality
|
|
47
|
+
|
|
48
|
+
Lint your code:
|
|
49
|
+
```bash
|
|
50
|
+
ruff check src/ tests/
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Format your code:
|
|
54
|
+
```bash
|
|
55
|
+
ruff format src/ tests/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Type checking (optional):
|
|
59
|
+
```bash
|
|
60
|
+
mypy src/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Pull Request Guidelines
|
|
64
|
+
|
|
65
|
+
1. **Keep PRs focused**: One feature or fix per PR
|
|
66
|
+
2. **Write tests**: Add unit tests for new functionality
|
|
67
|
+
3. **Follow existing patterns**: Match the project's architecture and style
|
|
68
|
+
4. **Update documentation**: Add docstrings and update README if needed
|
|
69
|
+
5. **Run tests locally**: Ensure all tests pass before submitting
|
|
70
|
+
6. **Write clear commit messages**: Use descriptive commit messages
|
|
71
|
+
|
|
72
|
+
## Code Style
|
|
73
|
+
|
|
74
|
+
- Python 3.11+ features are encouraged
|
|
75
|
+
- Follow PEP 8 (enforced by Ruff)
|
|
76
|
+
- Use type hints where possible
|
|
77
|
+
- Keep line length to 100 characters
|
|
78
|
+
- Write docstrings for public APIs
|
|
79
|
+
|
|
80
|
+
## Questions?
|
|
81
|
+
|
|
82
|
+
Open an issue for discussion before starting major changes.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
COPY pyproject.toml .
|
|
6
|
+
COPY src/ src/
|
|
7
|
+
|
|
8
|
+
RUN pip install --no-cache-dir . \
|
|
9
|
+
&& useradd --create-home appuser
|
|
10
|
+
|
|
11
|
+
USER appuser
|
|
12
|
+
|
|
13
|
+
EXPOSE 8000
|
|
14
|
+
|
|
15
|
+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
16
|
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
|
|
17
|
+
|
|
18
|
+
CMD ["uvicorn", "omni_proof.api.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]
|
omni_proof-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 OmniProof Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.PHONY: install test lint format build clean publish-test publish
|
|
2
|
+
|
|
3
|
+
install:
|
|
4
|
+
pip install -e ".[dev]"
|
|
5
|
+
|
|
6
|
+
test:
|
|
7
|
+
pytest -v --tb=short
|
|
8
|
+
|
|
9
|
+
lint:
|
|
10
|
+
ruff check src/ tests/
|
|
11
|
+
mypy src/
|
|
12
|
+
|
|
13
|
+
format:
|
|
14
|
+
ruff format src/ tests/
|
|
15
|
+
ruff check --fix src/ tests/
|
|
16
|
+
|
|
17
|
+
build:
|
|
18
|
+
pip install build && python -m build
|
|
19
|
+
|
|
20
|
+
clean:
|
|
21
|
+
rm -rf dist/ build/ *.egg-info src/*.egg-info
|
|
22
|
+
|
|
23
|
+
publish-test:
|
|
24
|
+
pip install twine && twine upload --repository testpypi dist/*
|
|
25
|
+
|
|
26
|
+
publish:
|
|
27
|
+
pip install twine && twine upload dist/*
|