Skip to main content

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

  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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepseek_reason_extractor-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepseek_reason_extractor-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file deepseek_reason_extractor-0.1.0.tar.gz.

File metadata

File hashes

Hashes for deepseek_reason_extractor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37546d077d2cc7ec9d878f0fc8e1141cfed67298d1c4e3c79aec45151886bca1
MD5 e7f1934ca95c0cab314eba07e0b8a541
BLAKE2b-256 833f6ef20c97b7411a6569e110d9c7943534537035390fe692c25619e3c64a0a

See more details on using hashes here.

File details

Details for the file deepseek_reason_extractor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepseek_reason_extractor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27d266509203e4370cd12272b49b5e4f393fd32d880a51fb92139a1f29e32966
MD5 304fce4fc63b96b3a7965ec6da900e31
BLAKE2b-256 55c792d953066337285c56e1cc7cf70c05caa96dec1d10302c6a453ed9351799

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page