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.0a9.tar.gz (7.8 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.0a9-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a9.tar.gz
Algorithm Hash digest
SHA256 82909d1e4c09118ea26df11a1f0aa12f47088d2c3488bbb250b974f7e917efa3
MD5 ce0f7b78ca081f97347ff9495b59e5d8
BLAKE2b-256 8524f769689019eeb25c135a35d0c5096f450fcde15ca692f8933f76b0013dd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for microsoft_teams_ai-2.0.0a9-py3-none-any.whl
Algorithm Hash digest
SHA256 7182ea87e020e9487f156e85c1709623a174f935933a04fa5dd860f9c420796a
MD5 ee813fc8848ac8ec4200026dc1709cb0
BLAKE2b-256 bd76b3609810630e78ad2822a19e858889c15a968486374dbadf35337f6c6c8e

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