This commit is contained in:
hsafaei 2026-01-01 07:04:10 +00:00
parent 8f20396bbe
commit f130e45dcf
4 changed files with 41 additions and 42 deletions

View File

@ -34,36 +34,6 @@ if not os.path.exists(DATA_DIR):
PERSIAN_BOUNDARIES = set(" \n،.؟!؛:")
# f"https://YOUR_DOMAIN.com
from pydantic import BaseModel
class DbRule(BaseModel):
rule_id: str
rule_content: str
rule_type: str
section_id: str
section_content: str
section_full_path :str
qanon_id: str
qanon_etebar: str
qanon_title: str
state_etebar: str
class InputRule(BaseModel):
rule_id: str
rule_content: str
rule_type: str
section_id: str
section_content: str
class SemanticSearchP2P(BaseModel):
in_rule: InputRule
db_rule: DbRule
score: float = 0
metadata: Dict
class Formatter:
"""
Formatting options
@ -598,11 +568,7 @@ class Formatter:
"""
deleteMessage
message_id
chat_id
"""
class RequestManager:
def __init__(self,

View File

@ -9,6 +9,11 @@ from dependencies import _get_bale_token, _get_bale_bot
router = APIRouter(tags=["bale-bot"])
##############
"""
deleteMessage
message_id
chat_id
"""
# @app.post(f"/webhook/{TOKEN}")
@router.post("/webhook/{token}", description="ربات قانون یار")

View File

@ -845,6 +845,8 @@ class BaleBot:
result["answer"] # , llm_answer["source"]
)
_buttons = [[HOME_BUTTON]]
if result['answer_type'] == 'legal_question':
print(f'legal_question-----------------')
_b = []
if user.limit < self.max_limit:
_b += [MORE_LIMIT_BUTTON]

View File

@ -6,6 +6,32 @@ from typing import Optional, Callable, List, Any
from pydantic import BaseModel
class DbRule(BaseModel):
rule_id: str
rule_content: str
rule_type: str
section_id: str
section_content: str
section_full_path :str
qanon_id: str
qanon_etebar: str
qanon_title: str
state_etebar: str
class InputRule(BaseModel):
rule_id: str
rule_content: str
rule_type: str
section_id: str
section_content: str
class SemanticSearchP2P(BaseModel):
in_rule: InputRule
db_rule: DbRule
score: float = 0
metadata: Dict
class BaleStartMessageForm(BaseModel):
id: int
is_bot: bool = False