Skip to main content

langchain-lexmex

Tool de LangChain para consultar LEX-MEX — asesor jurídico con IA sobre las 316 leyes federales mexicanas vigentes, sincronizadas con diputados.gob.mx. Respuestas citadas con ley y artículo exacto, sin alucinaciones.

Instalación

pip install langchain-lexmex

Credenciales

Necesitas una API key de LEX-MEX. Se obtiene registrándote como humano en lex-mex.xyz (Google OAuth) y generándola en POST /api/v1/keys — hay plan VIP (ilimitado) y pay-as-you-go por créditos.

import os
os.environ["LEXMEX_API_KEY"] = "lmx_live_..."

Uso

from langchain_lexmex import LexMexTool

tool = LexMexTool()  # toma LEXMEX_API_KEY del entorno
resultado = tool.invoke(
    "¿Cuáles son las causales de despido justificado según la LFT?"
)
print(resultado)

Dentro de un agente

from langchain.agents import create_agent
from langchain_lexmex import LexMexTool

agent = create_agent(
    model="claude-sonnet-4-6",
    tools=[LexMexTool()],
)

agent.invoke({
    "messages": [{"role": "user", "content": "¿Qué dice el artículo 47 de la LFT?"}]
})

Async

Instala el extra async (pip install langchain-lexmex[async]) y usa await tool.ainvoke(...).

Licencia

MIT

Download files

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

Source Distribution

langchain_lexmex-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

langchain_lexmex-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_lexmex-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for langchain_lexmex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c82f57c49f61892d21ff65e6ae7ef86bf5a8e6998512028dc675b831e34d3bb0
MD5 24e2740d56904815a0deb61c4792bdea
BLAKE2b-256 7b1ab9ce21db6638cbe24bc83da30892383e120e5944ee15e0de7c27bda21660

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_lexmex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba79e1030c4e9ab44836c64124cc041eeacb4b83b7054cd242952a24b144671d
MD5 35a91bcd806feb050393e1c779e0a431
BLAKE2b-256 350807f84927ab2393816551dba82ed899768ed4a1924f615b87ec6e049c7157

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 Sentry Error logging StatusPage Status page