Skip to main content

A flexible chatbot package with vector embeddings and prompt handling using Ollama and FAISS

Project description

mypackage_anshita

mypackage_anshita is a Python package built with Ollama models to provide:

  • Prompt-based text generation using models like gemma:2b, llama2, and others.
  • Vector-based document embedding and semantic search with FAISS.
  • Flexibility to use different models for generation and embeddings.

Installation

Install the package via PyPI:

pip install mypackage-anshita
Features

PromptRunner: Run prompts on various Ollama models.
DocumentEmbedder: Embed documents and perform vector search.
Integration with Ollama, FAISS, and NumPy.
Supports multiple Ollama models, including Gemma and LLaMA2.

Usage Example

Generate Text
from mypackage_anshita import PromptRunner

runner = PromptRunner(model='gemma:2b')
response = runner.run_prompt("What is the theory of relativity?")
print(response)
from mypackage_anshita import DocumentEmbedder

docs = [
    "Marie Curie won two Nobel Prizes.",
    "Einstein created the theory of relativity."
]

embedder = DocumentEmbedder()
embedder.embed_text(docs)

results = embedder.search("radioactivity")
print(results)
Author

Anshita Bhatnagar
Built during internship using LangChain, Ollama, FAISS, and Streamlit.

License

MIT License

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

mypackage_anshita-0.1.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

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

mypackage_anshita-0.1.2-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file mypackage_anshita-0.1.2.tar.gz.

File metadata

  • Download URL: mypackage_anshita-0.1.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for mypackage_anshita-0.1.2.tar.gz
Algorithm Hash digest
SHA256 920dd3541a4b54a3fbeda06080e49a5f78aa992d478cf3f404824b55bb5be9f5
MD5 41fae57b1db8b5dbf87c2d1a89dcdd8e
BLAKE2b-256 690dcf687bc8096570f1794d05a640df7d1af34966968f8a8cb16a038c54b711

See more details on using hashes here.

File details

Details for the file mypackage_anshita-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mypackage_anshita-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34aac58406f615e8d3e5e601d00482c3352687bfd291d0c90b27fe6bd8f66532
MD5 78c6288b3b32f4527a15b910a96395cd
BLAKE2b-256 bef3afd18e3f679a5c09dd8d893d39cd6d492f378848cbdc83bbfcec9c32b312

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