semvec/pypi-packages huggingface dataset:
logi-query-parser 2025.12.20175717
A new package helps users' text queries about boolean logic and truth values by providing structured, reliable answers, especially useful for clarifying programming concepts, conditional statements, a
License: MIT
Requires Python: >=3.9

# logi-query-parser ![PyPI version](https://img.shields.io/pypi/v/logi-query-parser) ![License: MIT](https://img.shields.io/badge/License-MIT-blue) ![Downloads](https://static.pepy.tech/pics/logi-query-parser/month.svg) ![LinkedIn](https://img.shields.io/badge/LinkedIn-Profile-blue)

logi-query-parser is a Python package designed to interpret and process user text queries related to boolean logic and truth values. It utilizes language models to provide structured, reliable answers, making it especially useful for clarifying programming concepts, conditional statements, and logical operations across various contexts. The package is built on top of the langchain framework and features an easy-to-use API for integrating powerful LLMs into your applications.

## Installation

```bash
pip install logi-query-parser
```

## Usage

```python
from logi-query-parser import logi_query_parser

# Example usage:
response = logi_query_parser(
    user_input="Explain boolean AND in programming",
    api_key="your_llm7_api_key"
)
print(response)
```

### Parameters

- **user_input** (*str*): The user input text to process.
- **llm** (*Optional[BaseChatModel]*): An instance of a language model (e.g., ChatOpenAI, ChatAnthropic). If not provided, the default `ChatLLM7` from `langchain_llm7` is used.
- **api_key** (*Optional[str]*): The API key for LLM7. If not provided, the package will try to fetch it from the environment variable `LLM7_API_KEY`. You can also pass it directly as shown above.

## Supported LLMs

By default, `logi-query-parser` uses `ChatLLM7` from [`langchain_llm7`](https://pypi.org/project/langchain-llm7/). You can pass your own LLM instance for more control or higher rate limits, such as:

```python
from langchain_openai import ChatOpenAI
from logi-query-parser import logi_query_parser

llm = ChatOpenAI()
response = logi_query_parser(user_input="What is a logical conjunction?", llm=llm)
```

Similarly, support for other models like Anthropic, Google PaLM, or others compatible with `BaseChatModel` can be used by passing their instances.

## Notes

- You can obtain a free API key for LLM7 by registering at [https://token.llm7.io/](https://token.llm7.io/).
- The default rate limits for the free tier are suitable for most use cases.
- For more information, report issues, or contribute, visit the [GitHub repository](https://github.com/chigwell/logi-query-parser).

## Author

Eugene Evstafev  
Email: hi@eugene.plus  
GitHub: [chigwell](https://github.com/chigwell)