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