সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আপনার প্রকল্পে SDK এবং নমুনা কোড ইনস্টল করতে এই নির্দেশাবলী অনুসরণ করুন। ডিভাইসের একটি টার্মিনালে এই পৃষ্ঠার সমস্ত কমান্ড চালান (হয় সরাসরি বা একটি SSH সংযোগের মাধ্যমে)।
পরিবেশ কনফিগার করুন
সিস্টেম Python প্যাকেজ থেকে SDK এবং এর নির্ভরতা বিচ্ছিন্ন করতে একটি Python ভার্চুয়াল পরিবেশ ব্যবহার করুন।
(প্রস্তাবিত) পাইথন 3 এর জন্য:
sudo apt-get updatesudo apt-get install python3-dev python3-venv # Use python3.4-venv if the package cannot be found.python3 -m venv envenv/bin/python -m pip install --upgrade pip setuptools wheelsource env/bin/activate
নমুনা কোড এবং সরঞ্জামগুলি চালাতে সক্ষম হতে শংসাপত্র তৈরি করুন। আপনি পূর্বে ডাউনলোড করা JSON ফাইলটি উল্লেখ করুনপদক্ষেপআপনি এটি ডিভাইস অনুলিপি প্রয়োজন হতে পারে. এই ফাইলটির নাম পরিবর্তন করবেন না।
Please visit this URL to authorize this application: https://...
URLটি অনুলিপি করুন এবং এটি একটি ব্রাউজারে পেস্ট করুন (এটি যে কোনও সিস্টেমে করা যেতে পারে)। পৃষ্ঠাটি আপনাকে আপনার Google অ্যাকাউন্টে সাইন ইন করতে বলবে। Google অ্যাকাউন্টে সাইন ইন করুন যা পূর্বে বিকাশকারী প্রকল্প তৈরি করেছেপদক্ষেপ
আপনি API থেকে অনুমতির অনুরোধ অনুমোদন করার পরে, আপনার ব্রাউজারে একটি কোড প্রদর্শিত হবে, যেমন "4/XXXX"৷ টার্মিনালে এই কোডটি কপি এবং পেস্ট করুন:
Enter the authorization code:
অনুমোদন সফল হলে, আপনি নিম্নলিখিত অনুরূপ একটি প্রতিক্রিয়া দেখতে পাবেন:
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThese instructions guide you through installing the Google Assistant SDK and sample code on a Linux device, primarily focusing on Python environments.\u003c/p\u003e\n"],["\u003cp\u003eYou'll set up a Python virtual environment, install necessary dependencies, and obtain the Google Assistant SDK package using pip.\u003c/p\u003e\n"],["\u003cp\u003eGenerating credentials involves authorizing your Google account to access the Assistant SDK and saving the credentials for API calls.\u003c/p\u003e\n"],["\u003cp\u003eAfter successful installation and credential generation, you can proceed to run the provided sample code.\u003c/p\u003e\n"]]],[],null,["# Install the SDK and Sample Code\n\nFollow these instructions to install the SDK and sample code in your project.\nRun all of the commands on this page in a terminal on the device (either\ndirectly or via an SSH connection).\n| **Note:** These instructions assume a Python environment running on a Linux platform. The SDK and sample code are currently only available in Python, but the Google Service API is available in many [other languages and platforms](/assistant/sdk/guides/service/integrate#other-languages).\n\nConfigure the environment\n-------------------------\n\nUse a [Python virtual environment](https://docs.python.org/3/library/venv.html)\nto isolate the SDK and its dependencies from the system Python packages.\n| **Note:** For the Raspberry Pi, run the following commands from the `/home/pi` directory.\n\n(Recommended) For Python 3: \n\n sudo apt-get update\n sudo apt-get install python3-dev python3-venv # Use python3.4-venv if the package cannot be found.\n python3 -m venv env\n env/bin/python -m pip install --upgrade pip setuptools wheel\n source env/bin/activate\n\nFor Python 2.7: \n\n sudo apt-get update\n sudo apt-get install python-dev python-virtualenv\n virtualenv env --no-site-packages\n env/bin/python -m pip install --upgrade pip setuptools wheel\n source env/bin/activate\n\nGet the package\n---------------\n\nThe Google Assistant SDK package contains all the code required to get the\nGoogle Assistant running on the device, including the sample code.\n\nInstall the package's system dependencies: \n\n```\nsudo apt-get install portaudio19-dev libffi-dev libssl-dev\n```\n\n\u003cbr /\u003e\n\nUse `pip` to install the latest version of the [Python package](https://pypi.python.org/pypi/google-assistant-library)\nin the virtual environment: \n\n```\npython -m pip install --upgrade google-assistant-sdk[samples]\n```\n\n\u003cbr /\u003e\n\nGenerate credentials\n--------------------\n\n1. Install or update the authorization tool:\n\n ```\n python -m pip install --upgrade google-auth-oauthlib[tool]\n ```\n\n \u003cbr /\u003e\n\n2. Generate credentials to be able to run the sample code and tools. Reference\n the JSON file you downloaded in a previous\n\n [step](/assistant/sdk/guides/service/python/embed/register-device#download-credentials);\n\n you may need to copy it the device. Do not rename this file.\n\n ```\n google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype \\\n --save --headless --client-secrets /path/to/client_secret_client-id.json\n ```\n\n You should see a URL displayed in the terminal: \n\n ```\n Please visit this URL to authorize this application: https://...\n ```\n\n \u003cbr /\u003e\n\n3. Copy the URL and paste it into a browser (this can be done on any system).\n The page will ask you to sign in to your Google account. Sign into the\n Google account that created the developer project in the previous\n\n [step](/assistant/sdk/guides/service/python/embed/config-dev-project-and-account#config-dev-project).\n\n | **Note:** To use other accounts, first [add those accounts](https://cloud.google.com/iam/docs/granting-changing-revoking-access) to your Actions Console project as Owners.\n4. After you approve the permission request from the API, a code will appear\n in your browser, such as \"4/XXXX\". Copy and paste this code into the\n terminal:\n\n ```\n Enter the authorization code:\n ```\n\n If authorization was successful, you will see a response similar to\n the following: \n\n ```\n credentials saved: /path/to/.config/google-oauthlib-tool/credentials.json\n ```\n\n If instead you see `InvalidGrantError`, then an invalid code was entered.\n Try again, taking care to copy and paste the entire code.\n | **Note:** The authorization tool creates a new `credentials.json` file in a hidden `.config` directory on the device. This file contains an access token that is used to call the Google Assistant API.\n\nNext step\n---------\n\n[Run the Sample Code](/assistant/sdk/guides/service/python/embed/run-sample)"]]