Expand description
§A proc-macro to delegate implementation to the ChatGPT API.
ChatGPT APIに実装を代行してもらうマクロです。
This crate requires nightly
toolchain!
本クレートでは nightly
ツールチェイン必須です!
use hey_chat_gpt::take_care_of_the_rest;
fn main() {
println!("{}", fib(10));
}
take_care_of_the_rest!();
The difference between the two macros is whether they are in English or Japanese.
この2つのマクロの違いは、英語か日本語かです。
Please see the links for each macro for more details.
詳細は各マクロのリンク先で読んでください。
§Preparation
To compile, run the below command.
OPENAI_API_KEY=sk-YOUR-API-KEY RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo +nightly run
OPENAI_API_KEY
: api key.RUSTFLAGS=...
: to enablesource_file
method of Span.cargo +nightly run
: the reason of specifynightly
is same as above.
These settings can also be enable by setting files.
.cargo/config.toml
[build]
rustflags = ["--cfg=procmacro2_semver_exempt"]
[env]
OPENAI_API_KEY = "sk-YOUR-API-KEY"
rust-toolchain.toml
[toolchain]
channel = "nightly"
In this case, the options are not necessary.
cargo run
§Cache
Responses from ChatGPT are stored in the gpt_responses directory and used as a cache when the code remains unchanged. If you get undesirable code or an error response from ChatGPT, remove those cache files before trying to compile again.
§使用のための準備
コンパイルするには以下を実行します。
OPENAI_API_KEY=sk-YOUR-API-KEY RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo +nightly run
OPENAI_API_KEY
: 取得してきたOpenAIのAPIキーを設定してください。RUSTFLAGS=...
: Span のsource_file
メソッドを使用するために指定しています。cargo +nightly run
:nightly
の指定理由は上記と同じです。
設定ファイルを通しての設定も可能です。
.cargo/config.toml
[build]
rustflags = ["--cfg=procmacro2_semver_exempt"]
[env]
OPENAI_API_KEY = "sk-YOUR-API-KEY"
rust-toolchain.toml
[toolchain]
channel = "nightly"
この場合オプションは不要になります。
cargo run
§キャッシュファイルについて
ChatGPTからの返答は gpt_responses
ディレクトリに保存され、コードが変わらないうちはこちらのキャッシュがコンパイルに利用されます。もし望まない結果になったりエラーレスポンスが帰ってきた場合は、キャッシュファイルを削除の上再コンパイルしてみてください。
Macros§
- abracadabra
- An alias for
take_care_of_the_rest
. - back_
me_ up - An alias for
take_care_of_the_rest
. - deliver_
it - An alias for
take_care_of_the_rest
. - do_it
- An alias for
take_care_of_the_rest
. - finish_
it - An alias for
take_care_of_the_rest
. - get_
it_ done - An alias for
take_care_of_the_rest
. - give_
it_ a_ go - An alias for
take_care_of_the_rest
. - go_
ahead - An alias for
take_care_of_the_rest
. - help_me
- An alias for
take_care_of_the_rest
. - just_
do_ it - An alias for
take_care_of_the_rest
. - lend_
a_ hand - An alias for
take_care_of_the_rest
. - magic
- An alias for
take_care_of_the_rest
. - make_
it_ happen - An alias for
take_care_of_the_rest
. - perform_
miracle - An alias for
take_care_of_the_rest
. - save_me
- An alias for
take_care_of_the_rest
. - take_
care_ of_ the_ rest - A macro to delegate implementation to the ChatGPT API.
- try_it
- An alias for
take_care_of_the_rest
. - wave_
your_ wand - An alias for
take_care_of_the_rest
. - wrap_
it_ up - An alias for
take_care_of_the_rest
. - あとは任せた
- ChatGPT APIに実装を代行してもらうマクロです。
- これやって
あとは任せた
へのエイリアス。- やって
あとは任せた
へのエイリアス。- やり遂げて
あとは任せた
へのエイリアス。- 仕上げて
あとは任せた
へのエイリアス。- 何とかして
あとは任せた
へのエイリアス。- 作って
あとは任せた
へのエイリアス。- 助けて
あとは任せた
へのエイリアス。- 奇跡を起こして
あとは任せた
へのエイリアス。- 完成させて
あとは任せた
へのエイリアス。- 実現して
あとは任せた
へのエイリアス。- 手を貸して
あとは任せた
へのエイリアス。- 手伝って
あとは任せた
へのエイリアス。- 最後まで頼む
あとは任せた
へのエイリアス。- 終わらせて
あとは任せた
へのエイリアス。- 進めて
あとは任せた
へのエイリアス。- 頼む
あとは任せた
へのエイリアス。- 魔法を見せて
あとは任せた
へのエイリアス。