bevy_openai
bevy_openai
is an event-driven plugin for Bevy that provides convenient access to the OpenAI API.
Current features:
Installation
Add the crate as a dependency:
[]
= "0.1.0"
Add the plugin:
use *;
use OpenAiPlugin;
Usage
Set OPENAI_API_KEY to environment variable
bevy_openai
is event-driven. You can send a prompt to the ChatGPT and read the response from the ChatGPT using events.
Use SendToAiEvent
to send your prompt to the ChatGPT.
Or use SendToAiWithConfigEvent
to send your prompt to the ChatGPT with a custom config.
Use AiResponseEvent
to read the response from the ChatGPT.
The full example is in the examples
directory.