[{"data":1,"prerenderedAt":6123},["ShallowReactive",2],{"navigation":3,"blog":61,"posts":72},[4,50,53],{"title":5,"_path":6,"children":7,"icon":49},"Docs","/docs",[8,21,36],{"title":9,"_path":10,"children":11,"icon":20},"شروع به کار","/docs/getting-started",[12,14,17],{"title":13,"_path":10},"مقدمه",{"title":15,"_path":16},"نصب","/docs/getting-started/installation",{"title":18,"_path":19},"قیمت‌گذاری","/docs/getting-started/pricing","i-lucide-square-play",{"title":22,"_path":23,"children":24,"icon":35},"تخصصی","/docs/studio",[25,27,31],{"title":13,"_path":23,"icon":26},"i-lucide-sparkles",{"title":28,"_path":29,"icon":30},"نظام مهندسی","/docs/studio/architecture","i-lucide-landmark",{"title":32,"_path":33,"icon":34},"تحلیل‌گر پتروشیمی","/docs/studio/petrochemical","i-lucide-bar-chart-3","i-lucide-brain",{"title":37,"_path":38,"children":39,"icon":48},"موارد استفاده","/docs/usage",[40,44],{"title":41,"_path":42,"icon":43},"Cursor","/docs/usage/cursor","i-lucide-code",{"title":45,"_path":46,"icon":47},"Claude Code","/docs/usage/claude-code","i-lucide-terminal","i-lucide-boxes","i-heroicons-book-open",{"title":18,"_path":51,"icon":52},"/pricing","i-heroicons-credit-card",{"title":54,"_path":55,"children":56,"icon":60},"وبلاگ","/blog",[57],{"title":58,"_path":59},"چطور از API های هوش مصنوعی استفاده کنیم","/blog/openai-compatible-api","i-heroicons-newspaper",{"_path":55,"_dir":62,"_draft":63,"_partial":63,"_locale":62,"title":54,"description":64,"navigation":65,"_id":66,"_type":67,"_source":68,"_file":69,"_stem":70,"_extension":71},"",false,"پلتفرم هوش مصنوعی آهور یک مجموعه کامل از ابزارهای هوش مصنوعی است که به شما کمک می‌کند تا در کارهای روزمره و پروژه‌های حرفه‌ای خود از هوش مصنوعی بهره‌مند شوید. با استفاده از ابزارهای مختلف آهور می‌توانید محتوای متنی تولید کنید، تصاویر خلق کنید، کدنویسی را تسریع بخشید و بسیاری از کارهای دیگر را به صورت خودکار انجام دهید. این پلتفرم برای توسعه‌دهندگان، محتواسازان، بازاریابان و کاربران عادی طراحی شده است تا بتوانند به راحتی از قدرت هوش مصنوعی استفاده کنند.",{"icon":60},"content:3.blog.yml","yaml","content","3.blog.yml","3.blog","yml",[73],{"_path":59,"_dir":74,"_draft":63,"_partial":63,"_locale":62,"title":58,"description":75,"image":76,"authors":78,"date":84,"badge":85,"body":87,"_type":6118,"_id":6119,"_source":68,"_file":6120,"_stem":6121,"_extension":6122},"blog","آموزشی تکمیلی جهتف استفاده از API های هوش مصنوعی توسط روز دنیا",{"src":77},"https://picsum.photos/id/490/640/360",[79],{"name":80,"to":81,"avatar":82},"علی خالقی","https://twitter.com/benjamincanac",{"src":83},"https://i.pravatar.cc/128?u=0","2026-02-17",{"label":86},"API, OpenAI, Anthropic, Google",{"type":88,"children":89,"toc":6100},"root",[90,97,113,161,167,172,248,254,261,273,472,478,489,1727,1733,1744,2038,2044,2055,2752,2758,2768,3640,3646,3657,4106,4112,4118,4123,5066,5072,5432,5438,6076,6082,6094],{"type":91,"tag":92,"props":93,"children":94},"element","h2",{"id":13},[95],{"type":96,"value":13},"text",{"type":91,"tag":98,"props":99,"children":100},"p",{},[101,103,111],{"type":96,"value":102},"رابط‌های برنامه‌نویسی کاربردی (API) سازگار با OpenAI به شما امکان می‌دهند تا از مدل‌های زبانی قدرتمند مشابه ChatGPT در سرورهای خود استفاده کنید. این راهنما نحوه استفاده از این API‌ها را با زبان‌های برنامه‌نویسی مختلف و سرور شخصی شما در ",{"type":91,"tag":104,"props":105,"children":109},"a",{"href":106,"rel":107},"https://api.ahur.ir/v1",[108],"nofollow",[110],{"type":96,"value":106},{"type":96,"value":112}," نشان می‌دهد.",{"type":91,"tag":114,"props":115,"children":121},"div",{"className":116},[117,118,119,120],"flex","space-x-4","items-center","justify-between",[122,137,149],{"type":91,"tag":114,"props":123,"children":124},{},[125],{"type":91,"tag":98,"props":126,"children":127},{},[128],{"type":91,"tag":129,"props":130,"children":136},"img",{"alt":131,"className":132,"height":134,"src":135,"width":134},"api",[133],"rounded-lg",400,"https://picsum.photos/id/75/400/400",[],{"type":91,"tag":114,"props":138,"children":139},{},[140],{"type":91,"tag":98,"props":141,"children":142},{},[143],{"type":91,"tag":129,"props":144,"children":148},{"alt":145,"className":146,"height":134,"src":147,"width":134},"code",[133],"https://picsum.photos/id/82/400/400",[],{"type":91,"tag":114,"props":150,"children":151},{},[152],{"type":91,"tag":98,"props":153,"children":154},{},[155],{"type":91,"tag":129,"props":156,"children":160},{"alt":157,"className":158,"height":134,"src":159,"width":134},"server",[133],"https://picsum.photos/id/102/400/400",[],{"type":91,"tag":92,"props":162,"children":164},{"id":163},"معرفی-openai-compatible-apis",[165],{"type":96,"value":166},"معرفی OpenAI Compatible APIs",{"type":91,"tag":98,"props":168,"children":169},{},[170],{"type":96,"value":171},"رابط‌های API سازگار با OpenAI به شما اجازه می‌دهند تا از مدل‌های زبانی پیشرفته در سرور خود استفاده کنید. این API‌ها با نسخه اصلی OpenAI سازگار هستند و می‌توانید به راحتی کدهای موجود خود را با تغییر URL به سرور شخصی خود منتقل کنید.",{"type":91,"tag":114,"props":173,"children":175},{"className":174},[117,118,119,120],[176,188,200,212,224,236],{"type":91,"tag":114,"props":177,"children":178},{},[179],{"type":91,"tag":98,"props":180,"children":181},{},[182],{"type":91,"tag":129,"props":183,"children":187},{"alt":184,"className":185,"height":134,"src":186,"width":134},"python",[133],"https://picsum.photos/id/107/400/400",[],{"type":91,"tag":114,"props":189,"children":190},{},[191],{"type":91,"tag":98,"props":192,"children":193},{},[194],{"type":91,"tag":129,"props":195,"children":199},{"alt":196,"className":197,"height":134,"src":198,"width":134},"javascript",[133],"https://picsum.photos/id/225/400/400",[],{"type":91,"tag":114,"props":201,"children":202},{},[203],{"type":91,"tag":98,"props":204,"children":205},{},[206],{"type":91,"tag":129,"props":207,"children":211},{"alt":208,"className":209,"height":134,"src":210,"width":134},"curl",[133],"https://picsum.photos/id/306/400/400",[],{"type":91,"tag":114,"props":213,"children":214},{},[215],{"type":91,"tag":98,"props":216,"children":217},{},[218],{"type":91,"tag":129,"props":219,"children":223},{"alt":220,"className":221,"height":134,"src":222,"width":134},"go",[133],"https://picsum.photos/id/488/400/400",[],{"type":91,"tag":114,"props":225,"children":226},{},[227],{"type":91,"tag":98,"props":228,"children":229},{},[230],{"type":91,"tag":129,"props":231,"children":235},{"alt":232,"className":233,"height":134,"src":234,"width":134},"rust",[133],"https://picsum.photos/id/326/400/400",[],{"type":91,"tag":114,"props":237,"children":238},{},[239],{"type":91,"tag":98,"props":240,"children":241},{},[242],{"type":91,"tag":129,"props":243,"children":247},{"alt":244,"className":245,"height":134,"src":246,"width":134},"java",[133],"https://picsum.photos/id/493/400/400",[],{"type":91,"tag":92,"props":249,"children":251},{"id":250},"راهنمای-استفاده",[252],{"type":96,"value":253},"راهنمای استفاده",{"type":91,"tag":255,"props":256,"children":258},"h3",{"id":257},"استفاده-با-python",[259],{"type":96,"value":260},"استفاده با Python",{"type":91,"tag":114,"props":262,"children":263},{},[264],{"type":91,"tag":98,"props":265,"children":266},{},[267],{"type":91,"tag":129,"props":268,"children":272},{"alt":184,"className":269,"height":134,"src":270,"width":271},[133],"https://picsum.photos/id/615/1200/400",1200,[],{"type":91,"tag":274,"props":275,"children":276},"tabs",{},[277],{"type":91,"tag":114,"props":278,"children":281},{"icon":279,"label":280},"i-heroicons-code-bracket-square","OpenAI SDK",[282,287,296,301],{"type":91,"tag":98,"props":283,"children":284},{},[285],{"type":96,"value":286},"برای استفاده از Python، کتابخانه رسمی OpenAI را نصب کنید ```bash\npip install openai",{"type":91,"tag":288,"props":289,"children":291},"pre",{"code":290},"\nسپس کد زیر را:\nاستفاده کنید:\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.ahur.ir/v1\",\n    api_key=\"your-api-key\"  # کلید API خود را وارد کنید\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": \"Hello! How are you?\"}\n    ]\n)\n\nprint(response.choices[0].message.content)\n",[292],{"type":91,"tag":145,"props":293,"children":294},{"__ignoreMap":62},[295],{"type":96,"value":290},{"type":91,"tag":98,"props":297,"children":298},{},[299],{"type":96,"value":300},"::",{"type":91,"tag":114,"props":302,"children":304},{"icon":279,"label":303},"Requests Library",[305,310],{"type":91,"tag":98,"props":306,"children":307},{},[308],{"type":96,"value":309},"همچنین می‌توانید از کتابخانه requests استفاده کنید:",{"type":91,"tag":288,"props":311,"children":314},{"code":312,"language":184,"meta":62,"className":313,"style":62},"import requests\n\nurl = \"https://api.ahur.ir/v1/chat/completions\"\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"Authorization\": \"Bearer your-api-key\"\n}\ndata = {\n  \"model\": \"gpt-3.5-turbo\",\n  \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\", \"content\": \"Hello! How are you?\"}\n  ]\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json()[\"choices\"][0][\"message\"][\"content\"])\n","language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[315],{"type":91,"tag":145,"props":316,"children":317},{"__ignoreMap":62},[318,329,339,348,357,366,375,384,393,402,411,420,429,438,446,454,463],{"type":91,"tag":319,"props":320,"children":323},"span",{"class":321,"line":322},"line",1,[324],{"type":91,"tag":319,"props":325,"children":326},{},[327],{"type":96,"value":328},"import requests\n",{"type":91,"tag":319,"props":330,"children":332},{"class":321,"line":331},2,[333],{"type":91,"tag":319,"props":334,"children":336},{"emptyLinePlaceholder":335},true,[337],{"type":96,"value":338},"\n",{"type":91,"tag":319,"props":340,"children":342},{"class":321,"line":341},3,[343],{"type":91,"tag":319,"props":344,"children":345},{},[346],{"type":96,"value":347},"url = \"https://api.ahur.ir/v1/chat/completions\"\n",{"type":91,"tag":319,"props":349,"children":351},{"class":321,"line":350},4,[352],{"type":91,"tag":319,"props":353,"children":354},{},[355],{"type":96,"value":356},"headers = {\n",{"type":91,"tag":319,"props":358,"children":360},{"class":321,"line":359},5,[361],{"type":91,"tag":319,"props":362,"children":363},{},[364],{"type":96,"value":365},"  \"Content-Type\": \"application/json\",\n",{"type":91,"tag":319,"props":367,"children":369},{"class":321,"line":368},6,[370],{"type":91,"tag":319,"props":371,"children":372},{},[373],{"type":96,"value":374},"  \"Authorization\": \"Bearer your-api-key\"\n",{"type":91,"tag":319,"props":376,"children":378},{"class":321,"line":377},7,[379],{"type":91,"tag":319,"props":380,"children":381},{},[382],{"type":96,"value":383},"}\n",{"type":91,"tag":319,"props":385,"children":387},{"class":321,"line":386},8,[388],{"type":91,"tag":319,"props":389,"children":390},{},[391],{"type":96,"value":392},"data = {\n",{"type":91,"tag":319,"props":394,"children":396},{"class":321,"line":395},9,[397],{"type":91,"tag":319,"props":398,"children":399},{},[400],{"type":96,"value":401},"  \"model\": \"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":403,"children":405},{"class":321,"line":404},10,[406],{"type":91,"tag":319,"props":407,"children":408},{},[409],{"type":96,"value":410},"  \"messages\": [\n",{"type":91,"tag":319,"props":412,"children":414},{"class":321,"line":413},11,[415],{"type":91,"tag":319,"props":416,"children":417},{},[418],{"type":96,"value":419},"      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",{"type":91,"tag":319,"props":421,"children":423},{"class":321,"line":422},12,[424],{"type":91,"tag":319,"props":425,"children":426},{},[427],{"type":96,"value":428},"      {\"role\": \"user\", \"content\": \"Hello! How are you?\"}\n",{"type":91,"tag":319,"props":430,"children":432},{"class":321,"line":431},13,[433],{"type":91,"tag":319,"props":434,"children":435},{},[436],{"type":96,"value":437},"  ]\n",{"type":91,"tag":319,"props":439,"children":441},{"class":321,"line":440},14,[442],{"type":91,"tag":319,"props":443,"children":444},{},[445],{"type":96,"value":383},{"type":91,"tag":319,"props":447,"children":449},{"class":321,"line":448},15,[450],{"type":91,"tag":319,"props":451,"children":452},{"emptyLinePlaceholder":335},[453],{"type":96,"value":338},{"type":91,"tag":319,"props":455,"children":457},{"class":321,"line":456},16,[458],{"type":91,"tag":319,"props":459,"children":460},{},[461],{"type":96,"value":462},"response = requests.post(url, headers=headers, json=data)\n",{"type":91,"tag":319,"props":464,"children":466},{"class":321,"line":465},17,[467],{"type":91,"tag":319,"props":468,"children":469},{},[470],{"type":96,"value":471},"print(response.json()[\"choices\"][0][\"message\"][\"content\"])\n",{"type":91,"tag":255,"props":473,"children":475},{"id":474},"استفاده-با-javascriptnodejs",[476],{"type":96,"value":477},"استفاده با JavaScript/Node.js",{"type":91,"tag":114,"props":479,"children":480},{},[481],{"type":91,"tag":98,"props":482,"children":483},{},[484],{"type":91,"tag":129,"props":485,"children":488},{"alt":196,"className":486,"height":134,"src":487,"width":271},[133],"https://picsum.photos/id/686/1200/400",[],{"type":91,"tag":274,"props":490,"children":491},{},[492,1121],{"type":91,"tag":114,"props":493,"children":498},{"icon":279,"label":494,"className":495},"Node.js",[117,496,497,119],"space-between","w-full",[499,504,533,538],{"type":91,"tag":98,"props":500,"children":501},{},[502],{"type":96,"value":503},"ابتدا کتابخانه openai را نصب کنید:",{"type":91,"tag":288,"props":505,"children":509},{"code":506,"language":507,"meta":62,"className":508,"style":62},"npm install openai\n","bash","language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[510],{"type":91,"tag":145,"props":511,"children":512},{"__ignoreMap":62},[513],{"type":91,"tag":319,"props":514,"children":515},{"class":321,"line":322},[516,522,528],{"type":91,"tag":319,"props":517,"children":519},{"style":518},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[520],{"type":96,"value":521},"npm",{"type":91,"tag":319,"props":523,"children":525},{"style":524},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[526],{"type":96,"value":527}," install",{"type":91,"tag":319,"props":529,"children":530},{"style":524},[531],{"type":96,"value":532}," openai\n",{"type":91,"tag":98,"props":534,"children":535},{},[536],{"type":96,"value":537},"سپس کد زیر را استفاده کنید:",{"type":91,"tag":288,"props":539,"children":542},{"code":540,"language":196,"meta":62,"className":541,"style":62},"import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n    baseURL: 'https://api.ahur.ir/v1',\n    apiKey: 'your-api-key' // کلید API خود را وارد کنید\n});\n\nasync function main() {\n    const chatCompletion = await openai.chat.completions.create({\n        model: 'gpt-3.5-turbo',\n        messages: [\n            {role: 'system', content: 'You are a helpful assistant.'},\n            {role: 'user', content: 'Hello! How are you?'}\n        ],\n    });\n\n    console.log(chatCompletion.choices[0].message.content);\n}\n\nmain();\n","language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[543],{"type":91,"tag":145,"props":544,"children":545},{"__ignoreMap":62},[546,587,594,634,665,696,713,720,748,812,841,858,920,977,989,1005,1012,1088,1096,1104],{"type":91,"tag":319,"props":547,"children":548},{"class":321,"line":322},[549,555,561,566,572,577,582],{"type":91,"tag":319,"props":550,"children":552},{"style":551},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[553],{"type":96,"value":554},"import",{"type":91,"tag":319,"props":556,"children":558},{"style":557},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[559],{"type":96,"value":560}," OpenAI ",{"type":91,"tag":319,"props":562,"children":563},{"style":551},[564],{"type":96,"value":565},"from",{"type":91,"tag":319,"props":567,"children":569},{"style":568},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[570],{"type":96,"value":571}," '",{"type":91,"tag":319,"props":573,"children":574},{"style":524},[575],{"type":96,"value":576},"openai",{"type":91,"tag":319,"props":578,"children":579},{"style":568},[580],{"type":96,"value":581},"'",{"type":91,"tag":319,"props":583,"children":584},{"style":568},[585],{"type":96,"value":586},";\n",{"type":91,"tag":319,"props":588,"children":589},{"class":321,"line":331},[590],{"type":91,"tag":319,"props":591,"children":592},{"emptyLinePlaceholder":335},[593],{"type":96,"value":338},{"type":91,"tag":319,"props":595,"children":596},{"class":321,"line":341},[597,603,608,613,618,624,629],{"type":91,"tag":319,"props":598,"children":600},{"style":599},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[601],{"type":96,"value":602},"const",{"type":91,"tag":319,"props":604,"children":605},{"style":557},[606],{"type":96,"value":607}," openai ",{"type":91,"tag":319,"props":609,"children":610},{"style":568},[611],{"type":96,"value":612},"=",{"type":91,"tag":319,"props":614,"children":615},{"style":568},[616],{"type":96,"value":617}," new",{"type":91,"tag":319,"props":619,"children":621},{"style":620},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[622],{"type":96,"value":623}," OpenAI",{"type":91,"tag":319,"props":625,"children":626},{"style":557},[627],{"type":96,"value":628},"(",{"type":91,"tag":319,"props":630,"children":631},{"style":568},[632],{"type":96,"value":633},"{\n",{"type":91,"tag":319,"props":635,"children":636},{"class":321,"line":350},[637,643,648,652,656,660],{"type":91,"tag":319,"props":638,"children":640},{"style":639},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[641],{"type":96,"value":642},"    baseURL",{"type":91,"tag":319,"props":644,"children":645},{"style":568},[646],{"type":96,"value":647},":",{"type":91,"tag":319,"props":649,"children":650},{"style":568},[651],{"type":96,"value":571},{"type":91,"tag":319,"props":653,"children":654},{"style":524},[655],{"type":96,"value":106},{"type":91,"tag":319,"props":657,"children":658},{"style":568},[659],{"type":96,"value":581},{"type":91,"tag":319,"props":661,"children":662},{"style":568},[663],{"type":96,"value":664},",\n",{"type":91,"tag":319,"props":666,"children":667},{"class":321,"line":359},[668,673,677,681,686,690],{"type":91,"tag":319,"props":669,"children":670},{"style":639},[671],{"type":96,"value":672},"    apiKey",{"type":91,"tag":319,"props":674,"children":675},{"style":568},[676],{"type":96,"value":647},{"type":91,"tag":319,"props":678,"children":679},{"style":568},[680],{"type":96,"value":571},{"type":91,"tag":319,"props":682,"children":683},{"style":524},[684],{"type":96,"value":685},"your-api-key",{"type":91,"tag":319,"props":687,"children":688},{"style":568},[689],{"type":96,"value":581},{"type":91,"tag":319,"props":691,"children":693},{"style":692},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[694],{"type":96,"value":695}," // کلید API خود را وارد کنید\n",{"type":91,"tag":319,"props":697,"children":698},{"class":321,"line":368},[699,704,709],{"type":91,"tag":319,"props":700,"children":701},{"style":568},[702],{"type":96,"value":703},"}",{"type":91,"tag":319,"props":705,"children":706},{"style":557},[707],{"type":96,"value":708},")",{"type":91,"tag":319,"props":710,"children":711},{"style":568},[712],{"type":96,"value":586},{"type":91,"tag":319,"props":714,"children":715},{"class":321,"line":377},[716],{"type":91,"tag":319,"props":717,"children":718},{"emptyLinePlaceholder":335},[719],{"type":96,"value":338},{"type":91,"tag":319,"props":721,"children":722},{"class":321,"line":386},[723,728,733,738,743],{"type":91,"tag":319,"props":724,"children":725},{"style":599},[726],{"type":96,"value":727},"async",{"type":91,"tag":319,"props":729,"children":730},{"style":599},[731],{"type":96,"value":732}," function",{"type":91,"tag":319,"props":734,"children":735},{"style":620},[736],{"type":96,"value":737}," main",{"type":91,"tag":319,"props":739,"children":740},{"style":568},[741],{"type":96,"value":742},"()",{"type":91,"tag":319,"props":744,"children":745},{"style":568},[746],{"type":96,"value":747}," {\n",{"type":91,"tag":319,"props":749,"children":750},{"class":321,"line":395},[751,756,761,766,771,776,781,786,790,795,799,804,808],{"type":91,"tag":319,"props":752,"children":753},{"style":599},[754],{"type":96,"value":755},"    const",{"type":91,"tag":319,"props":757,"children":758},{"style":557},[759],{"type":96,"value":760}," chatCompletion",{"type":91,"tag":319,"props":762,"children":763},{"style":568},[764],{"type":96,"value":765}," =",{"type":91,"tag":319,"props":767,"children":768},{"style":551},[769],{"type":96,"value":770}," await",{"type":91,"tag":319,"props":772,"children":773},{"style":557},[774],{"type":96,"value":775}," openai",{"type":91,"tag":319,"props":777,"children":778},{"style":568},[779],{"type":96,"value":780},".",{"type":91,"tag":319,"props":782,"children":783},{"style":557},[784],{"type":96,"value":785},"chat",{"type":91,"tag":319,"props":787,"children":788},{"style":568},[789],{"type":96,"value":780},{"type":91,"tag":319,"props":791,"children":792},{"style":557},[793],{"type":96,"value":794},"completions",{"type":91,"tag":319,"props":796,"children":797},{"style":568},[798],{"type":96,"value":780},{"type":91,"tag":319,"props":800,"children":801},{"style":620},[802],{"type":96,"value":803},"create",{"type":91,"tag":319,"props":805,"children":806},{"style":639},[807],{"type":96,"value":628},{"type":91,"tag":319,"props":809,"children":810},{"style":568},[811],{"type":96,"value":633},{"type":91,"tag":319,"props":813,"children":814},{"class":321,"line":404},[815,820,824,828,833,837],{"type":91,"tag":319,"props":816,"children":817},{"style":639},[818],{"type":96,"value":819},"        model",{"type":91,"tag":319,"props":821,"children":822},{"style":568},[823],{"type":96,"value":647},{"type":91,"tag":319,"props":825,"children":826},{"style":568},[827],{"type":96,"value":571},{"type":91,"tag":319,"props":829,"children":830},{"style":524},[831],{"type":96,"value":832},"gpt-3.5-turbo",{"type":91,"tag":319,"props":834,"children":835},{"style":568},[836],{"type":96,"value":581},{"type":91,"tag":319,"props":838,"children":839},{"style":568},[840],{"type":96,"value":664},{"type":91,"tag":319,"props":842,"children":843},{"class":321,"line":413},[844,849,853],{"type":91,"tag":319,"props":845,"children":846},{"style":639},[847],{"type":96,"value":848},"        messages",{"type":91,"tag":319,"props":850,"children":851},{"style":568},[852],{"type":96,"value":647},{"type":91,"tag":319,"props":854,"children":855},{"style":639},[856],{"type":96,"value":857}," [\n",{"type":91,"tag":319,"props":859,"children":860},{"class":321,"line":422},[861,866,871,875,879,884,888,893,898,902,906,911,915],{"type":91,"tag":319,"props":862,"children":863},{"style":568},[864],{"type":96,"value":865},"            {",{"type":91,"tag":319,"props":867,"children":868},{"style":639},[869],{"type":96,"value":870},"role",{"type":91,"tag":319,"props":872,"children":873},{"style":568},[874],{"type":96,"value":647},{"type":91,"tag":319,"props":876,"children":877},{"style":568},[878],{"type":96,"value":571},{"type":91,"tag":319,"props":880,"children":881},{"style":524},[882],{"type":96,"value":883},"system",{"type":91,"tag":319,"props":885,"children":886},{"style":568},[887],{"type":96,"value":581},{"type":91,"tag":319,"props":889,"children":890},{"style":568},[891],{"type":96,"value":892},",",{"type":91,"tag":319,"props":894,"children":895},{"style":639},[896],{"type":96,"value":897}," content",{"type":91,"tag":319,"props":899,"children":900},{"style":568},[901],{"type":96,"value":647},{"type":91,"tag":319,"props":903,"children":904},{"style":568},[905],{"type":96,"value":571},{"type":91,"tag":319,"props":907,"children":908},{"style":524},[909],{"type":96,"value":910},"You are a helpful assistant.",{"type":91,"tag":319,"props":912,"children":913},{"style":568},[914],{"type":96,"value":581},{"type":91,"tag":319,"props":916,"children":917},{"style":568},[918],{"type":96,"value":919},"},\n",{"type":91,"tag":319,"props":921,"children":922},{"class":321,"line":431},[923,927,931,935,939,944,948,952,956,960,964,969,973],{"type":91,"tag":319,"props":924,"children":925},{"style":568},[926],{"type":96,"value":865},{"type":91,"tag":319,"props":928,"children":929},{"style":639},[930],{"type":96,"value":870},{"type":91,"tag":319,"props":932,"children":933},{"style":568},[934],{"type":96,"value":647},{"type":91,"tag":319,"props":936,"children":937},{"style":568},[938],{"type":96,"value":571},{"type":91,"tag":319,"props":940,"children":941},{"style":524},[942],{"type":96,"value":943},"user",{"type":91,"tag":319,"props":945,"children":946},{"style":568},[947],{"type":96,"value":581},{"type":91,"tag":319,"props":949,"children":950},{"style":568},[951],{"type":96,"value":892},{"type":91,"tag":319,"props":953,"children":954},{"style":639},[955],{"type":96,"value":897},{"type":91,"tag":319,"props":957,"children":958},{"style":568},[959],{"type":96,"value":647},{"type":91,"tag":319,"props":961,"children":962},{"style":568},[963],{"type":96,"value":571},{"type":91,"tag":319,"props":965,"children":966},{"style":524},[967],{"type":96,"value":968},"Hello! How are you?",{"type":91,"tag":319,"props":970,"children":971},{"style":568},[972],{"type":96,"value":581},{"type":91,"tag":319,"props":974,"children":975},{"style":568},[976],{"type":96,"value":383},{"type":91,"tag":319,"props":978,"children":979},{"class":321,"line":440},[980,985],{"type":91,"tag":319,"props":981,"children":982},{"style":639},[983],{"type":96,"value":984},"        ]",{"type":91,"tag":319,"props":986,"children":987},{"style":568},[988],{"type":96,"value":664},{"type":91,"tag":319,"props":990,"children":991},{"class":321,"line":448},[992,997,1001],{"type":91,"tag":319,"props":993,"children":994},{"style":568},[995],{"type":96,"value":996},"    }",{"type":91,"tag":319,"props":998,"children":999},{"style":639},[1000],{"type":96,"value":708},{"type":91,"tag":319,"props":1002,"children":1003},{"style":568},[1004],{"type":96,"value":586},{"type":91,"tag":319,"props":1006,"children":1007},{"class":321,"line":456},[1008],{"type":91,"tag":319,"props":1009,"children":1010},{"emptyLinePlaceholder":335},[1011],{"type":96,"value":338},{"type":91,"tag":319,"props":1013,"children":1014},{"class":321,"line":465},[1015,1020,1024,1029,1033,1038,1042,1047,1052,1058,1063,1067,1072,1076,1080,1084],{"type":91,"tag":319,"props":1016,"children":1017},{"style":557},[1018],{"type":96,"value":1019},"    console",{"type":91,"tag":319,"props":1021,"children":1022},{"style":568},[1023],{"type":96,"value":780},{"type":91,"tag":319,"props":1025,"children":1026},{"style":620},[1027],{"type":96,"value":1028},"log",{"type":91,"tag":319,"props":1030,"children":1031},{"style":639},[1032],{"type":96,"value":628},{"type":91,"tag":319,"props":1034,"children":1035},{"style":557},[1036],{"type":96,"value":1037},"chatCompletion",{"type":91,"tag":319,"props":1039,"children":1040},{"style":568},[1041],{"type":96,"value":780},{"type":91,"tag":319,"props":1043,"children":1044},{"style":557},[1045],{"type":96,"value":1046},"choices",{"type":91,"tag":319,"props":1048,"children":1049},{"style":639},[1050],{"type":96,"value":1051},"[",{"type":91,"tag":319,"props":1053,"children":1055},{"style":1054},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1056],{"type":96,"value":1057},"0",{"type":91,"tag":319,"props":1059,"children":1060},{"style":639},[1061],{"type":96,"value":1062},"]",{"type":91,"tag":319,"props":1064,"children":1065},{"style":568},[1066],{"type":96,"value":780},{"type":91,"tag":319,"props":1068,"children":1069},{"style":557},[1070],{"type":96,"value":1071},"message",{"type":91,"tag":319,"props":1073,"children":1074},{"style":568},[1075],{"type":96,"value":780},{"type":91,"tag":319,"props":1077,"children":1078},{"style":557},[1079],{"type":96,"value":68},{"type":91,"tag":319,"props":1081,"children":1082},{"style":639},[1083],{"type":96,"value":708},{"type":91,"tag":319,"props":1085,"children":1086},{"style":568},[1087],{"type":96,"value":586},{"type":91,"tag":319,"props":1089,"children":1091},{"class":321,"line":1090},18,[1092],{"type":91,"tag":319,"props":1093,"children":1094},{"style":568},[1095],{"type":96,"value":383},{"type":91,"tag":319,"props":1097,"children":1099},{"class":321,"line":1098},19,[1100],{"type":91,"tag":319,"props":1101,"children":1102},{"emptyLinePlaceholder":335},[1103],{"type":96,"value":338},{"type":91,"tag":319,"props":1105,"children":1107},{"class":321,"line":1106},20,[1108,1113,1117],{"type":91,"tag":319,"props":1109,"children":1110},{"style":620},[1111],{"type":96,"value":1112},"main",{"type":91,"tag":319,"props":1114,"children":1115},{"style":557},[1116],{"type":96,"value":742},{"type":91,"tag":319,"props":1118,"children":1119},{"style":568},[1120],{"type":96,"value":586},{"type":91,"tag":114,"props":1122,"children":1124},{"icon":279,"label":1123},"Axios",[1125,1130],{"type":91,"tag":98,"props":1126,"children":1127},{},[1128],{"type":96,"value":1129},"می‌توانید از Axios نیز استفاده کنید:",{"type":91,"tag":288,"props":1131,"children":1133},{"code":1132,"language":196,"meta":62,"className":541,"style":62},"import axios from 'axios';\n\nconst url = 'https://api.ahur.ir/v1/chat/completions';\nconst headers = {\n    'Content-Type': 'application/json',\n    'Authorization': 'Bearer your-api-key'\n};\nconst data = {\n    model: 'gpt-3.5-turbo',\n    messages: [\n        {role: 'system', content: 'You are a helpful assistant.'},\n        {role: 'user', content: 'Hello! How are you?'}\n    ]\n};\n\naxios.post(url, data, {headers})\n    .then(response => {\n        console.log(response.data.choices[0].message.content);\n    })\n    .catch(error => console.error(error));\n",[1134],{"type":91,"tag":145,"props":1135,"children":1136},{"__ignoreMap":62},[1137,1170,1177,1210,1230,1268,1302,1310,1330,1358,1374,1430,1485,1493,1500,1507,1560,1592,1669,1680],{"type":91,"tag":319,"props":1138,"children":1139},{"class":321,"line":322},[1140,1144,1149,1153,1157,1162,1166],{"type":91,"tag":319,"props":1141,"children":1142},{"style":551},[1143],{"type":96,"value":554},{"type":91,"tag":319,"props":1145,"children":1146},{"style":557},[1147],{"type":96,"value":1148}," axios ",{"type":91,"tag":319,"props":1150,"children":1151},{"style":551},[1152],{"type":96,"value":565},{"type":91,"tag":319,"props":1154,"children":1155},{"style":568},[1156],{"type":96,"value":571},{"type":91,"tag":319,"props":1158,"children":1159},{"style":524},[1160],{"type":96,"value":1161},"axios",{"type":91,"tag":319,"props":1163,"children":1164},{"style":568},[1165],{"type":96,"value":581},{"type":91,"tag":319,"props":1167,"children":1168},{"style":568},[1169],{"type":96,"value":586},{"type":91,"tag":319,"props":1171,"children":1172},{"class":321,"line":331},[1173],{"type":91,"tag":319,"props":1174,"children":1175},{"emptyLinePlaceholder":335},[1176],{"type":96,"value":338},{"type":91,"tag":319,"props":1178,"children":1179},{"class":321,"line":341},[1180,1184,1189,1193,1197,1202,1206],{"type":91,"tag":319,"props":1181,"children":1182},{"style":599},[1183],{"type":96,"value":602},{"type":91,"tag":319,"props":1185,"children":1186},{"style":557},[1187],{"type":96,"value":1188}," url ",{"type":91,"tag":319,"props":1190,"children":1191},{"style":568},[1192],{"type":96,"value":612},{"type":91,"tag":319,"props":1194,"children":1195},{"style":568},[1196],{"type":96,"value":571},{"type":91,"tag":319,"props":1198,"children":1199},{"style":524},[1200],{"type":96,"value":1201},"https://api.ahur.ir/v1/chat/completions",{"type":91,"tag":319,"props":1203,"children":1204},{"style":568},[1205],{"type":96,"value":581},{"type":91,"tag":319,"props":1207,"children":1208},{"style":568},[1209],{"type":96,"value":586},{"type":91,"tag":319,"props":1211,"children":1212},{"class":321,"line":350},[1213,1217,1222,1226],{"type":91,"tag":319,"props":1214,"children":1215},{"style":599},[1216],{"type":96,"value":602},{"type":91,"tag":319,"props":1218,"children":1219},{"style":557},[1220],{"type":96,"value":1221}," headers ",{"type":91,"tag":319,"props":1223,"children":1224},{"style":568},[1225],{"type":96,"value":612},{"type":91,"tag":319,"props":1227,"children":1228},{"style":568},[1229],{"type":96,"value":747},{"type":91,"tag":319,"props":1231,"children":1232},{"class":321,"line":359},[1233,1238,1243,1247,1251,1255,1260,1264],{"type":91,"tag":319,"props":1234,"children":1235},{"style":568},[1236],{"type":96,"value":1237},"    '",{"type":91,"tag":319,"props":1239,"children":1240},{"style":639},[1241],{"type":96,"value":1242},"Content-Type",{"type":91,"tag":319,"props":1244,"children":1245},{"style":568},[1246],{"type":96,"value":581},{"type":91,"tag":319,"props":1248,"children":1249},{"style":568},[1250],{"type":96,"value":647},{"type":91,"tag":319,"props":1252,"children":1253},{"style":568},[1254],{"type":96,"value":571},{"type":91,"tag":319,"props":1256,"children":1257},{"style":524},[1258],{"type":96,"value":1259},"application/json",{"type":91,"tag":319,"props":1261,"children":1262},{"style":568},[1263],{"type":96,"value":581},{"type":91,"tag":319,"props":1265,"children":1266},{"style":568},[1267],{"type":96,"value":664},{"type":91,"tag":319,"props":1269,"children":1270},{"class":321,"line":368},[1271,1275,1280,1284,1288,1292,1297],{"type":91,"tag":319,"props":1272,"children":1273},{"style":568},[1274],{"type":96,"value":1237},{"type":91,"tag":319,"props":1276,"children":1277},{"style":639},[1278],{"type":96,"value":1279},"Authorization",{"type":91,"tag":319,"props":1281,"children":1282},{"style":568},[1283],{"type":96,"value":581},{"type":91,"tag":319,"props":1285,"children":1286},{"style":568},[1287],{"type":96,"value":647},{"type":91,"tag":319,"props":1289,"children":1290},{"style":568},[1291],{"type":96,"value":571},{"type":91,"tag":319,"props":1293,"children":1294},{"style":524},[1295],{"type":96,"value":1296},"Bearer your-api-key",{"type":91,"tag":319,"props":1298,"children":1299},{"style":568},[1300],{"type":96,"value":1301},"'\n",{"type":91,"tag":319,"props":1303,"children":1304},{"class":321,"line":377},[1305],{"type":91,"tag":319,"props":1306,"children":1307},{"style":568},[1308],{"type":96,"value":1309},"};\n",{"type":91,"tag":319,"props":1311,"children":1312},{"class":321,"line":386},[1313,1317,1322,1326],{"type":91,"tag":319,"props":1314,"children":1315},{"style":599},[1316],{"type":96,"value":602},{"type":91,"tag":319,"props":1318,"children":1319},{"style":557},[1320],{"type":96,"value":1321}," data ",{"type":91,"tag":319,"props":1323,"children":1324},{"style":568},[1325],{"type":96,"value":612},{"type":91,"tag":319,"props":1327,"children":1328},{"style":568},[1329],{"type":96,"value":747},{"type":91,"tag":319,"props":1331,"children":1332},{"class":321,"line":395},[1333,1338,1342,1346,1350,1354],{"type":91,"tag":319,"props":1334,"children":1335},{"style":639},[1336],{"type":96,"value":1337},"    model",{"type":91,"tag":319,"props":1339,"children":1340},{"style":568},[1341],{"type":96,"value":647},{"type":91,"tag":319,"props":1343,"children":1344},{"style":568},[1345],{"type":96,"value":571},{"type":91,"tag":319,"props":1347,"children":1348},{"style":524},[1349],{"type":96,"value":832},{"type":91,"tag":319,"props":1351,"children":1352},{"style":568},[1353],{"type":96,"value":581},{"type":91,"tag":319,"props":1355,"children":1356},{"style":568},[1357],{"type":96,"value":664},{"type":91,"tag":319,"props":1359,"children":1360},{"class":321,"line":404},[1361,1366,1370],{"type":91,"tag":319,"props":1362,"children":1363},{"style":639},[1364],{"type":96,"value":1365},"    messages",{"type":91,"tag":319,"props":1367,"children":1368},{"style":568},[1369],{"type":96,"value":647},{"type":91,"tag":319,"props":1371,"children":1372},{"style":557},[1373],{"type":96,"value":857},{"type":91,"tag":319,"props":1375,"children":1376},{"class":321,"line":413},[1377,1382,1386,1390,1394,1398,1402,1406,1410,1414,1418,1422,1426],{"type":91,"tag":319,"props":1378,"children":1379},{"style":568},[1380],{"type":96,"value":1381},"        {",{"type":91,"tag":319,"props":1383,"children":1384},{"style":639},[1385],{"type":96,"value":870},{"type":91,"tag":319,"props":1387,"children":1388},{"style":568},[1389],{"type":96,"value":647},{"type":91,"tag":319,"props":1391,"children":1392},{"style":568},[1393],{"type":96,"value":571},{"type":91,"tag":319,"props":1395,"children":1396},{"style":524},[1397],{"type":96,"value":883},{"type":91,"tag":319,"props":1399,"children":1400},{"style":568},[1401],{"type":96,"value":581},{"type":91,"tag":319,"props":1403,"children":1404},{"style":568},[1405],{"type":96,"value":892},{"type":91,"tag":319,"props":1407,"children":1408},{"style":639},[1409],{"type":96,"value":897},{"type":91,"tag":319,"props":1411,"children":1412},{"style":568},[1413],{"type":96,"value":647},{"type":91,"tag":319,"props":1415,"children":1416},{"style":568},[1417],{"type":96,"value":571},{"type":91,"tag":319,"props":1419,"children":1420},{"style":524},[1421],{"type":96,"value":910},{"type":91,"tag":319,"props":1423,"children":1424},{"style":568},[1425],{"type":96,"value":581},{"type":91,"tag":319,"props":1427,"children":1428},{"style":568},[1429],{"type":96,"value":919},{"type":91,"tag":319,"props":1431,"children":1432},{"class":321,"line":422},[1433,1437,1441,1445,1449,1453,1457,1461,1465,1469,1473,1477,1481],{"type":91,"tag":319,"props":1434,"children":1435},{"style":568},[1436],{"type":96,"value":1381},{"type":91,"tag":319,"props":1438,"children":1439},{"style":639},[1440],{"type":96,"value":870},{"type":91,"tag":319,"props":1442,"children":1443},{"style":568},[1444],{"type":96,"value":647},{"type":91,"tag":319,"props":1446,"children":1447},{"style":568},[1448],{"type":96,"value":571},{"type":91,"tag":319,"props":1450,"children":1451},{"style":524},[1452],{"type":96,"value":943},{"type":91,"tag":319,"props":1454,"children":1455},{"style":568},[1456],{"type":96,"value":581},{"type":91,"tag":319,"props":1458,"children":1459},{"style":568},[1460],{"type":96,"value":892},{"type":91,"tag":319,"props":1462,"children":1463},{"style":639},[1464],{"type":96,"value":897},{"type":91,"tag":319,"props":1466,"children":1467},{"style":568},[1468],{"type":96,"value":647},{"type":91,"tag":319,"props":1470,"children":1471},{"style":568},[1472],{"type":96,"value":571},{"type":91,"tag":319,"props":1474,"children":1475},{"style":524},[1476],{"type":96,"value":968},{"type":91,"tag":319,"props":1478,"children":1479},{"style":568},[1480],{"type":96,"value":581},{"type":91,"tag":319,"props":1482,"children":1483},{"style":568},[1484],{"type":96,"value":383},{"type":91,"tag":319,"props":1486,"children":1487},{"class":321,"line":431},[1488],{"type":91,"tag":319,"props":1489,"children":1490},{"style":557},[1491],{"type":96,"value":1492},"    ]\n",{"type":91,"tag":319,"props":1494,"children":1495},{"class":321,"line":440},[1496],{"type":91,"tag":319,"props":1497,"children":1498},{"style":568},[1499],{"type":96,"value":1309},{"type":91,"tag":319,"props":1501,"children":1502},{"class":321,"line":448},[1503],{"type":91,"tag":319,"props":1504,"children":1505},{"emptyLinePlaceholder":335},[1506],{"type":96,"value":338},{"type":91,"tag":319,"props":1508,"children":1509},{"class":321,"line":456},[1510,1514,1518,1523,1528,1532,1537,1541,1546,1551,1555],{"type":91,"tag":319,"props":1511,"children":1512},{"style":557},[1513],{"type":96,"value":1161},{"type":91,"tag":319,"props":1515,"children":1516},{"style":568},[1517],{"type":96,"value":780},{"type":91,"tag":319,"props":1519,"children":1520},{"style":620},[1521],{"type":96,"value":1522},"post",{"type":91,"tag":319,"props":1524,"children":1525},{"style":557},[1526],{"type":96,"value":1527},"(url",{"type":91,"tag":319,"props":1529,"children":1530},{"style":568},[1531],{"type":96,"value":892},{"type":91,"tag":319,"props":1533,"children":1534},{"style":557},[1535],{"type":96,"value":1536}," data",{"type":91,"tag":319,"props":1538,"children":1539},{"style":568},[1540],{"type":96,"value":892},{"type":91,"tag":319,"props":1542,"children":1543},{"style":568},[1544],{"type":96,"value":1545}," {",{"type":91,"tag":319,"props":1547,"children":1548},{"style":557},[1549],{"type":96,"value":1550},"headers",{"type":91,"tag":319,"props":1552,"children":1553},{"style":568},[1554],{"type":96,"value":703},{"type":91,"tag":319,"props":1556,"children":1557},{"style":557},[1558],{"type":96,"value":1559},")\n",{"type":91,"tag":319,"props":1561,"children":1562},{"class":321,"line":465},[1563,1568,1573,1577,1583,1588],{"type":91,"tag":319,"props":1564,"children":1565},{"style":568},[1566],{"type":96,"value":1567},"    .",{"type":91,"tag":319,"props":1569,"children":1570},{"style":620},[1571],{"type":96,"value":1572},"then",{"type":91,"tag":319,"props":1574,"children":1575},{"style":557},[1576],{"type":96,"value":628},{"type":91,"tag":319,"props":1578,"children":1580},{"style":1579},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1581],{"type":96,"value":1582},"response",{"type":91,"tag":319,"props":1584,"children":1585},{"style":599},[1586],{"type":96,"value":1587}," =>",{"type":91,"tag":319,"props":1589,"children":1590},{"style":568},[1591],{"type":96,"value":747},{"type":91,"tag":319,"props":1593,"children":1594},{"class":321,"line":1090},[1595,1600,1604,1608,1612,1616,1620,1625,1629,1633,1637,1641,1645,1649,1653,1657,1661,1665],{"type":91,"tag":319,"props":1596,"children":1597},{"style":557},[1598],{"type":96,"value":1599},"        console",{"type":91,"tag":319,"props":1601,"children":1602},{"style":568},[1603],{"type":96,"value":780},{"type":91,"tag":319,"props":1605,"children":1606},{"style":620},[1607],{"type":96,"value":1028},{"type":91,"tag":319,"props":1609,"children":1610},{"style":639},[1611],{"type":96,"value":628},{"type":91,"tag":319,"props":1613,"children":1614},{"style":557},[1615],{"type":96,"value":1582},{"type":91,"tag":319,"props":1617,"children":1618},{"style":568},[1619],{"type":96,"value":780},{"type":91,"tag":319,"props":1621,"children":1622},{"style":557},[1623],{"type":96,"value":1624},"data",{"type":91,"tag":319,"props":1626,"children":1627},{"style":568},[1628],{"type":96,"value":780},{"type":91,"tag":319,"props":1630,"children":1631},{"style":557},[1632],{"type":96,"value":1046},{"type":91,"tag":319,"props":1634,"children":1635},{"style":639},[1636],{"type":96,"value":1051},{"type":91,"tag":319,"props":1638,"children":1639},{"style":1054},[1640],{"type":96,"value":1057},{"type":91,"tag":319,"props":1642,"children":1643},{"style":639},[1644],{"type":96,"value":1062},{"type":91,"tag":319,"props":1646,"children":1647},{"style":568},[1648],{"type":96,"value":780},{"type":91,"tag":319,"props":1650,"children":1651},{"style":557},[1652],{"type":96,"value":1071},{"type":91,"tag":319,"props":1654,"children":1655},{"style":568},[1656],{"type":96,"value":780},{"type":91,"tag":319,"props":1658,"children":1659},{"style":557},[1660],{"type":96,"value":68},{"type":91,"tag":319,"props":1662,"children":1663},{"style":639},[1664],{"type":96,"value":708},{"type":91,"tag":319,"props":1666,"children":1667},{"style":568},[1668],{"type":96,"value":586},{"type":91,"tag":319,"props":1670,"children":1671},{"class":321,"line":1098},[1672,1676],{"type":91,"tag":319,"props":1673,"children":1674},{"style":568},[1675],{"type":96,"value":996},{"type":91,"tag":319,"props":1677,"children":1678},{"style":557},[1679],{"type":96,"value":1559},{"type":91,"tag":319,"props":1681,"children":1682},{"class":321,"line":1106},[1683,1687,1692,1696,1701,1705,1710,1714,1718,1723],{"type":91,"tag":319,"props":1684,"children":1685},{"style":568},[1686],{"type":96,"value":1567},{"type":91,"tag":319,"props":1688,"children":1689},{"style":620},[1690],{"type":96,"value":1691},"catch",{"type":91,"tag":319,"props":1693,"children":1694},{"style":557},[1695],{"type":96,"value":628},{"type":91,"tag":319,"props":1697,"children":1698},{"style":1579},[1699],{"type":96,"value":1700},"error",{"type":91,"tag":319,"props":1702,"children":1703},{"style":599},[1704],{"type":96,"value":1587},{"type":91,"tag":319,"props":1706,"children":1707},{"style":557},[1708],{"type":96,"value":1709}," console",{"type":91,"tag":319,"props":1711,"children":1712},{"style":568},[1713],{"type":96,"value":780},{"type":91,"tag":319,"props":1715,"children":1716},{"style":620},[1717],{"type":96,"value":1700},{"type":91,"tag":319,"props":1719,"children":1720},{"style":557},[1721],{"type":96,"value":1722},"(error))",{"type":91,"tag":319,"props":1724,"children":1725},{"style":568},[1726],{"type":96,"value":586},{"type":91,"tag":255,"props":1728,"children":1730},{"id":1729},"استفاده-با-curl",[1731],{"type":96,"value":1732},"استفاده با cURL",{"type":91,"tag":114,"props":1734,"children":1735},{},[1736],{"type":91,"tag":98,"props":1737,"children":1738},{},[1739],{"type":91,"tag":129,"props":1740,"children":1743},{"alt":208,"className":1741,"height":134,"src":1742,"width":271},[133],"https://picsum.photos/id/292/1200/400",[],{"type":91,"tag":274,"props":1745,"children":1746},{},[1747,1897],{"type":91,"tag":114,"props":1748,"children":1751},{"icon":1749,"label":1750},"i-heroicons-command-line","Basic Request",[1752,1757],{"type":91,"tag":98,"props":1753,"children":1754},{},[1755],{"type":96,"value":1756},"در ترمینال خود از دستور زیر استفاده کنید:",{"type":91,"tag":288,"props":1758,"children":1760},{"code":1759,"language":507,"meta":62,"className":508,"style":62},"curl https://api.ahur.ir/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer your-api-key\" \\\n  -d '{\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\", \"content\": \"Hello! How are you?\"}\n    ]\n  }'\n",[1761],{"type":91,"tag":145,"props":1762,"children":1763},{"__ignoreMap":62},[1764,1781,1808,1832,1848,1856,1864,1871,1878,1885],{"type":91,"tag":319,"props":1765,"children":1766},{"class":321,"line":322},[1767,1771,1776],{"type":91,"tag":319,"props":1768,"children":1769},{"style":518},[1770],{"type":96,"value":208},{"type":91,"tag":319,"props":1772,"children":1773},{"style":524},[1774],{"type":96,"value":1775}," https://api.ahur.ir/v1/chat/completions",{"type":91,"tag":319,"props":1777,"children":1778},{"style":557},[1779],{"type":96,"value":1780}," \\\n",{"type":91,"tag":319,"props":1782,"children":1783},{"class":321,"line":331},[1784,1789,1794,1799,1804],{"type":91,"tag":319,"props":1785,"children":1786},{"style":524},[1787],{"type":96,"value":1788},"  -H",{"type":91,"tag":319,"props":1790,"children":1791},{"style":568},[1792],{"type":96,"value":1793}," \"",{"type":91,"tag":319,"props":1795,"children":1796},{"style":524},[1797],{"type":96,"value":1798},"Content-Type: application/json",{"type":91,"tag":319,"props":1800,"children":1801},{"style":568},[1802],{"type":96,"value":1803},"\"",{"type":91,"tag":319,"props":1805,"children":1806},{"style":557},[1807],{"type":96,"value":1780},{"type":91,"tag":319,"props":1809,"children":1810},{"class":321,"line":341},[1811,1815,1819,1824,1828],{"type":91,"tag":319,"props":1812,"children":1813},{"style":524},[1814],{"type":96,"value":1788},{"type":91,"tag":319,"props":1816,"children":1817},{"style":568},[1818],{"type":96,"value":1793},{"type":91,"tag":319,"props":1820,"children":1821},{"style":524},[1822],{"type":96,"value":1823},"Authorization: Bearer your-api-key",{"type":91,"tag":319,"props":1825,"children":1826},{"style":568},[1827],{"type":96,"value":1803},{"type":91,"tag":319,"props":1829,"children":1830},{"style":557},[1831],{"type":96,"value":1780},{"type":91,"tag":319,"props":1833,"children":1834},{"class":321,"line":350},[1835,1840,1844],{"type":91,"tag":319,"props":1836,"children":1837},{"style":524},[1838],{"type":96,"value":1839},"  -d",{"type":91,"tag":319,"props":1841,"children":1842},{"style":568},[1843],{"type":96,"value":571},{"type":91,"tag":319,"props":1845,"children":1846},{"style":524},[1847],{"type":96,"value":633},{"type":91,"tag":319,"props":1849,"children":1850},{"class":321,"line":359},[1851],{"type":91,"tag":319,"props":1852,"children":1853},{"style":524},[1854],{"type":96,"value":1855},"    \"model\": \"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":1857,"children":1858},{"class":321,"line":368},[1859],{"type":91,"tag":319,"props":1860,"children":1861},{"style":524},[1862],{"type":96,"value":1863},"    \"messages\": [\n",{"type":91,"tag":319,"props":1865,"children":1866},{"class":321,"line":377},[1867],{"type":91,"tag":319,"props":1868,"children":1869},{"style":524},[1870],{"type":96,"value":419},{"type":91,"tag":319,"props":1872,"children":1873},{"class":321,"line":386},[1874],{"type":91,"tag":319,"props":1875,"children":1876},{"style":524},[1877],{"type":96,"value":428},{"type":91,"tag":319,"props":1879,"children":1880},{"class":321,"line":395},[1881],{"type":91,"tag":319,"props":1882,"children":1883},{"style":524},[1884],{"type":96,"value":1492},{"type":91,"tag":319,"props":1886,"children":1887},{"class":321,"line":404},[1888,1893],{"type":91,"tag":319,"props":1889,"children":1890},{"style":524},[1891],{"type":96,"value":1892},"  }",{"type":91,"tag":319,"props":1894,"children":1895},{"style":568},[1896],{"type":96,"value":1301},{"type":91,"tag":114,"props":1898,"children":1900},{"icon":1749,"label":1899},"Streaming",[1901,1906],{"type":91,"tag":98,"props":1902,"children":1903},{},[1904],{"type":96,"value":1905},"برای دریافت پاسخ به صورت استریم:",{"type":91,"tag":288,"props":1907,"children":1909},{"code":1908,"language":507,"meta":62,"className":508,"style":62},"curl https://api.ahur.ir/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer your-api-key\" \\\n  -d '{\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Count to 5\"}\n    ],\n    \"stream\": true\n  }'\n",[1910],{"type":91,"tag":145,"props":1911,"children":1912},{"__ignoreMap":62},[1913,1928,1951,1974,1989,1996,2003,2011,2019,2027],{"type":91,"tag":319,"props":1914,"children":1915},{"class":321,"line":322},[1916,1920,1924],{"type":91,"tag":319,"props":1917,"children":1918},{"style":518},[1919],{"type":96,"value":208},{"type":91,"tag":319,"props":1921,"children":1922},{"style":524},[1923],{"type":96,"value":1775},{"type":91,"tag":319,"props":1925,"children":1926},{"style":557},[1927],{"type":96,"value":1780},{"type":91,"tag":319,"props":1929,"children":1930},{"class":321,"line":331},[1931,1935,1939,1943,1947],{"type":91,"tag":319,"props":1932,"children":1933},{"style":524},[1934],{"type":96,"value":1788},{"type":91,"tag":319,"props":1936,"children":1937},{"style":568},[1938],{"type":96,"value":1793},{"type":91,"tag":319,"props":1940,"children":1941},{"style":524},[1942],{"type":96,"value":1798},{"type":91,"tag":319,"props":1944,"children":1945},{"style":568},[1946],{"type":96,"value":1803},{"type":91,"tag":319,"props":1948,"children":1949},{"style":557},[1950],{"type":96,"value":1780},{"type":91,"tag":319,"props":1952,"children":1953},{"class":321,"line":341},[1954,1958,1962,1966,1970],{"type":91,"tag":319,"props":1955,"children":1956},{"style":524},[1957],{"type":96,"value":1788},{"type":91,"tag":319,"props":1959,"children":1960},{"style":568},[1961],{"type":96,"value":1793},{"type":91,"tag":319,"props":1963,"children":1964},{"style":524},[1965],{"type":96,"value":1823},{"type":91,"tag":319,"props":1967,"children":1968},{"style":568},[1969],{"type":96,"value":1803},{"type":91,"tag":319,"props":1971,"children":1972},{"style":557},[1973],{"type":96,"value":1780},{"type":91,"tag":319,"props":1975,"children":1976},{"class":321,"line":350},[1977,1981,1985],{"type":91,"tag":319,"props":1978,"children":1979},{"style":524},[1980],{"type":96,"value":1839},{"type":91,"tag":319,"props":1982,"children":1983},{"style":568},[1984],{"type":96,"value":571},{"type":91,"tag":319,"props":1986,"children":1987},{"style":524},[1988],{"type":96,"value":633},{"type":91,"tag":319,"props":1990,"children":1991},{"class":321,"line":359},[1992],{"type":91,"tag":319,"props":1993,"children":1994},{"style":524},[1995],{"type":96,"value":1855},{"type":91,"tag":319,"props":1997,"children":1998},{"class":321,"line":368},[1999],{"type":91,"tag":319,"props":2000,"children":2001},{"style":524},[2002],{"type":96,"value":1863},{"type":91,"tag":319,"props":2004,"children":2005},{"class":321,"line":377},[2006],{"type":91,"tag":319,"props":2007,"children":2008},{"style":524},[2009],{"type":96,"value":2010},"      {\"role\": \"user\", \"content\": \"Count to 5\"}\n",{"type":91,"tag":319,"props":2012,"children":2013},{"class":321,"line":386},[2014],{"type":91,"tag":319,"props":2015,"children":2016},{"style":524},[2017],{"type":96,"value":2018},"    ],\n",{"type":91,"tag":319,"props":2020,"children":2021},{"class":321,"line":395},[2022],{"type":91,"tag":319,"props":2023,"children":2024},{"style":524},[2025],{"type":96,"value":2026},"    \"stream\": true\n",{"type":91,"tag":319,"props":2028,"children":2029},{"class":321,"line":404},[2030,2034],{"type":91,"tag":319,"props":2031,"children":2032},{"style":524},[2033],{"type":96,"value":1892},{"type":91,"tag":319,"props":2035,"children":2036},{"style":568},[2037],{"type":96,"value":1301},{"type":91,"tag":255,"props":2039,"children":2041},{"id":2040},"استفاده-با-go",[2042],{"type":96,"value":2043},"استفاده با Go",{"type":91,"tag":114,"props":2045,"children":2046},{},[2047],{"type":91,"tag":98,"props":2048,"children":2049},{},[2050],{"type":91,"tag":129,"props":2051,"children":2054},{"alt":220,"className":2052,"height":134,"src":2053,"width":271},[133],"https://picsum.photos/id/999/1200/400",[],{"type":91,"tag":274,"props":2056,"children":2057},{},[2058,2364],{"type":91,"tag":114,"props":2059,"children":2061},{"icon":279,"label":2060},"Golang",[2062,2067,2091,2096],{"type":91,"tag":98,"props":2063,"children":2064},{},[2065],{"type":96,"value":2066},"بسته‌های لازم را نصب کنید:",{"type":91,"tag":288,"props":2068,"children":2070},{"code":2069,"language":507,"meta":62,"className":508,"style":62},"go get github.com/sashabaranov/go-openai\n",[2071],{"type":91,"tag":145,"props":2072,"children":2073},{"__ignoreMap":62},[2074],{"type":91,"tag":319,"props":2075,"children":2076},{"class":321,"line":322},[2077,2081,2086],{"type":91,"tag":319,"props":2078,"children":2079},{"style":518},[2080],{"type":96,"value":220},{"type":91,"tag":319,"props":2082,"children":2083},{"style":524},[2084],{"type":96,"value":2085}," get",{"type":91,"tag":319,"props":2087,"children":2088},{"style":524},[2089],{"type":96,"value":2090}," github.com/sashabaranov/go-openai\n",{"type":91,"tag":98,"props":2092,"children":2093},{},[2094],{"type":96,"value":2095},"کد Go:",{"type":91,"tag":288,"props":2097,"children":2100},{"code":2098,"language":220,"meta":62,"className":2099,"style":62},"package main\n\nimport (\n    \"context\"\n    \"fmt\"\n    openai \"github.com/sashabaranov/go-openai\"\n)\n\nfunc main() {\n    client := openai.NewClientWithOpts(\n        openai.WithBaseURL(\"https://api.ahur.ir/v1\"),\n        openai.WithAPIKey(\"your-api-key\"),\n    )\n\n    resp, err := client.CreateChatCompletion(\n        context.Background(),\n        openai.ChatCompletionRequest{\n            Model: openai.GPT3Dot5Turbo,\n            Messages: []openai.ChatCompletionMessage{\n                {Role: openai.ChatMessageRoleSystem, Content: \"You are a helpful assistant.\"},\n                {Role: openai.ChatMessageRoleUser, Content: \"Hello! How are you?\"},\n            },\n        },\n    )\n\n    if err != nil {\n        fmt.Printf(\"ChatCompletion error: %v\\n\", err)\n        return\n    }\n\n    fmt.Println(resp.Choices[0].Message.Content)\n}\n","language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[2101],{"type":91,"tag":145,"props":2102,"children":2103},{"__ignoreMap":62},[2104,2112,2119,2127,2135,2143,2151,2158,2165,2173,2181,2189,2197,2205,2212,2220,2228,2236,2244,2252,2260,2269,2278,2287,2295,2303,2312,2321,2330,2339,2347,2356],{"type":91,"tag":319,"props":2105,"children":2106},{"class":321,"line":322},[2107],{"type":91,"tag":319,"props":2108,"children":2109},{},[2110],{"type":96,"value":2111},"package main\n",{"type":91,"tag":319,"props":2113,"children":2114},{"class":321,"line":331},[2115],{"type":91,"tag":319,"props":2116,"children":2117},{"emptyLinePlaceholder":335},[2118],{"type":96,"value":338},{"type":91,"tag":319,"props":2120,"children":2121},{"class":321,"line":341},[2122],{"type":91,"tag":319,"props":2123,"children":2124},{},[2125],{"type":96,"value":2126},"import (\n",{"type":91,"tag":319,"props":2128,"children":2129},{"class":321,"line":350},[2130],{"type":91,"tag":319,"props":2131,"children":2132},{},[2133],{"type":96,"value":2134},"    \"context\"\n",{"type":91,"tag":319,"props":2136,"children":2137},{"class":321,"line":359},[2138],{"type":91,"tag":319,"props":2139,"children":2140},{},[2141],{"type":96,"value":2142},"    \"fmt\"\n",{"type":91,"tag":319,"props":2144,"children":2145},{"class":321,"line":368},[2146],{"type":91,"tag":319,"props":2147,"children":2148},{},[2149],{"type":96,"value":2150},"    openai \"github.com/sashabaranov/go-openai\"\n",{"type":91,"tag":319,"props":2152,"children":2153},{"class":321,"line":377},[2154],{"type":91,"tag":319,"props":2155,"children":2156},{},[2157],{"type":96,"value":1559},{"type":91,"tag":319,"props":2159,"children":2160},{"class":321,"line":386},[2161],{"type":91,"tag":319,"props":2162,"children":2163},{"emptyLinePlaceholder":335},[2164],{"type":96,"value":338},{"type":91,"tag":319,"props":2166,"children":2167},{"class":321,"line":395},[2168],{"type":91,"tag":319,"props":2169,"children":2170},{},[2171],{"type":96,"value":2172},"func main() {\n",{"type":91,"tag":319,"props":2174,"children":2175},{"class":321,"line":404},[2176],{"type":91,"tag":319,"props":2177,"children":2178},{},[2179],{"type":96,"value":2180},"    client := openai.NewClientWithOpts(\n",{"type":91,"tag":319,"props":2182,"children":2183},{"class":321,"line":413},[2184],{"type":91,"tag":319,"props":2185,"children":2186},{},[2187],{"type":96,"value":2188},"        openai.WithBaseURL(\"https://api.ahur.ir/v1\"),\n",{"type":91,"tag":319,"props":2190,"children":2191},{"class":321,"line":422},[2192],{"type":91,"tag":319,"props":2193,"children":2194},{},[2195],{"type":96,"value":2196},"        openai.WithAPIKey(\"your-api-key\"),\n",{"type":91,"tag":319,"props":2198,"children":2199},{"class":321,"line":431},[2200],{"type":91,"tag":319,"props":2201,"children":2202},{},[2203],{"type":96,"value":2204},"    )\n",{"type":91,"tag":319,"props":2206,"children":2207},{"class":321,"line":440},[2208],{"type":91,"tag":319,"props":2209,"children":2210},{"emptyLinePlaceholder":335},[2211],{"type":96,"value":338},{"type":91,"tag":319,"props":2213,"children":2214},{"class":321,"line":448},[2215],{"type":91,"tag":319,"props":2216,"children":2217},{},[2218],{"type":96,"value":2219},"    resp, err := client.CreateChatCompletion(\n",{"type":91,"tag":319,"props":2221,"children":2222},{"class":321,"line":456},[2223],{"type":91,"tag":319,"props":2224,"children":2225},{},[2226],{"type":96,"value":2227},"        context.Background(),\n",{"type":91,"tag":319,"props":2229,"children":2230},{"class":321,"line":465},[2231],{"type":91,"tag":319,"props":2232,"children":2233},{},[2234],{"type":96,"value":2235},"        openai.ChatCompletionRequest{\n",{"type":91,"tag":319,"props":2237,"children":2238},{"class":321,"line":1090},[2239],{"type":91,"tag":319,"props":2240,"children":2241},{},[2242],{"type":96,"value":2243},"            Model: openai.GPT3Dot5Turbo,\n",{"type":91,"tag":319,"props":2245,"children":2246},{"class":321,"line":1098},[2247],{"type":91,"tag":319,"props":2248,"children":2249},{},[2250],{"type":96,"value":2251},"            Messages: []openai.ChatCompletionMessage{\n",{"type":91,"tag":319,"props":2253,"children":2254},{"class":321,"line":1106},[2255],{"type":91,"tag":319,"props":2256,"children":2257},{},[2258],{"type":96,"value":2259},"                {Role: openai.ChatMessageRoleSystem, Content: \"You are a helpful assistant.\"},\n",{"type":91,"tag":319,"props":2261,"children":2263},{"class":321,"line":2262},21,[2264],{"type":91,"tag":319,"props":2265,"children":2266},{},[2267],{"type":96,"value":2268},"                {Role: openai.ChatMessageRoleUser, Content: \"Hello! How are you?\"},\n",{"type":91,"tag":319,"props":2270,"children":2272},{"class":321,"line":2271},22,[2273],{"type":91,"tag":319,"props":2274,"children":2275},{},[2276],{"type":96,"value":2277},"            },\n",{"type":91,"tag":319,"props":2279,"children":2281},{"class":321,"line":2280},23,[2282],{"type":91,"tag":319,"props":2283,"children":2284},{},[2285],{"type":96,"value":2286},"        },\n",{"type":91,"tag":319,"props":2288,"children":2290},{"class":321,"line":2289},24,[2291],{"type":91,"tag":319,"props":2292,"children":2293},{},[2294],{"type":96,"value":2204},{"type":91,"tag":319,"props":2296,"children":2298},{"class":321,"line":2297},25,[2299],{"type":91,"tag":319,"props":2300,"children":2301},{"emptyLinePlaceholder":335},[2302],{"type":96,"value":338},{"type":91,"tag":319,"props":2304,"children":2306},{"class":321,"line":2305},26,[2307],{"type":91,"tag":319,"props":2308,"children":2309},{},[2310],{"type":96,"value":2311},"    if err != nil {\n",{"type":91,"tag":319,"props":2313,"children":2315},{"class":321,"line":2314},27,[2316],{"type":91,"tag":319,"props":2317,"children":2318},{},[2319],{"type":96,"value":2320},"        fmt.Printf(\"ChatCompletion error: %v\\n\", err)\n",{"type":91,"tag":319,"props":2322,"children":2324},{"class":321,"line":2323},28,[2325],{"type":91,"tag":319,"props":2326,"children":2327},{},[2328],{"type":96,"value":2329},"        return\n",{"type":91,"tag":319,"props":2331,"children":2333},{"class":321,"line":2332},29,[2334],{"type":91,"tag":319,"props":2335,"children":2336},{},[2337],{"type":96,"value":2338},"    }\n",{"type":91,"tag":319,"props":2340,"children":2342},{"class":321,"line":2341},30,[2343],{"type":91,"tag":319,"props":2344,"children":2345},{"emptyLinePlaceholder":335},[2346],{"type":96,"value":338},{"type":91,"tag":319,"props":2348,"children":2350},{"class":321,"line":2349},31,[2351],{"type":91,"tag":319,"props":2352,"children":2353},{},[2354],{"type":96,"value":2355},"    fmt.Println(resp.Choices[0].Message.Content)\n",{"type":91,"tag":319,"props":2357,"children":2359},{"class":321,"line":2358},32,[2360],{"type":91,"tag":319,"props":2361,"children":2362},{},[2363],{"type":96,"value":383},{"type":91,"tag":114,"props":2365,"children":2367},{"icon":279,"label":2366},"Native HTTP",[2368,2373],{"type":91,"tag":98,"props":2369,"children":2370},{},[2371],{"type":96,"value":2372},"بدون کتابخانه خارجی:",{"type":91,"tag":288,"props":2374,"children":2376},{"code":2375,"language":220,"meta":62,"className":2099,"style":62},"package main\n\nimport (\n    \"bytes\"\n    \"encoding/json\"\n    \"fmt\"\n    \"net/http\"\n)\n\ntype Request struct {\n    Model    string        `json:\"model\"`\n    Messages []Message     `json:\"messages\"`\n}\n\ntype Message struct {\n    Role    string `json:\"role\"`\n    Content string `json:\"content\"`\n}\n\nfunc main() {\n    url := \"https://api.ahur.ir/v1/chat/completions\"\n    \n    reqBody := Request{\n        Model: \"gpt-3.5-turbo\",\n        Messages: []Message{\n            {Role: \"system\", Content: \"You are a helpful assistant.\"},\n            {Role: \"user\", Content: \"Hello! How are you?\"},\n        },\n    }\n\n    body, _ := json.Marshal(reqBody)\n    \n    req, _ := http.NewRequest(\"POST\", url, bytes.NewBuffer(body))\n    req.Header.Set(\"Content-Type\", \"application/json\")\n    req.Header.Set(\"Authorization\", \"Bearer your-api-key\")\n\n    client := &http.Client{}\n    resp, _ := client.Do(req)\n    defer resp.Body.Close()\n\n    var result map[string]interface{}\n    json.NewDecoder(resp.Body).Decode(&result)\n    \n    choices := result[\"choices\"].([]interface{})\n    message := choices[0].(map[string]interface{})[\"message\"].(map[string]interface{})\n    fmt.Println(message[\"content\"])\n}\n",[2377],{"type":91,"tag":145,"props":2378,"children":2379},{"__ignoreMap":62},[2380,2387,2394,2401,2409,2417,2424,2432,2439,2446,2454,2462,2470,2477,2484,2492,2500,2508,2515,2522,2529,2537,2545,2553,2561,2569,2577,2585,2592,2599,2606,2614,2621,2630,2639,2648,2656,2665,2674,2683,2691,2700,2709,2717,2726,2735,2744],{"type":91,"tag":319,"props":2381,"children":2382},{"class":321,"line":322},[2383],{"type":91,"tag":319,"props":2384,"children":2385},{},[2386],{"type":96,"value":2111},{"type":91,"tag":319,"props":2388,"children":2389},{"class":321,"line":331},[2390],{"type":91,"tag":319,"props":2391,"children":2392},{"emptyLinePlaceholder":335},[2393],{"type":96,"value":338},{"type":91,"tag":319,"props":2395,"children":2396},{"class":321,"line":341},[2397],{"type":91,"tag":319,"props":2398,"children":2399},{},[2400],{"type":96,"value":2126},{"type":91,"tag":319,"props":2402,"children":2403},{"class":321,"line":350},[2404],{"type":91,"tag":319,"props":2405,"children":2406},{},[2407],{"type":96,"value":2408},"    \"bytes\"\n",{"type":91,"tag":319,"props":2410,"children":2411},{"class":321,"line":359},[2412],{"type":91,"tag":319,"props":2413,"children":2414},{},[2415],{"type":96,"value":2416},"    \"encoding/json\"\n",{"type":91,"tag":319,"props":2418,"children":2419},{"class":321,"line":368},[2420],{"type":91,"tag":319,"props":2421,"children":2422},{},[2423],{"type":96,"value":2142},{"type":91,"tag":319,"props":2425,"children":2426},{"class":321,"line":377},[2427],{"type":91,"tag":319,"props":2428,"children":2429},{},[2430],{"type":96,"value":2431},"    \"net/http\"\n",{"type":91,"tag":319,"props":2433,"children":2434},{"class":321,"line":386},[2435],{"type":91,"tag":319,"props":2436,"children":2437},{},[2438],{"type":96,"value":1559},{"type":91,"tag":319,"props":2440,"children":2441},{"class":321,"line":395},[2442],{"type":91,"tag":319,"props":2443,"children":2444},{"emptyLinePlaceholder":335},[2445],{"type":96,"value":338},{"type":91,"tag":319,"props":2447,"children":2448},{"class":321,"line":404},[2449],{"type":91,"tag":319,"props":2450,"children":2451},{},[2452],{"type":96,"value":2453},"type Request struct {\n",{"type":91,"tag":319,"props":2455,"children":2456},{"class":321,"line":413},[2457],{"type":91,"tag":319,"props":2458,"children":2459},{},[2460],{"type":96,"value":2461},"    Model    string        `json:\"model\"`\n",{"type":91,"tag":319,"props":2463,"children":2464},{"class":321,"line":422},[2465],{"type":91,"tag":319,"props":2466,"children":2467},{},[2468],{"type":96,"value":2469},"    Messages []Message     `json:\"messages\"`\n",{"type":91,"tag":319,"props":2471,"children":2472},{"class":321,"line":431},[2473],{"type":91,"tag":319,"props":2474,"children":2475},{},[2476],{"type":96,"value":383},{"type":91,"tag":319,"props":2478,"children":2479},{"class":321,"line":440},[2480],{"type":91,"tag":319,"props":2481,"children":2482},{"emptyLinePlaceholder":335},[2483],{"type":96,"value":338},{"type":91,"tag":319,"props":2485,"children":2486},{"class":321,"line":448},[2487],{"type":91,"tag":319,"props":2488,"children":2489},{},[2490],{"type":96,"value":2491},"type Message struct {\n",{"type":91,"tag":319,"props":2493,"children":2494},{"class":321,"line":456},[2495],{"type":91,"tag":319,"props":2496,"children":2497},{},[2498],{"type":96,"value":2499},"    Role    string `json:\"role\"`\n",{"type":91,"tag":319,"props":2501,"children":2502},{"class":321,"line":465},[2503],{"type":91,"tag":319,"props":2504,"children":2505},{},[2506],{"type":96,"value":2507},"    Content string `json:\"content\"`\n",{"type":91,"tag":319,"props":2509,"children":2510},{"class":321,"line":1090},[2511],{"type":91,"tag":319,"props":2512,"children":2513},{},[2514],{"type":96,"value":383},{"type":91,"tag":319,"props":2516,"children":2517},{"class":321,"line":1098},[2518],{"type":91,"tag":319,"props":2519,"children":2520},{"emptyLinePlaceholder":335},[2521],{"type":96,"value":338},{"type":91,"tag":319,"props":2523,"children":2524},{"class":321,"line":1106},[2525],{"type":91,"tag":319,"props":2526,"children":2527},{},[2528],{"type":96,"value":2172},{"type":91,"tag":319,"props":2530,"children":2531},{"class":321,"line":2262},[2532],{"type":91,"tag":319,"props":2533,"children":2534},{},[2535],{"type":96,"value":2536},"    url := \"https://api.ahur.ir/v1/chat/completions\"\n",{"type":91,"tag":319,"props":2538,"children":2539},{"class":321,"line":2271},[2540],{"type":91,"tag":319,"props":2541,"children":2542},{},[2543],{"type":96,"value":2544},"    \n",{"type":91,"tag":319,"props":2546,"children":2547},{"class":321,"line":2280},[2548],{"type":91,"tag":319,"props":2549,"children":2550},{},[2551],{"type":96,"value":2552},"    reqBody := Request{\n",{"type":91,"tag":319,"props":2554,"children":2555},{"class":321,"line":2289},[2556],{"type":91,"tag":319,"props":2557,"children":2558},{},[2559],{"type":96,"value":2560},"        Model: \"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":2562,"children":2563},{"class":321,"line":2297},[2564],{"type":91,"tag":319,"props":2565,"children":2566},{},[2567],{"type":96,"value":2568},"        Messages: []Message{\n",{"type":91,"tag":319,"props":2570,"children":2571},{"class":321,"line":2305},[2572],{"type":91,"tag":319,"props":2573,"children":2574},{},[2575],{"type":96,"value":2576},"            {Role: \"system\", Content: \"You are a helpful assistant.\"},\n",{"type":91,"tag":319,"props":2578,"children":2579},{"class":321,"line":2314},[2580],{"type":91,"tag":319,"props":2581,"children":2582},{},[2583],{"type":96,"value":2584},"            {Role: \"user\", Content: \"Hello! How are you?\"},\n",{"type":91,"tag":319,"props":2586,"children":2587},{"class":321,"line":2323},[2588],{"type":91,"tag":319,"props":2589,"children":2590},{},[2591],{"type":96,"value":2286},{"type":91,"tag":319,"props":2593,"children":2594},{"class":321,"line":2332},[2595],{"type":91,"tag":319,"props":2596,"children":2597},{},[2598],{"type":96,"value":2338},{"type":91,"tag":319,"props":2600,"children":2601},{"class":321,"line":2341},[2602],{"type":91,"tag":319,"props":2603,"children":2604},{"emptyLinePlaceholder":335},[2605],{"type":96,"value":338},{"type":91,"tag":319,"props":2607,"children":2608},{"class":321,"line":2349},[2609],{"type":91,"tag":319,"props":2610,"children":2611},{},[2612],{"type":96,"value":2613},"    body, _ := json.Marshal(reqBody)\n",{"type":91,"tag":319,"props":2615,"children":2616},{"class":321,"line":2358},[2617],{"type":91,"tag":319,"props":2618,"children":2619},{},[2620],{"type":96,"value":2544},{"type":91,"tag":319,"props":2622,"children":2624},{"class":321,"line":2623},33,[2625],{"type":91,"tag":319,"props":2626,"children":2627},{},[2628],{"type":96,"value":2629},"    req, _ := http.NewRequest(\"POST\", url, bytes.NewBuffer(body))\n",{"type":91,"tag":319,"props":2631,"children":2633},{"class":321,"line":2632},34,[2634],{"type":91,"tag":319,"props":2635,"children":2636},{},[2637],{"type":96,"value":2638},"    req.Header.Set(\"Content-Type\", \"application/json\")\n",{"type":91,"tag":319,"props":2640,"children":2642},{"class":321,"line":2641},35,[2643],{"type":91,"tag":319,"props":2644,"children":2645},{},[2646],{"type":96,"value":2647},"    req.Header.Set(\"Authorization\", \"Bearer your-api-key\")\n",{"type":91,"tag":319,"props":2649,"children":2651},{"class":321,"line":2650},36,[2652],{"type":91,"tag":319,"props":2653,"children":2654},{"emptyLinePlaceholder":335},[2655],{"type":96,"value":338},{"type":91,"tag":319,"props":2657,"children":2659},{"class":321,"line":2658},37,[2660],{"type":91,"tag":319,"props":2661,"children":2662},{},[2663],{"type":96,"value":2664},"    client := &http.Client{}\n",{"type":91,"tag":319,"props":2666,"children":2668},{"class":321,"line":2667},38,[2669],{"type":91,"tag":319,"props":2670,"children":2671},{},[2672],{"type":96,"value":2673},"    resp, _ := client.Do(req)\n",{"type":91,"tag":319,"props":2675,"children":2677},{"class":321,"line":2676},39,[2678],{"type":91,"tag":319,"props":2679,"children":2680},{},[2681],{"type":96,"value":2682},"    defer resp.Body.Close()\n",{"type":91,"tag":319,"props":2684,"children":2686},{"class":321,"line":2685},40,[2687],{"type":91,"tag":319,"props":2688,"children":2689},{"emptyLinePlaceholder":335},[2690],{"type":96,"value":338},{"type":91,"tag":319,"props":2692,"children":2694},{"class":321,"line":2693},41,[2695],{"type":91,"tag":319,"props":2696,"children":2697},{},[2698],{"type":96,"value":2699},"    var result map[string]interface{}\n",{"type":91,"tag":319,"props":2701,"children":2703},{"class":321,"line":2702},42,[2704],{"type":91,"tag":319,"props":2705,"children":2706},{},[2707],{"type":96,"value":2708},"    json.NewDecoder(resp.Body).Decode(&result)\n",{"type":91,"tag":319,"props":2710,"children":2712},{"class":321,"line":2711},43,[2713],{"type":91,"tag":319,"props":2714,"children":2715},{},[2716],{"type":96,"value":2544},{"type":91,"tag":319,"props":2718,"children":2720},{"class":321,"line":2719},44,[2721],{"type":91,"tag":319,"props":2722,"children":2723},{},[2724],{"type":96,"value":2725},"    choices := result[\"choices\"].([]interface{})\n",{"type":91,"tag":319,"props":2727,"children":2729},{"class":321,"line":2728},45,[2730],{"type":91,"tag":319,"props":2731,"children":2732},{},[2733],{"type":96,"value":2734},"    message := choices[0].(map[string]interface{})[\"message\"].(map[string]interface{})\n",{"type":91,"tag":319,"props":2736,"children":2738},{"class":321,"line":2737},46,[2739],{"type":91,"tag":319,"props":2740,"children":2741},{},[2742],{"type":96,"value":2743},"    fmt.Println(message[\"content\"])\n",{"type":91,"tag":319,"props":2745,"children":2747},{"class":321,"line":2746},47,[2748],{"type":91,"tag":319,"props":2749,"children":2750},{},[2751],{"type":96,"value":383},{"type":91,"tag":255,"props":2753,"children":2755},{"id":2754},"استفاده-با-rust",[2756],{"type":96,"value":2757},"استفاده با Rust",{"type":91,"tag":114,"props":2759,"children":2760},{},[2761],{"type":91,"tag":98,"props":2762,"children":2763},{},[2764],{"type":91,"tag":129,"props":2765,"children":2767},{"alt":232,"className":2766,"height":134,"src":1742,"width":271},[133],[],{"type":91,"tag":274,"props":2769,"children":2770},{},[2771,3270],{"type":91,"tag":114,"props":2772,"children":2774},{"icon":279,"label":2773},"Rust",[2775,2780,2829,2834],{"type":91,"tag":98,"props":2776,"children":2777},{},[2778],{"type":96,"value":2779},"وابستگی را به Cargo.toml اضافه کنید:",{"type":91,"tag":288,"props":2781,"children":2785},{"code":2782,"language":2783,"meta":62,"className":2784,"style":62},"[dependencies]\nreqwest = { version = \"0.11\", features = [\"json\"] }\ntokio = { version = \"1\", features = [\"full\"] }\nserde = { version = \"1.0\", features = [\"derive\"] }\nserde_json = \"1.0\"\n","toml","language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[2786],{"type":91,"tag":145,"props":2787,"children":2788},{"__ignoreMap":62},[2789,2797,2805,2813,2821],{"type":91,"tag":319,"props":2790,"children":2791},{"class":321,"line":322},[2792],{"type":91,"tag":319,"props":2793,"children":2794},{},[2795],{"type":96,"value":2796},"[dependencies]\n",{"type":91,"tag":319,"props":2798,"children":2799},{"class":321,"line":331},[2800],{"type":91,"tag":319,"props":2801,"children":2802},{},[2803],{"type":96,"value":2804},"reqwest = { version = \"0.11\", features = [\"json\"] }\n",{"type":91,"tag":319,"props":2806,"children":2807},{"class":321,"line":341},[2808],{"type":91,"tag":319,"props":2809,"children":2810},{},[2811],{"type":96,"value":2812},"tokio = { version = \"1\", features = [\"full\"] }\n",{"type":91,"tag":319,"props":2814,"children":2815},{"class":321,"line":350},[2816],{"type":91,"tag":319,"props":2817,"children":2818},{},[2819],{"type":96,"value":2820},"serde = { version = \"1.0\", features = [\"derive\"] }\n",{"type":91,"tag":319,"props":2822,"children":2823},{"class":321,"line":359},[2824],{"type":91,"tag":319,"props":2825,"children":2826},{},[2827],{"type":96,"value":2828},"serde_json = \"1.0\"\n",{"type":91,"tag":98,"props":2830,"children":2831},{},[2832],{"type":96,"value":2833},"کد Rust:",{"type":91,"tag":288,"props":2835,"children":2838},{"code":2836,"language":232,"meta":62,"className":2837,"style":62},"use reqwest::Client;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize)]\nstruct ChatRequest {\n    model: String,\n    messages: Vec\u003CMessage>,\n}\n\n#[derive(Serialize)]\nstruct Message {\n    role: String,\n    content: String,\n}\n\n#[derive(Deserialize)]\nstruct ChatResponse {\n    choices: Vec\u003CChoice>,\n}\n\n#[derive(Deserialize)]\nstruct Choice {\n    message: ResponseMessage,\n}\n\n#[derive(Deserialize)]\nstruct ResponseMessage {\n    content: String,\n}\n\n#[tokio::main]\nasync fn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n    let client = Client::new();\n\n    let request = ChatRequest {\n        model: \"gpt-3.5-turbo\".to_string(),\n        messages: vec![\n            Message { role: \"system\".to_string(), content: \"You are a helpful assistant.\".to_string() },\n            Message { role: \"user\".to_string(), content: \"Hello! How are you?\".to_string() },\n        ],\n    };\n\n    let response = client\n        .post(\"https://api.ahur.ir/v1/chat/completions\")\n        .header(\"Content-Type\", \"application/json\")\n        .header(\"Authorization\", \"Bearer your-api-key\")\n        .json(&request)\n        .send()\n        .await?;\n\n    let result: ChatResponse = response.json().await?;\n    println!(\"{}\", result.choices[0].message.content);\n\n    Ok(())\n}\n","language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[2839],{"type":91,"tag":145,"props":2840,"children":2841},{"__ignoreMap":62},[2842,2850,2858,2865,2873,2881,2889,2897,2904,2911,2918,2926,2934,2942,2949,2956,2964,2972,2980,2987,2994,3001,3009,3017,3024,3031,3038,3046,3053,3060,3067,3075,3083,3091,3098,3106,3114,3122,3130,3138,3146,3154,3161,3169,3177,3185,3193,3201,3210,3219,3227,3236,3245,3253,3262],{"type":91,"tag":319,"props":2843,"children":2844},{"class":321,"line":322},[2845],{"type":91,"tag":319,"props":2846,"children":2847},{},[2848],{"type":96,"value":2849},"use reqwest::Client;\n",{"type":91,"tag":319,"props":2851,"children":2852},{"class":321,"line":331},[2853],{"type":91,"tag":319,"props":2854,"children":2855},{},[2856],{"type":96,"value":2857},"use serde::{Deserialize, Serialize};\n",{"type":91,"tag":319,"props":2859,"children":2860},{"class":321,"line":341},[2861],{"type":91,"tag":319,"props":2862,"children":2863},{"emptyLinePlaceholder":335},[2864],{"type":96,"value":338},{"type":91,"tag":319,"props":2866,"children":2867},{"class":321,"line":350},[2868],{"type":91,"tag":319,"props":2869,"children":2870},{},[2871],{"type":96,"value":2872},"#[derive(Serialize)]\n",{"type":91,"tag":319,"props":2874,"children":2875},{"class":321,"line":359},[2876],{"type":91,"tag":319,"props":2877,"children":2878},{},[2879],{"type":96,"value":2880},"struct ChatRequest {\n",{"type":91,"tag":319,"props":2882,"children":2883},{"class":321,"line":368},[2884],{"type":91,"tag":319,"props":2885,"children":2886},{},[2887],{"type":96,"value":2888},"    model: String,\n",{"type":91,"tag":319,"props":2890,"children":2891},{"class":321,"line":377},[2892],{"type":91,"tag":319,"props":2893,"children":2894},{},[2895],{"type":96,"value":2896},"    messages: Vec\u003CMessage>,\n",{"type":91,"tag":319,"props":2898,"children":2899},{"class":321,"line":386},[2900],{"type":91,"tag":319,"props":2901,"children":2902},{},[2903],{"type":96,"value":383},{"type":91,"tag":319,"props":2905,"children":2906},{"class":321,"line":395},[2907],{"type":91,"tag":319,"props":2908,"children":2909},{"emptyLinePlaceholder":335},[2910],{"type":96,"value":338},{"type":91,"tag":319,"props":2912,"children":2913},{"class":321,"line":404},[2914],{"type":91,"tag":319,"props":2915,"children":2916},{},[2917],{"type":96,"value":2872},{"type":91,"tag":319,"props":2919,"children":2920},{"class":321,"line":413},[2921],{"type":91,"tag":319,"props":2922,"children":2923},{},[2924],{"type":96,"value":2925},"struct Message {\n",{"type":91,"tag":319,"props":2927,"children":2928},{"class":321,"line":422},[2929],{"type":91,"tag":319,"props":2930,"children":2931},{},[2932],{"type":96,"value":2933},"    role: String,\n",{"type":91,"tag":319,"props":2935,"children":2936},{"class":321,"line":431},[2937],{"type":91,"tag":319,"props":2938,"children":2939},{},[2940],{"type":96,"value":2941},"    content: String,\n",{"type":91,"tag":319,"props":2943,"children":2944},{"class":321,"line":440},[2945],{"type":91,"tag":319,"props":2946,"children":2947},{},[2948],{"type":96,"value":383},{"type":91,"tag":319,"props":2950,"children":2951},{"class":321,"line":448},[2952],{"type":91,"tag":319,"props":2953,"children":2954},{"emptyLinePlaceholder":335},[2955],{"type":96,"value":338},{"type":91,"tag":319,"props":2957,"children":2958},{"class":321,"line":456},[2959],{"type":91,"tag":319,"props":2960,"children":2961},{},[2962],{"type":96,"value":2963},"#[derive(Deserialize)]\n",{"type":91,"tag":319,"props":2965,"children":2966},{"class":321,"line":465},[2967],{"type":91,"tag":319,"props":2968,"children":2969},{},[2970],{"type":96,"value":2971},"struct ChatResponse {\n",{"type":91,"tag":319,"props":2973,"children":2974},{"class":321,"line":1090},[2975],{"type":91,"tag":319,"props":2976,"children":2977},{},[2978],{"type":96,"value":2979},"    choices: Vec\u003CChoice>,\n",{"type":91,"tag":319,"props":2981,"children":2982},{"class":321,"line":1098},[2983],{"type":91,"tag":319,"props":2984,"children":2985},{},[2986],{"type":96,"value":383},{"type":91,"tag":319,"props":2988,"children":2989},{"class":321,"line":1106},[2990],{"type":91,"tag":319,"props":2991,"children":2992},{"emptyLinePlaceholder":335},[2993],{"type":96,"value":338},{"type":91,"tag":319,"props":2995,"children":2996},{"class":321,"line":2262},[2997],{"type":91,"tag":319,"props":2998,"children":2999},{},[3000],{"type":96,"value":2963},{"type":91,"tag":319,"props":3002,"children":3003},{"class":321,"line":2271},[3004],{"type":91,"tag":319,"props":3005,"children":3006},{},[3007],{"type":96,"value":3008},"struct Choice {\n",{"type":91,"tag":319,"props":3010,"children":3011},{"class":321,"line":2280},[3012],{"type":91,"tag":319,"props":3013,"children":3014},{},[3015],{"type":96,"value":3016},"    message: ResponseMessage,\n",{"type":91,"tag":319,"props":3018,"children":3019},{"class":321,"line":2289},[3020],{"type":91,"tag":319,"props":3021,"children":3022},{},[3023],{"type":96,"value":383},{"type":91,"tag":319,"props":3025,"children":3026},{"class":321,"line":2297},[3027],{"type":91,"tag":319,"props":3028,"children":3029},{"emptyLinePlaceholder":335},[3030],{"type":96,"value":338},{"type":91,"tag":319,"props":3032,"children":3033},{"class":321,"line":2305},[3034],{"type":91,"tag":319,"props":3035,"children":3036},{},[3037],{"type":96,"value":2963},{"type":91,"tag":319,"props":3039,"children":3040},{"class":321,"line":2314},[3041],{"type":91,"tag":319,"props":3042,"children":3043},{},[3044],{"type":96,"value":3045},"struct ResponseMessage {\n",{"type":91,"tag":319,"props":3047,"children":3048},{"class":321,"line":2323},[3049],{"type":91,"tag":319,"props":3050,"children":3051},{},[3052],{"type":96,"value":2941},{"type":91,"tag":319,"props":3054,"children":3055},{"class":321,"line":2332},[3056],{"type":91,"tag":319,"props":3057,"children":3058},{},[3059],{"type":96,"value":383},{"type":91,"tag":319,"props":3061,"children":3062},{"class":321,"line":2341},[3063],{"type":91,"tag":319,"props":3064,"children":3065},{"emptyLinePlaceholder":335},[3066],{"type":96,"value":338},{"type":91,"tag":319,"props":3068,"children":3069},{"class":321,"line":2349},[3070],{"type":91,"tag":319,"props":3071,"children":3072},{},[3073],{"type":96,"value":3074},"#[tokio::main]\n",{"type":91,"tag":319,"props":3076,"children":3077},{"class":321,"line":2358},[3078],{"type":91,"tag":319,"props":3079,"children":3080},{},[3081],{"type":96,"value":3082},"async fn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>> {\n",{"type":91,"tag":319,"props":3084,"children":3085},{"class":321,"line":2623},[3086],{"type":91,"tag":319,"props":3087,"children":3088},{},[3089],{"type":96,"value":3090},"    let client = Client::new();\n",{"type":91,"tag":319,"props":3092,"children":3093},{"class":321,"line":2632},[3094],{"type":91,"tag":319,"props":3095,"children":3096},{"emptyLinePlaceholder":335},[3097],{"type":96,"value":338},{"type":91,"tag":319,"props":3099,"children":3100},{"class":321,"line":2641},[3101],{"type":91,"tag":319,"props":3102,"children":3103},{},[3104],{"type":96,"value":3105},"    let request = ChatRequest {\n",{"type":91,"tag":319,"props":3107,"children":3108},{"class":321,"line":2650},[3109],{"type":91,"tag":319,"props":3110,"children":3111},{},[3112],{"type":96,"value":3113},"        model: \"gpt-3.5-turbo\".to_string(),\n",{"type":91,"tag":319,"props":3115,"children":3116},{"class":321,"line":2658},[3117],{"type":91,"tag":319,"props":3118,"children":3119},{},[3120],{"type":96,"value":3121},"        messages: vec![\n",{"type":91,"tag":319,"props":3123,"children":3124},{"class":321,"line":2667},[3125],{"type":91,"tag":319,"props":3126,"children":3127},{},[3128],{"type":96,"value":3129},"            Message { role: \"system\".to_string(), content: \"You are a helpful assistant.\".to_string() },\n",{"type":91,"tag":319,"props":3131,"children":3132},{"class":321,"line":2676},[3133],{"type":91,"tag":319,"props":3134,"children":3135},{},[3136],{"type":96,"value":3137},"            Message { role: \"user\".to_string(), content: \"Hello! How are you?\".to_string() },\n",{"type":91,"tag":319,"props":3139,"children":3140},{"class":321,"line":2685},[3141],{"type":91,"tag":319,"props":3142,"children":3143},{},[3144],{"type":96,"value":3145},"        ],\n",{"type":91,"tag":319,"props":3147,"children":3148},{"class":321,"line":2693},[3149],{"type":91,"tag":319,"props":3150,"children":3151},{},[3152],{"type":96,"value":3153},"    };\n",{"type":91,"tag":319,"props":3155,"children":3156},{"class":321,"line":2702},[3157],{"type":91,"tag":319,"props":3158,"children":3159},{"emptyLinePlaceholder":335},[3160],{"type":96,"value":338},{"type":91,"tag":319,"props":3162,"children":3163},{"class":321,"line":2711},[3164],{"type":91,"tag":319,"props":3165,"children":3166},{},[3167],{"type":96,"value":3168},"    let response = client\n",{"type":91,"tag":319,"props":3170,"children":3171},{"class":321,"line":2719},[3172],{"type":91,"tag":319,"props":3173,"children":3174},{},[3175],{"type":96,"value":3176},"        .post(\"https://api.ahur.ir/v1/chat/completions\")\n",{"type":91,"tag":319,"props":3178,"children":3179},{"class":321,"line":2728},[3180],{"type":91,"tag":319,"props":3181,"children":3182},{},[3183],{"type":96,"value":3184},"        .header(\"Content-Type\", \"application/json\")\n",{"type":91,"tag":319,"props":3186,"children":3187},{"class":321,"line":2737},[3188],{"type":91,"tag":319,"props":3189,"children":3190},{},[3191],{"type":96,"value":3192},"        .header(\"Authorization\", \"Bearer your-api-key\")\n",{"type":91,"tag":319,"props":3194,"children":3195},{"class":321,"line":2746},[3196],{"type":91,"tag":319,"props":3197,"children":3198},{},[3199],{"type":96,"value":3200},"        .json(&request)\n",{"type":91,"tag":319,"props":3202,"children":3204},{"class":321,"line":3203},48,[3205],{"type":91,"tag":319,"props":3206,"children":3207},{},[3208],{"type":96,"value":3209},"        .send()\n",{"type":91,"tag":319,"props":3211,"children":3213},{"class":321,"line":3212},49,[3214],{"type":91,"tag":319,"props":3215,"children":3216},{},[3217],{"type":96,"value":3218},"        .await?;\n",{"type":91,"tag":319,"props":3220,"children":3222},{"class":321,"line":3221},50,[3223],{"type":91,"tag":319,"props":3224,"children":3225},{"emptyLinePlaceholder":335},[3226],{"type":96,"value":338},{"type":91,"tag":319,"props":3228,"children":3230},{"class":321,"line":3229},51,[3231],{"type":91,"tag":319,"props":3232,"children":3233},{},[3234],{"type":96,"value":3235},"    let result: ChatResponse = response.json().await?;\n",{"type":91,"tag":319,"props":3237,"children":3239},{"class":321,"line":3238},52,[3240],{"type":91,"tag":319,"props":3241,"children":3242},{},[3243],{"type":96,"value":3244},"    println!(\"{}\", result.choices[0].message.content);\n",{"type":91,"tag":319,"props":3246,"children":3248},{"class":321,"line":3247},53,[3249],{"type":91,"tag":319,"props":3250,"children":3251},{"emptyLinePlaceholder":335},[3252],{"type":96,"value":338},{"type":91,"tag":319,"props":3254,"children":3256},{"class":321,"line":3255},54,[3257],{"type":91,"tag":319,"props":3258,"children":3259},{},[3260],{"type":96,"value":3261},"    Ok(())\n",{"type":91,"tag":319,"props":3263,"children":3265},{"class":321,"line":3264},55,[3266],{"type":91,"tag":319,"props":3267,"children":3268},{},[3269],{"type":96,"value":383},{"type":91,"tag":114,"props":3271,"children":3273},{"icon":279,"label":3272},"Async",[3274,3279],{"type":91,"tag":98,"props":3275,"children":3276},{},[3277],{"type":96,"value":3278},"نسخه با async/await بیشتر:",{"type":91,"tag":288,"props":3280,"children":3282},{"code":3281,"language":232,"meta":62,"className":2837,"style":62},"use reqwest::Client;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Debug)]\nstruct Message {\n    role: String,\n    content: String,\n}\n\n#[derive(Serialize, Debug)]\nstruct ChatRequest {\n    model: String,\n    messages: Vec\u003CMessage>,\n    stream: Option\u003Cbool>,\n}\n\n#[derive(Deserialize, Debug)]\nstruct Choice {\n    message: Message,\n}\n\n#[derive(Deserialize, Debug)]\nstruct Response {\n    choices: Vec\u003CChoice>,\n}\n\nasync fn call_api(api_key: &str, content: &str) -> Result\u003CString, Box\u003Cdyn std::error::Error>> {\n    let client = Client::new();\n\n    let request = ChatRequest {\n        model: \"gpt-3.5-turbo\".to_string(),\n        messages: vec![\n            Message { role: \"system\".to_string(), content: \"You are a helpful assistant.\".to_string() },\n            Message { role: \"user\".to_string(), content: content.to_string() },\n        ],\n        stream: Some(false),\n    };\n\n    let response = client\n        .post(\"https://api.ahur.ir/v1/chat/completions\")\n        .header(\"Content-Type\", \"application/json\")\n        .header(\"Authorization\", format!(\"Bearer {}\", api_key))\n        .json(&request)\n        .send()\n        .await?;\n\n    let result: Response = response.json().await?;\n    Ok(result.choices[0].message.content)\n}\n",[3283],{"type":91,"tag":145,"props":3284,"children":3285},{"__ignoreMap":62},[3286,3293,3300,3307,3315,3322,3329,3336,3343,3350,3357,3364,3371,3378,3386,3393,3400,3408,3415,3423,3430,3437,3444,3452,3459,3466,3473,3481,3488,3495,3502,3509,3516,3523,3531,3538,3546,3553,3560,3567,3574,3581,3589,3596,3603,3610,3617,3625,3633],{"type":91,"tag":319,"props":3287,"children":3288},{"class":321,"line":322},[3289],{"type":91,"tag":319,"props":3290,"children":3291},{},[3292],{"type":96,"value":2849},{"type":91,"tag":319,"props":3294,"children":3295},{"class":321,"line":331},[3296],{"type":91,"tag":319,"props":3297,"children":3298},{},[3299],{"type":96,"value":2857},{"type":91,"tag":319,"props":3301,"children":3302},{"class":321,"line":341},[3303],{"type":91,"tag":319,"props":3304,"children":3305},{"emptyLinePlaceholder":335},[3306],{"type":96,"value":338},{"type":91,"tag":319,"props":3308,"children":3309},{"class":321,"line":350},[3310],{"type":91,"tag":319,"props":3311,"children":3312},{},[3313],{"type":96,"value":3314},"#[derive(Serialize, Debug)]\n",{"type":91,"tag":319,"props":3316,"children":3317},{"class":321,"line":359},[3318],{"type":91,"tag":319,"props":3319,"children":3320},{},[3321],{"type":96,"value":2925},{"type":91,"tag":319,"props":3323,"children":3324},{"class":321,"line":368},[3325],{"type":91,"tag":319,"props":3326,"children":3327},{},[3328],{"type":96,"value":2933},{"type":91,"tag":319,"props":3330,"children":3331},{"class":321,"line":377},[3332],{"type":91,"tag":319,"props":3333,"children":3334},{},[3335],{"type":96,"value":2941},{"type":91,"tag":319,"props":3337,"children":3338},{"class":321,"line":386},[3339],{"type":91,"tag":319,"props":3340,"children":3341},{},[3342],{"type":96,"value":383},{"type":91,"tag":319,"props":3344,"children":3345},{"class":321,"line":395},[3346],{"type":91,"tag":319,"props":3347,"children":3348},{"emptyLinePlaceholder":335},[3349],{"type":96,"value":338},{"type":91,"tag":319,"props":3351,"children":3352},{"class":321,"line":404},[3353],{"type":91,"tag":319,"props":3354,"children":3355},{},[3356],{"type":96,"value":3314},{"type":91,"tag":319,"props":3358,"children":3359},{"class":321,"line":413},[3360],{"type":91,"tag":319,"props":3361,"children":3362},{},[3363],{"type":96,"value":2880},{"type":91,"tag":319,"props":3365,"children":3366},{"class":321,"line":422},[3367],{"type":91,"tag":319,"props":3368,"children":3369},{},[3370],{"type":96,"value":2888},{"type":91,"tag":319,"props":3372,"children":3373},{"class":321,"line":431},[3374],{"type":91,"tag":319,"props":3375,"children":3376},{},[3377],{"type":96,"value":2896},{"type":91,"tag":319,"props":3379,"children":3380},{"class":321,"line":440},[3381],{"type":91,"tag":319,"props":3382,"children":3383},{},[3384],{"type":96,"value":3385},"    stream: Option\u003Cbool>,\n",{"type":91,"tag":319,"props":3387,"children":3388},{"class":321,"line":448},[3389],{"type":91,"tag":319,"props":3390,"children":3391},{},[3392],{"type":96,"value":383},{"type":91,"tag":319,"props":3394,"children":3395},{"class":321,"line":456},[3396],{"type":91,"tag":319,"props":3397,"children":3398},{"emptyLinePlaceholder":335},[3399],{"type":96,"value":338},{"type":91,"tag":319,"props":3401,"children":3402},{"class":321,"line":465},[3403],{"type":91,"tag":319,"props":3404,"children":3405},{},[3406],{"type":96,"value":3407},"#[derive(Deserialize, Debug)]\n",{"type":91,"tag":319,"props":3409,"children":3410},{"class":321,"line":1090},[3411],{"type":91,"tag":319,"props":3412,"children":3413},{},[3414],{"type":96,"value":3008},{"type":91,"tag":319,"props":3416,"children":3417},{"class":321,"line":1098},[3418],{"type":91,"tag":319,"props":3419,"children":3420},{},[3421],{"type":96,"value":3422},"    message: Message,\n",{"type":91,"tag":319,"props":3424,"children":3425},{"class":321,"line":1106},[3426],{"type":91,"tag":319,"props":3427,"children":3428},{},[3429],{"type":96,"value":383},{"type":91,"tag":319,"props":3431,"children":3432},{"class":321,"line":2262},[3433],{"type":91,"tag":319,"props":3434,"children":3435},{"emptyLinePlaceholder":335},[3436],{"type":96,"value":338},{"type":91,"tag":319,"props":3438,"children":3439},{"class":321,"line":2271},[3440],{"type":91,"tag":319,"props":3441,"children":3442},{},[3443],{"type":96,"value":3407},{"type":91,"tag":319,"props":3445,"children":3446},{"class":321,"line":2280},[3447],{"type":91,"tag":319,"props":3448,"children":3449},{},[3450],{"type":96,"value":3451},"struct Response {\n",{"type":91,"tag":319,"props":3453,"children":3454},{"class":321,"line":2289},[3455],{"type":91,"tag":319,"props":3456,"children":3457},{},[3458],{"type":96,"value":2979},{"type":91,"tag":319,"props":3460,"children":3461},{"class":321,"line":2297},[3462],{"type":91,"tag":319,"props":3463,"children":3464},{},[3465],{"type":96,"value":383},{"type":91,"tag":319,"props":3467,"children":3468},{"class":321,"line":2305},[3469],{"type":91,"tag":319,"props":3470,"children":3471},{"emptyLinePlaceholder":335},[3472],{"type":96,"value":338},{"type":91,"tag":319,"props":3474,"children":3475},{"class":321,"line":2314},[3476],{"type":91,"tag":319,"props":3477,"children":3478},{},[3479],{"type":96,"value":3480},"async fn call_api(api_key: &str, content: &str) -> Result\u003CString, Box\u003Cdyn std::error::Error>> {\n",{"type":91,"tag":319,"props":3482,"children":3483},{"class":321,"line":2323},[3484],{"type":91,"tag":319,"props":3485,"children":3486},{},[3487],{"type":96,"value":3090},{"type":91,"tag":319,"props":3489,"children":3490},{"class":321,"line":2332},[3491],{"type":91,"tag":319,"props":3492,"children":3493},{"emptyLinePlaceholder":335},[3494],{"type":96,"value":338},{"type":91,"tag":319,"props":3496,"children":3497},{"class":321,"line":2341},[3498],{"type":91,"tag":319,"props":3499,"children":3500},{},[3501],{"type":96,"value":3105},{"type":91,"tag":319,"props":3503,"children":3504},{"class":321,"line":2349},[3505],{"type":91,"tag":319,"props":3506,"children":3507},{},[3508],{"type":96,"value":3113},{"type":91,"tag":319,"props":3510,"children":3511},{"class":321,"line":2358},[3512],{"type":91,"tag":319,"props":3513,"children":3514},{},[3515],{"type":96,"value":3121},{"type":91,"tag":319,"props":3517,"children":3518},{"class":321,"line":2623},[3519],{"type":91,"tag":319,"props":3520,"children":3521},{},[3522],{"type":96,"value":3129},{"type":91,"tag":319,"props":3524,"children":3525},{"class":321,"line":2632},[3526],{"type":91,"tag":319,"props":3527,"children":3528},{},[3529],{"type":96,"value":3530},"            Message { role: \"user\".to_string(), content: content.to_string() },\n",{"type":91,"tag":319,"props":3532,"children":3533},{"class":321,"line":2641},[3534],{"type":91,"tag":319,"props":3535,"children":3536},{},[3537],{"type":96,"value":3145},{"type":91,"tag":319,"props":3539,"children":3540},{"class":321,"line":2650},[3541],{"type":91,"tag":319,"props":3542,"children":3543},{},[3544],{"type":96,"value":3545},"        stream: Some(false),\n",{"type":91,"tag":319,"props":3547,"children":3548},{"class":321,"line":2658},[3549],{"type":91,"tag":319,"props":3550,"children":3551},{},[3552],{"type":96,"value":3153},{"type":91,"tag":319,"props":3554,"children":3555},{"class":321,"line":2667},[3556],{"type":91,"tag":319,"props":3557,"children":3558},{"emptyLinePlaceholder":335},[3559],{"type":96,"value":338},{"type":91,"tag":319,"props":3561,"children":3562},{"class":321,"line":2676},[3563],{"type":91,"tag":319,"props":3564,"children":3565},{},[3566],{"type":96,"value":3168},{"type":91,"tag":319,"props":3568,"children":3569},{"class":321,"line":2685},[3570],{"type":91,"tag":319,"props":3571,"children":3572},{},[3573],{"type":96,"value":3176},{"type":91,"tag":319,"props":3575,"children":3576},{"class":321,"line":2693},[3577],{"type":91,"tag":319,"props":3578,"children":3579},{},[3580],{"type":96,"value":3184},{"type":91,"tag":319,"props":3582,"children":3583},{"class":321,"line":2702},[3584],{"type":91,"tag":319,"props":3585,"children":3586},{},[3587],{"type":96,"value":3588},"        .header(\"Authorization\", format!(\"Bearer {}\", api_key))\n",{"type":91,"tag":319,"props":3590,"children":3591},{"class":321,"line":2711},[3592],{"type":91,"tag":319,"props":3593,"children":3594},{},[3595],{"type":96,"value":3200},{"type":91,"tag":319,"props":3597,"children":3598},{"class":321,"line":2719},[3599],{"type":91,"tag":319,"props":3600,"children":3601},{},[3602],{"type":96,"value":3209},{"type":91,"tag":319,"props":3604,"children":3605},{"class":321,"line":2728},[3606],{"type":91,"tag":319,"props":3607,"children":3608},{},[3609],{"type":96,"value":3218},{"type":91,"tag":319,"props":3611,"children":3612},{"class":321,"line":2737},[3613],{"type":91,"tag":319,"props":3614,"children":3615},{"emptyLinePlaceholder":335},[3616],{"type":96,"value":338},{"type":91,"tag":319,"props":3618,"children":3619},{"class":321,"line":2746},[3620],{"type":91,"tag":319,"props":3621,"children":3622},{},[3623],{"type":96,"value":3624},"    let result: Response = response.json().await?;\n",{"type":91,"tag":319,"props":3626,"children":3627},{"class":321,"line":3203},[3628],{"type":91,"tag":319,"props":3629,"children":3630},{},[3631],{"type":96,"value":3632},"    Ok(result.choices[0].message.content)\n",{"type":91,"tag":319,"props":3634,"children":3635},{"class":321,"line":3212},[3636],{"type":91,"tag":319,"props":3637,"children":3638},{},[3639],{"type":96,"value":383},{"type":91,"tag":255,"props":3641,"children":3643},{"id":3642},"استفاده-با-php",[3644],{"type":96,"value":3645},"استفاده با PHP",{"type":91,"tag":114,"props":3647,"children":3648},{},[3649],{"type":91,"tag":98,"props":3650,"children":3651},{},[3652],{"type":91,"tag":129,"props":3653,"children":3656},{"alt":3654,"className":3655,"height":134,"src":2053,"width":271},"php",[133],[],{"type":91,"tag":274,"props":3658,"children":3659},{},[3660,3902],{"type":91,"tag":114,"props":3661,"children":3663},{"icon":279,"label":3662},"PHP",[3664,3669],{"type":91,"tag":98,"props":3665,"children":3666},{},[3667],{"type":96,"value":3668},"با استفاده از cURL در PHP:",{"type":91,"tag":288,"props":3670,"children":3673},{"code":3671,"language":3654,"meta":62,"className":3672,"style":62},"\u003C?php\n\n$url = \"https://api.ahur.ir/v1/chat/completions\";\n$apiKey = \"your-api-key\";\n\n$data = [\n    \"model\" => \"gpt-3.5-turbo\",\n    \"messages\" => [\n        [\"role\" => \"system\", \"content\" => \"You are a helpful assistant.\"],\n        [\"role\" => \"user\", \"content\" => \"Hello! How are you?\"]\n    ]\n];\n\n$ch = curl_init($url);\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POST, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    \"Content-Type: application/json\",\n    \"Authorization: Bearer \" . $apiKey\n]);\n\n$response = curl_exec($ch);\ncurl_close($ch);\n\n$result = json_decode($response, true);\necho $result['choices'][0]['message']['content'];\n?>\n","language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",[3674],{"type":91,"tag":145,"props":3675,"children":3676},{"__ignoreMap":62},[3677,3685,3692,3700,3708,3715,3723,3731,3739,3747,3755,3762,3770,3777,3785,3792,3800,3808,3816,3824,3832,3840,3848,3855,3863,3871,3878,3886,3894],{"type":91,"tag":319,"props":3678,"children":3679},{"class":321,"line":322},[3680],{"type":91,"tag":319,"props":3681,"children":3682},{},[3683],{"type":96,"value":3684},"\u003C?php\n",{"type":91,"tag":319,"props":3686,"children":3687},{"class":321,"line":331},[3688],{"type":91,"tag":319,"props":3689,"children":3690},{"emptyLinePlaceholder":335},[3691],{"type":96,"value":338},{"type":91,"tag":319,"props":3693,"children":3694},{"class":321,"line":341},[3695],{"type":91,"tag":319,"props":3696,"children":3697},{},[3698],{"type":96,"value":3699},"$url = \"https://api.ahur.ir/v1/chat/completions\";\n",{"type":91,"tag":319,"props":3701,"children":3702},{"class":321,"line":350},[3703],{"type":91,"tag":319,"props":3704,"children":3705},{},[3706],{"type":96,"value":3707},"$apiKey = \"your-api-key\";\n",{"type":91,"tag":319,"props":3709,"children":3710},{"class":321,"line":359},[3711],{"type":91,"tag":319,"props":3712,"children":3713},{"emptyLinePlaceholder":335},[3714],{"type":96,"value":338},{"type":91,"tag":319,"props":3716,"children":3717},{"class":321,"line":368},[3718],{"type":91,"tag":319,"props":3719,"children":3720},{},[3721],{"type":96,"value":3722},"$data = [\n",{"type":91,"tag":319,"props":3724,"children":3725},{"class":321,"line":377},[3726],{"type":91,"tag":319,"props":3727,"children":3728},{},[3729],{"type":96,"value":3730},"    \"model\" => \"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":3732,"children":3733},{"class":321,"line":386},[3734],{"type":91,"tag":319,"props":3735,"children":3736},{},[3737],{"type":96,"value":3738},"    \"messages\" => [\n",{"type":91,"tag":319,"props":3740,"children":3741},{"class":321,"line":395},[3742],{"type":91,"tag":319,"props":3743,"children":3744},{},[3745],{"type":96,"value":3746},"        [\"role\" => \"system\", \"content\" => \"You are a helpful assistant.\"],\n",{"type":91,"tag":319,"props":3748,"children":3749},{"class":321,"line":404},[3750],{"type":91,"tag":319,"props":3751,"children":3752},{},[3753],{"type":96,"value":3754},"        [\"role\" => \"user\", \"content\" => \"Hello! How are you?\"]\n",{"type":91,"tag":319,"props":3756,"children":3757},{"class":321,"line":413},[3758],{"type":91,"tag":319,"props":3759,"children":3760},{},[3761],{"type":96,"value":1492},{"type":91,"tag":319,"props":3763,"children":3764},{"class":321,"line":422},[3765],{"type":91,"tag":319,"props":3766,"children":3767},{},[3768],{"type":96,"value":3769},"];\n",{"type":91,"tag":319,"props":3771,"children":3772},{"class":321,"line":431},[3773],{"type":91,"tag":319,"props":3774,"children":3775},{"emptyLinePlaceholder":335},[3776],{"type":96,"value":338},{"type":91,"tag":319,"props":3778,"children":3779},{"class":321,"line":440},[3780],{"type":91,"tag":319,"props":3781,"children":3782},{},[3783],{"type":96,"value":3784},"$ch = curl_init($url);\n",{"type":91,"tag":319,"props":3786,"children":3787},{"class":321,"line":448},[3788],{"type":91,"tag":319,"props":3789,"children":3790},{"emptyLinePlaceholder":335},[3791],{"type":96,"value":338},{"type":91,"tag":319,"props":3793,"children":3794},{"class":321,"line":456},[3795],{"type":91,"tag":319,"props":3796,"children":3797},{},[3798],{"type":96,"value":3799},"curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n",{"type":91,"tag":319,"props":3801,"children":3802},{"class":321,"line":465},[3803],{"type":91,"tag":319,"props":3804,"children":3805},{},[3806],{"type":96,"value":3807},"curl_setopt($ch, CURLOPT_POST, true);\n",{"type":91,"tag":319,"props":3809,"children":3810},{"class":321,"line":1090},[3811],{"type":91,"tag":319,"props":3812,"children":3813},{},[3814],{"type":96,"value":3815},"curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n",{"type":91,"tag":319,"props":3817,"children":3818},{"class":321,"line":1098},[3819],{"type":91,"tag":319,"props":3820,"children":3821},{},[3822],{"type":96,"value":3823},"curl_setopt($ch, CURLOPT_HTTPHEADER, [\n",{"type":91,"tag":319,"props":3825,"children":3826},{"class":321,"line":1106},[3827],{"type":91,"tag":319,"props":3828,"children":3829},{},[3830],{"type":96,"value":3831},"    \"Content-Type: application/json\",\n",{"type":91,"tag":319,"props":3833,"children":3834},{"class":321,"line":2262},[3835],{"type":91,"tag":319,"props":3836,"children":3837},{},[3838],{"type":96,"value":3839},"    \"Authorization: Bearer \" . $apiKey\n",{"type":91,"tag":319,"props":3841,"children":3842},{"class":321,"line":2271},[3843],{"type":91,"tag":319,"props":3844,"children":3845},{},[3846],{"type":96,"value":3847},"]);\n",{"type":91,"tag":319,"props":3849,"children":3850},{"class":321,"line":2280},[3851],{"type":91,"tag":319,"props":3852,"children":3853},{"emptyLinePlaceholder":335},[3854],{"type":96,"value":338},{"type":91,"tag":319,"props":3856,"children":3857},{"class":321,"line":2289},[3858],{"type":91,"tag":319,"props":3859,"children":3860},{},[3861],{"type":96,"value":3862},"$response = curl_exec($ch);\n",{"type":91,"tag":319,"props":3864,"children":3865},{"class":321,"line":2297},[3866],{"type":91,"tag":319,"props":3867,"children":3868},{},[3869],{"type":96,"value":3870},"curl_close($ch);\n",{"type":91,"tag":319,"props":3872,"children":3873},{"class":321,"line":2305},[3874],{"type":91,"tag":319,"props":3875,"children":3876},{"emptyLinePlaceholder":335},[3877],{"type":96,"value":338},{"type":91,"tag":319,"props":3879,"children":3880},{"class":321,"line":2314},[3881],{"type":91,"tag":319,"props":3882,"children":3883},{},[3884],{"type":96,"value":3885},"$result = json_decode($response, true);\n",{"type":91,"tag":319,"props":3887,"children":3888},{"class":321,"line":2323},[3889],{"type":91,"tag":319,"props":3890,"children":3891},{},[3892],{"type":96,"value":3893},"echo $result['choices'][0]['message']['content'];\n",{"type":91,"tag":319,"props":3895,"children":3896},{"class":321,"line":2332},[3897],{"type":91,"tag":319,"props":3898,"children":3899},{},[3900],{"type":96,"value":3901},"?>\n",{"type":91,"tag":114,"props":3903,"children":3905},{"icon":279,"label":3904},"Guzzle",[3906,3911],{"type":91,"tag":98,"props":3907,"children":3908},{},[3909],{"type":96,"value":3910},"با استفاده از کتابخانه Guzzle:",{"type":91,"tag":288,"props":3912,"children":3914},{"code":3913,"language":3654,"meta":62,"className":3672,"style":62},"\u003C?php\n\nrequire 'vendor/autoload.php';\n\n$client = new \\GuzzleHttp\\Client([\n    'base_uri' => 'https://api.ahur.ir/v1',\n]);\n\n$response = $client->post('chat/completions', [\n    'headers' => [\n        'Authorization' => 'Bearer your-api-key',\n        'Content-Type' => 'application/json',\n    ],\n    'json' => [\n        'model' => 'gpt-3.5-turbo',\n        'messages' => [\n            ['role' => 'system', 'content' => 'You are a helpful assistant.'],\n            ['role' => 'user', 'content' => 'Hello! How are you?']\n        ],\n    ],\n]);\n\n$result = json_decode($response->getBody(), true);\necho $result['choices'][0]['message']['content'];\n?>\n",[3915],{"type":91,"tag":145,"props":3916,"children":3917},{"__ignoreMap":62},[3918,3925,3932,3940,3947,3955,3963,3970,3977,3985,3993,4001,4009,4016,4024,4032,4040,4048,4056,4063,4070,4077,4084,4092,4099],{"type":91,"tag":319,"props":3919,"children":3920},{"class":321,"line":322},[3921],{"type":91,"tag":319,"props":3922,"children":3923},{},[3924],{"type":96,"value":3684},{"type":91,"tag":319,"props":3926,"children":3927},{"class":321,"line":331},[3928],{"type":91,"tag":319,"props":3929,"children":3930},{"emptyLinePlaceholder":335},[3931],{"type":96,"value":338},{"type":91,"tag":319,"props":3933,"children":3934},{"class":321,"line":341},[3935],{"type":91,"tag":319,"props":3936,"children":3937},{},[3938],{"type":96,"value":3939},"require 'vendor/autoload.php';\n",{"type":91,"tag":319,"props":3941,"children":3942},{"class":321,"line":350},[3943],{"type":91,"tag":319,"props":3944,"children":3945},{"emptyLinePlaceholder":335},[3946],{"type":96,"value":338},{"type":91,"tag":319,"props":3948,"children":3949},{"class":321,"line":359},[3950],{"type":91,"tag":319,"props":3951,"children":3952},{},[3953],{"type":96,"value":3954},"$client = new \\GuzzleHttp\\Client([\n",{"type":91,"tag":319,"props":3956,"children":3957},{"class":321,"line":368},[3958],{"type":91,"tag":319,"props":3959,"children":3960},{},[3961],{"type":96,"value":3962},"    'base_uri' => 'https://api.ahur.ir/v1',\n",{"type":91,"tag":319,"props":3964,"children":3965},{"class":321,"line":377},[3966],{"type":91,"tag":319,"props":3967,"children":3968},{},[3969],{"type":96,"value":3847},{"type":91,"tag":319,"props":3971,"children":3972},{"class":321,"line":386},[3973],{"type":91,"tag":319,"props":3974,"children":3975},{"emptyLinePlaceholder":335},[3976],{"type":96,"value":338},{"type":91,"tag":319,"props":3978,"children":3979},{"class":321,"line":395},[3980],{"type":91,"tag":319,"props":3981,"children":3982},{},[3983],{"type":96,"value":3984},"$response = $client->post('chat/completions', [\n",{"type":91,"tag":319,"props":3986,"children":3987},{"class":321,"line":404},[3988],{"type":91,"tag":319,"props":3989,"children":3990},{},[3991],{"type":96,"value":3992},"    'headers' => [\n",{"type":91,"tag":319,"props":3994,"children":3995},{"class":321,"line":413},[3996],{"type":91,"tag":319,"props":3997,"children":3998},{},[3999],{"type":96,"value":4000},"        'Authorization' => 'Bearer your-api-key',\n",{"type":91,"tag":319,"props":4002,"children":4003},{"class":321,"line":422},[4004],{"type":91,"tag":319,"props":4005,"children":4006},{},[4007],{"type":96,"value":4008},"        'Content-Type' => 'application/json',\n",{"type":91,"tag":319,"props":4010,"children":4011},{"class":321,"line":431},[4012],{"type":91,"tag":319,"props":4013,"children":4014},{},[4015],{"type":96,"value":2018},{"type":91,"tag":319,"props":4017,"children":4018},{"class":321,"line":440},[4019],{"type":91,"tag":319,"props":4020,"children":4021},{},[4022],{"type":96,"value":4023},"    'json' => [\n",{"type":91,"tag":319,"props":4025,"children":4026},{"class":321,"line":448},[4027],{"type":91,"tag":319,"props":4028,"children":4029},{},[4030],{"type":96,"value":4031},"        'model' => 'gpt-3.5-turbo',\n",{"type":91,"tag":319,"props":4033,"children":4034},{"class":321,"line":456},[4035],{"type":91,"tag":319,"props":4036,"children":4037},{},[4038],{"type":96,"value":4039},"        'messages' => [\n",{"type":91,"tag":319,"props":4041,"children":4042},{"class":321,"line":465},[4043],{"type":91,"tag":319,"props":4044,"children":4045},{},[4046],{"type":96,"value":4047},"            ['role' => 'system', 'content' => 'You are a helpful assistant.'],\n",{"type":91,"tag":319,"props":4049,"children":4050},{"class":321,"line":1090},[4051],{"type":91,"tag":319,"props":4052,"children":4053},{},[4054],{"type":96,"value":4055},"            ['role' => 'user', 'content' => 'Hello! How are you?']\n",{"type":91,"tag":319,"props":4057,"children":4058},{"class":321,"line":1098},[4059],{"type":91,"tag":319,"props":4060,"children":4061},{},[4062],{"type":96,"value":3145},{"type":91,"tag":319,"props":4064,"children":4065},{"class":321,"line":1106},[4066],{"type":91,"tag":319,"props":4067,"children":4068},{},[4069],{"type":96,"value":2018},{"type":91,"tag":319,"props":4071,"children":4072},{"class":321,"line":2262},[4073],{"type":91,"tag":319,"props":4074,"children":4075},{},[4076],{"type":96,"value":3847},{"type":91,"tag":319,"props":4078,"children":4079},{"class":321,"line":2271},[4080],{"type":91,"tag":319,"props":4081,"children":4082},{"emptyLinePlaceholder":335},[4083],{"type":96,"value":338},{"type":91,"tag":319,"props":4085,"children":4086},{"class":321,"line":2280},[4087],{"type":91,"tag":319,"props":4088,"children":4089},{},[4090],{"type":96,"value":4091},"$result = json_decode($response->getBody(), true);\n",{"type":91,"tag":319,"props":4093,"children":4094},{"class":321,"line":2289},[4095],{"type":91,"tag":319,"props":4096,"children":4097},{},[4098],{"type":96,"value":3893},{"type":91,"tag":319,"props":4100,"children":4101},{"class":321,"line":2297},[4102],{"type":91,"tag":319,"props":4103,"children":4104},{},[4105],{"type":96,"value":3901},{"type":91,"tag":92,"props":4107,"children":4109},{"id":4108},"کاربردهای-عملی",[4110],{"type":96,"value":4111},"کاربردهای عملی",{"type":91,"tag":255,"props":4113,"children":4115},{"id":4114},"چت-بات",[4116],{"type":96,"value":4117},"چت بات",{"type":91,"tag":98,"props":4119,"children":4120},{},[4121],{"type":96,"value":4122},"یکی از محبوب‌ترین کاربردها، ساخت چت بات است:",{"type":91,"tag":274,"props":4124,"children":4125},{},[4126,4317],{"type":91,"tag":114,"props":4127,"children":4130},{"icon":4128,"label":4129},"i-heroicons-chat-bubble-left","Python Chatbot",[4131],{"type":91,"tag":288,"props":4132,"children":4134},{"code":4133,"language":184,"meta":62,"className":313,"style":62},"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.ahur.ir/v1\",\n    api_key=\"your-api-key\"\n)\n\ndef chat_with_ai(prompt):\n    response = client.chat.completions.create(\n        model=\"gpt-3.5-turbo\",\n        messages=[\n            {\"role\": \"system\", \"content\": \"You are a helpful AI assistant.\"},\n            {\"role\": \"user\", \"content\": prompt}\n        ]\n    )\n    return response.choices[0].message.content\n\nwhile True:\n    user_input = input(\"You: \")\n    if user_input.lower() in [\"exit\", \"quit\"]:\n        break\n    response = chat_with_ai(user_input)\n    print(f\"AI: {response}\")\n",[4135],{"type":91,"tag":145,"props":4136,"children":4137},{"__ignoreMap":62},[4138,4146,4153,4161,4169,4177,4184,4191,4199,4207,4215,4223,4231,4239,4247,4254,4262,4269,4277,4285,4293,4301,4309],{"type":91,"tag":319,"props":4139,"children":4140},{"class":321,"line":322},[4141],{"type":91,"tag":319,"props":4142,"children":4143},{},[4144],{"type":96,"value":4145},"from openai import OpenAI\n",{"type":91,"tag":319,"props":4147,"children":4148},{"class":321,"line":331},[4149],{"type":91,"tag":319,"props":4150,"children":4151},{"emptyLinePlaceholder":335},[4152],{"type":96,"value":338},{"type":91,"tag":319,"props":4154,"children":4155},{"class":321,"line":341},[4156],{"type":91,"tag":319,"props":4157,"children":4158},{},[4159],{"type":96,"value":4160},"client = OpenAI(\n",{"type":91,"tag":319,"props":4162,"children":4163},{"class":321,"line":350},[4164],{"type":91,"tag":319,"props":4165,"children":4166},{},[4167],{"type":96,"value":4168},"    base_url=\"https://api.ahur.ir/v1\",\n",{"type":91,"tag":319,"props":4170,"children":4171},{"class":321,"line":359},[4172],{"type":91,"tag":319,"props":4173,"children":4174},{},[4175],{"type":96,"value":4176},"    api_key=\"your-api-key\"\n",{"type":91,"tag":319,"props":4178,"children":4179},{"class":321,"line":368},[4180],{"type":91,"tag":319,"props":4181,"children":4182},{},[4183],{"type":96,"value":1559},{"type":91,"tag":319,"props":4185,"children":4186},{"class":321,"line":377},[4187],{"type":91,"tag":319,"props":4188,"children":4189},{"emptyLinePlaceholder":335},[4190],{"type":96,"value":338},{"type":91,"tag":319,"props":4192,"children":4193},{"class":321,"line":386},[4194],{"type":91,"tag":319,"props":4195,"children":4196},{},[4197],{"type":96,"value":4198},"def chat_with_ai(prompt):\n",{"type":91,"tag":319,"props":4200,"children":4201},{"class":321,"line":395},[4202],{"type":91,"tag":319,"props":4203,"children":4204},{},[4205],{"type":96,"value":4206},"    response = client.chat.completions.create(\n",{"type":91,"tag":319,"props":4208,"children":4209},{"class":321,"line":404},[4210],{"type":91,"tag":319,"props":4211,"children":4212},{},[4213],{"type":96,"value":4214},"        model=\"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":4216,"children":4217},{"class":321,"line":413},[4218],{"type":91,"tag":319,"props":4219,"children":4220},{},[4221],{"type":96,"value":4222},"        messages=[\n",{"type":91,"tag":319,"props":4224,"children":4225},{"class":321,"line":422},[4226],{"type":91,"tag":319,"props":4227,"children":4228},{},[4229],{"type":96,"value":4230},"            {\"role\": \"system\", \"content\": \"You are a helpful AI assistant.\"},\n",{"type":91,"tag":319,"props":4232,"children":4233},{"class":321,"line":431},[4234],{"type":91,"tag":319,"props":4235,"children":4236},{},[4237],{"type":96,"value":4238},"            {\"role\": \"user\", \"content\": prompt}\n",{"type":91,"tag":319,"props":4240,"children":4241},{"class":321,"line":440},[4242],{"type":91,"tag":319,"props":4243,"children":4244},{},[4245],{"type":96,"value":4246},"        ]\n",{"type":91,"tag":319,"props":4248,"children":4249},{"class":321,"line":448},[4250],{"type":91,"tag":319,"props":4251,"children":4252},{},[4253],{"type":96,"value":2204},{"type":91,"tag":319,"props":4255,"children":4256},{"class":321,"line":456},[4257],{"type":91,"tag":319,"props":4258,"children":4259},{},[4260],{"type":96,"value":4261},"    return response.choices[0].message.content\n",{"type":91,"tag":319,"props":4263,"children":4264},{"class":321,"line":465},[4265],{"type":91,"tag":319,"props":4266,"children":4267},{"emptyLinePlaceholder":335},[4268],{"type":96,"value":338},{"type":91,"tag":319,"props":4270,"children":4271},{"class":321,"line":1090},[4272],{"type":91,"tag":319,"props":4273,"children":4274},{},[4275],{"type":96,"value":4276},"while True:\n",{"type":91,"tag":319,"props":4278,"children":4279},{"class":321,"line":1098},[4280],{"type":91,"tag":319,"props":4281,"children":4282},{},[4283],{"type":96,"value":4284},"    user_input = input(\"You: \")\n",{"type":91,"tag":319,"props":4286,"children":4287},{"class":321,"line":1106},[4288],{"type":91,"tag":319,"props":4289,"children":4290},{},[4291],{"type":96,"value":4292},"    if user_input.lower() in [\"exit\", \"quit\"]:\n",{"type":91,"tag":319,"props":4294,"children":4295},{"class":321,"line":2262},[4296],{"type":91,"tag":319,"props":4297,"children":4298},{},[4299],{"type":96,"value":4300},"        break\n",{"type":91,"tag":319,"props":4302,"children":4303},{"class":321,"line":2271},[4304],{"type":91,"tag":319,"props":4305,"children":4306},{},[4307],{"type":96,"value":4308},"    response = chat_with_ai(user_input)\n",{"type":91,"tag":319,"props":4310,"children":4311},{"class":321,"line":2280},[4312],{"type":91,"tag":319,"props":4313,"children":4314},{},[4315],{"type":96,"value":4316},"    print(f\"AI: {response}\")\n",{"type":91,"tag":114,"props":4318,"children":4320},{"icon":4128,"label":4319},"JavaScript Chatbot",[4321],{"type":91,"tag":288,"props":4322,"children":4324},{"code":4323,"language":196,"meta":62,"className":541,"style":62},"import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n    baseURL: 'https://api.ahur.ir/v1',\n    apiKey: 'your-api-key'\n});\n\nasync function chat(prompt) {\n    const response = await openai.chat.completions.create({\n        model: 'gpt-3.5-turbo',\n        messages: [\n            {role: 'system', content: 'You are a helpful AI assistant.'},\n            {role: 'user', content: prompt}\n        ],\n    });\n    return response.choices[0].message.content;\n}\n\n// استفاده در یک برنامه وب\ndocument.getElementById('sendBtn').addEventListener('click', async () => {\n    const input = document.getElementById('userInput').value;\n    const response = await chat(input);\n    document.getElementById('output').innerText = response;\n});\n",[4325],{"type":91,"tag":145,"props":4326,"children":4327},{"__ignoreMap":62},[4328,4359,4366,4397,4424,4447,4462,4469,4502,4558,4585,4600,4656,4704,4715,4730,4782,4789,4796,4804,4890,4953,4993,5051],{"type":91,"tag":319,"props":4329,"children":4330},{"class":321,"line":322},[4331,4335,4339,4343,4347,4351,4355],{"type":91,"tag":319,"props":4332,"children":4333},{"style":551},[4334],{"type":96,"value":554},{"type":91,"tag":319,"props":4336,"children":4337},{"style":557},[4338],{"type":96,"value":560},{"type":91,"tag":319,"props":4340,"children":4341},{"style":551},[4342],{"type":96,"value":565},{"type":91,"tag":319,"props":4344,"children":4345},{"style":568},[4346],{"type":96,"value":571},{"type":91,"tag":319,"props":4348,"children":4349},{"style":524},[4350],{"type":96,"value":576},{"type":91,"tag":319,"props":4352,"children":4353},{"style":568},[4354],{"type":96,"value":581},{"type":91,"tag":319,"props":4356,"children":4357},{"style":568},[4358],{"type":96,"value":586},{"type":91,"tag":319,"props":4360,"children":4361},{"class":321,"line":331},[4362],{"type":91,"tag":319,"props":4363,"children":4364},{"emptyLinePlaceholder":335},[4365],{"type":96,"value":338},{"type":91,"tag":319,"props":4367,"children":4368},{"class":321,"line":341},[4369,4373,4377,4381,4385,4389,4393],{"type":91,"tag":319,"props":4370,"children":4371},{"style":599},[4372],{"type":96,"value":602},{"type":91,"tag":319,"props":4374,"children":4375},{"style":557},[4376],{"type":96,"value":607},{"type":91,"tag":319,"props":4378,"children":4379},{"style":568},[4380],{"type":96,"value":612},{"type":91,"tag":319,"props":4382,"children":4383},{"style":568},[4384],{"type":96,"value":617},{"type":91,"tag":319,"props":4386,"children":4387},{"style":620},[4388],{"type":96,"value":623},{"type":91,"tag":319,"props":4390,"children":4391},{"style":557},[4392],{"type":96,"value":628},{"type":91,"tag":319,"props":4394,"children":4395},{"style":568},[4396],{"type":96,"value":633},{"type":91,"tag":319,"props":4398,"children":4399},{"class":321,"line":350},[4400,4404,4408,4412,4416,4420],{"type":91,"tag":319,"props":4401,"children":4402},{"style":639},[4403],{"type":96,"value":642},{"type":91,"tag":319,"props":4405,"children":4406},{"style":568},[4407],{"type":96,"value":647},{"type":91,"tag":319,"props":4409,"children":4410},{"style":568},[4411],{"type":96,"value":571},{"type":91,"tag":319,"props":4413,"children":4414},{"style":524},[4415],{"type":96,"value":106},{"type":91,"tag":319,"props":4417,"children":4418},{"style":568},[4419],{"type":96,"value":581},{"type":91,"tag":319,"props":4421,"children":4422},{"style":568},[4423],{"type":96,"value":664},{"type":91,"tag":319,"props":4425,"children":4426},{"class":321,"line":359},[4427,4431,4435,4439,4443],{"type":91,"tag":319,"props":4428,"children":4429},{"style":639},[4430],{"type":96,"value":672},{"type":91,"tag":319,"props":4432,"children":4433},{"style":568},[4434],{"type":96,"value":647},{"type":91,"tag":319,"props":4436,"children":4437},{"style":568},[4438],{"type":96,"value":571},{"type":91,"tag":319,"props":4440,"children":4441},{"style":524},[4442],{"type":96,"value":685},{"type":91,"tag":319,"props":4444,"children":4445},{"style":568},[4446],{"type":96,"value":1301},{"type":91,"tag":319,"props":4448,"children":4449},{"class":321,"line":368},[4450,4454,4458],{"type":91,"tag":319,"props":4451,"children":4452},{"style":568},[4453],{"type":96,"value":703},{"type":91,"tag":319,"props":4455,"children":4456},{"style":557},[4457],{"type":96,"value":708},{"type":91,"tag":319,"props":4459,"children":4460},{"style":568},[4461],{"type":96,"value":586},{"type":91,"tag":319,"props":4463,"children":4464},{"class":321,"line":377},[4465],{"type":91,"tag":319,"props":4466,"children":4467},{"emptyLinePlaceholder":335},[4468],{"type":96,"value":338},{"type":91,"tag":319,"props":4470,"children":4471},{"class":321,"line":386},[4472,4476,4480,4485,4489,4494,4498],{"type":91,"tag":319,"props":4473,"children":4474},{"style":599},[4475],{"type":96,"value":727},{"type":91,"tag":319,"props":4477,"children":4478},{"style":599},[4479],{"type":96,"value":732},{"type":91,"tag":319,"props":4481,"children":4482},{"style":620},[4483],{"type":96,"value":4484}," chat",{"type":91,"tag":319,"props":4486,"children":4487},{"style":568},[4488],{"type":96,"value":628},{"type":91,"tag":319,"props":4490,"children":4491},{"style":1579},[4492],{"type":96,"value":4493},"prompt",{"type":91,"tag":319,"props":4495,"children":4496},{"style":568},[4497],{"type":96,"value":708},{"type":91,"tag":319,"props":4499,"children":4500},{"style":568},[4501],{"type":96,"value":747},{"type":91,"tag":319,"props":4503,"children":4504},{"class":321,"line":395},[4505,4509,4514,4518,4522,4526,4530,4534,4538,4542,4546,4550,4554],{"type":91,"tag":319,"props":4506,"children":4507},{"style":599},[4508],{"type":96,"value":755},{"type":91,"tag":319,"props":4510,"children":4511},{"style":557},[4512],{"type":96,"value":4513}," response",{"type":91,"tag":319,"props":4515,"children":4516},{"style":568},[4517],{"type":96,"value":765},{"type":91,"tag":319,"props":4519,"children":4520},{"style":551},[4521],{"type":96,"value":770},{"type":91,"tag":319,"props":4523,"children":4524},{"style":557},[4525],{"type":96,"value":775},{"type":91,"tag":319,"props":4527,"children":4528},{"style":568},[4529],{"type":96,"value":780},{"type":91,"tag":319,"props":4531,"children":4532},{"style":557},[4533],{"type":96,"value":785},{"type":91,"tag":319,"props":4535,"children":4536},{"style":568},[4537],{"type":96,"value":780},{"type":91,"tag":319,"props":4539,"children":4540},{"style":557},[4541],{"type":96,"value":794},{"type":91,"tag":319,"props":4543,"children":4544},{"style":568},[4545],{"type":96,"value":780},{"type":91,"tag":319,"props":4547,"children":4548},{"style":620},[4549],{"type":96,"value":803},{"type":91,"tag":319,"props":4551,"children":4552},{"style":639},[4553],{"type":96,"value":628},{"type":91,"tag":319,"props":4555,"children":4556},{"style":568},[4557],{"type":96,"value":633},{"type":91,"tag":319,"props":4559,"children":4560},{"class":321,"line":404},[4561,4565,4569,4573,4577,4581],{"type":91,"tag":319,"props":4562,"children":4563},{"style":639},[4564],{"type":96,"value":819},{"type":91,"tag":319,"props":4566,"children":4567},{"style":568},[4568],{"type":96,"value":647},{"type":91,"tag":319,"props":4570,"children":4571},{"style":568},[4572],{"type":96,"value":571},{"type":91,"tag":319,"props":4574,"children":4575},{"style":524},[4576],{"type":96,"value":832},{"type":91,"tag":319,"props":4578,"children":4579},{"style":568},[4580],{"type":96,"value":581},{"type":91,"tag":319,"props":4582,"children":4583},{"style":568},[4584],{"type":96,"value":664},{"type":91,"tag":319,"props":4586,"children":4587},{"class":321,"line":413},[4588,4592,4596],{"type":91,"tag":319,"props":4589,"children":4590},{"style":639},[4591],{"type":96,"value":848},{"type":91,"tag":319,"props":4593,"children":4594},{"style":568},[4595],{"type":96,"value":647},{"type":91,"tag":319,"props":4597,"children":4598},{"style":639},[4599],{"type":96,"value":857},{"type":91,"tag":319,"props":4601,"children":4602},{"class":321,"line":422},[4603,4607,4611,4615,4619,4623,4627,4631,4635,4639,4643,4648,4652],{"type":91,"tag":319,"props":4604,"children":4605},{"style":568},[4606],{"type":96,"value":865},{"type":91,"tag":319,"props":4608,"children":4609},{"style":639},[4610],{"type":96,"value":870},{"type":91,"tag":319,"props":4612,"children":4613},{"style":568},[4614],{"type":96,"value":647},{"type":91,"tag":319,"props":4616,"children":4617},{"style":568},[4618],{"type":96,"value":571},{"type":91,"tag":319,"props":4620,"children":4621},{"style":524},[4622],{"type":96,"value":883},{"type":91,"tag":319,"props":4624,"children":4625},{"style":568},[4626],{"type":96,"value":581},{"type":91,"tag":319,"props":4628,"children":4629},{"style":568},[4630],{"type":96,"value":892},{"type":91,"tag":319,"props":4632,"children":4633},{"style":639},[4634],{"type":96,"value":897},{"type":91,"tag":319,"props":4636,"children":4637},{"style":568},[4638],{"type":96,"value":647},{"type":91,"tag":319,"props":4640,"children":4641},{"style":568},[4642],{"type":96,"value":571},{"type":91,"tag":319,"props":4644,"children":4645},{"style":524},[4646],{"type":96,"value":4647},"You are a helpful AI assistant.",{"type":91,"tag":319,"props":4649,"children":4650},{"style":568},[4651],{"type":96,"value":581},{"type":91,"tag":319,"props":4653,"children":4654},{"style":568},[4655],{"type":96,"value":919},{"type":91,"tag":319,"props":4657,"children":4658},{"class":321,"line":431},[4659,4663,4667,4671,4675,4679,4683,4687,4691,4695,4700],{"type":91,"tag":319,"props":4660,"children":4661},{"style":568},[4662],{"type":96,"value":865},{"type":91,"tag":319,"props":4664,"children":4665},{"style":639},[4666],{"type":96,"value":870},{"type":91,"tag":319,"props":4668,"children":4669},{"style":568},[4670],{"type":96,"value":647},{"type":91,"tag":319,"props":4672,"children":4673},{"style":568},[4674],{"type":96,"value":571},{"type":91,"tag":319,"props":4676,"children":4677},{"style":524},[4678],{"type":96,"value":943},{"type":91,"tag":319,"props":4680,"children":4681},{"style":568},[4682],{"type":96,"value":581},{"type":91,"tag":319,"props":4684,"children":4685},{"style":568},[4686],{"type":96,"value":892},{"type":91,"tag":319,"props":4688,"children":4689},{"style":639},[4690],{"type":96,"value":897},{"type":91,"tag":319,"props":4692,"children":4693},{"style":568},[4694],{"type":96,"value":647},{"type":91,"tag":319,"props":4696,"children":4697},{"style":557},[4698],{"type":96,"value":4699}," prompt",{"type":91,"tag":319,"props":4701,"children":4702},{"style":568},[4703],{"type":96,"value":383},{"type":91,"tag":319,"props":4705,"children":4706},{"class":321,"line":440},[4707,4711],{"type":91,"tag":319,"props":4708,"children":4709},{"style":639},[4710],{"type":96,"value":984},{"type":91,"tag":319,"props":4712,"children":4713},{"style":568},[4714],{"type":96,"value":664},{"type":91,"tag":319,"props":4716,"children":4717},{"class":321,"line":448},[4718,4722,4726],{"type":91,"tag":319,"props":4719,"children":4720},{"style":568},[4721],{"type":96,"value":996},{"type":91,"tag":319,"props":4723,"children":4724},{"style":639},[4725],{"type":96,"value":708},{"type":91,"tag":319,"props":4727,"children":4728},{"style":568},[4729],{"type":96,"value":586},{"type":91,"tag":319,"props":4731,"children":4732},{"class":321,"line":456},[4733,4738,4742,4746,4750,4754,4758,4762,4766,4770,4774,4778],{"type":91,"tag":319,"props":4734,"children":4735},{"style":551},[4736],{"type":96,"value":4737},"    return",{"type":91,"tag":319,"props":4739,"children":4740},{"style":557},[4741],{"type":96,"value":4513},{"type":91,"tag":319,"props":4743,"children":4744},{"style":568},[4745],{"type":96,"value":780},{"type":91,"tag":319,"props":4747,"children":4748},{"style":557},[4749],{"type":96,"value":1046},{"type":91,"tag":319,"props":4751,"children":4752},{"style":639},[4753],{"type":96,"value":1051},{"type":91,"tag":319,"props":4755,"children":4756},{"style":1054},[4757],{"type":96,"value":1057},{"type":91,"tag":319,"props":4759,"children":4760},{"style":639},[4761],{"type":96,"value":1062},{"type":91,"tag":319,"props":4763,"children":4764},{"style":568},[4765],{"type":96,"value":780},{"type":91,"tag":319,"props":4767,"children":4768},{"style":557},[4769],{"type":96,"value":1071},{"type":91,"tag":319,"props":4771,"children":4772},{"style":568},[4773],{"type":96,"value":780},{"type":91,"tag":319,"props":4775,"children":4776},{"style":557},[4777],{"type":96,"value":68},{"type":91,"tag":319,"props":4779,"children":4780},{"style":568},[4781],{"type":96,"value":586},{"type":91,"tag":319,"props":4783,"children":4784},{"class":321,"line":465},[4785],{"type":91,"tag":319,"props":4786,"children":4787},{"style":568},[4788],{"type":96,"value":383},{"type":91,"tag":319,"props":4790,"children":4791},{"class":321,"line":1090},[4792],{"type":91,"tag":319,"props":4793,"children":4794},{"emptyLinePlaceholder":335},[4795],{"type":96,"value":338},{"type":91,"tag":319,"props":4797,"children":4798},{"class":321,"line":1098},[4799],{"type":91,"tag":319,"props":4800,"children":4801},{"style":692},[4802],{"type":96,"value":4803},"// استفاده در یک برنامه وب\n",{"type":91,"tag":319,"props":4805,"children":4806},{"class":321,"line":1106},[4807,4812,4816,4821,4825,4829,4834,4838,4842,4846,4851,4855,4859,4864,4868,4872,4877,4882,4886],{"type":91,"tag":319,"props":4808,"children":4809},{"style":557},[4810],{"type":96,"value":4811},"document",{"type":91,"tag":319,"props":4813,"children":4814},{"style":568},[4815],{"type":96,"value":780},{"type":91,"tag":319,"props":4817,"children":4818},{"style":620},[4819],{"type":96,"value":4820},"getElementById",{"type":91,"tag":319,"props":4822,"children":4823},{"style":557},[4824],{"type":96,"value":628},{"type":91,"tag":319,"props":4826,"children":4827},{"style":568},[4828],{"type":96,"value":581},{"type":91,"tag":319,"props":4830,"children":4831},{"style":524},[4832],{"type":96,"value":4833},"sendBtn",{"type":91,"tag":319,"props":4835,"children":4836},{"style":568},[4837],{"type":96,"value":581},{"type":91,"tag":319,"props":4839,"children":4840},{"style":557},[4841],{"type":96,"value":708},{"type":91,"tag":319,"props":4843,"children":4844},{"style":568},[4845],{"type":96,"value":780},{"type":91,"tag":319,"props":4847,"children":4848},{"style":620},[4849],{"type":96,"value":4850},"addEventListener",{"type":91,"tag":319,"props":4852,"children":4853},{"style":557},[4854],{"type":96,"value":628},{"type":91,"tag":319,"props":4856,"children":4857},{"style":568},[4858],{"type":96,"value":581},{"type":91,"tag":319,"props":4860,"children":4861},{"style":524},[4862],{"type":96,"value":4863},"click",{"type":91,"tag":319,"props":4865,"children":4866},{"style":568},[4867],{"type":96,"value":581},{"type":91,"tag":319,"props":4869,"children":4870},{"style":568},[4871],{"type":96,"value":892},{"type":91,"tag":319,"props":4873,"children":4874},{"style":599},[4875],{"type":96,"value":4876}," async",{"type":91,"tag":319,"props":4878,"children":4879},{"style":568},[4880],{"type":96,"value":4881}," ()",{"type":91,"tag":319,"props":4883,"children":4884},{"style":599},[4885],{"type":96,"value":1587},{"type":91,"tag":319,"props":4887,"children":4888},{"style":568},[4889],{"type":96,"value":747},{"type":91,"tag":319,"props":4891,"children":4892},{"class":321,"line":2262},[4893,4897,4902,4906,4911,4915,4919,4923,4927,4932,4936,4940,4944,4949],{"type":91,"tag":319,"props":4894,"children":4895},{"style":599},[4896],{"type":96,"value":755},{"type":91,"tag":319,"props":4898,"children":4899},{"style":557},[4900],{"type":96,"value":4901}," input",{"type":91,"tag":319,"props":4903,"children":4904},{"style":568},[4905],{"type":96,"value":765},{"type":91,"tag":319,"props":4907,"children":4908},{"style":557},[4909],{"type":96,"value":4910}," document",{"type":91,"tag":319,"props":4912,"children":4913},{"style":568},[4914],{"type":96,"value":780},{"type":91,"tag":319,"props":4916,"children":4917},{"style":620},[4918],{"type":96,"value":4820},{"type":91,"tag":319,"props":4920,"children":4921},{"style":639},[4922],{"type":96,"value":628},{"type":91,"tag":319,"props":4924,"children":4925},{"style":568},[4926],{"type":96,"value":581},{"type":91,"tag":319,"props":4928,"children":4929},{"style":524},[4930],{"type":96,"value":4931},"userInput",{"type":91,"tag":319,"props":4933,"children":4934},{"style":568},[4935],{"type":96,"value":581},{"type":91,"tag":319,"props":4937,"children":4938},{"style":639},[4939],{"type":96,"value":708},{"type":91,"tag":319,"props":4941,"children":4942},{"style":568},[4943],{"type":96,"value":780},{"type":91,"tag":319,"props":4945,"children":4946},{"style":557},[4947],{"type":96,"value":4948},"value",{"type":91,"tag":319,"props":4950,"children":4951},{"style":568},[4952],{"type":96,"value":586},{"type":91,"tag":319,"props":4954,"children":4955},{"class":321,"line":2271},[4956,4960,4964,4968,4972,4976,4980,4985,4989],{"type":91,"tag":319,"props":4957,"children":4958},{"style":599},[4959],{"type":96,"value":755},{"type":91,"tag":319,"props":4961,"children":4962},{"style":557},[4963],{"type":96,"value":4513},{"type":91,"tag":319,"props":4965,"children":4966},{"style":568},[4967],{"type":96,"value":765},{"type":91,"tag":319,"props":4969,"children":4970},{"style":551},[4971],{"type":96,"value":770},{"type":91,"tag":319,"props":4973,"children":4974},{"style":620},[4975],{"type":96,"value":4484},{"type":91,"tag":319,"props":4977,"children":4978},{"style":639},[4979],{"type":96,"value":628},{"type":91,"tag":319,"props":4981,"children":4982},{"style":557},[4983],{"type":96,"value":4984},"input",{"type":91,"tag":319,"props":4986,"children":4987},{"style":639},[4988],{"type":96,"value":708},{"type":91,"tag":319,"props":4990,"children":4991},{"style":568},[4992],{"type":96,"value":586},{"type":91,"tag":319,"props":4994,"children":4995},{"class":321,"line":2280},[4996,5001,5005,5009,5013,5017,5022,5026,5030,5034,5039,5043,5047],{"type":91,"tag":319,"props":4997,"children":4998},{"style":557},[4999],{"type":96,"value":5000},"    document",{"type":91,"tag":319,"props":5002,"children":5003},{"style":568},[5004],{"type":96,"value":780},{"type":91,"tag":319,"props":5006,"children":5007},{"style":620},[5008],{"type":96,"value":4820},{"type":91,"tag":319,"props":5010,"children":5011},{"style":639},[5012],{"type":96,"value":628},{"type":91,"tag":319,"props":5014,"children":5015},{"style":568},[5016],{"type":96,"value":581},{"type":91,"tag":319,"props":5018,"children":5019},{"style":524},[5020],{"type":96,"value":5021},"output",{"type":91,"tag":319,"props":5023,"children":5024},{"style":568},[5025],{"type":96,"value":581},{"type":91,"tag":319,"props":5027,"children":5028},{"style":639},[5029],{"type":96,"value":708},{"type":91,"tag":319,"props":5031,"children":5032},{"style":568},[5033],{"type":96,"value":780},{"type":91,"tag":319,"props":5035,"children":5036},{"style":557},[5037],{"type":96,"value":5038},"innerText",{"type":91,"tag":319,"props":5040,"children":5041},{"style":568},[5042],{"type":96,"value":765},{"type":91,"tag":319,"props":5044,"children":5045},{"style":557},[5046],{"type":96,"value":4513},{"type":91,"tag":319,"props":5048,"children":5049},{"style":568},[5050],{"type":96,"value":586},{"type":91,"tag":319,"props":5052,"children":5053},{"class":321,"line":2289},[5054,5058,5062],{"type":91,"tag":319,"props":5055,"children":5056},{"style":568},[5057],{"type":96,"value":703},{"type":91,"tag":319,"props":5059,"children":5060},{"style":557},[5061],{"type":96,"value":708},{"type":91,"tag":319,"props":5063,"children":5064},{"style":568},[5065],{"type":96,"value":586},{"type":91,"tag":255,"props":5067,"children":5069},{"id":5068},"تولید-متن",[5070],{"type":96,"value":5071},"تولید متن",{"type":91,"tag":274,"props":5073,"children":5074},{},[5075,5313],{"type":91,"tag":114,"props":5076,"children":5079},{"icon":5077,"label":5078},"i-heroicons-document-text","Text Generation",[5080,5085],{"type":91,"tag":98,"props":5081,"children":5082},{},[5083],{"type":96,"value":5084},"تولید متن با مدل‌های مختلف:",{"type":91,"tag":288,"props":5086,"children":5088},{"code":5087,"language":184,"meta":62,"className":313,"style":62},"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.ahur.ir/v1\",\n    api_key=\"your-api-key\"\n)\n\n# مقاله\narticle = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"Write an article about AI\"}\n    ]\n)\n\n# کد نویسی\ncode = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"Write a Python function to sort an array\"}\n    ]\n)\n\n# ترجمه\ntranslate = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"Translate 'Hello' to Persian\"}\n    ]\n)\n",[5089],{"type":91,"tag":145,"props":5090,"children":5091},{"__ignoreMap":62},[5092,5099,5106,5113,5120,5127,5134,5141,5149,5157,5165,5173,5181,5188,5195,5202,5210,5218,5225,5232,5240,5247,5254,5261,5269,5277,5284,5291,5299,5306],{"type":91,"tag":319,"props":5093,"children":5094},{"class":321,"line":322},[5095],{"type":91,"tag":319,"props":5096,"children":5097},{},[5098],{"type":96,"value":4145},{"type":91,"tag":319,"props":5100,"children":5101},{"class":321,"line":331},[5102],{"type":91,"tag":319,"props":5103,"children":5104},{"emptyLinePlaceholder":335},[5105],{"type":96,"value":338},{"type":91,"tag":319,"props":5107,"children":5108},{"class":321,"line":341},[5109],{"type":91,"tag":319,"props":5110,"children":5111},{},[5112],{"type":96,"value":4160},{"type":91,"tag":319,"props":5114,"children":5115},{"class":321,"line":350},[5116],{"type":91,"tag":319,"props":5117,"children":5118},{},[5119],{"type":96,"value":4168},{"type":91,"tag":319,"props":5121,"children":5122},{"class":321,"line":359},[5123],{"type":91,"tag":319,"props":5124,"children":5125},{},[5126],{"type":96,"value":4176},{"type":91,"tag":319,"props":5128,"children":5129},{"class":321,"line":368},[5130],{"type":91,"tag":319,"props":5131,"children":5132},{},[5133],{"type":96,"value":1559},{"type":91,"tag":319,"props":5135,"children":5136},{"class":321,"line":377},[5137],{"type":91,"tag":319,"props":5138,"children":5139},{"emptyLinePlaceholder":335},[5140],{"type":96,"value":338},{"type":91,"tag":319,"props":5142,"children":5143},{"class":321,"line":386},[5144],{"type":91,"tag":319,"props":5145,"children":5146},{},[5147],{"type":96,"value":5148},"# مقاله\n",{"type":91,"tag":319,"props":5150,"children":5151},{"class":321,"line":395},[5152],{"type":91,"tag":319,"props":5153,"children":5154},{},[5155],{"type":96,"value":5156},"article = client.chat.completions.create(\n",{"type":91,"tag":319,"props":5158,"children":5159},{"class":321,"line":404},[5160],{"type":91,"tag":319,"props":5161,"children":5162},{},[5163],{"type":96,"value":5164},"    model=\"gpt-3.5-turbo\",\n",{"type":91,"tag":319,"props":5166,"children":5167},{"class":321,"line":413},[5168],{"type":91,"tag":319,"props":5169,"children":5170},{},[5171],{"type":96,"value":5172},"    messages=[\n",{"type":91,"tag":319,"props":5174,"children":5175},{"class":321,"line":422},[5176],{"type":91,"tag":319,"props":5177,"children":5178},{},[5179],{"type":96,"value":5180},"        {\"role\": \"user\", \"content\": \"Write an article about AI\"}\n",{"type":91,"tag":319,"props":5182,"children":5183},{"class":321,"line":431},[5184],{"type":91,"tag":319,"props":5185,"children":5186},{},[5187],{"type":96,"value":1492},{"type":91,"tag":319,"props":5189,"children":5190},{"class":321,"line":440},[5191],{"type":91,"tag":319,"props":5192,"children":5193},{},[5194],{"type":96,"value":1559},{"type":91,"tag":319,"props":5196,"children":5197},{"class":321,"line":448},[5198],{"type":91,"tag":319,"props":5199,"children":5200},{"emptyLinePlaceholder":335},[5201],{"type":96,"value":338},{"type":91,"tag":319,"props":5203,"children":5204},{"class":321,"line":456},[5205],{"type":91,"tag":319,"props":5206,"children":5207},{},[5208],{"type":96,"value":5209},"# کد نویسی\n",{"type":91,"tag":319,"props":5211,"children":5212},{"class":321,"line":465},[5213],{"type":91,"tag":319,"props":5214,"children":5215},{},[5216],{"type":96,"value":5217},"code = client.chat.completions.create(\n",{"type":91,"tag":319,"props":5219,"children":5220},{"class":321,"line":1090},[5221],{"type":91,"tag":319,"props":5222,"children":5223},{},[5224],{"type":96,"value":5164},{"type":91,"tag":319,"props":5226,"children":5227},{"class":321,"line":1098},[5228],{"type":91,"tag":319,"props":5229,"children":5230},{},[5231],{"type":96,"value":5172},{"type":91,"tag":319,"props":5233,"children":5234},{"class":321,"line":1106},[5235],{"type":91,"tag":319,"props":5236,"children":5237},{},[5238],{"type":96,"value":5239},"        {\"role\": \"user\", \"content\": \"Write a Python function to sort an array\"}\n",{"type":91,"tag":319,"props":5241,"children":5242},{"class":321,"line":2262},[5243],{"type":91,"tag":319,"props":5244,"children":5245},{},[5246],{"type":96,"value":1492},{"type":91,"tag":319,"props":5248,"children":5249},{"class":321,"line":2271},[5250],{"type":91,"tag":319,"props":5251,"children":5252},{},[5253],{"type":96,"value":1559},{"type":91,"tag":319,"props":5255,"children":5256},{"class":321,"line":2280},[5257],{"type":91,"tag":319,"props":5258,"children":5259},{"emptyLinePlaceholder":335},[5260],{"type":96,"value":338},{"type":91,"tag":319,"props":5262,"children":5263},{"class":321,"line":2289},[5264],{"type":91,"tag":319,"props":5265,"children":5266},{},[5267],{"type":96,"value":5268},"# ترجمه\n",{"type":91,"tag":319,"props":5270,"children":5271},{"class":321,"line":2297},[5272],{"type":91,"tag":319,"props":5273,"children":5274},{},[5275],{"type":96,"value":5276},"translate = client.chat.completions.create(\n",{"type":91,"tag":319,"props":5278,"children":5279},{"class":321,"line":2305},[5280],{"type":91,"tag":319,"props":5281,"children":5282},{},[5283],{"type":96,"value":5164},{"type":91,"tag":319,"props":5285,"children":5286},{"class":321,"line":2314},[5287],{"type":91,"tag":319,"props":5288,"children":5289},{},[5290],{"type":96,"value":5172},{"type":91,"tag":319,"props":5292,"children":5293},{"class":321,"line":2323},[5294],{"type":91,"tag":319,"props":5295,"children":5296},{},[5297],{"type":96,"value":5298},"        {\"role\": \"user\", \"content\": \"Translate 'Hello' to Persian\"}\n",{"type":91,"tag":319,"props":5300,"children":5301},{"class":321,"line":2332},[5302],{"type":91,"tag":319,"props":5303,"children":5304},{},[5305],{"type":96,"value":1492},{"type":91,"tag":319,"props":5307,"children":5308},{"class":321,"line":2341},[5309],{"type":91,"tag":319,"props":5310,"children":5311},{},[5312],{"type":96,"value":1559},{"type":91,"tag":114,"props":5314,"children":5316},{"icon":5077,"label":5315},"Embedding",[5317,5322],{"type":91,"tag":98,"props":5318,"children":5319},{},[5320],{"type":96,"value":5321},"استفاده از Embedding برای جستجوی معنایی:",{"type":91,"tag":288,"props":5323,"children":5325},{"code":5324,"language":184,"meta":62,"className":313,"style":62},"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.ahur.ir/v1\",\n    api_key=\"your-api-key\"\n)\n\nresponse = client.embeddings.create(\n    model=\"text-embedding-ada-002\",\n    input=\"The quick brown fox jumps over the lazy dog\"\n)\n\nembedding = response.data[0].embedding\nprint(f\"Embedding dimension: {len(embedding)}\")\n",[5326],{"type":91,"tag":145,"props":5327,"children":5328},{"__ignoreMap":62},[5329,5336,5343,5350,5357,5364,5371,5378,5386,5394,5402,5409,5416,5424],{"type":91,"tag":319,"props":5330,"children":5331},{"class":321,"line":322},[5332],{"type":91,"tag":319,"props":5333,"children":5334},{},[5335],{"type":96,"value":4145},{"type":91,"tag":319,"props":5337,"children":5338},{"class":321,"line":331},[5339],{"type":91,"tag":319,"props":5340,"children":5341},{"emptyLinePlaceholder":335},[5342],{"type":96,"value":338},{"type":91,"tag":319,"props":5344,"children":5345},{"class":321,"line":341},[5346],{"type":91,"tag":319,"props":5347,"children":5348},{},[5349],{"type":96,"value":4160},{"type":91,"tag":319,"props":5351,"children":5352},{"class":321,"line":350},[5353],{"type":91,"tag":319,"props":5354,"children":5355},{},[5356],{"type":96,"value":4168},{"type":91,"tag":319,"props":5358,"children":5359},{"class":321,"line":359},[5360],{"type":91,"tag":319,"props":5361,"children":5362},{},[5363],{"type":96,"value":4176},{"type":91,"tag":319,"props":5365,"children":5366},{"class":321,"line":368},[5367],{"type":91,"tag":319,"props":5368,"children":5369},{},[5370],{"type":96,"value":1559},{"type":91,"tag":319,"props":5372,"children":5373},{"class":321,"line":377},[5374],{"type":91,"tag":319,"props":5375,"children":5376},{"emptyLinePlaceholder":335},[5377],{"type":96,"value":338},{"type":91,"tag":319,"props":5379,"children":5380},{"class":321,"line":386},[5381],{"type":91,"tag":319,"props":5382,"children":5383},{},[5384],{"type":96,"value":5385},"response = client.embeddings.create(\n",{"type":91,"tag":319,"props":5387,"children":5388},{"class":321,"line":395},[5389],{"type":91,"tag":319,"props":5390,"children":5391},{},[5392],{"type":96,"value":5393},"    model=\"text-embedding-ada-002\",\n",{"type":91,"tag":319,"props":5395,"children":5396},{"class":321,"line":404},[5397],{"type":91,"tag":319,"props":5398,"children":5399},{},[5400],{"type":96,"value":5401},"    input=\"The quick brown fox jumps over the lazy dog\"\n",{"type":91,"tag":319,"props":5403,"children":5404},{"class":321,"line":413},[5405],{"type":91,"tag":319,"props":5406,"children":5407},{},[5408],{"type":96,"value":1559},{"type":91,"tag":319,"props":5410,"children":5411},{"class":321,"line":422},[5412],{"type":91,"tag":319,"props":5413,"children":5414},{"emptyLinePlaceholder":335},[5415],{"type":96,"value":338},{"type":91,"tag":319,"props":5417,"children":5418},{"class":321,"line":431},[5419],{"type":91,"tag":319,"props":5420,"children":5421},{},[5422],{"type":96,"value":5423},"embedding = response.data[0].embedding\n",{"type":91,"tag":319,"props":5425,"children":5426},{"class":321,"line":440},[5427],{"type":91,"tag":319,"props":5428,"children":5429},{},[5430],{"type":96,"value":5431},"print(f\"Embedding dimension: {len(embedding)}\")\n",{"type":91,"tag":255,"props":5433,"children":5435},{"id":5434},"استریم-پاسخ",[5436],{"type":96,"value":5437},"استریم پاسخ",{"type":91,"tag":274,"props":5439,"children":5440},{},[5441,5576],{"type":91,"tag":114,"props":5442,"children":5445},{"icon":5443,"label":5444},"i-heroicons-arrows-up-down","Python Stream",[5446,5451],{"type":91,"tag":98,"props":5447,"children":5448},{},[5449],{"type":96,"value":5450},"دریافت پاسخ به صورت استریم:",{"type":91,"tag":288,"props":5452,"children":5454},{"code":5453,"language":184,"meta":62,"className":313,"style":62},"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.ahur.ir/v1\",\n    api_key=\"your-api-key\"\n)\n\nstream = client.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a story about a cat\"}],\n    stream=True\n)\n\nfor chunk in stream:\n    if chunk.choices[0].delta.content:\n        print(chunk.choices[0].delta.content, end=\"\")\n",[5455],{"type":91,"tag":145,"props":5456,"children":5457},{"__ignoreMap":62},[5458,5465,5472,5479,5486,5493,5500,5507,5515,5522,5530,5538,5545,5552,5560,5568],{"type":91,"tag":319,"props":5459,"children":5460},{"class":321,"line":322},[5461],{"type":91,"tag":319,"props":5462,"children":5463},{},[5464],{"type":96,"value":4145},{"type":91,"tag":319,"props":5466,"children":5467},{"class":321,"line":331},[5468],{"type":91,"tag":319,"props":5469,"children":5470},{"emptyLinePlaceholder":335},[5471],{"type":96,"value":338},{"type":91,"tag":319,"props":5473,"children":5474},{"class":321,"line":341},[5475],{"type":91,"tag":319,"props":5476,"children":5477},{},[5478],{"type":96,"value":4160},{"type":91,"tag":319,"props":5480,"children":5481},{"class":321,"line":350},[5482],{"type":91,"tag":319,"props":5483,"children":5484},{},[5485],{"type":96,"value":4168},{"type":91,"tag":319,"props":5487,"children":5488},{"class":321,"line":359},[5489],{"type":91,"tag":319,"props":5490,"children":5491},{},[5492],{"type":96,"value":4176},{"type":91,"tag":319,"props":5494,"children":5495},{"class":321,"line":368},[5496],{"type":91,"tag":319,"props":5497,"children":5498},{},[5499],{"type":96,"value":1559},{"type":91,"tag":319,"props":5501,"children":5502},{"class":321,"line":377},[5503],{"type":91,"tag":319,"props":5504,"children":5505},{"emptyLinePlaceholder":335},[5506],{"type":96,"value":338},{"type":91,"tag":319,"props":5508,"children":5509},{"class":321,"line":386},[5510],{"type":91,"tag":319,"props":5511,"children":5512},{},[5513],{"type":96,"value":5514},"stream = client.chat.completions.create(\n",{"type":91,"tag":319,"props":5516,"children":5517},{"class":321,"line":395},[5518],{"type":91,"tag":319,"props":5519,"children":5520},{},[5521],{"type":96,"value":5164},{"type":91,"tag":319,"props":5523,"children":5524},{"class":321,"line":404},[5525],{"type":91,"tag":319,"props":5526,"children":5527},{},[5528],{"type":96,"value":5529},"    messages=[{\"role\": \"user\", \"content\": \"Write a story about a cat\"}],\n",{"type":91,"tag":319,"props":5531,"children":5532},{"class":321,"line":413},[5533],{"type":91,"tag":319,"props":5534,"children":5535},{},[5536],{"type":96,"value":5537},"    stream=True\n",{"type":91,"tag":319,"props":5539,"children":5540},{"class":321,"line":422},[5541],{"type":91,"tag":319,"props":5542,"children":5543},{},[5544],{"type":96,"value":1559},{"type":91,"tag":319,"props":5546,"children":5547},{"class":321,"line":431},[5548],{"type":91,"tag":319,"props":5549,"children":5550},{"emptyLinePlaceholder":335},[5551],{"type":96,"value":338},{"type":91,"tag":319,"props":5553,"children":5554},{"class":321,"line":440},[5555],{"type":91,"tag":319,"props":5556,"children":5557},{},[5558],{"type":96,"value":5559},"for chunk in stream:\n",{"type":91,"tag":319,"props":5561,"children":5562},{"class":321,"line":448},[5563],{"type":91,"tag":319,"props":5564,"children":5565},{},[5566],{"type":96,"value":5567},"    if chunk.choices[0].delta.content:\n",{"type":91,"tag":319,"props":5569,"children":5570},{"class":321,"line":456},[5571],{"type":91,"tag":319,"props":5572,"children":5573},{},[5574],{"type":96,"value":5575},"        print(chunk.choices[0].delta.content, end=\"\")\n",{"type":91,"tag":114,"props":5577,"children":5579},{"icon":5443,"label":5578},"JavaScript Stream",[5580,5585],{"type":91,"tag":98,"props":5581,"children":5582},{},[5583],{"type":96,"value":5584},"در JavaScript:",{"type":91,"tag":288,"props":5586,"children":5588},{"code":5587,"language":196,"meta":62,"className":541,"style":62},"import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n    baseURL: 'https://api.ahur.ir/v1',\n    apiKey: 'your-api-key'\n});\n\nconst stream = await openai.chat.completions.create({\n    model: 'gpt-3.5-turbo',\n    messages: [{role: 'user', content: 'Write a story about a cat'}],\n    stream: true,\n});\n\nfor await (const chunk of stream) {\n    process.stdout.write(chunk.choices[0]?.delta?.content || '');\n}\n",[5589],{"type":91,"tag":145,"props":5590,"children":5591},{"__ignoreMap":62},[5592,5623,5630,5661,5688,5711,5726,5733,5789,5816,5894,5916,5931,5938,5978,6069],{"type":91,"tag":319,"props":5593,"children":5594},{"class":321,"line":322},[5595,5599,5603,5607,5611,5615,5619],{"type":91,"tag":319,"props":5596,"children":5597},{"style":551},[5598],{"type":96,"value":554},{"type":91,"tag":319,"props":5600,"children":5601},{"style":557},[5602],{"type":96,"value":560},{"type":91,"tag":319,"props":5604,"children":5605},{"style":551},[5606],{"type":96,"value":565},{"type":91,"tag":319,"props":5608,"children":5609},{"style":568},[5610],{"type":96,"value":571},{"type":91,"tag":319,"props":5612,"children":5613},{"style":524},[5614],{"type":96,"value":576},{"type":91,"tag":319,"props":5616,"children":5617},{"style":568},[5618],{"type":96,"value":581},{"type":91,"tag":319,"props":5620,"children":5621},{"style":568},[5622],{"type":96,"value":586},{"type":91,"tag":319,"props":5624,"children":5625},{"class":321,"line":331},[5626],{"type":91,"tag":319,"props":5627,"children":5628},{"emptyLinePlaceholder":335},[5629],{"type":96,"value":338},{"type":91,"tag":319,"props":5631,"children":5632},{"class":321,"line":341},[5633,5637,5641,5645,5649,5653,5657],{"type":91,"tag":319,"props":5634,"children":5635},{"style":599},[5636],{"type":96,"value":602},{"type":91,"tag":319,"props":5638,"children":5639},{"style":557},[5640],{"type":96,"value":607},{"type":91,"tag":319,"props":5642,"children":5643},{"style":568},[5644],{"type":96,"value":612},{"type":91,"tag":319,"props":5646,"children":5647},{"style":568},[5648],{"type":96,"value":617},{"type":91,"tag":319,"props":5650,"children":5651},{"style":620},[5652],{"type":96,"value":623},{"type":91,"tag":319,"props":5654,"children":5655},{"style":557},[5656],{"type":96,"value":628},{"type":91,"tag":319,"props":5658,"children":5659},{"style":568},[5660],{"type":96,"value":633},{"type":91,"tag":319,"props":5662,"children":5663},{"class":321,"line":350},[5664,5668,5672,5676,5680,5684],{"type":91,"tag":319,"props":5665,"children":5666},{"style":639},[5667],{"type":96,"value":642},{"type":91,"tag":319,"props":5669,"children":5670},{"style":568},[5671],{"type":96,"value":647},{"type":91,"tag":319,"props":5673,"children":5674},{"style":568},[5675],{"type":96,"value":571},{"type":91,"tag":319,"props":5677,"children":5678},{"style":524},[5679],{"type":96,"value":106},{"type":91,"tag":319,"props":5681,"children":5682},{"style":568},[5683],{"type":96,"value":581},{"type":91,"tag":319,"props":5685,"children":5686},{"style":568},[5687],{"type":96,"value":664},{"type":91,"tag":319,"props":5689,"children":5690},{"class":321,"line":359},[5691,5695,5699,5703,5707],{"type":91,"tag":319,"props":5692,"children":5693},{"style":639},[5694],{"type":96,"value":672},{"type":91,"tag":319,"props":5696,"children":5697},{"style":568},[5698],{"type":96,"value":647},{"type":91,"tag":319,"props":5700,"children":5701},{"style":568},[5702],{"type":96,"value":571},{"type":91,"tag":319,"props":5704,"children":5705},{"style":524},[5706],{"type":96,"value":685},{"type":91,"tag":319,"props":5708,"children":5709},{"style":568},[5710],{"type":96,"value":1301},{"type":91,"tag":319,"props":5712,"children":5713},{"class":321,"line":368},[5714,5718,5722],{"type":91,"tag":319,"props":5715,"children":5716},{"style":568},[5717],{"type":96,"value":703},{"type":91,"tag":319,"props":5719,"children":5720},{"style":557},[5721],{"type":96,"value":708},{"type":91,"tag":319,"props":5723,"children":5724},{"style":568},[5725],{"type":96,"value":586},{"type":91,"tag":319,"props":5727,"children":5728},{"class":321,"line":377},[5729],{"type":91,"tag":319,"props":5730,"children":5731},{"emptyLinePlaceholder":335},[5732],{"type":96,"value":338},{"type":91,"tag":319,"props":5734,"children":5735},{"class":321,"line":386},[5736,5740,5745,5749,5753,5757,5761,5765,5769,5773,5777,5781,5785],{"type":91,"tag":319,"props":5737,"children":5738},{"style":599},[5739],{"type":96,"value":602},{"type":91,"tag":319,"props":5741,"children":5742},{"style":557},[5743],{"type":96,"value":5744}," stream ",{"type":91,"tag":319,"props":5746,"children":5747},{"style":568},[5748],{"type":96,"value":612},{"type":91,"tag":319,"props":5750,"children":5751},{"style":551},[5752],{"type":96,"value":770},{"type":91,"tag":319,"props":5754,"children":5755},{"style":557},[5756],{"type":96,"value":775},{"type":91,"tag":319,"props":5758,"children":5759},{"style":568},[5760],{"type":96,"value":780},{"type":91,"tag":319,"props":5762,"children":5763},{"style":557},[5764],{"type":96,"value":785},{"type":91,"tag":319,"props":5766,"children":5767},{"style":568},[5768],{"type":96,"value":780},{"type":91,"tag":319,"props":5770,"children":5771},{"style":557},[5772],{"type":96,"value":794},{"type":91,"tag":319,"props":5774,"children":5775},{"style":568},[5776],{"type":96,"value":780},{"type":91,"tag":319,"props":5778,"children":5779},{"style":620},[5780],{"type":96,"value":803},{"type":91,"tag":319,"props":5782,"children":5783},{"style":557},[5784],{"type":96,"value":628},{"type":91,"tag":319,"props":5786,"children":5787},{"style":568},[5788],{"type":96,"value":633},{"type":91,"tag":319,"props":5790,"children":5791},{"class":321,"line":395},[5792,5796,5800,5804,5808,5812],{"type":91,"tag":319,"props":5793,"children":5794},{"style":639},[5795],{"type":96,"value":1337},{"type":91,"tag":319,"props":5797,"children":5798},{"style":568},[5799],{"type":96,"value":647},{"type":91,"tag":319,"props":5801,"children":5802},{"style":568},[5803],{"type":96,"value":571},{"type":91,"tag":319,"props":5805,"children":5806},{"style":524},[5807],{"type":96,"value":832},{"type":91,"tag":319,"props":5809,"children":5810},{"style":568},[5811],{"type":96,"value":581},{"type":91,"tag":319,"props":5813,"children":5814},{"style":568},[5815],{"type":96,"value":664},{"type":91,"tag":319,"props":5817,"children":5818},{"class":321,"line":404},[5819,5823,5827,5832,5837,5841,5845,5849,5853,5857,5861,5865,5869,5873,5878,5882,5886,5890],{"type":91,"tag":319,"props":5820,"children":5821},{"style":639},[5822],{"type":96,"value":1365},{"type":91,"tag":319,"props":5824,"children":5825},{"style":568},[5826],{"type":96,"value":647},{"type":91,"tag":319,"props":5828,"children":5829},{"style":557},[5830],{"type":96,"value":5831}," [",{"type":91,"tag":319,"props":5833,"children":5834},{"style":568},[5835],{"type":96,"value":5836},"{",{"type":91,"tag":319,"props":5838,"children":5839},{"style":639},[5840],{"type":96,"value":870},{"type":91,"tag":319,"props":5842,"children":5843},{"style":568},[5844],{"type":96,"value":647},{"type":91,"tag":319,"props":5846,"children":5847},{"style":568},[5848],{"type":96,"value":571},{"type":91,"tag":319,"props":5850,"children":5851},{"style":524},[5852],{"type":96,"value":943},{"type":91,"tag":319,"props":5854,"children":5855},{"style":568},[5856],{"type":96,"value":581},{"type":91,"tag":319,"props":5858,"children":5859},{"style":568},[5860],{"type":96,"value":892},{"type":91,"tag":319,"props":5862,"children":5863},{"style":639},[5864],{"type":96,"value":897},{"type":91,"tag":319,"props":5866,"children":5867},{"style":568},[5868],{"type":96,"value":647},{"type":91,"tag":319,"props":5870,"children":5871},{"style":568},[5872],{"type":96,"value":571},{"type":91,"tag":319,"props":5874,"children":5875},{"style":524},[5876],{"type":96,"value":5877},"Write a story about a cat",{"type":91,"tag":319,"props":5879,"children":5880},{"style":568},[5881],{"type":96,"value":581},{"type":91,"tag":319,"props":5883,"children":5884},{"style":568},[5885],{"type":96,"value":703},{"type":91,"tag":319,"props":5887,"children":5888},{"style":557},[5889],{"type":96,"value":1062},{"type":91,"tag":319,"props":5891,"children":5892},{"style":568},[5893],{"type":96,"value":664},{"type":91,"tag":319,"props":5895,"children":5896},{"class":321,"line":413},[5897,5902,5906,5912],{"type":91,"tag":319,"props":5898,"children":5899},{"style":639},[5900],{"type":96,"value":5901},"    stream",{"type":91,"tag":319,"props":5903,"children":5904},{"style":568},[5905],{"type":96,"value":647},{"type":91,"tag":319,"props":5907,"children":5909},{"style":5908},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[5910],{"type":96,"value":5911}," true",{"type":91,"tag":319,"props":5913,"children":5914},{"style":568},[5915],{"type":96,"value":664},{"type":91,"tag":319,"props":5917,"children":5918},{"class":321,"line":422},[5919,5923,5927],{"type":91,"tag":319,"props":5920,"children":5921},{"style":568},[5922],{"type":96,"value":703},{"type":91,"tag":319,"props":5924,"children":5925},{"style":557},[5926],{"type":96,"value":708},{"type":91,"tag":319,"props":5928,"children":5929},{"style":568},[5930],{"type":96,"value":586},{"type":91,"tag":319,"props":5932,"children":5933},{"class":321,"line":431},[5934],{"type":91,"tag":319,"props":5935,"children":5936},{"emptyLinePlaceholder":335},[5937],{"type":96,"value":338},{"type":91,"tag":319,"props":5939,"children":5940},{"class":321,"line":440},[5941,5946,5950,5955,5959,5964,5969,5974],{"type":91,"tag":319,"props":5942,"children":5943},{"style":551},[5944],{"type":96,"value":5945},"for",{"type":91,"tag":319,"props":5947,"children":5948},{"style":551},[5949],{"type":96,"value":770},{"type":91,"tag":319,"props":5951,"children":5952},{"style":557},[5953],{"type":96,"value":5954}," (",{"type":91,"tag":319,"props":5956,"children":5957},{"style":599},[5958],{"type":96,"value":602},{"type":91,"tag":319,"props":5960,"children":5961},{"style":557},[5962],{"type":96,"value":5963}," chunk ",{"type":91,"tag":319,"props":5965,"children":5966},{"style":568},[5967],{"type":96,"value":5968},"of",{"type":91,"tag":319,"props":5970,"children":5971},{"style":557},[5972],{"type":96,"value":5973}," stream) ",{"type":91,"tag":319,"props":5975,"children":5976},{"style":568},[5977],{"type":96,"value":633},{"type":91,"tag":319,"props":5979,"children":5980},{"class":321,"line":448},[5981,5986,5990,5995,5999,6004,6008,6013,6017,6021,6025,6029,6033,6038,6043,6047,6051,6056,6061,6065],{"type":91,"tag":319,"props":5982,"children":5983},{"style":557},[5984],{"type":96,"value":5985},"    process",{"type":91,"tag":319,"props":5987,"children":5988},{"style":568},[5989],{"type":96,"value":780},{"type":91,"tag":319,"props":5991,"children":5992},{"style":557},[5993],{"type":96,"value":5994},"stdout",{"type":91,"tag":319,"props":5996,"children":5997},{"style":568},[5998],{"type":96,"value":780},{"type":91,"tag":319,"props":6000,"children":6001},{"style":620},[6002],{"type":96,"value":6003},"write",{"type":91,"tag":319,"props":6005,"children":6006},{"style":639},[6007],{"type":96,"value":628},{"type":91,"tag":319,"props":6009,"children":6010},{"style":557},[6011],{"type":96,"value":6012},"chunk",{"type":91,"tag":319,"props":6014,"children":6015},{"style":568},[6016],{"type":96,"value":780},{"type":91,"tag":319,"props":6018,"children":6019},{"style":557},[6020],{"type":96,"value":1046},{"type":91,"tag":319,"props":6022,"children":6023},{"style":639},[6024],{"type":96,"value":1051},{"type":91,"tag":319,"props":6026,"children":6027},{"style":1054},[6028],{"type":96,"value":1057},{"type":91,"tag":319,"props":6030,"children":6031},{"style":639},[6032],{"type":96,"value":1062},{"type":91,"tag":319,"props":6034,"children":6035},{"style":568},[6036],{"type":96,"value":6037},"?.",{"type":91,"tag":319,"props":6039,"children":6040},{"style":557},[6041],{"type":96,"value":6042},"delta",{"type":91,"tag":319,"props":6044,"children":6045},{"style":568},[6046],{"type":96,"value":6037},{"type":91,"tag":319,"props":6048,"children":6049},{"style":557},[6050],{"type":96,"value":68},{"type":91,"tag":319,"props":6052,"children":6053},{"style":568},[6054],{"type":96,"value":6055}," ||",{"type":91,"tag":319,"props":6057,"children":6058},{"style":568},[6059],{"type":96,"value":6060}," ''",{"type":91,"tag":319,"props":6062,"children":6063},{"style":639},[6064],{"type":96,"value":708},{"type":91,"tag":319,"props":6066,"children":6067},{"style":568},[6068],{"type":96,"value":586},{"type":91,"tag":319,"props":6070,"children":6071},{"class":321,"line":456},[6072],{"type":91,"tag":319,"props":6073,"children":6074},{"style":568},[6075],{"type":96,"value":383},{"type":91,"tag":92,"props":6077,"children":6079},{"id":6078},"نتیجهگیری",[6080],{"type":96,"value":6081},"نتیجه‌گیری",{"type":91,"tag":98,"props":6083,"children":6084},{},[6085,6087,6092],{"type":96,"value":6086},"رابط‌های API سازگار با OpenAI ابزار قدرتمندی هستند که به شما امکان می‌دهند از قابلیت‌های هوش مصنوعی در برنامه‌های خود استفاده کنید. با استفاده از سرور شخصی در ",{"type":91,"tag":104,"props":6088,"children":6090},{"href":106,"rel":6089},[108],[6091],{"type":96,"value":106},{"type":96,"value":6093}," می‌توانید از این امکانات با کنترل بیشتر و حریم خصوصی بهتر بهره‌مند شوید.",{"type":91,"tag":6095,"props":6096,"children":6097},"style",{},[6098],{"type":96,"value":6099},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":62,"searchDepth":331,"depth":331,"links":6101},[6102,6103,6104,6112,6117],{"id":13,"depth":331,"text":13},{"id":163,"depth":331,"text":166},{"id":250,"depth":331,"text":253,"children":6105},[6106,6107,6108,6109,6110,6111],{"id":257,"depth":341,"text":260},{"id":474,"depth":341,"text":477},{"id":1729,"depth":341,"text":1732},{"id":2040,"depth":341,"text":2043},{"id":2754,"depth":341,"text":2757},{"id":3642,"depth":341,"text":3645},{"id":4108,"depth":331,"text":4111,"children":6113},[6114,6115,6116],{"id":4114,"depth":341,"text":4117},{"id":5068,"depth":341,"text":5071},{"id":5434,"depth":341,"text":5437},{"id":6078,"depth":331,"text":6081},"markdown","content:3.blog:1.openai-compatible-api.md","3.blog/1.openai-compatible-api.md","3.blog/1.openai-compatible-api","md",1771612255813]