This Python package provides a simple and reliable way to analyze and extract structured incident summaries from unstructured text reports or news snippets. It leverages large language models (LLMs) to interpret incident descriptions and outputs standardized information, making it easy to integrate incident analysis into your workflow or applications.
Install the package via pip:
pip install incident_summary_parserImport and utilize the incident_summary_parser function as follows:
from incident_summary_parser import incident_summary_parser
response = incident_summary_parser(
user_input="Your incident report text here",
api_key="your_llm7_api_key", # optional if set via environment variable
llm=None # optional, can pass your own LLM instance
)
print(response)-
user_input(str): The incident report or news snippet you want to analyze. -
llm(Optional[BaseChatModel]): An optional language model instance conforming tolangchain's interface. If not provided, the function defaults to usingChatLLM7. -
api_key(Optional[str]): Your API key for the LLM7 service. Can also be set via the environment variableLLM7_API_KEY.
You can pass your own LLM implementations, such as OpenAI, Anthropic, or Google's Generative AI, to the function for flexibility, for example:
from langchain_openai import ChatOpenAI
from incident_summary_parser import incident_summary_parser
llm = ChatOpenAI()
response = incident_summary_parser(
user_input="Sample incident report",
llm=llm
)Or with other providers:
from langchain_anthropic import ChatAnthropic
from incident_summary_parser import incident_summary_parser
llm = ChatAnthropic()
response = incident_summary_parser(
user_input="Sample incident report",
llm=llm
)- The package uses
ChatLLM7fromlangchain_llm7(see PyPI) by default. - Default rate limits are suitable for most use cases, but you can increase limits by obtaining your own API key.
- You can register for a free API key at https://token.llm7.io/.
Please report issues or contribute improvements via the GitHub repository: https://github.....
- Name: Eugene Evstafev
- Email: hi@eugene.plus
- GitHub: chigwell