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

Open
designersdecode opened this issue Aug 15, 2024 · 6 comments · May be fixed by #153
Open

AbortableAsyncIterator type export #135

designersdecode opened this issue Aug 15, 2024 · 6 comments · May be fixed by #153

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

hopperelec added a commit to hopperelec/ollama-js that referenced this issue Oct 18, 2024
@hopperelec hopperelec linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants