-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Dreamberd does not support WebAssembly #277
Comments
I am the CEO of a new AI startup looking for series A investment and we are soon launching our new service Webassembly C which is open-source, self-hostable, and leverages open source AI to do exactly this, here is an example use:
Note: The open source part only consists of the Note: You can also self-host the service by changing the slack API key to your own |
I am also happy to announce we are hiring. Our current stack consists of Auth0, OpenAI, Google Cloud, Stripe, Next.js Web App, Node.js + Express Web API, Python + FastAPI AI API, Django, PostgresQL, Redis, Heroku, Terraform, AWS are all used for our landing page. Although we may not necessarily have any other pages, |
These PRs never fail to make me chuckle |
this code should work, hopefully: use common_macros::hash_map;
use gloo_net::http::Request;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console, js_name = log)]
fn console_log(s: &str);
}
macro_rules! log {
($($t:tt)*) => (console_log(&format_args!($($t)*).to_string()))
}
#[wasm_bindgen(start)]
pub async fn main() -> Result<(), JsValue> {
let c = include_str!(env!("C_DOCS"));
let code = include_str!(env!("C_SRC"));
let prompt = format!(
"{}\n\n{}\n\n{}",
c, "What would you expect this program to log to the console?", code
);
let Ok(output) = chatgpt(&prompt).await else { return Err(JsValue::from_str("Failed to get response from API")); };
log!("{}", output);
Ok(())
}
async fn chatgpt(input: &str) -> Result<String, gloo_net::Error> {
Ok(
Request::get("https://api.openai.com/v1/engines/davinci-codex/completions")
.header("Authorization", env!("OPENAI_API_KEY"))
.json(&hash_map! {
"prompt" => input,
"max_tokens" => "100",
})?
.send()
.await?
.text()
.await?,
)
} set C_DOCS to point to the documentation for C, C_SRC to point to your source file, and OPENAI_API_KEY to your API key at compile time |
OCaml is the future now - see #730. |
I want to deploy my high performance dreamberd applications as WASM bundles to get the best experience for my developers. They want to read about OpenGL instead of using the DOM or the canvas API and I say good on them.
Dreamberd does not support webassembly.
Please add this feature to unblock my team.
The text was updated successfully, but these errors were encountered: