test1
This commit is contained in:
parent
8f20396bbe
commit
f130e45dcf
36
core/core.py
36
core/core.py
|
|
@ -34,36 +34,6 @@ if not os.path.exists(DATA_DIR):
|
||||||
PERSIAN_BOUNDARIES = set(" \n،.؟!؛:")
|
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:
|
class Formatter:
|
||||||
"""
|
"""
|
||||||
Formatting options
|
Formatting options
|
||||||
|
|
@ -598,11 +568,7 @@ class Formatter:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
deleteMessage
|
|
||||||
message_id
|
|
||||||
chat_id
|
|
||||||
"""
|
|
||||||
|
|
||||||
class RequestManager:
|
class RequestManager:
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ from dependencies import _get_bale_token, _get_bale_bot
|
||||||
router = APIRouter(tags=["bale-bot"])
|
router = APIRouter(tags=["bale-bot"])
|
||||||
##############
|
##############
|
||||||
|
|
||||||
|
"""
|
||||||
|
deleteMessage
|
||||||
|
message_id
|
||||||
|
chat_id
|
||||||
|
"""
|
||||||
|
|
||||||
# @app.post(f"/webhook/{TOKEN}")
|
# @app.post(f"/webhook/{TOKEN}")
|
||||||
@router.post("/webhook/{token}", description="ربات قانون یار")
|
@router.post("/webhook/{token}", description="ربات قانون یار")
|
||||||
|
|
|
||||||
|
|
@ -845,6 +845,8 @@ class BaleBot:
|
||||||
result["answer"] # , llm_answer["source"]
|
result["answer"] # , llm_answer["source"]
|
||||||
)
|
)
|
||||||
_buttons = [[HOME_BUTTON]]
|
_buttons = [[HOME_BUTTON]]
|
||||||
|
if result['answer_type'] == 'legal_question':
|
||||||
|
print(f'legal_question-----------------')
|
||||||
_b = []
|
_b = []
|
||||||
if user.limit < self.max_limit:
|
if user.limit < self.max_limit:
|
||||||
_b += [MORE_LIMIT_BUTTON]
|
_b += [MORE_LIMIT_BUTTON]
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,32 @@ from typing import Optional, Callable, List, Any
|
||||||
from pydantic import BaseModel
|
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):
|
class BaleStartMessageForm(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
is_bot: bool = False
|
is_bot: bool = False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user