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

Function format_rows_from_table

explorer/assistant/utils.py:85–94  ·  view source on GitHub ↗

Given an array of rows (a list of lists), returns e.g. AlbumId | Title | ArtistId 1 | For Those About To Rock We Salute You | 1 2 | Let It Rip | 2 3 | Restless and Wild | 2

(rows)

Source from the content-addressed store, hash-verified

83
84
85def format_rows_from_table(rows):
86 """ Given an array of rows (a list of lists), returns e.g.
87
88AlbumId | Title | ArtistId
891 | For Those About To Rock We Salute You | 1
902 | Let It Rip | 2
913 | Restless and Wild | 2
92
93 """
94 return "\n".join([" | ".join([str(item) for item in row]) for row in rows])
95
96
97def build_system_prompt(flavor):

Callers 3

renderMethod · 0.85

Calls

no outgoing calls

Tested by 2