{"id":80,"date":"2025-06-21T00:16:56","date_gmt":"2025-06-20T23:16:56","guid":{"rendered":"https:\/\/chilternslightnetwork.org\/?page_id=80"},"modified":"2025-06-21T16:00:15","modified_gmt":"2025-06-21T15:00:15","slug":"not-public-3","status":"publish","type":"page","link":"https:\/\/chilternslightnetwork.org\/index.php\/not-public-3\/","title":{"rendered":"test Code Samples"},"content":{"rendered":"\n<div style=\"font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); color: #1e293b; padding: 40px 20px; border-radius: 12px; margin: 20px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid #e2e8f0;\">\n    \n    <!-- Header -->\n    <div style=\"text-align: center; margin-bottom: 40px;\">\n        <h2 style=\"font-size: 2rem; font-weight: 800; margin-bottom: 16px; background: linear-gradient(135deg, #1e293b, #475569); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;\">\n            AI Code Generation Demo\n        <\/h2>\n        <p style=\"font-size: 1.1rem; color: #64748b;\">Transform prompts into production-ready code instantly<\/p>\n    <\/div>\n    \n    <!-- Single Code Example -->\n    <div style=\"background: #ffffff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); max-width: 700px; margin: 0 auto;\">\n        \n        <div style=\"background: #f8fafc; padding: 12px 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 10px;\">\n            <div style=\"width: 12px; height: 12px; background: #ef4444; border-radius: 50%;\"><\/div>\n            <div style=\"width: 12px; height: 12px; background: #f59e0b; border-radius: 50%;\"><\/div>\n            <div style=\"width: 12px; height: 12px; background: #22c55e; border-radius: 50%;\"><\/div>\n            <span style=\"margin-left: auto; font-family: 'Monaco', 'Menlo', monospace; font-size: 12px; color: #64748b;\">api_client.py<\/span>\n        <\/div>\n        \n        <div style=\"padding: 24px;\">\n            <h3 style=\"font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: #15803d;\">Python API Client<\/h3>\n            <p style=\"font-size: 0.9rem; color: #64748b; margin-bottom: 16px;\">Prompt: &#8220;Create an API client with error handling&#8221;<\/p>\n            \n            <pre style=\"background: #ffffff !important; padding: 16px; border-radius: 6px; border: 1px solid #e2e8f0; overflow-x: auto; font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important; font-size: 13px; line-height: 1.6 !important; color: #1e293b !important; margin: 0 !important; white-space: pre !important;\"><span style=\"color: #0ea5e9 !important;\">import<\/span> <span style=\"color: #1e293b !important;\">requests<\/span>\n<span style=\"color: #0ea5e9 !important;\">from<\/span> <span style=\"color: #1e293b !important;\">typing<\/span> <span style=\"color: #0ea5e9 !important;\">import<\/span> <span style=\"color: #1e293b !important;\">Dict, Optional<\/span>\n\n<span style=\"color: #0ea5e9 !important;\">class<\/span> <span style=\"color: #dc2626 !important;\">ApiClient<\/span>:\n    <span style=\"color: #0ea5e9 !important;\">def<\/span> <span style=\"color: #7c3aed !important;\">__init__<\/span>(<span style=\"color: #dc2626 !important;\">self<\/span>, <span style=\"color: #1e293b !important;\">base_url<\/span>: <span style=\"color: #dc2626 !important;\">str<\/span>):\n        <span style=\"color: #dc2626 !important;\">self<\/span>.<span style=\"color: #1e293b !important;\">base_url<\/span> = <span style=\"color: #1e293b !important;\">base_url<\/span>\n        <span style=\"color: #dc2626 !important;\">self<\/span>.<span style=\"color: #1e293b !important;\">session<\/span> = <span style=\"color: #1e293b !important;\">requests<\/span>.<span style=\"color: #7c3aed !important;\">Session<\/span>()\n    \n    <span style=\"color: #0ea5e9 !important;\">def<\/span> <span style=\"color: #7c3aed !important;\">get<\/span>(<span style=\"color: #dc2626 !important;\">self<\/span>, <span style=\"color: #1e293b !important;\">endpoint<\/span>: <span style=\"color: #dc2626 !important;\">str<\/span>) -> <span style=\"color: #dc2626 !important;\">Optional<\/span>[<span style=\"color: #dc2626 !important;\">Dict<\/span>]:\n        <span style=\"color: #0ea5e9 !important;\">try<\/span>:\n            <span style=\"color: #1e293b !important;\">response<\/span> = <span style=\"color: #dc2626 !important;\">self<\/span>.<span style=\"color: #1e293b !important;\">session<\/span>.<span style=\"color: #7c3aed !important;\">get<\/span>(<span style=\"color: #059669 !important;\">f\"<\/span><span style=\"color: #059669 !important;\">{<\/span><span style=\"color: #dc2626 !important;\">self<\/span>.<span style=\"color: #1e293b !important;\">base_url<\/span><span style=\"color: #059669 !important;\">}<\/span><span style=\"color: #059669 !important;\">{endpoint}\"<\/span>)\n            <span style=\"color: #1e293b !important;\">response<\/span>.<span style=\"color: #7c3aed !important;\">raise_for_status<\/span>()\n            <span style=\"color: #0ea5e9 !important;\">return<\/span> <span style=\"color: #1e293b !important;\">response<\/span>.<span style=\"color: #7c3aed !important;\">json<\/span>()\n        <span style=\"color: #0ea5e9 !important;\">except<\/span> <span style=\"color: #1e293b !important;\">requests<\/span>.<span style=\"color: #dc2626 !important;\">RequestException<\/span> <span style=\"color: #0ea5e9 !important;\">as<\/span> <span style=\"color: #1e293b !important;\">e<\/span>:\n            <span style=\"color: #7c3aed !important;\">print<\/span>(<span style=\"color: #059669 !important;\">f\"API Error: <\/span><span style=\"color: #059669 !important;\">{<\/span><span style=\"color: #1e293b !important;\">e<\/span><span style=\"color: #059669 !important;\">}<\/span><span style=\"color: #059669 !important;\">\"<\/span>)\n            <span style=\"color: #0ea5e9 !important;\">return<\/span> <span style=\"color: #0ea5e9 !important;\">None<\/span><\/pre>\n        <\/div>\n    <\/div>\n    \n    <!-- Performance Stats -->\n    <div style=\"margin-top: 40px; text-align: center; background: #ffffff; padding: 30px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 4px 15px rgba(0,0,0,0.05);\">\n        <div style=\"display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap;\">\n            <div>\n                <div style=\"font-size: 2rem; font-weight: 800; color: #15803d; margin-bottom: 4px;\">94%<\/div>\n                <div style=\"font-size: 0.9rem; color: #64748b;\">Accuracy<\/div>\n            <\/div>\n            <div>\n                <div style=\"font-size: 2rem; font-weight: 800; color: #2563eb; margin-bottom: 4px;\">2.8s<\/div>\n                <div style=\"font-size: 0.9rem; color: #64748b;\">Generation<\/div>\n            <\/div>\n            <div>\n                <div style=\"font-size: 2rem; font-weight: 800; color: #d97706; margin-bottom: 4px;\">15+<\/div>\n                <div style=\"font-size: 0.9rem; color: #64748b;\">Languages<\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n    \n<\/div>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>a<\/td><td><\/td><td>a<\/td><td>a<\/td><\/tr><tr><td><\/td><td>a<\/td><td>a<\/td><td>a<\/td><\/tr><tr><td>a<\/td><td>a<\/td><td>a<\/td><td>a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"1024\" src=\"http:\/\/chilternslightnetwork.org\/wp-content\/uploads\/2025\/06\/image-1-730x1024.png\" alt=\"\" class=\"wp-image-68\" srcset=\"https:\/\/chilternslightnetwork.org\/wp-content\/uploads\/2025\/06\/image-1-730x1024.png 730w, https:\/\/chilternslightnetwork.org\/wp-content\/uploads\/2025\/06\/image-1-214x300.png 214w, https:\/\/chilternslightnetwork.org\/wp-content\/uploads\/2025\/06\/image-1-768x1078.png 768w, https:\/\/chilternslightnetwork.org\/wp-content\/uploads\/2025\/06\/image-1.png 1033w\" sizes=\"auto, (max-width: 730px) 85vw, 730px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>AI Code Generation Demo Transform prompts into production-ready code instantly api_client.py Python API Client Prompt: &#8220;Create an API client with error handling&#8221; import requests from typing import Dict, Optional class ApiClient: def __init__(self, base_url: str): self.base_url = base_url self.session = requests.Session() def get(self, endpoint: str) -> Optional[Dict]: try: response = self.session.get(f&#8221;{self.base_url}{endpoint}&#8221;) response.raise_for_status() return response.json() except &hellip; <a href=\"https:\/\/chilternslightnetwork.org\/index.php\/not-public-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;test Code Samples&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"class_list":["post-80","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/pages\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":6,"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/pages\/80\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/pages\/80\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/chilternslightnetwork.org\/index.php\/wp-json\/wp\/v2\/media?parent=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}