Skip to main content

Overview

This project uses langchain (currently only OpenAI) to search a Django model. Simply use LangChainSearchMixin in your view, and let the user perform a query with the ?q= parameter. Example:

http://127.0.0.1:8000/api/jobs/?q=Engineer jobs posted after or on June 22 2025 salary minimum 40000 hybrid

The human language query will be converted to your model fields using LangChain and ChatGPT.

Installation

This project runs with uv.

pip install uv
uv sync --frozen

To add to your django project Add this to apps: 'langchain_search'

You need to also set your openai key

export OPENAI_API_KEY=....

Usage example

from .models import Job
from rest_framework import generics
from .serializers import JobSerializer
from langchain_search import LangChainSearchMixin

# Add mixin here
class JobListAPI(LangChainSearchMixin, generics.ListAPIView):
    queryset = Job.objects.all()
    serializer_class = JobSerializer

    def get(self, request, *args, **kwargs):
        return super().get(request, *args, **kwargs)

Example project: https://github.com/errietta/django-langchain-search-example

Metadata

Release files for langchain-search-django 0.7.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 langchain-search-django 0.7.0
File Size Uploaded Provenance Actions
langchain_search_django-0.7.0.tar.gz 4.0 kB Without provenance Details for langchain_search_django-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-search-django 0.7.0
File Interpreter ABI Platform Actions
langchain_search_django-0.7.0-py3-none-any.whl Python 3 none any Details for langchain_search_django-0.7.0-py3-none-any.whl

Total release size: 9.2 kB

Release files / langchain_search_django-0.7.0.tar.gz

Download URL langchain_search_django-0.7.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fefec35fbbe20bbb1010632a57d56b815578080e1a6df48fbcbdaf79cc345604
BLAKE2b-256 checksum
How to use checksums
c9cda531cbe594b4ce0b1a6bce8b456488c40d167409008c5213842bf8c160f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / langchain_search_django-0.7.0-py3-none-any.whl

Download URL langchain_search_django-0.7.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4276f2b095289694c967f27732c9c85c99718af6c0815be878cb19036d55e3f
BLAKE2b-256 checksum
How to use checksums
76bf8f93d39a6005c962f34742a6f42251b0b289ee3a28729ff43fa8d0a00b99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Security for langchain-search-django 0.7.0

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.

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