A Python package for extracting and processing reasoning patterns
Project description
Deepseek Reason Extractor
A Python package for extracting reasoning patterns using Vaklm models.
Installation
pip install deepseek_reason_extractor
Usage
from deepseek_reason_extractor import DeepseekReasonExtractor
# Initialize with default settings
extractor = DeepseekReasonExtractor(
api_key="your-api-key" # Optional if endpoint doesn't require auth
)
# Extract reasoning
prompt = "Explain the concept of quantum entanglement"
reasoning = extractor.extract_reasoning(prompt)
print(reasoning)
Configuration
You can customize the endpoint, model, and system prompt:
extractor = DeepseekReasonExtractor(
endpoint="http://custom.endpoint/v1/chat/completions",
model_name="custom-model",
api_key="your-api-key",
system_prompt="You are a helpful AI assistant"
)
Development
Building the Package
- Install build tools:
pip install build
- Build the package:
python -m build
- Install locally for testing:
pip install -e .
Running Tests
python -m pytest tests/
Deployment
- Update version in
pyproject.tomland__init__.py - Build the package:
python -m build
- Upload to PyPI:
python -m twine upload dist/*
Error Handling
The package raises RuntimeError for API failures:
try:
reasoning = extractor.extract_reasoning(prompt)
except RuntimeError as e:
print(f"Error: {str(e)}")
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepseek_reason_extractor-0.1.0.tar.gz.
File metadata
- Download URL: deepseek_reason_extractor-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37546d077d2cc7ec9d878f0fc8e1141cfed67298d1c4e3c79aec45151886bca1
|
|
| MD5 |
e7f1934ca95c0cab314eba07e0b8a541
|
|
| BLAKE2b-256 |
833f6ef20c97b7411a6569e110d9c7943534537035390fe692c25619e3c64a0a
|
File details
Details for the file deepseek_reason_extractor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deepseek_reason_extractor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27d266509203e4370cd12272b49b5e4f393fd32d880a51fb92139a1f29e32966
|
|
| MD5 |
304fce4fc63b96b3a7965ec6da900e31
|
|
| BLAKE2b-256 |
55c792d953066337285c56e1cc7cf70c05caa96dec1d10302c6a453ed9351799
|