Beatrica Embedding
beatrica-embedding is a Python package designed to embed and analyze code changes in git repositories, utilizing Language Learning Models (LLMs) for enhanced insights. It allows seamless switching between different LLMs, making it highly adaptable for various code analysis needs.
Installation
To install beatrica-embedding, use pip:
pip install beatrica-embedding
Usage
beatrica-embedding offers a flexible way to analyze commit changes and generate insights using different LLMs. Below is an example demonstrating how to extract commit changes from a repository and process them with a chosen LLM.
Extracting and Embedding Code Changes with LLM
from beatrica_git.recent_change_inspector import BeatricaDiffTracker
from beatrica_embedding.embedding_generator import BeatricaCodeChangeProcessor
from langchain_openai import ChatOpenAI
from langchain_mistralai.chat_models import ChatMistralAI
# Extract commit changes from a git repository
beatrica_diff_tracker = BeatricaDiffTracker(base_branch="main")
# Analyze the commits
beatrica_diff_tracker.analyze_commits()
# Get the commit changes
commit_changes = beatrica_diff_tracker.commit_changes.items()
# Choose the LLM for processing
# language_model = ChatOpenAI(model_name="gpt-4-0125-preview", api_key=os.getenv("OPENAI_API_KEY"), max_tokens=1000)
language_model = ChatMistralAI(model="mistral-medium-latest", mistral_api_key=os.getenv("MISTRAL_API_KEY"), max_tokens=500)
code_change_processor = BeatricaCodeChangeProcessor(commit_changes, language_model=language_model)
# Process the commit changes
retrieval_chain = code_change_processor.process()
# Example query to analyze the changes
question = "What are the changes in the following code?"
print(question)
result = retrieval_chain(question)
answer = result['answer']
print(answer)
Features
- Flexible integration with multiple LLMs for code change analysis.
- Easy to switch between models like OpenAI's GPT or MistralAI for different levels of analysis.
- Embedding and analyzing commit changes in git repositories for enhanced insights.
- Supports detailed analysis of code changes, leveraging the power of conversational models.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
License
This project is licensed under the MIT License.
Metadata
Release files for beatrica-embedding 2025.5.180922
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| beatrica_embedding-2025.5.180922.tar.gz | 6.0 kB | Without provenance | Details for beatrica_embedding-2025.5.180922.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beatrica_embedding-2025.5.180922-py3-none-any.whl | Python 3 | none | any | Details for beatrica_embedding-2025.5.180922-py3-none-any.whl |
Total release size: 12.9 kB
Release files / beatrica_embedding-2025.5.180922.tar.gz
| Download URL | beatrica_embedding-2025.5.180922.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09a437e8aa8a88b550fc98d317ae37db75b932e6ceeb3731bddad981c9bb10df
|
|
BLAKE2b-256 checksum How to use checksums |
bc7f3dd9cdd79e74201351c5ff61dd23392c892c0d525bac9d3dd079c4d951a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Release files / beatrica_embedding-2025.5.180922-py3-none-any.whl
| Download URL | beatrica_embedding-2025.5.180922-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6cfee5d6df8d7e1342772a4a7928a9bfeb7f7e6bd2018c37f5956ea62f837c9
|
|
BLAKE2b-256 checksum How to use checksums |
74f55e87e302a786ffac33e2fbf67bd95ad4747dd1dbf6b720047f58543c085e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Security for beatrica-embedding 2025.5.180922
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.