Skip to content

Commit

Permalink
Adding descriptions to the new agent
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza committed Mar 5, 2024
1 parent 09f65c6 commit 6de8bce
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dataherald/sql_generator/dataherald_finetuning_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,18 @@ def _run(
for table in self.db_scan:
if table.table_name in table_names_list:
tables_schema += table.table_schema + "\n"
descriptions = []
if table.description is not None:
tables_schema += "Table description: " + table.description + "\n"
descriptions.append(
f"Table `{table.table_name}`: {table.description}\n"
)
for column in table.columns:
if column.description is not None:
descriptions.append(
f"Column `{column.name}`: {column.description}\n"
)
if len(descriptions) > 0:
tables_schema += f"/*\n{''.join(descriptions)}*/\n"
if tables_schema == "":
tables_schema += "Tables not found in the database"
return tables_schema
Expand Down

0 comments on commit 6de8bce

Please sign in to comment.