MCPcopy Create free account
hub / github.com/explorerhq/sql-explorer / TablePromptData

Class TablePromptData

explorer/assistant/utils.py:138–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137@dataclass
138class TablePromptData:
139 name: str
140 schema: list
141 sample: list
142 annotation: TableDescription
143
144 def render(self):
145 fmt_schema = "\n".join([str(field) for field in self.schema])
146 ret = f"""## Information for Table '{self.name}' ##
147
148Schema:\n{fmt_schema}
149
150Sample rows:\n{format_rows_from_table(self.sample)}"""
151 if self.annotation:
152 ret += f"\nUsage Notes:\n{self.annotation.description}"
153 return ret
154
155
156def build_prompt(db_connection, assistant_request, included_tables, query_error=None, sql=None):

Callers 1

build_promptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected