Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /BerriAI_litellm /litellm /proxy /db /base_client.py
| from typing import Any, Literal | |
| class CustomDB: | |
| """ | |
| Implements a base class that we expect any custom db implementation (e.g. DynamoDB) to follow | |
| """ | |
| def __init__(self) -> None: | |
| pass | |
| def get_data(self, key: str, table_name: Literal["user", "key", "config"]): | |
| """ | |
| Check if key valid | |
| """ | |
| def insert_data(self, value: Any, table_name: Literal["user", "key", "config"]): | |
| """ | |
| For new key / user logic | |
| """ | |
| def update_data(self, key: str, value: Any, table_name: Literal["user", "key", "config"]): | |
| """ | |
| For cost tracking logic | |
| """ | |
| def delete_data(self, keys: list[str], table_name: Literal["user", "key", "config"]): | |
| """ | |
| For /key/delete endpoint s | |
| """ | |
| def connect( | |
| self, | |
| ): | |
| """ | |
| For connecting to db and creating / updating any tables | |
| """ | |
| def disconnect( | |
| self, | |
| ): | |
| """ | |
| For closing connection on server shutdown | |
| """ | |
Xet Storage Details
- Size:
- 1.03 kB
- Xet hash:
- c902df49ddbc42d5e6ed9652d76b72833a0d52e677078f9c6d1a021cdb639323
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.