Skip to main content

Building blocks for rapid development of GenAI applications

Project description

Ragbits Core

Ragbits Core is a collection of utilities and tools that are used across all Ragbits packages. It includes fundamentals, such as utilities for logging, configuration, prompt creation, classes for comunicating with LLMs, embedders, vector stores, and more.

Installation

pip install ragbits-core

Quick Start

from pydantic import BaseModel
from ragbits.core.prompt import Prompt
from ragbits.core.llms.litellm import LiteLLM


class Dog(BaseModel):
    breed: str
    age: int
    temperament: str

class DogNamePrompt(Prompt[Dog, str]):
    system_prompt = """
    You are a dog name generator. You come up with funny names for dogs given the dog details.
    """

    user_prompt = """
    The dog is a {breed} breed, {age} years old, and has a {temperament} temperament.
    """

async def main() -> None:
    llm = LiteLLM("gpt-4o")
    dog = Dog(breed="Golden Retriever", age=3, temperament="friendly")
    prompt = DogNamePrompt(dog)
    response = await llm.generate(prompt)
    print(response)


if __name__ == "__main__":
    asyncio.run(main())

Documentation

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ragbits_core-1.3.0.dev202509120609.tar.gz (185.4 kB view details)

Uploaded Source

Built Distribution

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

ragbits_core-1.3.0.dev202509120609-py3-none-any.whl (124.1 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_core-1.3.0.dev202509120609.tar.gz.

File metadata

File hashes

Hashes for ragbits_core-1.3.0.dev202509120609.tar.gz
Algorithm Hash digest
SHA256 0965017d3b80dd519aa50c2cbe904302dd9c70b1bc7b7f5926ff00acb53df6ce
MD5 ec96263af3b68accb71d38c98c454a26
BLAKE2b-256 657e6ce811414d207097a243e91ebf5202a1fe764a2976aab4fe20e9996dbeb0

See more details on using hashes here.

File details

Details for the file ragbits_core-1.3.0.dev202509120609-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_core-1.3.0.dev202509120609-py3-none-any.whl
Algorithm Hash digest
SHA256 5f564b5598dd185c0214d470ac8ceb9f6b5d19ea499a0e9062ad67dc603382a6
MD5 605fc3af494940c2a70e73411d71ff78
BLAKE2b-256 8bc4d62b465fccc745faba7277d0d9c5144ed682fda623490c56d9656daa90bf

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