Skip to content

Commit

Permalink
Merge branch 'main' into rysweet-refactor-4670-rename-Abstractions-to…
Browse files Browse the repository at this point in the history
…-Contracts
  • Loading branch information
rysweet committed Dec 13, 2024
2 parents c75ec80 + 7d4bf9b commit ff49e70
Show file tree
Hide file tree
Showing 13 changed files with 1,132 additions and 295 deletions.
9 changes: 1 addition & 8 deletions dotnet/src/Microsoft.AutoGen/Agents/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.AutoGen.Agents;

public abstract class Agent : IDisposable, IHandle
public abstract class Agent : IHandle
{
public static readonly ActivitySource s_source = new("AutoGen.Agent");
public AgentId AgentId => _runtime.AgentId;
Expand All @@ -22,8 +22,6 @@ public abstract class Agent : IDisposable, IHandle

private readonly Channel<object> _mailbox = Channel.CreateUnbounded<object>();
private readonly IAgentRuntime _runtime;
public string Route { get; set; } = "base";

protected internal ILogger<Agent> _logger;
public IAgentRuntime Context => _runtime;
protected readonly EventTypes EventTypes;
Expand Down Expand Up @@ -343,9 +341,4 @@ public async ValueTask PublishEventAsync(string topic, IMessage evt, Cancellatio
{
await PublishEventAsync(evt.ToCloudEvent(topic), cancellationToken).ConfigureAwait(false);
}

public void Dispose()
{
throw new NotImplementedException();
}
}
2 changes: 1 addition & 1 deletion dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal sealed class AgentRuntime(AgentId agentId, IAgentWorker worker, ILogger
private readonly IAgentWorker worker = worker;

public AgentId AgentId { get; } = agentId;
public ILogger<Agent> Logger { get; } = logger;
private ILogger<Agent> Logger { get; } = logger;
public Agent? AgentInstance { get; set; }
private DistributedContextPropagator DistributedContextPropagator { get; } = distributedContextPropagator;
public (string?, string?) GetTraceIdAndState(IDictionary<string, string> metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Microsoft.AutoGen.Agents;

public interface IHandleConsole : IHandle<Output>, IHandle<Input>
{
string Route { get; }
AgentId AgentId { get; }
ValueTask PublishMessageAsync<T>(T message, string? source = null, CancellationToken token = default) where T : IMessage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static class HostBuilderExtensions

public static IHostApplicationBuilder AddAgent<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TAgent>(this IHostApplicationBuilder builder, string typeName) where TAgent : Agent
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TAgent>(this IHostApplicationBuilder builder, string typeName) where TAgent : Agent
{
builder.Services.AddKeyedSingleton("AgentTypes", (sp, key) => Tuple.Create(typeName, typeof(TAgent)));

Expand Down
7 changes: 6 additions & 1 deletion python/packages/autogen-ext/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ web-surfer = [
"autogen-agentchat==0.4.0.dev11",
"playwright>=1.48.0",
"pillow>=11.0.0",
"markitdown>=0.0.1a2",
]
magentic-one = [
"autogen-agentchat==0.4.0.dev11",
Expand Down Expand Up @@ -77,7 +78,11 @@ testpaths = ["tests"]
include = "../../shared_tasks.toml"

[tool.poe.tasks]
test = "pytest -n auto"
test.sequence = [
"playwright install",
"pytest -n auto",
]
test.default_item_type = "cmd"
mypy = "mypy --config-file ../../pyproject.toml --exclude src/autogen_ext/runtimes/grpc/protos --exclude tests/protos src tests"

[tool.mypy]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ._multimodal_web_surfer import MultimodalWebSurfer
from .playwright_controller import PlaywrightController

__all__ = ["MultimodalWebSurfer"]
__all__ = ["MultimodalWebSurfer", "PlaywrightController"]

Large diffs are not rendered by default.

Loading

0 comments on commit ff49e70

Please sign in to comment.