Skip to main content

package to handle interacting with ai or llms

Project description

Microsoft Teams SDK

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.0a20.tar.gz (8.1 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.0a20-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for microsoft_teams_ai-2.0.0a20.tar.gz
Algorithm Hash digest
SHA256 46dbb4db23ec645277b2def5f0363f8fb165dca48ab7e82de9604aa9f9aa75be
MD5 8b57535edc95f56940d801837aa47097
BLAKE2b-256 f93c30178097b90bf2a76d501bcc0888fa3ae8b8f031a0cb2da71f97b9460fa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a20-py3-none-any.whl
Algorithm Hash digest
SHA256 06a07398da39f5f886ae9472beb0065cf2d866b6b82c5f0e60d106c0553dfe73
MD5 ff401ac11ba73e919b0035e526dc77e2
BLAKE2b-256 3339bf6b61b4c818861c97b1058ca34cec21c58881624c6cfc5dacfdb7d7dc8d

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