Skip to content

Commit

Permalink
[PY] bump: minor bump to 1.5.0 (#2158)
Browse files Browse the repository at this point in the history
## Linked issues

closes: #minor

## Details

- Package update and sample updates

## Attestation Checklist

- [x] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (updating the
doc strings in the code is sufficient)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
  - Local testing
  - E2E testing in Teams
- New and existing unit tests pass locally with my changes
  • Loading branch information
lilyydu authored Oct 31, 2024
1 parent ec81697 commit ddb7332
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 39 deletions.
2 changes: 1 addition & 1 deletion python/packages/ai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "teams-ai"
version = "1.4.1"
version = "1.5.0"
description = "SDK focused on building AI based applications for Microsoft Teams."
authors = ["Microsoft <[email protected]>"]
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions python/packages/ai/teams/ai/planners/assistants_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AzureOpenAIAssistantsOptions:
"""
Options for configuring the AssistantsPlanner for AzureOpenAI.
"""

default_model: str
"Default name of the Azure OpenAI deployment (model) to use."

Expand Down
24 changes: 6 additions & 18 deletions python/packages/ai/tests/ai/models/test_openai_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ class MockAsyncCompletions:
has_tool_calls = False
create_params = None

def __init__(
self, should_error=False, has_tool_call=False, has_tool_calls=False
) -> None:
def __init__(self, should_error=False, has_tool_call=False, has_tool_calls=False) -> None:
self.should_error = should_error
self.has_tool_call = has_tool_call
self.has_tool_calls = has_tool_calls
Expand Down Expand Up @@ -315,9 +313,7 @@ async def test_o1_model_should_use_user_message_over_system_message(self, mock_a
self.assertTrue(mock_async_openai.called)
self.assertEqual(res.status, "success")
create_params = mock_async_openai.return_value.chat.completions.create_params
self.assertEqual(
create_params["messages"][0]["role"], "user"
)
self.assertEqual(create_params["messages"][0]["role"], "user")

@mock.patch("openai.AsyncOpenAI", return_value=MockAsyncOpenAI)
async def test_o1_model_should_use_max_completion_tokens_param(self, mock_async_openai):
Expand Down Expand Up @@ -348,12 +344,8 @@ async def test_o1_model_should_use_max_completion_tokens_param(self, mock_async_
self.assertTrue(mock_async_openai.called)
self.assertEqual(res.status, "success")
create_params = mock_async_openai.return_value.chat.completions.create_params
self.assertEqual(
create_params["max_completion_tokens"], 1000
)
self.assertEqual(
create_params["max_tokens"], openai.NOT_GIVEN
)
self.assertEqual(create_params["max_completion_tokens"], 1000)
self.assertEqual(create_params["max_tokens"], openai.NOT_GIVEN)

@mock.patch("openai.AsyncOpenAI", return_value=MockAsyncOpenAI)
async def test_non_o1_model_should_use_max_tokens_param(self, mock_async_openai):
Expand Down Expand Up @@ -384,12 +376,8 @@ async def test_non_o1_model_should_use_max_tokens_param(self, mock_async_openai)
self.assertTrue(mock_async_openai.called)
self.assertEqual(res.status, "success")
create_params = mock_async_openai.return_value.chat.completions.create_params
self.assertEqual(
create_params["max_tokens"], 1000
)
self.assertEqual(
create_params["max_completion_tokens"], openai.NOT_GIVEN
)
self.assertEqual(create_params["max_tokens"], 1000)
self.assertEqual(create_params["max_completion_tokens"], openai.NOT_GIVEN)

@mock.patch("openai.AsyncOpenAI", return_value=MockAsyncOpenAI)
async def test_should_succeed_on_prev_tool_calls(self, mock_async_openai):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ async def test_create_openai_assistant(self, mock_async_openai):
api_version="",
organization="",
endpoint="",
request=params
request=params,
)

self.assertTrue(mock_async_openai.called)
Expand All @@ -588,9 +588,11 @@ async def test_create_azure_openai_assistant(self, mock_async_azure_openai):
self.assertTrue(mock_async_azure_openai.called)
self.assertEqual(assistant.id, ASSISTANT_ID)
self.assertEqual(assistant.model, ASSISTANT_MODEL)

@mock.patch("openai.AsyncAzureOpenAI", return_value=MockAsyncOpenAI())
async def test_create_azure_openai_assistant_with_az_token_provider(self, mock_async_azure_openai):
async def test_create_azure_openai_assistant_with_az_token_provider(
self, mock_async_azure_openai
):
params = beta.AssistantCreateParams(model="123")

assistant = await AssistantsPlanner.create_assistant(
Expand Down
2 changes: 1 addition & 1 deletion python/samples/01.messaging.a.echoBot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python-dotenv = "^1.0.1"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion python/samples/04.ai.a.twentyQuestions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python-dotenv = "^1.0.1"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"
azure-identity = "^1.17.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = "<3.13,>=3.9"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"
pyautogen = "0.2.28"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = { path = "../../packages/ai", develop = true }
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion python/samples/05.chatModeration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion python/samples/06.assistants.a.mathBot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"
azure-identity = "^1.19.0"

Expand Down
2 changes: 1 addition & 1 deletion python/samples/06.assistants.b.orderBot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"
azure-identity = "^1.19.0"

Expand Down
2 changes: 1 addition & 1 deletion python/samples/06.auth.oauth.bot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python-dotenv = "^1.0.1"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python-dotenv = "^1.0.1"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
msgraph-sdk = "^1.2.0"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion python/samples/07.planners.a.langchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
teams-ai = "^1.2.2"
teams-ai = "^1.5.0"
python-dotenv = "^1.0.1"
langchain = "^0.2.10"
langchain-openai = "^0.1.8"
Expand Down

0 comments on commit ddb7332

Please sign in to comment.