Skip to content

Fix broken images in finance-chart-sandbox README#73

Merged
jliounis merged 2 commits into
mainfrom
fix/finance-chart-sandbox-images
Jun 8, 2026
Merged

Fix broken images in finance-chart-sandbox README#73
jliounis merged 2 commits into
mainfrom
fix/finance-chart-sandbox-images

Conversation

@jliounis

@jliounis jliounis commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Problem

The images in the Finance Chart (Sandbox) example don't render on the live cookbook (docs.perplexity.ai). The references used relative paths:

![...](../../static/img/finance-chart-sandbox-aapl.png)

These don't resolve on the deployed Mintlify site — the repo-root static/ folder isn't served there. (The same broken pattern affects other examples like discord-py-bot; verified all candidate deployed paths return 404.)

Fix

Point both images at their committed location via raw.githubusercontent.com, which returns 200 image/png and matches the convention already used by the showcase pages:

![...](https://raw.githubusercontent.com/perplexityai/api-cookbook/main/static/img/finance-chart-sandbox-aapl.png)

Affects only docs/examples/finance-chart-sandbox/README.mdx (2 image references).

🤖 Generated with Claude Code

jliounis added 2 commits June 1, 2026 18:22
The relative ../../static/img/ paths don't resolve on the deployed
Mintlify cookbook (docs.perplexity.ai). Use absolute raw.githubusercontent
URLs instead, matching the convention used by the showcase pages.
The sandbox tool now returns files written to its workspace as downloadable
`share_file` artifacts. Use that instead of scraping a fenced CSV out of
stdout: the sandbox fetches the daily closes and renders the chart itself,
returning prices.csv and chart.png, which the client downloads.

- Pin the data source to Yahoo's v8 chart JSON (Stooq fallback): collapses the
  old multi-call source hunt to ~1 sandbox invocation, cutting latency/cost.
- Raise max_output_tokens to 8192 — the sandbox spends output tokens writing
  its own code; a tight cap starved the file-write step (data fetched, no files).
- CLI: download both files, no local matplotlib (no third-party deps).
- Web UI: display the sandbox-rendered PNG via a new /chart.png endpoint and
  drop Chart.js; keep the CSV download and streamed analysis.
- README updated; finance_search re-confirmed history-less (latest quote only).
@jliounis jliounis merged commit 17d4586 into main Jun 8, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant