This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Literal | |
from bank_database import DatabaseConn | |
from openai_sdk import client | |
from pydantic import BaseModel, Field | |
RESPOND_TO_USER_QUERY_SYSTEM_PROMPT = """ | |
You are a support agent in our bank, give the best advice to the user based on their query. | |
If the user is asking for their balance, give them the balance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Much of this was borrowed from: | |
https://github.com/Tert0/fastapi-framework/blob/develop/fastapi_framework/redis.py | |
Assumes redis = "^4.5.1" | |
Meant to be used like this: | |
@app.on_event("startup") | |
async def on_startup(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from src.app.db.base import Base as AppBase # noqa | |
from src.b2b.db.base import Base as B2BBase # noqa | |
target_metadata = MetaData() | |
for table in AppBase.metadata.tables.values(): | |
table.tometadata(target_metadata) | |
for table in B2BBase.metadata.tables.values(): | |
table.tometadata(target_metadata) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from typing import Dict | |
from io import StringIO | |
from dateutil import parser | |
from sqlalchemy import create_engine | |
import pandas as pd | |
def is_date(string): | |
if string.isnumeric(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Based off Stripe's checkout repo, see the link for the Flask analogue. | |
https://github.com/stripe-samples/checkout-one-time-payments/blob/master/server/python/server.py | |
Assumes project is structured like: | |
src/ | |
backend/ | |
app.py |