kodit 0.5.2__tar.gz → 0.5.4__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.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/test.yaml +1 -0
- {kodit-0.5.2 → kodit-0.5.4}/Makefile +1 -1
- {kodit-0.5.2 → kodit-0.5.4}/PKG-INFO +1 -1
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/index.md +1 -1
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/openapi.json +1 -1
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/configuration/index.md +6 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/_version.py +2 -2
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/factories/server_factory.py +0 -5
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/config.py +12 -0
- kodit-0.5.4/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py +107 -0
- kodit-0.5.4/src/kodit/infrastructure/enricher/litellm_enricher.py +83 -0
- kodit-0.5.4/src/kodit/infrastructure/providers/__init__.py +1 -0
- kodit-0.5.4/src/kodit/infrastructure/providers/async_batch_processor.py +51 -0
- kodit-0.5.4/src/kodit/infrastructure/providers/litellm_provider.py +154 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/log.py +10 -1
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/embedding_provider/litellm_embedding_provider_test.py +72 -156
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/test_litellm_socket_providers.py +4 -4
- kodit-0.5.4/tests/kodit/infrastructure/providers/__init__.py +1 -0
- kodit-0.5.4/tests/kodit/infrastructure/providers/litellm_provider_test.py +273 -0
- kodit-0.5.2/src/kodit/domain/services/enrichment_service.py +0 -27
- kodit-0.5.2/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py +0 -156
- kodit-0.5.2/src/kodit/infrastructure/enricher/litellm_enricher.py +0 -153
- kodit-0.5.2/tests/kodit/domain/enrichment_service_test.py +0 -120
- {kodit-0.5.2 → kodit-0.5.4}/.claude/commands/debug.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.claude/commands/new-requirement.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.claude/commands/refactor.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.claude/commands/update-docs.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.claude/settings.json +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.cursor/rules/style.mdc +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.dockerignore +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/dependabot.yml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/docker.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/docs.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.gitignore +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.python-version +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.vscode/launch.json +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/.vscode/settings.json +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/CLAUDE.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/Dockerfile +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/LICENSE +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/README.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/alembic.ini +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/_index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/demos/_index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/demos/go-simple-microservice/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/demos/knock-knock-auth/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/developer/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/getting-started/_index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/getting-started/installation/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/getting-started/integration/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/getting-started/quick-start/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/_index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/templates/_content.md.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/templates/_example.md.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/templates/_object_schema.md.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/templates/_security_scheme.md.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/api/templates/api_doc_template.md.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/configuration/templates/template.j2 +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/deployment/docker-compose.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/deployment/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/deployment/kubernetes.yaml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/hosted-kodit/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/indexing/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/mcp/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/sync/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/telemetry/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/docs/reference/troubleshooting/index.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/pyproject.toml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/.gitignore +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/app.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/factories/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/factories/reporting_factory.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/code_search_application_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/commit_indexing_application_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/enrichment_query_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/indexing_worker_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/queue_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/reporting.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/application/services/sync_scheduler.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/cli.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/cli_utils.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/database.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/architecture.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/physical/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/physical/discovery_notes.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/physical/formatter.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/architecture/physical/physical.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/development/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/development/development.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/development/snippet/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/development/snippet/snippet.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/enricher.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/enrichment.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/request.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/response.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/usage/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/usage/api_docs.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/enrichments/usage/usage.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/entities/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/entities/git.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/errors.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/factories/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/factories/git_repo_factory.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/protocols.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/bm25_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/embedding_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/git_repository_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/git_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/physical_architecture_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/services/task_status_query_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/tracking/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/tracking/resolution_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/tracking/trackable.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/domain/value_objects.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/client/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/client/base.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/client/exceptions.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/client/generated_endpoints.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/client/search_client.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/middleware/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/middleware/auth.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/dependencies.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/routers/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/routers/commits.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/routers/queue.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/routers/repositories.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/routers/search.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/commit.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/context.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/enrichment.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/queue.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/search.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/snippet.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/tag.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/api/v1/schemas/task_status.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/bm25/local_bm25_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/bm25/vectorchord_bm25_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/cloning/git/git_python_adaptor.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/cloning/git/working_copy.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/embedding_factory.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/embedding_providers/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/embedding_providers/batching.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/embedding_providers/hash_embedding_provider.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/embedding_providers/local_embedding_provider.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/local_vector_search_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/embedding/vectorchord_vector_search_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/enricher/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/enricher/enricher_factory.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/enricher/local_enricher.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/enricher/null_enricher.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/enricher/utils.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/git/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/git/git_utils.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/ignore/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/ignore/ignore_pattern_provider.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/indexing/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/indexing/fusion_service.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/enrichment_mapper.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/git_mapper.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/snippet_mapper.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/task_mapper.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/mappers/task_status_mapper.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/physical_architecture/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/physical_architecture/detectors/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/physical_architecture/detectors/docker_compose_detector.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/physical_architecture/formatters/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/physical_architecture/formatters/narrative_formatter.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/reporting/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/reporting/db_progress.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/reporting/log_progress.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/reporting/telemetry_progress.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/slicing/api_doc_extractor.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/slicing/ast_analyzer.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/slicing/slicer.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/embedding_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/enrichment_v2_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/entities.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/git_branch_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/git_commit_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/git_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/git_tag_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/snippet_v2_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/task_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/task_status_repository.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/infrastructure/sqlalchemy/unit_of_work.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/mcp.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/middleware.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/README +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/env.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/04b80f802e0c_foreign_key_review.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/19f8c7faf8b9_add_generic_enrichment_type.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/4073b33f9436_add_file_processing_flag.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/4552eb3f23ce_add_summary.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/7f15f878c3a1_add_new_git_entities.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/9cf0e87de578_add_queue.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/9e53ea8bb3b0_add_authors.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/b9cd1c3fd762_add_task_status.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/migrations/versions/f9e5ef5e688f_add_git_commits_number.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/py.typed +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/utils/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/utils/dump_config.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/utils/dump_openapi.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/utils/generate_api_paths.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/src/kodit/utils/path_utils.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/conftest.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/docker-smoke.sh +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/services/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/services/commit_indexing_application_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/services/queue_service_get_task_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/services/queue_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/application/services/reporting_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/cli_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/bm25_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/embedding_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/entities_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/language_detection_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/services/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/domain/services/git_repository_service_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/e2e.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/bm25/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/bm25/local_bm25_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/cloning/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/cloning/git/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/cloning/git/git_python_adaptor_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/cloning/git_cloning/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/cloning/git_cloning/working_copy_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/batching_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/embedding_factory_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/embedding_provider/hash_embedding_provider_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/embedding/embedding_provider/local_embedding_provider_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/enricher/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/enricher/null_enricher_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/mappers/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/mappers/git_mapper_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/detectors/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/detectors/docker_compose_detector_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/end_to_end_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/fixtures/simple_web_app/docker-compose.yml +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/formatters/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/physical_architecture/formatters/narrative_formatter_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/api_doc_extractor_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/ast_analyzer_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/c/main.c +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/c/models.c +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/c/models.h +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/c/utils.c +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/c/utils.h +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/cpp/main.cpp +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/cpp/models.cpp +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/cpp/models.hpp +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/cpp/utils.cpp +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/cpp/utils.hpp +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/csharp/Main.cs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/csharp/Models.cs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/csharp/Utils.cs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/css/components.css +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/css/main.css +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/css/utilities.css +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/go/api/pkg/controller/filestore.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/go/api/pkg/controller/filestore_test.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/go/main.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/go/models.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/go/utils.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/html/components.html +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/html/forms.html +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/html/main.html +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/java/Main.java +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/java/Models.java +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/java/Utils.java +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/javascript/main.js +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/javascript/models.js +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/javascript/utils.js +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/main.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/models.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/submodule/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/submodule/main.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/python/utils.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/rust/main.rs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/rust/models.rs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/data/rust/utils.rs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/slicing/slicer_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/csharp.cs +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/golang.go +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/javascript.js +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/knock_knock_server.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/python.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/snippets/typescript.tsx +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/embedding_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/enrichment_v2_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/git_branch_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/git_commit_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/git_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/git_tag_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/infrastructure/sqlalchemy/snippet_v2_repository_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/log_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/kodit/mcp_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/smoke.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/utils/__init__.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/utils/path_utils_test.py +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/tests/vectorchord-smoke.sh +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/understanding_architecture.md +0 -0
- {kodit-0.5.2 → kodit-0.5.4}/uv.lock +0 -0
|
@@ -12,7 +12,7 @@ look at the [hosted version](https://kodit.helix.ml/docs).
|
|
|
12
12
|
This is the REST API for the Kodit server. Please refer to the
|
|
13
13
|
[Kodit documentation](https://docs.helix.ml/kodit/) for more information.
|
|
14
14
|
|
|
15
|
-
Current version: 0.5.
|
|
15
|
+
Current version: 0.5.3
|
|
16
16
|
|
|
17
17
|
## Authentication
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "kodit API",
|
|
5
5
|
"description": "\nThis is the REST API for the Kodit server. Please refer to the\n[Kodit documentation](https://docs.helix.ml/kodit/) for more information.\n ",
|
|
6
|
-
"version": "0.5.
|
|
6
|
+
"version": "0.5.3"
|
|
7
7
|
},
|
|
8
8
|
"paths": {
|
|
9
9
|
"/healthz": {
|
|
@@ -24,6 +24,9 @@ Global context for the kodit project. Provides a shared state for the app.
|
|
|
24
24
|
| `EMBEDDING_ENDPOINT_NUM_PARALLEL_TASKS` | int | `10` | Number of parallel tasks to use for the endpoint |
|
|
25
25
|
| `EMBEDDING_ENDPOINT_SOCKET_PATH` | `str | None` | `None` | Unix socket path for local communication (e.g., /tmp/openai.sock) |
|
|
26
26
|
| `EMBEDDING_ENDPOINT_TIMEOUT` | float | `60` | Request timeout in seconds |
|
|
27
|
+
| `EMBEDDING_ENDPOINT_MAX_RETRIES` | int | `5` | Maximum number of retries for the endpoint |
|
|
28
|
+
| `EMBEDDING_ENDPOINT_INITIAL_DELAY` | float | `2.0` | Initial delay in seconds for the endpoint |
|
|
29
|
+
| `EMBEDDING_ENDPOINT_BACKOFF_FACTOR` | float | `2.0` | Backoff factor for the endpoint |
|
|
27
30
|
| `EMBEDDING_ENDPOINT_EXTRA_PARAMS` | `dict | None` | `None` | Extra provider-specific non-secret parameters for LiteLLM |
|
|
28
31
|
| `EMBEDDING_ENDPOINT_MAX_TOKENS` | int | `8000` | Conservative token limit for the embedding model |
|
|
29
32
|
| `ENRICHMENT_ENDPOINT` | `Endpoint | None` | `None` | Endpoint to use for enrichment. |
|
|
@@ -33,6 +36,9 @@ Global context for the kodit project. Provides a shared state for the app.
|
|
|
33
36
|
| `ENRICHMENT_ENDPOINT_NUM_PARALLEL_TASKS` | int | `10` | Number of parallel tasks to use for the endpoint |
|
|
34
37
|
| `ENRICHMENT_ENDPOINT_SOCKET_PATH` | `str | None` | `None` | Unix socket path for local communication (e.g., /tmp/openai.sock) |
|
|
35
38
|
| `ENRICHMENT_ENDPOINT_TIMEOUT` | float | `60` | Request timeout in seconds |
|
|
39
|
+
| `ENRICHMENT_ENDPOINT_MAX_RETRIES` | int | `5` | Maximum number of retries for the endpoint |
|
|
40
|
+
| `ENRICHMENT_ENDPOINT_INITIAL_DELAY` | float | `2.0` | Initial delay in seconds for the endpoint |
|
|
41
|
+
| `ENRICHMENT_ENDPOINT_BACKOFF_FACTOR` | float | `2.0` | Backoff factor for the endpoint |
|
|
36
42
|
| `ENRICHMENT_ENDPOINT_EXTRA_PARAMS` | `dict | None` | `None` | Extra provider-specific non-secret parameters for LiteLLM |
|
|
37
43
|
| `ENRICHMENT_ENDPOINT_MAX_TOKENS` | int | `8000` | Conservative token limit for the embedding model |
|
|
38
44
|
| `DEFAULT_SEARCH` | Search | `provider='sqlite'` | |
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.5.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 5,
|
|
31
|
+
__version__ = version = '0.5.4'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 5, 4)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Create a big object that contains all the application services."""
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
4
|
|
|
6
5
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
7
6
|
|
|
@@ -86,9 +85,6 @@ from kodit.infrastructure.sqlalchemy.task_status_repository import (
|
|
|
86
85
|
)
|
|
87
86
|
from kodit.infrastructure.sqlalchemy.unit_of_work import SqlAlchemyUnitOfWork
|
|
88
87
|
|
|
89
|
-
if TYPE_CHECKING:
|
|
90
|
-
from kodit.domain.services.enrichment_service import EnrichmentDomainService
|
|
91
|
-
|
|
92
88
|
|
|
93
89
|
class ServerFactory:
|
|
94
90
|
"""Factory for creating server application services."""
|
|
@@ -109,7 +105,6 @@ class ServerFactory:
|
|
|
109
105
|
self._commit_indexing_application_service: (
|
|
110
106
|
CommitIndexingApplicationService | None
|
|
111
107
|
) = None
|
|
112
|
-
self._enrichment_service: EnrichmentDomainService | None = None
|
|
113
108
|
self._enricher_service: Enricher | None = None
|
|
114
109
|
self._task_status_repository: TaskStatusRepository | None = None
|
|
115
110
|
self._operation: ProgressTracker | None = None
|
|
@@ -70,6 +70,18 @@ class Endpoint(BaseModel):
|
|
|
70
70
|
default=60,
|
|
71
71
|
description="Request timeout in seconds",
|
|
72
72
|
)
|
|
73
|
+
max_retries: int = Field(
|
|
74
|
+
default=5,
|
|
75
|
+
description="Maximum number of retries for the endpoint",
|
|
76
|
+
)
|
|
77
|
+
initial_delay: float = Field(
|
|
78
|
+
default=2.0,
|
|
79
|
+
description="Initial delay in seconds for the endpoint",
|
|
80
|
+
)
|
|
81
|
+
backoff_factor: float = Field(
|
|
82
|
+
default=2.0,
|
|
83
|
+
description="Backoff factor for the endpoint",
|
|
84
|
+
)
|
|
73
85
|
extra_params: dict[str, Any] | None = Field(
|
|
74
86
|
default=None,
|
|
75
87
|
description="Extra provider-specific non-secret parameters for LiteLLM",
|
kodit-0.5.4/src/kodit/infrastructure/embedding/embedding_providers/litellm_embedding_provider.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""LiteLLM embedding provider implementation."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import AsyncGenerator
|
|
4
|
+
|
|
5
|
+
import structlog
|
|
6
|
+
import tiktoken
|
|
7
|
+
|
|
8
|
+
from kodit.config import Endpoint
|
|
9
|
+
from kodit.domain.services.embedding_service import EmbeddingProvider
|
|
10
|
+
from kodit.domain.value_objects import EmbeddingRequest, EmbeddingResponse
|
|
11
|
+
from kodit.infrastructure.embedding.embedding_providers.batching import (
|
|
12
|
+
split_sub_batches,
|
|
13
|
+
)
|
|
14
|
+
from kodit.infrastructure.providers.async_batch_processor import (
|
|
15
|
+
process_items_concurrently,
|
|
16
|
+
)
|
|
17
|
+
from kodit.infrastructure.providers.litellm_provider import LiteLLMProvider
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class LiteLLMEmbeddingProvider(EmbeddingProvider):
|
|
21
|
+
"""LiteLLM embedding provider that supports 100+ providers."""
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
endpoint: Endpoint,
|
|
26
|
+
) -> None:
|
|
27
|
+
"""Initialize the LiteLLM embedding provider.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
endpoint: The endpoint configuration containing all settings.
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
self.endpoint = endpoint
|
|
34
|
+
self.log = structlog.get_logger(__name__)
|
|
35
|
+
self._encoding: tiktoken.Encoding | None = None
|
|
36
|
+
self.provider: LiteLLMProvider = LiteLLMProvider(self.endpoint)
|
|
37
|
+
|
|
38
|
+
def _split_sub_batches(
|
|
39
|
+
self, encoding: tiktoken.Encoding, data: list[EmbeddingRequest]
|
|
40
|
+
) -> list[list[EmbeddingRequest]]:
|
|
41
|
+
"""Proxy to the shared batching utility (kept for backward-compat)."""
|
|
42
|
+
return split_sub_batches(
|
|
43
|
+
encoding,
|
|
44
|
+
data,
|
|
45
|
+
max_tokens=self.endpoint.max_tokens,
|
|
46
|
+
batch_size=self.endpoint.num_parallel_tasks,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
async def embed(
|
|
50
|
+
self, data: list[EmbeddingRequest]
|
|
51
|
+
) -> AsyncGenerator[list[EmbeddingResponse], None]:
|
|
52
|
+
"""Embed a list of strings using LiteLLM."""
|
|
53
|
+
if not data:
|
|
54
|
+
yield []
|
|
55
|
+
return
|
|
56
|
+
|
|
57
|
+
# Split into batches
|
|
58
|
+
encoding = self._get_encoding()
|
|
59
|
+
batched_data = self._split_sub_batches(encoding, data)
|
|
60
|
+
|
|
61
|
+
async def _process_batch(
|
|
62
|
+
batch: list[EmbeddingRequest],
|
|
63
|
+
) -> list[EmbeddingResponse]:
|
|
64
|
+
texts = [item.text for item in batch]
|
|
65
|
+
response = await self.provider.embedding(texts)
|
|
66
|
+
embeddings_data = response.get("data", [])
|
|
67
|
+
|
|
68
|
+
# Handle mismatch between batch size and response size
|
|
69
|
+
if len(embeddings_data) != len(batch):
|
|
70
|
+
preview_response = embeddings_data[:3] if embeddings_data else None
|
|
71
|
+
self.log.error(
|
|
72
|
+
"Embedding response size mismatch",
|
|
73
|
+
batch_size=len(batch),
|
|
74
|
+
response_size=len(embeddings_data),
|
|
75
|
+
texts_preview=[t[:50] for t in texts[:3]],
|
|
76
|
+
response_preview=preview_response,
|
|
77
|
+
)
|
|
78
|
+
raise ValueError(
|
|
79
|
+
f"Expected {len(batch)} embeddings, got {len(embeddings_data)}"
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return [
|
|
83
|
+
EmbeddingResponse(
|
|
84
|
+
snippet_id=item.snippet_id,
|
|
85
|
+
embedding=emb_data.get("embedding", []),
|
|
86
|
+
)
|
|
87
|
+
for item, emb_data in zip(batch, embeddings_data, strict=True)
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
async for result in process_items_concurrently(
|
|
91
|
+
batched_data,
|
|
92
|
+
_process_batch,
|
|
93
|
+
self.endpoint.num_parallel_tasks,
|
|
94
|
+
):
|
|
95
|
+
yield result
|
|
96
|
+
|
|
97
|
+
async def close(self) -> None:
|
|
98
|
+
"""Close the provider."""
|
|
99
|
+
await self.provider.close()
|
|
100
|
+
|
|
101
|
+
def _get_encoding(self) -> tiktoken.Encoding:
|
|
102
|
+
"""Return (and cache) the tiktoken encoding for the chosen model."""
|
|
103
|
+
if self._encoding is None:
|
|
104
|
+
self._encoding = tiktoken.get_encoding(
|
|
105
|
+
"o200k_base"
|
|
106
|
+
) # Reasonable default for most models, but might not be perfect.
|
|
107
|
+
return self._encoding
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""LiteLLM enricher implementation."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import AsyncGenerator
|
|
4
|
+
|
|
5
|
+
import structlog
|
|
6
|
+
|
|
7
|
+
from kodit.config import Endpoint
|
|
8
|
+
from kodit.domain.enrichments.enricher import Enricher
|
|
9
|
+
from kodit.domain.enrichments.request import EnrichmentRequest
|
|
10
|
+
from kodit.domain.enrichments.response import EnrichmentResponse
|
|
11
|
+
from kodit.infrastructure.enricher.utils import clean_thinking_tags
|
|
12
|
+
from kodit.infrastructure.providers.async_batch_processor import (
|
|
13
|
+
process_items_concurrently,
|
|
14
|
+
)
|
|
15
|
+
from kodit.infrastructure.providers.litellm_provider import LiteLLMProvider
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class LiteLLMEnricher(Enricher):
|
|
19
|
+
"""LiteLLM enricher that supports 100+ providers."""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
endpoint: Endpoint,
|
|
24
|
+
) -> None:
|
|
25
|
+
"""Initialize the LiteLLM enricher.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
endpoint: The endpoint configuration containing all settings.
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
self.log = structlog.get_logger(__name__)
|
|
32
|
+
self.provider: LiteLLMProvider = LiteLLMProvider(endpoint)
|
|
33
|
+
self.endpoint = endpoint
|
|
34
|
+
|
|
35
|
+
async def enrich(
|
|
36
|
+
self, requests: list[EnrichmentRequest]
|
|
37
|
+
) -> AsyncGenerator[EnrichmentResponse, None]:
|
|
38
|
+
"""Enrich a list of requests using LiteLLM.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
requests: List of generic enrichment requests.
|
|
42
|
+
|
|
43
|
+
Yields:
|
|
44
|
+
Generic enrichment responses as they are processed.
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
if not requests:
|
|
48
|
+
self.log.warning("No requests for enrichment")
|
|
49
|
+
return
|
|
50
|
+
|
|
51
|
+
async def process_request(
|
|
52
|
+
request: EnrichmentRequest,
|
|
53
|
+
) -> EnrichmentResponse:
|
|
54
|
+
if not request.text:
|
|
55
|
+
return EnrichmentResponse(
|
|
56
|
+
id=request.id,
|
|
57
|
+
text="",
|
|
58
|
+
)
|
|
59
|
+
messages = [
|
|
60
|
+
{
|
|
61
|
+
"role": "system",
|
|
62
|
+
"content": request.system_prompt,
|
|
63
|
+
},
|
|
64
|
+
{"role": "user", "content": request.text},
|
|
65
|
+
]
|
|
66
|
+
response = await self.provider.chat_completion(messages)
|
|
67
|
+
content = (
|
|
68
|
+
response.get("choices", [{}])[0].get("message", {}).get("content", "")
|
|
69
|
+
)
|
|
70
|
+
cleaned_content = clean_thinking_tags(content or "")
|
|
71
|
+
return EnrichmentResponse(
|
|
72
|
+
id=request.id,
|
|
73
|
+
text=cleaned_content,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
async for result in process_items_concurrently(
|
|
77
|
+
requests, process_request, self.endpoint.num_parallel_tasks
|
|
78
|
+
):
|
|
79
|
+
yield result
|
|
80
|
+
|
|
81
|
+
async def close(self) -> None:
|
|
82
|
+
"""Close the enricher and cleanup HTTPX client if using Unix sockets."""
|
|
83
|
+
await self.provider.close()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Provider utilities for LiteLLM and async batch processing."""
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Generic async batch processor with semaphore-controlled concurrency."""
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
from collections.abc import AsyncGenerator, Awaitable, Callable
|
|
5
|
+
from typing import TypeVar
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T")
|
|
8
|
+
R = TypeVar("R")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
async def process_items_concurrently(
|
|
12
|
+
items: list[T],
|
|
13
|
+
process_fn: Callable[[T], Awaitable[R]],
|
|
14
|
+
max_parallel_tasks: int,
|
|
15
|
+
) -> AsyncGenerator[R, None]:
|
|
16
|
+
"""Process items concurrently with semaphore-controlled concurrency.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
items: List of items to process.
|
|
20
|
+
process_fn: Async function to process each item.
|
|
21
|
+
max_parallel_tasks: Maximum number of concurrent tasks.
|
|
22
|
+
|
|
23
|
+
Yields:
|
|
24
|
+
Results as they are completed (not necessarily in order).
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
if not items:
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
sem = asyncio.Semaphore(max_parallel_tasks)
|
|
31
|
+
|
|
32
|
+
async def _process_with_semaphore(item: T) -> R:
|
|
33
|
+
async with sem:
|
|
34
|
+
return await process_fn(item)
|
|
35
|
+
|
|
36
|
+
tasks: list[asyncio.Task[R]] = [
|
|
37
|
+
asyncio.create_task(_process_with_semaphore(item)) for item in items
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
for task in asyncio.as_completed(tasks):
|
|
42
|
+
yield await task
|
|
43
|
+
finally:
|
|
44
|
+
# Cancel any remaining tasks when generator exits
|
|
45
|
+
# (due to exception, Ctrl+C, or early consumer termination)
|
|
46
|
+
for task in tasks:
|
|
47
|
+
if not task.done():
|
|
48
|
+
task.cancel()
|
|
49
|
+
|
|
50
|
+
# Wait for all tasks to finish cancelling
|
|
51
|
+
await asyncio.gather(*tasks, return_exceptions=True)
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""LiteLLM provider implementation."""
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import functools
|
|
5
|
+
from collections.abc import Callable, Coroutine
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
import litellm
|
|
10
|
+
import structlog
|
|
11
|
+
from litellm import acompletion, aembedding
|
|
12
|
+
|
|
13
|
+
from kodit.config import Endpoint
|
|
14
|
+
|
|
15
|
+
ProviderMaxRetriesError = Exception("LiteLLM API error: Max retries exceeded")
|
|
16
|
+
|
|
17
|
+
RETRYABLE_ERRORS = (
|
|
18
|
+
litellm.exceptions.Timeout,
|
|
19
|
+
litellm.exceptions.RateLimitError,
|
|
20
|
+
litellm.exceptions.InternalServerError,
|
|
21
|
+
litellm.exceptions.ServiceUnavailableError,
|
|
22
|
+
litellm.exceptions.APIConnectionError,
|
|
23
|
+
litellm.exceptions.MidStreamFallbackError,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def litellm_retry(
|
|
28
|
+
func: Callable[..., Coroutine[Any, Any, Any]],
|
|
29
|
+
) -> Callable[..., Coroutine[Any, Any, Any]]:
|
|
30
|
+
"""Retry decorator for LiteLLM API calls with exponential backoff.
|
|
31
|
+
|
|
32
|
+
Extracts retry configuration from the endpoint attribute of the first
|
|
33
|
+
argument (self) if it's a LiteLLMProvider instance.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
@functools.wraps(func)
|
|
37
|
+
async def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
38
|
+
# Extract endpoint configuration from self if available
|
|
39
|
+
endpoint = None
|
|
40
|
+
if args and hasattr(args[0], "endpoint"):
|
|
41
|
+
endpoint = args[0].endpoint
|
|
42
|
+
|
|
43
|
+
# Use endpoint configuration or fall back to defaults
|
|
44
|
+
max_retries = endpoint.max_retries if endpoint else 5
|
|
45
|
+
initial_delay = endpoint.initial_delay if endpoint else 2.0
|
|
46
|
+
backoff_factor = endpoint.backoff_factor if endpoint else 2.0
|
|
47
|
+
|
|
48
|
+
retries = max_retries
|
|
49
|
+
delay = initial_delay
|
|
50
|
+
log: structlog.stdlib.BoundLogger = structlog.get_logger(__name__)
|
|
51
|
+
|
|
52
|
+
while True:
|
|
53
|
+
try:
|
|
54
|
+
return await func(*args, **kwargs)
|
|
55
|
+
except (asyncio.CancelledError, KeyboardInterrupt):
|
|
56
|
+
raise
|
|
57
|
+
except Exception as e:
|
|
58
|
+
if isinstance(e, RETRYABLE_ERRORS) and retries > 0:
|
|
59
|
+
log.warning(
|
|
60
|
+
"LiteLLM API error: Retrying",
|
|
61
|
+
error=e,
|
|
62
|
+
retries=retries,
|
|
63
|
+
backoff=delay,
|
|
64
|
+
)
|
|
65
|
+
try:
|
|
66
|
+
await asyncio.sleep(delay)
|
|
67
|
+
except (asyncio.CancelledError, KeyboardInterrupt):
|
|
68
|
+
# Cancellation during sleep should stop retries immediately
|
|
69
|
+
log.info("Retry cancelled during backoff")
|
|
70
|
+
raise
|
|
71
|
+
retries -= 1
|
|
72
|
+
delay *= backoff_factor
|
|
73
|
+
continue
|
|
74
|
+
|
|
75
|
+
exception_info = {
|
|
76
|
+
attr: getattr(e, attr)
|
|
77
|
+
for attr in dir(e)
|
|
78
|
+
if not attr.startswith("_")
|
|
79
|
+
}
|
|
80
|
+
log.exception(
|
|
81
|
+
"LiteLLM API error, check provider logs for details",
|
|
82
|
+
error=e,
|
|
83
|
+
exception_info=exception_info,
|
|
84
|
+
retries=retries,
|
|
85
|
+
backoff=delay,
|
|
86
|
+
)
|
|
87
|
+
raise
|
|
88
|
+
|
|
89
|
+
return wrapper
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class LiteLLMProvider:
|
|
93
|
+
"""LiteLLM provider that supports 100+ providers."""
|
|
94
|
+
|
|
95
|
+
def __init__(self, endpoint: Endpoint) -> None:
|
|
96
|
+
"""Initialize the LiteLLM provider."""
|
|
97
|
+
self.endpoint = endpoint
|
|
98
|
+
self._setup_litellm_client()
|
|
99
|
+
|
|
100
|
+
def _setup_litellm_client(self) -> None:
|
|
101
|
+
"""Set up LiteLLM with custom HTTPX client for Unix socket support."""
|
|
102
|
+
if self.endpoint.socket_path:
|
|
103
|
+
# Create HTTPX client with Unix socket transport
|
|
104
|
+
transport = httpx.AsyncHTTPTransport(uds=self.endpoint.socket_path)
|
|
105
|
+
unix_client = httpx.AsyncClient(
|
|
106
|
+
transport=transport,
|
|
107
|
+
base_url="http://localhost", # Base URL for Unix socket
|
|
108
|
+
timeout=self.endpoint.timeout,
|
|
109
|
+
)
|
|
110
|
+
# Set as LiteLLM's async client session
|
|
111
|
+
litellm.aclient_session = unix_client
|
|
112
|
+
|
|
113
|
+
def _populate_base_kwargs(self) -> dict[str, Any]:
|
|
114
|
+
"""Populate base kwargs common to all API calls."""
|
|
115
|
+
kwargs = {
|
|
116
|
+
"model": self.endpoint.model,
|
|
117
|
+
"timeout": self.endpoint.timeout,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if self.endpoint.api_key:
|
|
121
|
+
kwargs["api_key"] = self.endpoint.api_key
|
|
122
|
+
|
|
123
|
+
if self.endpoint.base_url:
|
|
124
|
+
kwargs["api_base"] = self.endpoint.base_url
|
|
125
|
+
|
|
126
|
+
kwargs.update(self.endpoint.extra_params or {})
|
|
127
|
+
|
|
128
|
+
return kwargs
|
|
129
|
+
|
|
130
|
+
@litellm_retry
|
|
131
|
+
async def chat_completion(self, messages: list[dict[str, str]]) -> Any:
|
|
132
|
+
"""Call the chat completion API using LiteLLM."""
|
|
133
|
+
kwargs = self._populate_base_kwargs()
|
|
134
|
+
kwargs["messages"] = messages
|
|
135
|
+
response = await acompletion(max_retries=0, **kwargs)
|
|
136
|
+
return response.model_dump()
|
|
137
|
+
|
|
138
|
+
@litellm_retry
|
|
139
|
+
async def embedding(self, texts: list[str]) -> Any:
|
|
140
|
+
"""Call the embedding API using LiteLLM."""
|
|
141
|
+
kwargs = self._populate_base_kwargs()
|
|
142
|
+
kwargs["input"] = texts
|
|
143
|
+
response = await aembedding(max_retries=0, **kwargs)
|
|
144
|
+
return response.model_dump()
|
|
145
|
+
|
|
146
|
+
async def close(self) -> None:
|
|
147
|
+
"""Close the provider and cleanup HTTPX client if using Unix sockets."""
|
|
148
|
+
if (
|
|
149
|
+
self.endpoint.socket_path
|
|
150
|
+
and hasattr(litellm, "aclient_session")
|
|
151
|
+
and litellm.aclient_session
|
|
152
|
+
):
|
|
153
|
+
await litellm.aclient_session.aclose()
|
|
154
|
+
litellm.aclient_session = None
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Logging configuration for kodit."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import os
|
|
4
5
|
import platform
|
|
5
6
|
import re
|
|
6
7
|
import shutil
|
|
@@ -11,6 +12,9 @@ from functools import lru_cache
|
|
|
11
12
|
from pathlib import Path
|
|
12
13
|
from typing import Any
|
|
13
14
|
|
|
15
|
+
# Set litellm logging level BEFORE import to prevent broken logging objects
|
|
16
|
+
os.environ["LITELLM_LOG"] = "ERROR"
|
|
17
|
+
|
|
14
18
|
import litellm
|
|
15
19
|
import rudderstack.analytics as rudder_analytics # type: ignore[import-untyped]
|
|
16
20
|
import structlog
|
|
@@ -108,9 +112,14 @@ def configure_logging(app_context: AppContext) -> None:
|
|
|
108
112
|
else:
|
|
109
113
|
logging.getLogger(_log).disabled = True
|
|
110
114
|
|
|
111
|
-
#
|
|
115
|
+
# Disable litellm's internal debug logging
|
|
112
116
|
litellm.suppress_debug_info = True
|
|
113
117
|
|
|
118
|
+
# Monkey-patch litellm's Logging class to add missing debug method
|
|
119
|
+
# This prevents AttributeError when litellm tries to call logging_obj.debug()
|
|
120
|
+
if not hasattr(litellm.Logging, "debug"):
|
|
121
|
+
litellm.Logging.debug = lambda _self, *_args, **_kwargs: None # type: ignore[attr-defined]
|
|
122
|
+
|
|
114
123
|
# Configure SQLAlchemy loggers to use our structlog setup
|
|
115
124
|
for _log in ["sqlalchemy.engine", "alembic"]:
|
|
116
125
|
engine_logger = logging.getLogger(_log)
|