fix: refine details (#979)

* feat: add parquet preview and extract common DataFrame preview logic

* refactor: improve error messages, prompts, regex, and session loading

* lint
This commit is contained in:
you-n-g
2025-06-23 10:38:27 +08:00
committed by GitHub
parent a4206e99b2
commit b60f5fc506
8 changed files with 62 additions and 26 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ class PythonAgentOut(AgentOut):
@classmethod
def extract_output(cls, resp: str):
match = re.search(r".*```[Pp]ython\n(.*)\n```.*", resp, re.DOTALL)
# We use lazy mode (.*?) to only extract the first code block in the response.
match = re.search(r".*```[Pp]ython\n(.*?)\n```.*", resp, re.DOTALL)
if match:
code = match.group(1)
code = re.sub(r"</?code>", "", code, flags=re.IGNORECASE)