Caution

This Rust crate is potentially dangerous so there is a chance it will cause harm to you or your computer. Run at you own risk (ideally in a sandbox).

ai bindgen

This is a procedural macro that generates Rust code at compile-time using the OpenAI (or compatible) API. Simply add the dependency to your Cargo.toml and follow the example usage.

[dependencies]
ai-bindgen = { git = "https://github.com/germangb/ai-bindgen.git" }

Example usage

You must have a valid API token and define the following two variables in your environment, so the macro can connect to the OpenAI API, and select a model of your choosing:

export OPENAI_API_KEY="<your-api-token>"
export OPENAI_API_MODEL="gpt-5"

Note

By default the macro will send requests to `https://api.ope…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help