Skip to content

Commit bb2d5d3

Browse files
committed
Fix mypy error
1 parent 4293dd6 commit bb2d5d3

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

evals/generate_ground_truth.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,17 @@ def source_retriever() -> Generator[str, None, None]:
5656
DATABASE_URI = f"postgresql://{DBUSER}:{DBPASS}@{DBHOST}/{DBNAME}"
5757
engine = create_engine(DATABASE_URI, echo=False)
5858
with Session(engine) as session:
59-
# Fetch all products for a particular type
60-
item_types = session.scalars(select(Item.type).distinct())
61-
for item_type in item_types:
62-
records = list(session.scalars(select(Item).filter(Item.type == item_type).order_by(Item.id)))
63-
logger.info(f"Processing database records for type: {item_type}")
64-
yield "\n\n".join([f"## Product ID: [{record.id}]\n" + record.to_str_for_rag() for record in records])
59+
# Fetch all products for a particular type - depends on the database columns
60+
# item_types = session.scalars(select(Item.type).distinct())
61+
# for item_type in item_types:
62+
# records = list(session.scalars(select(Item).filter(Item.type == item_type).order_by(Item.id)))
63+
# logger.info(f"Processing database records for type: {item_type}")
64+
# yield "\n\n".join([f"## Product ID: [{record.id}]\n" + record.to_str_for_rag() for record in records])
6565
# Fetch each item individually
66-
# records = list(session.scalars(select(Item).order_by(Item.id)))
67-
# for record in records:
68-
# logger.info(f"Processing database record: {record.name}")
69-
# yield f"## Product ID: [{record.id}]\n" + record.to_str_for_rag()
70-
# await self.openai_chat_client.chat.completions.create(
66+
records = list(session.scalars(select(Item).order_by(Item.id)))
67+
for record in records:
68+
logger.info(f"Processing database record: {record.name}")
69+
yield f"## Product ID: [{record.id}]\n" + record.to_str_for_rag()
7170

7271

7372
def source_to_text(source) -> str:

0 commit comments

Comments
 (0)