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.7.0.dev202605130309.tar.gz (187.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.7.0.dev202605130309-py3-none-any.whl (125.5 kB view details)

Uploaded Python 3

File details

Details for the file ragbits_core-1.7.0.dev202605130309.tar.gz.

File metadata

File hashes

Hashes for ragbits_core-1.7.0.dev202605130309.tar.gz
Algorithm Hash digest
SHA256 ec3b7a4d5b930495ba2b33958bbd44e660cc7edd6ef6d9bef079d491c32be9fd
MD5 f1fe31e67c9f58fcdcdc1b118d17656a
BLAKE2b-256 0fd458f44cdbb61e4d671e2c11277f1c83352e43f5f4b758682fc7c1ef2a4497

See more details on using hashes here.

File details

Details for the file ragbits_core-1.7.0.dev202605130309-py3-none-any.whl.

File metadata

File hashes

Hashes for ragbits_core-1.7.0.dev202605130309-py3-none-any.whl
Algorithm Hash digest
SHA256 62029ed46a4f90d72f4f209565c09778b9b4b19026129282e035a25867e83314
MD5 962c8386926dc5925a6582c6484bcf29
BLAKE2b-256 d2715489357a2c89fb7713103f0a220872fd3e29a85fbc7174bfe7bd40f28646

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