Skip to content

Fix Flask template discovery#2

Open
112-stack wants to merge 3 commits into
mainfrom
codex/create-local-python-web-application-with-chatgpt-p03xt5
Open

Fix Flask template discovery#2
112-stack wants to merge 3 commits into
mainfrom
codex/create-local-python-web-application-with-chatgpt-p03xt5

Conversation

@112-stack

Copy link
Copy Markdown
Owner

Summary

  • configure the Flask factory to explicitly point at the project templates and static directories so runtime deployments can resolve Jinja templates

Testing

  • python -m compileall app install.py app.py

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/chatgpt_client.py Outdated
Comment on lines +105 to +110
@staticmethod
def _parse_response(response: Any) -> Dict[str, Any]:
try:
return json.loads(response.output[0].content[0].text)
except (KeyError, AttributeError, IndexError, json.JSONDecodeError) as exc:
raise RuntimeError('Unable to parse response from ChatGPT.') from exc

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse structured response from wrong field

When generate_business_insights requests a JSON schema response, the OpenAI SDK already places the parsed object under response.output[0].content[0].parsed (or an equivalent json attribute). The code instead indexes into .text and runs json.loads, which is None for JSON‑schema responses, so every successful call raises the RuntimeError('Unable to parse response from ChatGPT.') path and the predictor view never renders results. Use the SDK’s structured field instead of .text to avoid the unconditional failure.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant