Skip to content

Dynamic proxies for agents #76

@bojidar-bg

Description

@bojidar-bg

It might be nice to have a dynamic proxy for IAgent-s, so that code which uses a remote agent is cleaner.
For example, this would allow writing:

dynamic agentProxy = ...;
Assert.Equals((int)await agentProxy.Neg(1), -1);
Assert.Equals((int)await agent.Add(1, 2), 3);
await agent.Print("test");

instead of:

IAgent agent = ...;
Assert.Equals(await agent.CallFunctionAsync<int>("Neg", 1), -1);
Assert.Equals(await agent.CallFunctionAsync<int>("Add", (1, 2)), 3);
await agent.CallActionAsync<int>("Print", "test")

(Note that for return types, we should probably use a second dynamic proxy as outlined in this StackOverflow question; see also #75)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions