Skip to main content

Integration library for Microsoft Agents with Slack

Project description

Microsoft Agents Hosting - Slack

PyPI version

Integration library for building Slack agents using the Microsoft 365 Agents SDK. Provides direct-to-Slack responses (the full Slack Web API surface, beyond what Azure Bot Service exposes), a typed SlackChannelData envelope with dot-notation property access, and a SlackStream helper for chat.startStream / chat.appendStream / chat.stopStream.

Installation

pip install microsoft-agents-hosting-slack

Usage

from microsoft_agents.hosting.core.app import AgentApplication
from microsoft_agents.hosting.slack import SlackAgentExtension
from microsoft_agents.hosting.slack.api import SlackChannelData

app = AgentApplication(options)
slack = SlackAgentExtension(app)

@slack.on_message()
async def on_slack_message(context, state):
    channel_data = SlackChannelData.from_activity(context.activity)
    await slack.call(
        context,
        "chat.postMessage",
        {
            "channel": channel_data.get("event.channel"),
            "text": f"You said: {context.activity.text}",
        },
        token=channel_data.api_token,
    )

Key Classes

  • SlackAgentExtension — registers Slack-channel-scoped message/event handlers; exposes call(...) and create_stream(...).
  • SlackChannelData — typed wrapper around Bot Service's Slack channel-data payload with get(path) / try_get(path) accessors.
  • SlackApi — async HTTP client for the Slack Web API.
  • SlackStream — wraps Slack's streaming methods for incremental message updates.
  • SlackHelpers — encode/decode and conversation-id parsing utilities.

Quick Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microsoft_agents_hosting_slack-1.1.0.dev7.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file microsoft_agents_hosting_slack-1.1.0.dev7.tar.gz.

File metadata

File hashes

Hashes for microsoft_agents_hosting_slack-1.1.0.dev7.tar.gz
Algorithm Hash digest
SHA256 680d95967e2843eb00fce23cfc26622860da696230c0f7ae13b2534d7fa2313d
MD5 8fb249db25df910da262203d8388590d
BLAKE2b-256 a51be5313c891dcd7434c09f9de5178ce22fc9c9e5e12dfef46e1429b3c03ea3

See more details on using hashes here.

File details

Details for the file microsoft_agents_hosting_slack-1.1.0.dev7-py3-none-any.whl.

File metadata

File hashes

Hashes for microsoft_agents_hosting_slack-1.1.0.dev7-py3-none-any.whl
Algorithm Hash digest
SHA256 de6ba6874349adb8b94b047c3a0e095839643bed99e1b0fcf74f9278874f149e
MD5 d730408d22831ee297042aa2a3f56083
BLAKE2b-256 cd224b69d41bbcda79c42c79d29206fb1d1b4f98d743cdb4958791df73369d63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page