mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 17:37:43 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user