Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbortableAsyncIterator type export #135

Closed
designersdecode opened this issue Aug 15, 2024 · 7 comments · Fixed by #157
Closed

AbortableAsyncIterator type export #135

designersdecode opened this issue Aug 15, 2024 · 7 comments · Fixed by #157

Comments

@designersdecode
Copy link

Hi,
It seems there is no type export for AbortableAsyncIterator class.

When I import:

import type { AbortableAsyncIterator } from "ollama";

It gives me a type error:

Module '"ollama"' has no exported member 'AbortableAsyncIterator'.
@hopperelec
Copy link
Contributor

I believe it's

import type { AbortableAsyncIterator } from "ollama/utils";

Although generally "utils" things are for internal use, so it might be worth moving it to index.ts

@designersdecode
Copy link
Author

import type { AbortableAsyncIterator } from "ollama/utils"; doesn't work, either.

@hopperelec
Copy link
Contributor

hopperelec commented Aug 15, 2024

Hm, I thought this line in the package.json would export utils, but I must be misunderstanding.

"./*": "./*"

Regardless, it probably makes more sense to define AbortableAsyncIterator in index.ts instead of utils.ts. I'd like another maintainers opinion on this first, though, in case it's better suited in an entirely different file.

Thanks for bringing this to our attention!

@gatlin
Copy link

gatlin commented Aug 24, 2024

I can confirm this is an issue as well. It seems clear that the intent was to export AbortableAsyncIterator but I get the exact same errors and behavior @designersdecode reported above.

@hammer-ai
Copy link

This is still an error for me, would be very useful to export the type if possible! Thanks!

@hopperelec
Copy link
Contributor

Since it doesn't look like I'm getting a maintainer's approval any time soon, I'll just create a PR now and see if it gets accepted

@ParthSareen
Copy link
Contributor

We've given it some thought and think it is best if stream management is done by the user. We'll move forward with 1 client per stream at the moment. I've updated the examples in here - would also love your thoughts 😄
#157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants