Pharma-Globex is a Python library designed to analyze input texts related to global pharmaceutical trends, such as India's role in manufacturing generics. It leverages structured pattern matching to extract key points from user-provided content and generate concise, information-rich summaries suitable for reporting or decision-making. The system ensures reliable extraction even with varied phrasing by using pattern verification and retries, making it ideal for summarizing market developments, policy impacts, or industry progress.
Install the package via pip:
pip install pharma_globexImport and use the package in your Python code:
from pharma_globex import pharma_globex
response = pharma_globex(user_input="Your input text here")- user_input (
str): The input text to process. - llm (
Optional[BaseChatModel]): An instance of a language model from langchain. Defaults to using ChatLLM7. - api_key (
Optional[str]): API key for the LLM7 service. If not provided, it attempts to read from the environment variableLLM7_API_KEY.
The package defaults to using ChatLLM7 from langchain_llm7 (https://pypi.org/project/langchain-llm7/). Users can pass their own language model instances for flexibility:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI()
response = pharma_globex(user_input="Query", llm=llm)Similarly, support for other LLM providers such as Anthropic, Google Generative AI, etc., is available with appropriate imports and model instantiations.
- To get a free API key for LLM7, register at https://token.llm7.io/
- The default rate limits are sufficient for most use cases.
- For higher limits, pass your API key via environment variable
LLM7_API_KEYor directly during function call.
Please report issues or suggest improvements on the GitHub repository: https://github.com/...
- Eugene Evstafev (hi@eugene.plus)
This project is open source and available under the MIT License.