Skip to content

Supports from streaming output #85

Description

As far as I can tell, I do not see support for streaming output.

Let’s consider the fowlloing use case:

    [Function(nameof(McpFunction))]
    public async Task<string> McpFunction(
        [McpToolTrigger("return_string", "returns the numbers in the Fibonacci sequence up to a given limit.")] ToolInvocationContext context,
        FunctionContext functionContext,
        CancellationToken cancellationToken
        )
    {

        return "1, 1, 2, 3, 5, 8, 13, 21";
    }

What If I want to stream the results up to a potentially unbounded limit?
I think this use case is not realistic, but it is really to drive the point home.

I would expect to be able to use ToolInvocationContext and from there, acquire some kind of SendResponseAsync(…)-ish method to the client, while the function is still running and computing results.

Am I missing something obvious ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions