diff --git a/python/packages/ai/pyproject.toml b/python/packages/ai/pyproject.toml index 57ad0024e..4bc50834d 100644 --- a/python/packages/ai/pyproject.toml +++ b/python/packages/ai/pyproject.toml @@ -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 "] readme = "README.md" diff --git a/python/packages/ai/teams/ai/planners/assistants_planner.py b/python/packages/ai/teams/ai/planners/assistants_planner.py index 057d6de46..877490114 100644 --- a/python/packages/ai/teams/ai/planners/assistants_planner.py +++ b/python/packages/ai/teams/ai/planners/assistants_planner.py @@ -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." diff --git a/python/packages/ai/tests/ai/models/test_openai_model.py b/python/packages/ai/tests/ai/models/test_openai_model.py index f385d6485..0cf3525ed 100644 --- a/python/packages/ai/tests/ai/models/test_openai_model.py +++ b/python/packages/ai/tests/ai/models/test_openai_model.py @@ -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 @@ -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): @@ -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): @@ -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): diff --git a/python/packages/ai/tests/ai/planners/test_assistants_planner.py b/python/packages/ai/tests/ai/planners/test_assistants_planner.py index 94d020f50..118f8b62a 100644 --- a/python/packages/ai/tests/ai/planners/test_assistants_planner.py +++ b/python/packages/ai/tests/ai/planners/test_assistants_planner.py @@ -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) @@ -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( diff --git a/python/samples/01.messaging.a.echoBot/pyproject.toml b/python/samples/01.messaging.a.echoBot/pyproject.toml index 210e328d8..be237c8f6 100644 --- a/python/samples/01.messaging.a.echoBot/pyproject.toml +++ b/python/samples/01.messaging.a.echoBot/pyproject.toml @@ -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" diff --git a/python/samples/02.messageExtensions.a.searchCommand/pyproject.toml b/python/samples/02.messageExtensions.a.searchCommand/pyproject.toml index 15b8f836c..b4cb7597c 100644 --- a/python/samples/02.messageExtensions.a.searchCommand/pyproject.toml +++ b/python/samples/02.messageExtensions.a.searchCommand/pyproject.toml @@ -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] diff --git a/python/samples/03.adaptiveCards.a.typeAheadBot/pyproject.toml b/python/samples/03.adaptiveCards.a.typeAheadBot/pyproject.toml index 78896441c..008cde12b 100644 --- a/python/samples/03.adaptiveCards.a.typeAheadBot/pyproject.toml +++ b/python/samples/03.adaptiveCards.a.typeAheadBot/pyproject.toml @@ -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] diff --git a/python/samples/04.ai.a.twentyQuestions/pyproject.toml b/python/samples/04.ai.a.twentyQuestions/pyproject.toml index 214d9a61d..d618c1387 100644 --- a/python/samples/04.ai.a.twentyQuestions/pyproject.toml +++ b/python/samples/04.ai.a.twentyQuestions/pyproject.toml @@ -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] diff --git a/python/samples/04.ai.b.messageExtensions.AI-ME/pyproject.toml b/python/samples/04.ai.b.messageExtensions.AI-ME/pyproject.toml index 210e328d8..be237c8f6 100644 --- a/python/samples/04.ai.b.messageExtensions.AI-ME/pyproject.toml +++ b/python/samples/04.ai.b.messageExtensions.AI-ME/pyproject.toml @@ -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" diff --git a/python/samples/04.ai.c.actionMapping.lightBot/pyproject.toml b/python/samples/04.ai.c.actionMapping.lightBot/pyproject.toml index 53bc1056d..e3a7248cd 100644 --- a/python/samples/04.ai.c.actionMapping.lightBot/pyproject.toml +++ b/python/samples/04.ai.c.actionMapping.lightBot/pyproject.toml @@ -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] diff --git a/python/samples/04.ai.d.chainedActions.listBot/pyproject.toml b/python/samples/04.ai.d.chainedActions.listBot/pyproject.toml index e34c4247f..81337285d 100644 --- a/python/samples/04.ai.d.chainedActions.listBot/pyproject.toml +++ b/python/samples/04.ai.d.chainedActions.listBot/pyproject.toml @@ -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] diff --git a/python/samples/04.ai.e.chainedActions.devOpsBot/pyproject.toml b/python/samples/04.ai.e.chainedActions.devOpsBot/pyproject.toml index 7f581f719..82469e447 100644 --- a/python/samples/04.ai.e.chainedActions.devOpsBot/pyproject.toml +++ b/python/samples/04.ai.e.chainedActions.devOpsBot/pyproject.toml @@ -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] diff --git a/python/samples/04.ai.f.dataSource.azureOpenAI/pyproject.toml b/python/samples/04.ai.f.dataSource.azureOpenAI/pyproject.toml index 1c4b9beaf..aafe3ecda 100644 --- a/python/samples/04.ai.f.dataSource.azureOpenAI/pyproject.toml +++ b/python/samples/04.ai.f.dataSource.azureOpenAI/pyproject.toml @@ -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" diff --git a/python/samples/04.ai.g.autogen.product-spec-critique/pyproject.toml b/python/samples/04.ai.g.autogen.product-spec-critique/pyproject.toml index 606188830..7a895ce69 100644 --- a/python/samples/04.ai.g.autogen.product-spec-critique/pyproject.toml +++ b/python/samples/04.ai.g.autogen.product-spec-critique/pyproject.toml @@ -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" diff --git a/python/samples/04.ai.h.chainedActions.listBot-streaming/pyproject.toml b/python/samples/04.ai.h.chainedActions.listBot-streaming/pyproject.toml index c1ac9c0cc..81337285d 100644 --- a/python/samples/04.ai.h.chainedActions.listBot-streaming/pyproject.toml +++ b/python/samples/04.ai.h.chainedActions.listBot-streaming/pyproject.toml @@ -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] diff --git a/python/samples/05.chatModeration/pyproject.toml b/python/samples/05.chatModeration/pyproject.toml index 53bc1056d..e3a7248cd 100644 --- a/python/samples/05.chatModeration/pyproject.toml +++ b/python/samples/05.chatModeration/pyproject.toml @@ -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] diff --git a/python/samples/06.assistants.a.mathBot/pyproject.toml b/python/samples/06.assistants.a.mathBot/pyproject.toml index 5cb2b2661..6d9e852df 100644 --- a/python/samples/06.assistants.a.mathBot/pyproject.toml +++ b/python/samples/06.assistants.a.mathBot/pyproject.toml @@ -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" diff --git a/python/samples/06.assistants.b.orderBot/pyproject.toml b/python/samples/06.assistants.b.orderBot/pyproject.toml index 921f01bfb..883ff7bd7 100644 --- a/python/samples/06.assistants.b.orderBot/pyproject.toml +++ b/python/samples/06.assistants.b.orderBot/pyproject.toml @@ -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" diff --git a/python/samples/06.auth.oauth.bot/pyproject.toml b/python/samples/06.auth.oauth.bot/pyproject.toml index b2779997a..4614a0658 100644 --- a/python/samples/06.auth.oauth.bot/pyproject.toml +++ b/python/samples/06.auth.oauth.bot/pyproject.toml @@ -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" diff --git a/python/samples/06.auth.oauth.messageExtensions/pyproject.toml b/python/samples/06.auth.oauth.messageExtensions/pyproject.toml index 2c8109845..23bfa9fa6 100644 --- a/python/samples/06.auth.oauth.messageExtensions/pyproject.toml +++ b/python/samples/06.auth.oauth.messageExtensions/pyproject.toml @@ -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] diff --git a/python/samples/07.planners.a.langchain/pyproject.toml b/python/samples/07.planners.a.langchain/pyproject.toml index bb3697391..a41aee0d8 100644 --- a/python/samples/07.planners.a.langchain/pyproject.toml +++ b/python/samples/07.planners.a.langchain/pyproject.toml @@ -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"