chainfury_server.database module

class chainfury_server.database.ChainLog(**kwargs)[source]

Bases: Base

created_at: datetime
data: Dict[str, Any]
id: str
message: str
node_id: str
prompt_id: int
worker_id: str
class chainfury_server.database.ChatBot(**kwargs)[source]

Bases: Base

created_at: datetime
created_by: str
dag: Dict[str, Any]
deleted_at: datetime
description: str
engine: str
id: str
meta: Dict[str, Any]
name: str
tag_id: str
to_dict()[source]
class chainfury_server.database.ChatBotTypes[source]

Bases: object

FURY = 'fury'
LANGFLOW = 'langflow'
all()[source]
class chainfury_server.database.JWTPayload(username: str, user_id: str)[source]

Bases: object

to_dict()[source]
user_id: str
username: str
class chainfury_server.database.Prompt(**kwargs)[source]

Bases: Base

chatbot_id: str
created_at: datetime
gpt_rating: str
id: int
input_prompt: str
meta: Dict[str, Any]
num_tokens: int
response: str
session_id: Dict[str, Any]
time_taken: float
to_dict()[source]
user_rating: int
class chainfury_server.database.PromptRating(value)[source]

Bases: Enum

Enum to know how the conversation went with chat.

HAPPY = 3
NEUTRAL = 2
SAD = 1
UNRATED = 0
class chainfury_server.database.Template(**kwargs)[source]

Bases: Base

dag: Dict[str, Any]
description: str
id: int
meta: Dict[str, Any]
name: str
to_dict()[source]
class chainfury_server.database.User(**kwargs)[source]

Bases: Base

email: str
id: str
meta: Dict[str, Any]
password: str
username: str
chainfury_server.database.add_default_templates()[source]
chainfury_server.database.add_default_user()[source]
chainfury_server.database.db_session() Session[source]
chainfury_server.database.fastapi_db_session()[source]
chainfury_server.database.get_local_session() sessionmaker[source]
chainfury_server.database.get_random_alphanumeric_string(length) str[source]
chainfury_server.database.get_random_number(length) int[source]
chainfury_server.database.get_user_from_jwt(token, db: Session) User[source]
chainfury_server.database.unique_number(Table, row_reference, length=8)[source]

Gets Random Unique Number for Primary key and makes sure its unique for the table.

chainfury_server.database.unique_string(table, row_reference, length=8)[source]

Gets Random Unique String for Primary key and makes sure its unique for the table.