Skip to content

Commit

Permalink
feat: add streaming for cea basic bot py and upgrade dependencies (#1…
Browse files Browse the repository at this point in the history
…3173)

* feat: enable streaming response in supported CEA templates

* feat: enable streaming response in supported CEA templates

* refactor: upgrade teams-ai dependency

* fix: remove extra codes

* fix: remove extra import
  • Loading branch information
frankqianms authored Feb 12, 2025
1 parent be209a8 commit 5e56288
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python-dotenv
aiohttp
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python-dotenv
aiohttp
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0
8 changes: 7 additions & 1 deletion templates/python/custom-copilot-basic/src/bot.py.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ model = OpenAIModel(
api_key=config.AZURE_OPENAI_API_KEY,
default_model=config.AZURE_OPENAI_MODEL_DEPLOYMENT_NAME,
endpoint=config.AZURE_OPENAI_ENDPOINT,
{{#CEAEnabled}}
stream=True,
{{/CEAEnabled}}
)
)
{{/useAzureOpenAI}}
Expand All @@ -34,10 +37,13 @@ model = OpenAIModel(
OpenAIModelOptions(
api_key=config.OPENAI_API_KEY,
default_model=config.OPENAI_MODEL_NAME,
{{#CEAEnabled}}
stream=True,
{{/CEAEnabled}}
)
)
{{/useOpenAI}}

prompts = PromptManager(PromptManagerOptions(prompts_folder=f"{os.getcwd()}/prompts"))

planner = ActionPlanner(
Expand Down
2 changes: 1 addition & 1 deletion templates/python/custom-copilot-basic/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python-dotenv
aiohttp
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python-dotenv
aiohttp
azure-search
azure-search-documents
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
python-dotenv
aiohttp
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0
requests~=2.32.3
pyyaml~=6.0.1
openapi-pydantic~=0.4.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python-dotenv
aiohttp
teams-ai>=1.4.0,<2.0.0
teams-ai>=1.6.0,<2.0.0

0 comments on commit 5e56288

Please sign in to comment.