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

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.0a5.tar.gz (7.7 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.0a5-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a5.tar.gz
Algorithm Hash digest
SHA256 582bb2cb87dc1a46dcb2bfb76224c8fc6438863bfe1d58c99d9c32ab9353a363
MD5 b60a28c9766920928e73618cd1324dae
BLAKE2b-256 185b0e9e01f863b3cc5b9661298d206303ca7b87576e147f487fc6c044fe6026

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 a8fc7d2ee1f2cd2b55cd40efdc61e85c681963a1ab279263c3ae51efd3376fee
MD5 c26be17860cc327b875c2d22af140af9
BLAKE2b-256 f1601ed4a4c74d3dce56da9fb958e16a1d11bd9599c6919722eb88359c255495

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