You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
53% of the time* ChatGPT will try to pass the code as a plaintext body (which FastAPI will obviously bomb on):
# First, let's check if we are in a Git repository by running the `git rev-parse --is-inside-work-tree` command.# If the output is "true", then we are inside a Git repository, and we can proceed with generating the plot.# If the output is not "true", then we are not in a Git repository, and we cannot generate the plot.importsubprocessdefis_inside_git_repo():
try:
output=subprocess.check_output(["git", "rev-parse", "--is-inside-work-tree"], universal_newlines=True)
returnoutput.strip() =="true"exceptsubprocess.CalledProcessError:
returnFalseis_inside_git_repo()
rather than the expected payload format
{
"code": "# First, let's check if we are in a Git repository by running the `git rev-parse --is-inside-work-tree` command.\n# If the output is \"true\", then we are inside a Git repository, and we can proceed with generating the plot.\n# If the output is not \"true\", then we are not in a Git repository, and we cannot generate the plot.\n\nimport subprocess\n\ndef is_inside_git_repo():\n try:\n output = subprocess.check_output([\"git\", \"rev-parse\", \"--is-inside-work-tree\"], universal_newlines=True)\n return output.strip() == \"true\"\n except subprocess.CalledProcessError:\n return False\n\nis_inside_git_repo()"
}
This made me think that maybe we should make the format more "notebook-like" by encoding it as a list of strings:
{
"code": [
"# First, let's check if we are in a Git repository by running the `git rev-parse --is-inside-work-tree` command.",
"# If the output is \"true\", then we are inside a Git repository, and we can proceed with generating the plot.",
"# If the output is not \"true\", then we are not in a Git repository, and we cannot generate the plot.",
"",
"import subprocess",
"",
"def is_inside_git_repo():",
" try:",
" output = subprocess.check_output([\"git\", \"rev-parse\", \"--is-inside-work-tree\"], universal_newlines=True)",
" return output.strip() == \"true\"",
" except subprocess.CalledProcessError:",
" return False",
"",
"is_inside_git_repo()"
]
}
That would also make it easier to read inside of the plugin UI:
* I hallucinated this statistic just like GPT-3
The text was updated successfully, but these errors were encountered:
53% of the time* ChatGPT will try to pass the code as a plaintext body (which FastAPI will obviously bomb on):
rather than the expected payload format
This made me think that maybe we should make the format more "notebook-like" by encoding it as a list of strings:
That would also make it easier to read inside of the plugin UI:
* I hallucinated this statistic just like GPT-3
The text was updated successfully, but these errors were encountered: