Skip to main content

A Python package for generating questions and answers using various LLM providers.

Project description

QAGeneratorLLM

A Python package for generating questions and answers using various LLM providers.

Features

  • Support for multiple LLM providers (Anthropic, Ollama, OpenAI, XAI)
  • Generate both Multiple Choice Questions (MCQ) and Question-Answer (QA) pairs
  • Structured output using Pydantic models
  • Batch processing support
  • File-based context input

Installation

pip install qageneratorllm

Usage

from qageneratorllm import ChatLLM, ChatLLMType, QuestionType

# Initialize with default settings (Ollama + QA format)
llm = ChatLLM()

# Generate QA from text
result = llm.invoke("Your context text here")

# Generate MCQ using OpenAI
llm = ChatLLM(chat_type=ChatLLMType.OPENAI, question_type=QuestionType.MCQ)
result = llm.invoke("Your context text here")

# Generate from file
result = llm.invoke_from_file("path/to/your/file.txt")

Environment Variables

  • ANTHROPIC_MODEL_NAME: Anthropic model name (default: claude-3-sonnet-20240229)
  • OLLAMA_MODEL_NAME: Ollama model name (default: deepseek-r1)
  • OPENAI_MODEL_NAME: OpenAI model name (default: gpt-4)
  • XAI_MODEL_NAME: XAI model name (default: grok-beta)

License

MIT

Project details


Download files

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

Source Distribution

qageneratorllm-0.0.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

qageneratorllm-0.0.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file qageneratorllm-0.0.1.tar.gz.

File metadata

  • Download URL: qageneratorllm-0.0.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qageneratorllm-0.0.1.tar.gz
Algorithm Hash digest
SHA256 235d4c7acdbfd7e9d632faa6c685a2d83df47163b6f00abb49762fc875a2634c
MD5 a29efeb5fb839884323629b8079014ce
BLAKE2b-256 9632c57e97987f173ab595afc014b98f76aadf8ca1724ea6fc3acf721e04399c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qageneratorllm-0.0.1.tar.gz:

Publisher: python-publish.yml on KameniAlexNea/create-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qageneratorllm-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qageneratorllm-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qageneratorllm-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4381110fb97bf309f977b9063478db8f1233c9287ab98b2de2cf52723ed6761c
MD5 a779ccce13c293c0b0d0cde1f6a74ee8
BLAKE2b-256 8120f981438d6c4c69b7ffd75a7143039b2c1e2281c340dd62c36c77ac5d456b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qageneratorllm-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on KameniAlexNea/create-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page