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.4.0.dev202509220622.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.4.0.dev202509220622-py3-none-any.whl (124.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202509220622.tar.gz
Algorithm Hash digest
SHA256 714c7ffca7b93e08c2f38954859e26a9ae33e722071a2b2b88835d59d595d63f
MD5 ab02554a672a884ec014ac5b29272821
BLAKE2b-256 81e5b5972454510a4f9eb6479b5a9ab63034d48be5034f1797bd6490b1c4c438

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202509220622-py3-none-any.whl
Algorithm Hash digest
SHA256 8e477e305e35b21cd5090441b989c3846a8b8c194be7b409443fda7116036527
MD5 8023bf126eaf21a1ea6e752421b56016
BLAKE2b-256 549bf2819ad62fc14692f6de02772805a3f2bad0e5a78e41077dba8852f680ef

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