microsoft-agents-m365copilot-beta


Namemicrosoft-agents-m365copilot-beta JSON
Version 1.0.0rc4 PyPI version JSON
download
home_pageNone
SummaryMicrosoft Agents M365 Copilot Python SDK (Beta)
upload_time2025-07-16 22:39:08
maintainerMicrosoft
docs_urlNone
authorMicrosoft
requires_python<4.0,>=3.9
licenseMIT
keywords copilot openapi microsoft m365 beta
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Microsoft 365 Copilot APIs Python Beta Client Library

Integrate the Microsoft 365 Copilot APIs into your Python application!

> **Note:**
>
> Because the Copilot APIs in the beta endpoint are subject to breaking changes, don't use a preview release of the client libraries in production apps.

## Installation

To install the client libraries via PyPi:

```shell
pip install microsoft-agents-m365copilot-beta
```

## Create a Copilot APIs client and make an API call

The following code example shows how to create an instance of a Microsoft 365 Copilot APIs client with an authentication provider in the supported languages. The authentication provider handles acquiring access tokens for the application. Many different authentication providers are available for each language and platform. The different authentication providers support different client scenarios. For details about which provider and options are appropriate for your scenario, see [Choose an Authentication Provider](https://learn.microsoft.com/graph/sdks/choose-authentication-providers). 

The example also shows how to make a call to the Microsoft 365 Copilot Retrieval API. To call this API, you first need to create a request object and then run the POST method on the request.

The client ID is the app registration ID that is generated when you [register your app in the Azure portal](https://learn.microsoft.com/graph/auth-register-app-v2).

> **Note:**
>    
> Your tenant must have a Microsoft 365 Copilot license.

```TypeScript
import { createBaseAgentsM365CopilotBetaServiceClient, RetrievalDataSourceObject } from '@microsoft/agents-m365copilot-beta';
import { DeviceCodeCredential } from '@azure/identity';
import { FetchRequestAdapter } from '@microsoft/kiota-http-fetchlibrary';

async function main() {
    // Initialize authentication with Device Code flow
    const credential = new DeviceCodeCredential({
        tenantId: process.env.TENANT_ID,
        clientId: process.env.CLIENT_ID,
        userPromptCallback: (info) => {
            console.log(`\nTo sign in, use a web browser to open the page ${info.verificationUri}`);
            console.log(`Enter the code ${info.userCode} to authenticate.`);
            console.log(`The code will expire at ${info.expiresOn}`);
        }
    });

    // Create request adapter with auth
    const adapter = new FetchRequestAdapter(credential, {
        scopes: ['https://graph.microsoft.com/.default']
    });
    adapter.baseUrl = "https://graph.microsoft.com/beta";

    // Create client instance
    const client = createBaseAgentsM365CopilotBetaServiceClient(adapter);

    try {
        console.log(`Using API base URL: ${adapter.baseUrl}\n`);

        // Create the retrieval request body
        const retrievalBody = {
            dataSource: RetrievalDataSourceObject.SharePoint,
            queryString: "What is the latest in my organization"
        };

        // Make the API call
        console.log("Making retrieval API request...");
        const retrieval = await client.copilot.retrieval.post(retrievalBody);

        // Process the results
        if (retrieval?.retrievalHits) {
            console.log(`\nReceived ${retrieval.retrievalHits.length} hits`);
            for (const hit of retrieval.retrievalHits) {
                console.log(`\nWeb URL: ${hit.webUrl}`);
                for (const extract of hit.extracts || []) {
                    console.log(`Text:\n${extract.text}\n`);
                }
            }
        }
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}
```

## Issues

View or log issues on the [Issues](https://github.com/microsoft/Agents-M365Copilot/issues) tab in the repo and tag them as `python` or `python-core`.

## Copyright and license

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT [license](https://github.com/microsoft/Agents-M365Copilot/tree/main/typescript/LICENSE).

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "microsoft-agents-m365copilot-beta",
    "maintainer": "Microsoft",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "graphtooling+ccspython@microsoft.com",
    "keywords": "copilot, openAPI, Microsoft, M365, Beta",
    "author": "Microsoft",
    "author_email": "graphtooling+ccspython@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/04/23/c270bc7ab4e07142ac2c05deeff39c3d9cc1a3a5c1d0a88585f1a5d3dc6d/microsoft_agents_m365copilot_beta-1.0.0rc4.tar.gz",
    "platform": null,
    "description": "# Microsoft 365 Copilot APIs Python Beta Client Library\n\nIntegrate the Microsoft 365 Copilot APIs into your Python application!\n\n> **Note:**\n>\n> Because the Copilot APIs in the beta endpoint are subject to breaking changes, don't use a preview release of the client libraries in production apps.\n\n## Installation\n\nTo install the client libraries via PyPi:\n\n```shell\npip install microsoft-agents-m365copilot-beta\n```\n\n## Create a Copilot APIs client and make an API call\n\nThe following code example shows how to create an instance of a Microsoft 365 Copilot APIs client with an authentication provider in the supported languages. The authentication provider handles acquiring access tokens for the application. Many different authentication providers are available for each language and platform. The different authentication providers support different client scenarios. For details about which provider and options are appropriate for your scenario, see [Choose an Authentication Provider](https://learn.microsoft.com/graph/sdks/choose-authentication-providers). \n\nThe example also shows how to make a call to the Microsoft 365 Copilot Retrieval API. To call this API, you first need to create a request object and then run the POST method on the request.\n\nThe client ID is the app registration ID that is generated when you [register your app in the Azure portal](https://learn.microsoft.com/graph/auth-register-app-v2).\n\n> **Note:**\n>    \n> Your tenant must have a Microsoft 365 Copilot license.\n\n```TypeScript\nimport { createBaseAgentsM365CopilotBetaServiceClient, RetrievalDataSourceObject } from '@microsoft/agents-m365copilot-beta';\nimport { DeviceCodeCredential } from '@azure/identity';\nimport { FetchRequestAdapter } from '@microsoft/kiota-http-fetchlibrary';\n\nasync function main() {\n    // Initialize authentication with Device Code flow\n    const credential = new DeviceCodeCredential({\n        tenantId: process.env.TENANT_ID,\n        clientId: process.env.CLIENT_ID,\n        userPromptCallback: (info) => {\n            console.log(`\\nTo sign in, use a web browser to open the page ${info.verificationUri}`);\n            console.log(`Enter the code ${info.userCode} to authenticate.`);\n            console.log(`The code will expire at ${info.expiresOn}`);\n        }\n    });\n\n    // Create request adapter with auth\n    const adapter = new FetchRequestAdapter(credential, {\n        scopes: ['https://graph.microsoft.com/.default']\n    });\n    adapter.baseUrl = \"https://graph.microsoft.com/beta\";\n\n    // Create client instance\n    const client = createBaseAgentsM365CopilotBetaServiceClient(adapter);\n\n    try {\n        console.log(`Using API base URL: ${adapter.baseUrl}\\n`);\n\n        // Create the retrieval request body\n        const retrievalBody = {\n            dataSource: RetrievalDataSourceObject.SharePoint,\n            queryString: \"What is the latest in my organization\"\n        };\n\n        // Make the API call\n        console.log(\"Making retrieval API request...\");\n        const retrieval = await client.copilot.retrieval.post(retrievalBody);\n\n        // Process the results\n        if (retrieval?.retrievalHits) {\n            console.log(`\\nReceived ${retrieval.retrievalHits.length} hits`);\n            for (const hit of retrieval.retrievalHits) {\n                console.log(`\\nWeb URL: ${hit.webUrl}`);\n                for (const extract of hit.extracts || []) {\n                    console.log(`Text:\\n${extract.text}\\n`);\n                }\n            }\n        }\n    } catch (error) {\n        console.error('Error:', error);\n        throw error;\n    }\n}\n```\n\n## Issues\n\nView or log issues on the [Issues](https://github.com/microsoft/Agents-M365Copilot/issues) tab in the repo and tag them as `python` or `python-core`.\n\n## Copyright and license\n\nCopyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT [license](https://github.com/microsoft/Agents-M365Copilot/tree/main/typescript/LICENSE).\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Microsoft Agents M365 Copilot Python SDK (Beta)",
    "version": "1.0.0rc4",
    "project_urls": {
        "Documentation": "https://github.com/microsoft/Agents-M365Copilot/tree/main/python/packages/microsoft_agents_m365copilot_beta#readme",
        "Homepage": "https://github.com/microsoft/Agents-M365Copilot/tree/main/python",
        "Repository": "https://github.com/microsoft/Agents-M365Copilot"
    },
    "split_keywords": [
        "copilot",
        " openapi",
        " microsoft",
        " m365",
        " beta"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1faf978d19123e9779ddf011ce4956eae6e5b9eb2f2bb41125e7251bf054236f",
                "md5": "b09d9d6c092a868ce95591a3bc857b1e",
                "sha256": "2b9fe350096d0b50edfc4636c41a42b17e2b3d2d81db8740c8aa36f67ba4d4ea"
            },
            "downloads": -1,
            "filename": "microsoft_agents_m365copilot_beta-1.0.0rc4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b09d9d6c092a868ce95591a3bc857b1e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 133888,
            "upload_time": "2025-07-16T22:39:10",
            "upload_time_iso_8601": "2025-07-16T22:39:10.038836Z",
            "url": "https://files.pythonhosted.org/packages/1f/af/978d19123e9779ddf011ce4956eae6e5b9eb2f2bb41125e7251bf054236f/microsoft_agents_m365copilot_beta-1.0.0rc4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0423c270bc7ab4e07142ac2c05deeff39c3d9cc1a3a5c1d0a88585f1a5d3dc6d",
                "md5": "a097cb5afd63c91549b5ddc54e57c6d8",
                "sha256": "d482911d6dcbabdd88088fc8722e6a1f43fc1cebac707740bb8f5ef7af814a2c"
            },
            "downloads": -1,
            "filename": "microsoft_agents_m365copilot_beta-1.0.0rc4.tar.gz",
            "has_sig": false,
            "md5_digest": "a097cb5afd63c91549b5ddc54e57c6d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 33195,
            "upload_time": "2025-07-16T22:39:08",
            "upload_time_iso_8601": "2025-07-16T22:39:08.934017Z",
            "url": "https://files.pythonhosted.org/packages/04/23/c270bc7ab4e07142ac2c05deeff39c3d9cc1a3a5c1d0a88585f1a5d3dc6d/microsoft_agents_m365copilot_beta-1.0.0rc4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-16 22:39:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microsoft",
    "github_project": "Agents-M365Copilot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "microsoft-agents-m365copilot-beta"
}
        
Elapsed time: 1.36286s