Skip to content

Commit 586c98f

Browse files
authored
Merge branch 'main' into lpinheiro/chore/remove-deprecated-code
2 parents 46f7e0b + 232068a commit 586c98f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dotnet/src/Microsoft.AutoGen/Agents/Services/Orleans/SubscriptionsGrain.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ namespace Microsoft.AutoGen.Agents;
66
internal sealed class SubscriptionsGrain([PersistentState("state", "PubSubStore")] IPersistentState<SubscriptionsState> state) : Grain, ISubscriptionsGrain
77
{
88
private readonly Dictionary<string, List<string>> _subscriptions = new();
9-
public ValueTask<Dictionary<string, List<string>>> GetSubscriptions(string agentType)
9+
public ValueTask<Dictionary<string, List<string>>> GetSubscriptions(string? agentType = null)
1010
{
11+
//if agentType is null, return all subscriptions else filter on agentType
12+
if (agentType != null)
13+
{
14+
return new ValueTask<Dictionary<string, List<string>>>(_subscriptions.Where(x => x.Value.Contains(agentType)).ToDictionary(x => x.Key, x => x.Value));
15+
}
1116
return new ValueTask<Dictionary<string, List<string>>>(_subscriptions);
1217
}
1318
public ValueTask Subscribe(string agentType, string topic)

python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ async def on_messages_stream(
279279
return
280280

281281
# Generate an inference result based on the current model context.
282+
llm_messages = self._system_messages + self._model_context
282283
result = await self._model_client.create(
283-
self._model_context, tools=self._tools + self._handoff_tools, cancellation_token=cancellation_token
284+
llm_messages, tools=self._tools + self._handoff_tools, cancellation_token=cancellation_token
284285
)
285286
self._model_context.append(AssistantMessage(content=result.content, source=self.name))
286287

0 commit comments

Comments
 (0)