Read docs
Built on solid web foundations, not the latest fads - with FastHTML you can get started on anything from simple dashboards to scalable web applications in minutes.
Learn more Watch intro 7min 30sec
| from html2text import HTML2Text | |
| from textwrap import dedent | |
| import re | |
| def get_md(cts, extractor='h2t'): | |
| h2t = HTML2Text(bodywidth=5000) | |
| h2t.ignore_links,h2t.mark_code,h2t.ignore_images = (True,)*3 | |
| res = h2t.handle(cts) | |
| def _f(m): return f'```\n{dedent(m.group(1))}\n```' | |
| return re.sub(r'\[code]\s*\n(.*?)\n\[/code]', _f, res or '', flags=re.DOTALL).strip() |
| def follow_user_follows(client, target_user): | |
| "Follow everyone the target_user is following." | |
| cursor = None | |
| total_followed = 0 | |
| while True: | |
| # Step 1: Fetch a batch of accounts the target user is following | |
| # https://docs.bsky.app/docs/api/app-bsky-graph-get-follows | |
| response = client.app.bsky.graph.get_follows({ |
Practical Deep Learning for Coders
__
JSON is one of the most widely used formats in the world for applications to exchange data.
Structured Outputs is a feature that ensures the model will always generate responses that adhere to your supplied JSON Schema, so you don't need to worry about the model omitting a required key, or hallucinating an invalid enum value.
Some benefits of Structed Outputs include: