Skip to main content

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

  1. Install build tools:
pip install build
  1. Build the package:
python -m build
  1. Install locally for testing:
pip install -e .

Running Tests

python -m pytest tests/

Deployment

  1. Update version in pyproject.toml and __init__.py
  2. Build the package:
python -m build
  1. 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

MIT

Metadata

Release files for deepseek-reason-extractor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepseek-reason-extractor 0.1.0
File Size Uploaded
deepseek_reason_extractor-0.1.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deepseek-reason-extractor 0.1.0
File Interpreter ABI Platform
deepseek_reason_extractor-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / deepseek_reason_extractor-0.1.0.tar.gz

Download URL deepseek_reason_extractor-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
37546d077d2cc7ec9d878f0fc8e1141cfed67298d1c4e3c79aec45151886bca1
BLAKE2b-256 checksum
How to use checksums
833f6ef20c97b7411a6569e110d9c7943534537035390fe692c25619e3c64a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / deepseek_reason_extractor-0.1.0-py3-none-any.whl

Download URL deepseek_reason_extractor-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27d266509203e4370cd12272b49b5e4f393fd32d880a51fb92139a1f29e32966
BLAKE2b-256 checksum
How to use checksums
55c792d953066337285c56e1cc7cf70c05caa96dec1d10302c6a453ed9351799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page