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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragbits_core-1.3.0.tar.gz.
File metadata
- Download URL: ragbits_core-1.3.0.tar.gz
- Upload date:
- Size: 185.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7019d2f82706d828ff695029c42f874009386550e42685e01a746e4189703005
|
|
| MD5 |
39a75323a2c2ccaea030908febae8a34
|
|
| BLAKE2b-256 |
2cea40f648062b83686532199ef0e74997fd63d225bed77376133885dd4205d3
|
File details
Details for the file ragbits_core-1.3.0-py3-none-any.whl.
File metadata
- Download URL: ragbits_core-1.3.0-py3-none-any.whl
- Upload date:
- Size: 124.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3891fe0570c9b052b69219cc8927fd66042f2d6ae603cf5178a9e75865bee5cb
|
|
| MD5 |
922c635bd14adbee85ffa8937fc2fa43
|
|
| BLAKE2b-256 |
1f6062799b02e30388bccff9c8135e9efb4dbc3eca3e7f1dd6496006125c78aa
|