https://github.com/chayleaf/rust-neuro-sama-game-api
A crate that implements the Neuro-sama game API
https://github.com/chayleaf/rust-neuro-sama-game-api
Last synced: 8 months ago
JSON representation
A crate that implements the Neuro-sama game API
- Host: GitHub
- URL: https://github.com/chayleaf/rust-neuro-sama-game-api
- Owner: chayleaf
- License: 0bsd
- Created: 2024-12-11T00:08:39.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-17T18:51:23.000Z (over 1 year ago)
- Last Synced: 2025-01-17T19:45:49.692Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 314 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-0BSD
Awesome Lists containing this project
README
[](https://crates.io/crates/neuro-sama)
[](https://docs.rs/neuro-sama)
# neuro_sama, the Rust crate
A Rust crate that implements the [Neuro-sama game
API](https://github.com/VedalAI/neuro-game-sdk). It doesn't handle
WebSocket communications itself, instead, it works with `tungstenite`
messages, which you can handle whichever way you want.
There's a high-level API and a low-level API available. The low-level
API simply defines the API schema, it's available in the `schema`
submodule. The high-level API is hopefully easier and safer to work
with, it's available in the `game` submodule.
Optionally, a `proposals` feature is available that enables proposed
commands that have not yet been accepted or implemented - you can use it
for testing, but the feature is excluded from semver guarantees.
Another feature is `strip-trailing-zeroes`, which strips `.0` from round
floating point numbers, it may be useful for slightly reducing
schema/context size.
## Changelog
- 0.1.0 - initial release
- 0.2.0 - reworked the API a bit to make it easier to work with and more
semver-compatible, and added handling for the proposed
`actions/reregister_all` command.
- 0.2.1 - generate a leaner JSON schema that's hopefully less confusing
- 0.3.0 - add a `proposals` feature.
- 0.3.1 - don't require `Arc` for `Api::new`
- 0.4.0 - convert `Api` from a separate object into a sealed trait
- 0.4.1 - interpret whitespace-only messages as null
- 0.4.2 - cleanup action schemas in `register_actions_raw`
- 0.4.3 - add the `strip-trailing-zeroes` feature
- 0.4.4 - fix invalid name for `action/result`
- 0.4.5 - consider `null` schemas equivalent to untyped `{}`
## License
TL;DR do whatever you want.
Licensed under either the [BSD Zero Clause License](LICENSE-0BSD)
(https://opensource.org/licenses/0BSD), the [Apache 2.0
License](LICENSE-APACHE) (http://www.apache.org/licenses/LICENSE-2.0) or
the [MIT License](LICENSE-MIT) (http://opensource.org/licenses/MIT), at
your choice.