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

import asyncio

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.4.0.dev202511160236.tar.gz (186.6 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.4.0.dev202511160236-py3-none-any.whl (125.5 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_core-1.4.0.dev202511160236.tar.gz.

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202511160236.tar.gz
Algorithm Hash digest
SHA256 290744c0ee7e7115a5b145205bc19d303a69f1db60b92c30d2e20397e2e9808b
MD5 99e0cc50ca04b5bc9d0cac2156de37a2
BLAKE2b-256 0a4e13f6f92733985f046a43f1d617b6d9b2587896b282c77b39bc30c362bdfd

See more details on using hashes here.

File details

Details for the file ragbits_core-1.4.0.dev202511160236-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202511160236-py3-none-any.whl
Algorithm Hash digest
SHA256 39290c77d933ed38546cf07c8dfba81ea264bcf12e063c21310ce1d453ef01ec
MD5 060aacc280f2317b5176b23225a217d9
BLAKE2b-256 ea8a6fcf7f51f9fe269448504e669ec858ce10a7c73a04f3d549f4f75b94e40c

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