Skip to content

Allow passing external AbortSignal to chat and generate methods #274

@abhijeetsharma7

Description

@abhijeetsharma7

Currently, ollama.chat() and ollama.generate() create their own internal AbortController.
The only way to abort is via stream.abort() or ollama.abort(), but these don't provide instant response - the async iterator continues waiting for the server.

This introduces lag on the UI side where the feedback is not instant after abort.

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