ai-agents-for-beginners

कोर्स सेटअप

परिचय

यो पाठले यस कोर्सका कोड नमूनाहरू कसरी चलाउने भनेर समेट्नेछ।

अन्य सिक्नेहरूसँग जोडिनुहोस् र सहयोग प्राप्त गर्नुहोस्

रिपो क्लोन गर्नुभन्दा पहिले, सेटअपमा सहयोग, कोर्स सम्बन्धी कुनै प्रश्नहरू, वा अन्य सिक्नेहरूसँग जडान हुनको लागि AI एजेन्टहरू प्रारम्भकर्ताका लागि Discord च्यानल मा सहभागी हुनुहोस्।

यो रिपो क्लोन वा फोर्क गर्नुहोस्

सुरु गर्नको लागि, कृपया GitHub रिपोजिटरी क्लोन वा फोर्क गर्नुहोस्। यसले कोर्स सामग्रीको आफ्नो संस्करण बनाउँछ जसले गर्दा तपाईंले कोड चलाउन, परीक्षण गर्न, र परिमार्जन गर्न सक्नुहुन्छ!

This can be done by clicking the link to रिपो फोर्क गर्नुहोस्

You should now have your own forked version of this course in the following link:

फोर्क गरिएको रिपो

हल्का क्लोन (व्यावहारिक कार्यशाला / Codespaces का लागि सिफारिस गरिएको)

पूर्ण रिपोजिटरी पूरा इतिहास र सबै फाइलहरू डाउनलोड गर्दा ठूलो (~3 GB) हुनसक्छ। यदि तपाईं केवल कार्यशाला मा सहभागी हुनुहुन्छ वा केवल केही पाठ फोल्डरहरू चाहिएको छ भने, एक हल्का क्लोन (वा स्पार्स क्लोन) ले इतिहास छोट्याएर र/वा ब्लबहरू छोडेर त्यहाँको अधिकांश डाउनलोडबाट बचाउँछ।

द्रुत हल्का क्लोन — न्यूनतम इतिहास, सबै फाइलहरू

Replace <your-username> in the below commands with your fork URL (or the upstream URL if you prefer).

To clone only the latest commit history (small download):

git clone --depth 1 https://github.com/<your-username>/ai-agents-for-beginners.git

To clone a specific branch:

git clone --depth 1 --branch <branch-name> https://github.com/<your-username>/ai-agents-for-beginners.git

आंशिक (स्पार्स) क्लोन — न्यूनतम ब्लबहरू + मात्रै चयन गरिएका फोल्डरहरू

This uses partial clone and sparse-checkout (requires Git 2.25+ and recommended modern Git with partial clone support):

git clone --depth 1 --filter=blob:none --sparse https://github.com/<your-username>/ai-agents-for-beginners.git

Traverse into the repo folder:

cd ai-agents-for-beginners

Then specify which folders you want (example below shows two folders):

git sparse-checkout set 00-course-setup 01-intro-to-ai-agents

After cloning and verifying the files, if you only need files and want to free space (no git history), please delete the repository metadata (💀irreversible — you will lose all Git functionality: no commits, pulls, pushes, or history access).

# zsh/bash
rm -rf .git
# पावरशेल
Remove-Item -Recurse -Force .git

GitHub Codespaces प्रयोग गर्दै (स्थानीय ठूलो डाउनलोडबाट बच्न सिफारिस गरिएको)

सुझावहरू

कोड चलाउने तरिका

यस कोर्सले Jupyter Notebook हरूको श्रृंखला प्रदान गर्दछ जसलाई चलाएर तपाईं AI एजेन्टहरू निर्माण गर्ने व्यावहारिक अनुभव प्राप्त गर्न सक्नुहुन्छ।

The code samples use either:

Requires GitHub Account - Free:

1) Semantic Kernel Agent Framework + GitHub Models Marketplace. (फाइल: semantic-kernel.ipynb) 2) AutoGen Framework + GitHub Models Marketplace. (फाइल: autogen.ipynb)

Azure सदस्यता आवश्यक: 3) Azure AI Foundry + Azure AI Agent Service. (फाइल: azureaiagent.ipynb)

We encourage you to try out all three types of examples to see which one works best for you.

Whichever option you choose, it will determine which setup steps you need to follow below:

आवश्यकताहरू

We have included a requirements.txt file in the root of this repository that contains all the required Python packages to run the code samples.

You can install them by running the following command in your terminal at the root of the repository:

pip install -r requirements.txt

We recommend creating a Python virtual environment to avoid any conflicts and issues.

VSCode सेटअप गर्नुहोस्

Make sure that you are using the right version of Python in VSCode.

छवि

GitHub Models प्रयोग गर्ने नमूनाहरूको सेटअप

चरण 1: आफ्नो GitHub Personal Access Token (PAT) प्राप्त गर्नुहोस्

यो कोर्सले GitHub Models Marketplace प्रयोग गर्दछ, जसले तपाईंले AI एजेन्टहरू निर्माण गर्न प्रयोग गर्ने ठूलो भाषा मोडेलहरू (LLMs) मा निःशुल्क पहुँच प्रदान गर्छ।

GitHub Models प्रयोग गर्न, तपाईंले GitHub Personal Access Token सिर्जना गर्न आवश्यक हुनेछ।

यसलाई तपाईंको GitHub खातामा रहेको Personal Access Tokens सेटिङहरू मा गएर गर्न सकिन्छ।

