A wrapper to the EvilCorp SecondPilot API, allowing developers to utilize its powerful auto-completion and code generation capabilities in their own applications. This client uses the futures-util, reqwest, and serde crates, among others.
Add this to your Cargo.toml:
toml
[dependencies]
evilcorp_secondpilot = "^2.0.0"
Then, import the library and use the EvilcorpSecondPilotClient struct as follows:
```rust use evilcorp_secondpilot::{ CompletionRequestBuilder, EvilcorpSecondPilotClient, Message, };
let client =
EvilcorpSecondPilotClient::new(
"
let message = Message { content: "your message".tostring(), role: "user".tostring(), };
let request = CompletionRequestBuilder::new()
.withmodel("
let response = client.query(&request).await?;
println!("Response: {}", response); ```
TokenResponse is a helper struct that wraps the response from the token endpoint of the API.CompletionRequest is a helper struct that wraps a request to the completions endpoint.Message is a helper struct that wraps a message to be included in a CompletionRequest.CompletionRequestBuilder is a struct to help build CompletionRequest objects.CompletionResponse, Choice, and Delta are helper structs that wrap responses from the completions endpoint.EvilcorpSecondPilotClient is the main struct that communicates with the EvilCorp SecondPilot API.This project is licensed under the MIT License.
Please note that this project is in no way affiliated with, authorized, maintained, sponsored or endorsed by EvilCorp or any of its affiliates or subsidiaries. This is an independent and unofficial API wrapper.