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.dev202512050236.tar.gz (186.7 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.dev202512050236-py3-none-any.whl (125.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202512050236.tar.gz
Algorithm Hash digest
SHA256 a6b8e4672c353cbc7e5b56be21e12b7d30045b0e56f610adeaf198dbf6d5de82
MD5 5be0dda202bfd6b164cc66126f672844
BLAKE2b-256 558e62e6519c50053f1802a63b6cf983cacf141a46636fa32a8d136b993a2734

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ragbits_core-1.4.0.dev202512050236-py3-none-any.whl
Algorithm Hash digest
SHA256 c686d69193eb3c954518b4ae7e886395508fe41c9865b08018a2e59862968207
MD5 104134715379a12cc137523aca284c93
BLAKE2b-256 73d580d815519f384378c17b215f83dfef1d34e50f92ffd960dff0ca29e3110d

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