diff --git a/service/banking/core_banking_routes.py b/service/banking/core_banking_routes.py index 8d1eb33..499fc24 100644 --- a/service/banking/core_banking_routes.py +++ b/service/banking/core_banking_routes.py @@ -42,22 +42,22 @@ class PaymentRequest(BaseModel): category: Optional[str] = None otp: Optional[str] = None -def format_contact_details(contacts, limit=None): - """Helper function to format contact details for error messages""" - details = [] - for b in contacts: - identifier = f"'{b.name}'" - if b.nickname: - identifier += f" (nickname: {b.nickname})" - if b.tag: - identifier += f" (tag: {b.tag})" - details.append(identifier) +# def format_contact_details(contacts, limit=None): #not used elsewhere +# """Helper function to format contact details for error messages""" +# details = [] +# for b in contacts: +# identifier = f"'{b.name}'" +# if b.nickname: +# identifier += f" (nickname: {b.nickname})" +# if b.tag: +# identifier += f" (tag: {b.tag})" +# details.append(identifier) - if limit and len(details) > limit: - displayed = details[:limit] - more_count = len(details) - limit - return f"{', '.join(displayed)} and {more_count} more" - return ', '.join(details) +# if limit and len(details) > limit: +# displayed = details[:limit] +# more_count = len(details) - limit +# return f"{', '.join(displayed)} and {more_count} more" +# return ', '.join(details) def find_beneficiary(db: Session, customer_id: int, to: str): """Find a beneficiary by name, nickname, or tag with smart conflict handling.""" @@ -433,7 +433,7 @@ async def search_txn( return {"transactions": db_transactions} @router.get("/beneficiaries") -def get_beneficiaries( +def get_beneficiaries( customer_id: int = None, phone: str = None, db: Session = Depends(get_db) diff --git a/service/drive.py b/service/drive.py index 4cf5aed..4f63f4d 100644 --- a/service/drive.py +++ b/service/drive.py @@ -34,23 +34,23 @@ def get_credentials(): os.getenv("SERVICE_ACCOUNT_FILE"), scopes=SCOPES) return credentials -def user_account_creds(): - '''Get user account credentials''' - creds = None - if os.path.exists("token.json"): - creds = Credentials.from_authorized_user_file("token.json", SCOPES) - if not creds or not creds.valid: - if creds and creds.expired and creds.refresh_token: - creds.refresh(Request()) - else: - flow = InstalledAppFlow.from_client_secrets_file( - os.getenv("GOOGLE_ACCOUNT_FILE"), - SCOPES - ) - creds = flow.run_local_server(port=0) - with open("token.json", "w") as token: - token.write(creds.to_json()) - return creds +# def user_account_creds(): # not used in service package +# '''Get user account credentials''' +# creds = None +# if os.path.exists("token.json"): +# creds = Credentials.from_authorized_user_file("token.json", SCOPES) +# if not creds or not creds.valid: +# if creds and creds.expired and creds.refresh_token: +# creds.refresh(Request()) +# else: +# flow = InstalledAppFlow.from_client_secrets_file( +# os.getenv("GOOGLE_ACCOUNT_FILE"), +# SCOPES +# ) +# creds = flow.run_local_server(port=0) +# with open("token.json", "w") as token: +# token.write(creds.to_json()) +# return creds def get_folder_id(service, folder_name): """Get the ID of a folder by name.""" @@ -222,4 +222,4 @@ def main(): if __name__ == "__main__": - files = main() + files = main() #not imported/used elsewhere (ask if it used in any script) diff --git a/service/main.py b/service/main.py index f11c046..43323da 100644 --- a/service/main.py +++ b/service/main.py @@ -50,7 +50,7 @@ def generate_timestamp_json(translation, summary, detected_language=None): } @api_version(1) -@app.post("/upload-audio") +@app.post("/upload-audio") #2 definations of upload_audio , we can keep the latest version or which is getting used and remove another async def upload_audio(body: Body): try: if body.audio_file_link == "": diff --git a/service/surv.py b/service/surv.py index f46b64b..741ae87 100644 --- a/service/surv.py +++ b/service/surv.py @@ -2,7 +2,7 @@ #SARVAM_API_KEY="sk_lz33toms_amJdXnvyWxlBQIs4OPue1yexi" -SARVAM_API_KEY="sk_t7fvsjjb_7JsD5ZXGrEhHqjUtAQSFsCxB" +SARVAM_API_KEY="sk_t7fvsjjb_7JsD5ZXGrEhHqjUtAQSFsCxB" #should not harcode an API key in code client = SarvamAI( api_subscription_key=SARVAM_API_KEY, ) diff --git a/service/util.py b/service/util.py index b0e3e27..3b8a908 100644 --- a/service/util.py +++ b/service/util.py @@ -1,6 +1,6 @@ import json -def generate_timestamp_json(translation,summary,detected_language): +def generate_timestamp_json(translation,summary,detected_language): #same name function is used in main.py , can we write logic in such a way that only one function used everywhere segs = [] seg = {} segments = translation["segments"]