Skip to main content

package to handle interacting with ai or llms

Project description

Microsoft Teams SDK

[!WARNING] Deprecated — This package was originally in preview, but we have decided to stop maintaining it before General Availability. We recommend using the Agent Framework instead, which provides better long-term support for building AI-powered Teams applications.

AI-powered conversational experiences for Microsoft Teams applications. Provides prompt management, action planning, and model integration for building intelligent Teams bots.

📖 Documentation

Installation

pip install microsoft-teams-ai

Or if using uv:

uv add microsoft-teams-ai

Usage

ChatPrompt

from microsoft_teams.ai import ChatPrompt, Function
from microsoft_teams.openai import OpenAICompletionsAIModel
from pydantic import BaseModel

model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4")

# Create a ChatPrompt
prompt = ChatPrompt(model)

result = await prompt.send(
    input="Hello!",
    instructions="You are a helpful assistant."
)

Function Calling

class GetWeatherParams(BaseModel):
    location: str

async def get_weather(params: GetWeatherParams) -> str:
    return f"The weather in {params.location} is sunny"

weather_function = Function(
    name="get_weather",
    description="Get weather for a location",
    parameter_schema=GetWeatherParams,
    handler=get_weather
)

prompt = ChatPrompt(model, functions=[weather_function])

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_teams_ai-2.0.0a78.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

microsoft_teams_ai-2.0.0a78-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file microsoft_teams_ai-2.0.0a78.tar.gz.

File metadata

  • Download URL: microsoft_teams_ai-2.0.0a78.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: RestSharp/106.13.0.0

File hashes

Hashes for microsoft_teams_ai-2.0.0a78.tar.gz
Algorithm Hash digest
SHA256 7e0c4902c7e99048583a52cc8f31cd756c0150fd808c7b7f74d5dce39e742024
MD5 572f44c246485d011fd0c6ef402f0a39
BLAKE2b-256 6c96fa6741973f68873c6a67fb7d8664bd85a469072ceacd2cc608956cdf53c3

See more details on using hashes here.

File details

Details for the file microsoft_teams_ai-2.0.0a78-py3-none-any.whl.

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a78-py3-none-any.whl
Algorithm Hash digest
SHA256 8bb866aaf022334d8e410d39a630c95e8821557a25451d65f4429b86b67dde36
MD5 1f9561f6c4f4dcacbf4540319da99ca9
BLAKE2b-256 a1a3b3333d0af8859055176d92a92d639094011b48b5211c359f489cc0472a5e

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