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

prototyping on observable #31

Open
trebor opened this issue Jun 24, 2024 · 9 comments
Open

prototyping on observable #31

trebor opened this issue Jun 24, 2024 · 9 comments

Comments

@trebor
Copy link

trebor commented Jun 24, 2024

  • I'm submitting a ...
    [x] feature request

  • Summary

i would love to use ax-llm in observable but sadly the module won't import. :(

https://observablehq.com/@observablehq/module-require-debugger?module=@ax-llm/ax

i'm not really sure why. i tried to fork and build my own module, but i am not a module expert, and couldn't figure it out.

@dosco
Copy link
Collaborator

dosco commented Jun 25, 2024

interesting will look into this do you know another package that does work will help me compare

@dosco
Copy link
Collaborator

dosco commented Jun 25, 2024

i'm looking into abstracting out fs so the library can work in browsers.

@trebor
Copy link
Author

trebor commented Jun 25, 2024

thank you for the quick response!

as an example, i found a very small module that imports properly, see:

https://observablehq.com/@trebor/filled-array-example

i didn't realize ax was hitting the file system, so that suddenly sounds like more work than i had thought.

@dosco
Copy link
Collaborator

dosco commented Jun 26, 2024

no worries happy to get it working in browsers

@dosco
Copy link
Collaborator

dosco commented Jul 6, 2024

Latest release seems to pass the test on this link https://observablehq.com/@observablehq/module-require-debugger?module=@ax-llm/ax let me know if it works for you.

@trebor
Copy link
Author

trebor commented Jul 6, 2024

fantastic! i'll give it a go today, thank you!

@trebor
Copy link
Author

trebor commented Jul 6, 2024

sadly it is not working. i'm not 100% sure what's going on, but clicking on the error in the browser it looks like problems occur before these assets are exported.

skypack has a maybe useful hint:

https://cdn.skypack.dev/error/build:@ax-llm/[email protected]

this is my test notebook:

https://observablehq.com/@trebor-labs/test-ax-llm-ax

the __createBinding and __exportStar are red herrings from typescript as far as i can see.

@dosco
Copy link
Collaborator

dosco commented Jul 16, 2024

according to their debugger this works, gonna continue to look into it I think it's got to do with how we override static fields in AxBaseAI.

https://observablehq.com/@observablehq/module-require-debugger?module=@ax-llm/ax

require('@ax-llm/[email protected]/cjs/index.js').catch(() => window["__createBinding"]);

@trebor
Copy link
Author

trebor commented Jul 18, 2024

sadly this still doesn't doesn't work.

i've updated my test notebook.

if you look in the console you can click through and see that 'exports' is not defined, and this is before any of the sub modules are imported. it's transpiled code so it's not fun to read. :(

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

No branches or pull requests

2 participants