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-0.0.30rc1.tar.gz (194.0 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-0.0.30rc1-py3-none-any.whl (144.9 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_core-0.0.30rc1.tar.gz.

File metadata

  • Download URL: ragbits_core-0.0.30rc1.tar.gz
  • Upload date:
  • Size: 194.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for ragbits_core-0.0.30rc1.tar.gz
Algorithm Hash digest
SHA256 6bd129d553b9e8ced3dc7e37d4ec11b824724e09fb410afe27068d8a8016831b
MD5 5bf38cc00e6fd5948d874bae73229c93
BLAKE2b-256 aef209130e5721d4288f74456c1ecf4e480194e941f3dabedc3342445566039a

See more details on using hashes here.

File details

Details for the file ragbits_core-0.0.30rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_core-0.0.30rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 c95a1bf367ecc0fc0d7d1a001658f8d2a4311b5ef6ceb620b0cd0d262e07e677
MD5 f8656e3681fcaa7d2edeb449175af379
BLAKE2b-256 d5d1256d86f454b9be74568f3ead6a86fb58ebe2aa3a90907d82f827219bac30

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