कृपया टोकन बनाउँदा न्यूनतम अधिकारको सिद्धान्त पालना गर्नुहोस्। यसको अर्थ तपाइँले टोकनलाई केवल यस कोर्सका कोड नमूनाहरू चलाउन आवश्यक अधिकार मात्र दिनु पर्ने हुन्छ।

  1. Developer settings मा गएर आफ्नो स्क्रिनको बाँया पट्टीमा रहेको Fine-grained tokens विकल्प चयन गर्नुहोस्।

    डेभलपर सेटिङ

    त्यसपछि Generate new token चयन गर्नुहोस्।

    टोकन उत्पन्न गर्नुहोस्

  2. Enter a descriptive name for your token that reflects its purpose, making it easy to identify later.

    🔐 Token Duration Recommendation

    Recommended duration: 30 days For a more secure posture, you can opt for a shorter period—such as 7 days 🛡️ It’s a great way to set a personal target and complete the course while your learning momentum is high 🚀.

    Token Name and Expiration

  3. Limit the token’s scope to your fork of this repository.

    Limit scope to fork repository

  4. Restrict the token’s permissions: Under Permissions, click Account tab, and click the “+ Add permissions” button. A dropdown will appear. Please search for Models and check the box for it.

    Add Models Permission

  5. Verify the permissions required before generating the token. अनुमतिहरू जाँच गर्नुहोस्

  6. Before generating the token, ensure you are ready to store the token in a secure place like a password manager vault, as it will not be shown again after you create it. टोकन सुरक्षित रूपमा भण्डारण गर्नुहोस्

Copy your new token that you have just created. You will now add this to your .env file included in this course.

चरण 2: आफ्नो .env फाइल सिर्जना गर्नुहोस्

To create your .env file run the following command in your terminal.

# zsh वा bash
cp .env.example .env
# पावरशेल
Copy-Item .env.example .env

This will copy the example file and create a .env in your directory and where you fill in the values for the environment variables.

With your token copied, open the .env file in your favorite text editor and paste your token into the GITHUB_TOKEN field.

GitHub टोकन फिल्ड

You should now be able to run the code samples of this course.

Microsoft Foundry र Azure AI Agent Service प्रयोग गर्ने नमूनाहरूको सेटअप

चरण 1: आफ्नो Azure प्रोजेक्ट एंडपोइन्ट प्राप्त गर्नुहोस्

Azure AI Foundry मा हब र प्रोजेक्ट सिर्जना गर्ने चरणहरू यहाँ फेला पार्नुहोस्: Hub resources overview

Once you have created your project, you will need to retrieve the connection string for your project.

This can be done by going to the Overview page of your project in the Microsoft Foundry portal.

प्रोजेक्ट कनेक्सन स्ट्रिङ

चरण 2: आफ्नो .env फाइल सिर्जना गर्नुहोस्

To create your .env file run the following command in your terminal.

# zsh/bash
cp .env.example .env
# पावरशेल
Copy-Item .env.example .env

This will copy the example file and create a .env in your directory and where you fill in the values for the environment variables.

With your token copied, open the .env file in your favorite text editor and paste your token into the PROJECT_ENDPOINT field.

चरण 3: Azure मा साइन इन गर्नुहोस्

सुरक्षा उत्तम अभ्यासको रूपमा, हामी Microsoft Entra ID मार्फत Azure OpenAI लाई प्रमाणीकृत गर्न कुञ्जीविहीन प्रमाणीकरण प्रयोग गर्नेछौं।

Next, open a terminal and run az login --use-device-code to sign in to your Azure account.

Once you’ve logged in, select your subscription in the terminal.

थप वातावरण चरहरू - Azure Search र Azure OpenAI

For the Agentic RAG Lesson - Lesson 5 - there are samples that use Azure Search and Azure OpenAI.

If you want to run these samples, you will need to add the following environment variables to your .env file:

Overview Page (Project)

व्यवस्थापन केन्द्र

Models + Endpoints पृष्ठ

Azure Portal

बाह्य वेबपेज

कुञ्जीविहीन प्रमाणीकरण सेटअप गर्नुहोस्

Rather than hardcode your credentials, we’ll use a keyless connection with Azure OpenAI. To do so, we’ll import DefaultAzureCredential and later call the DefaultAzureCredential function to get the credential.

# पाइथन
from azure.identity import DefaultAzureCredential, InteractiveBrowserCredential

कतै अट्किनुभयो?

यदि तपाईंले यो सेटअप चलाउँदा कुनै समस्या भएमा, हाम्रो Azure AI समुदाय Discord मा आउनुहोस् वा इश्यू सिर्जना गर्नुहोस्

अर्को पाठ

अब तपाईं यो कोर्सको कोड चलाउन तयार हुनुहुन्छ। AI एजेन्टहरूको संसारबारे थप सिक्न शुभकामना!

AI एजेन्टहरू र एजेन्ट प्रयोगका केसहरूको परिचय


अस्वीकरण: यो दस्तावेज AI अनुवाद सेवा Co-op Translator प्रयोग गरेर अनुवाद गरिएको हो। हामी सहीताको लागि प्रयास गर्छौं भने पनि, कृपया ध्यान दिनुहोस् कि स्वचालित अनुवादमा त्रुटि वा अशुद्धता हुन सक्छ। मूल भाषामा रहेको दस्तावेजलाई आधिकारिक स्रोतको रूपमा मानिनु पर्छ। महत्वपुर्ण जानकारीका लागि पेशेवर मानवीय अनुवाद सिफारिस गरिन्छ। यो अनुवादको प्रयोगबाट उत्पन्न कुनै पनि गलतफहमी वा गलत व्याख्याका लागि हामी जिम्मेवार छैनौं।