microsoft / TypeChat

TypeChat is a library that makes it easy to build natural language interfaces using types.
https://microsoft.github.io/TypeChat/
MIT License
8.16k stars 390 forks source link

[Feature Request] Make TypeChat platform agnostic (Remove Node.js dependencies) #105

Closed shiqimei closed 1 year ago

shiqimei commented 1 year ago

Hi @steveluc ! Can we make typechat platform agnostic in the near future? Remove node.js built-in dependencies like fs module to make it run in the edge runtime or web browser without any concern.

We can provide a higher level abstract layer or an adapter to let users provide fs implementation or readFile implementaiton to avoid dependency maybe?

shiqimei commented 1 year ago

/feature-request

shiqimei commented 1 year ago

I think it's duplicate of #102

xumx commented 1 year ago

I have a version of it working with Deno.

Example import { createJsonTranslator } from "https://esm.sh/gh/keyreply/typechat@0.0.10/src/index.ts";

Code compare: https://github.com/microsoft/TypeChat/compare/main...keyreply:TypeChat:main

The NodeJS interactive mode is disabled. (not required for worker usage)

shiqimei commented 1 year ago

I have a version of it working with Deno.

Example import { createJsonTranslator } from "https://esm.sh/gh/keyreply/typechat@0.0.10/src/index.ts";

Code compare: main...keyreply:TypeChat:main

The NodeJS interactive mode is disabled. (not required for worker usage)

Thanks @xumx for pointing this out!