Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

can we call tools and return steaming output? #472

Copy link
Copy link
@guanyang-nb

Description

@guanyang-nb
Issue body actions

such as
@mcp.tool()
async def function(text: str):

url =URL

headers = {
    "User-Agent": USER_AGENT
}

async with httpx.AsyncClient() as client:
    try:
        async with client.stream("POST", url, headers=headers, json={"text": text}, timeout=100) as response:
            response.raise_for_status()
            async for chunk in response.aiter_bytes():
                yield chunk
    except Exception as e:
        print("error", e)
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.