-
Notifications
You must be signed in to change notification settings - Fork 56
Description
When ChannelServiceAdapter#create_conversation is called, TypeError("TurnContext must be instantiated with a request parameter of type Activity.") is raised.
More detail:
In libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py#create_conversation, it calls self._create_turn_context without specifying activity.
In _create_turn_context the default value is None for activity, and it uses that to initialize TurnContext
In the TurnContext initializer, it has the following check
if self.activity is None:
raise TypeError(
"TurnContext must be instantiated with a request parameter of type Activity."
)
My 2 cents:
ChannelServiceAdapter#_create_turn_context should require an Activity rather than having one be optional
The bug was introduced in PR 137 https://github.com/microsoft/Agents-for-python/pull/137/files#diff-935f31e7436a6b94b74346a295724e8c816f07b2eecbd3c6b115a59c2e747391