From e9b38c069a9fb702be01b1a1da407a425e7ddbfb Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 19:09:54 -0500 Subject: [PATCH] Remove old openai crate --- Cargo.lock | 116 ---------------------------------------------------- Cargo.toml | 7 +++- src/main.rs | 4 -- 3 files changed, 5 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1dc9c91..0577f90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,6 @@ version = "0.2.0" dependencies = [ "anyhow", "async-openai", - "openai", "parking_lot", "poise", "rand", @@ -644,21 +643,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -924,19 +908,6 @@ dependencies = [ "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "iana-time-zone" version = "0.1.59" @@ -1155,24 +1126,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "no-std-net" version = "0.6.0" @@ -1264,62 +1217,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openai" -version = "1.0.0-alpha.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee36bba3836458bc93e5196fb3db43bff8758975d7059d259532464a33cc4d8" -dependencies = [ - "derive_builder", - "reqwest", - "serde", - "serde_json", -] - -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-float" version = "2.10.1" @@ -1630,13 +1533,11 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", "mime_guess", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1648,7 +1549,6 @@ dependencies = [ "serde_urlencoded", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls 0.24.1", "tokio-util", "tower-service", @@ -2506,16 +2406,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.23.4" @@ -2903,12 +2793,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" diff --git a/Cargo.toml b/Cargo.toml index 76e1b74..4e3d295 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,13 +9,16 @@ parking_lot = "0.12.1" poise = "0.6.1" tracing = "0.1.37" tracing-futures = "0.2.5" -openai = "1.0.0-alpha.8" rand = "0.8.5" -reqwest = "0.11.23" songbird = "0.4.0" thiserror = "1.0.39" async-openai = "0.18.1" +[dependencies.reqwest] +version = "0.11.23" +default-features = false +features = ["rustls-tls"] + [dependencies.symphonia] version = "0.5.2" features = ["mkv"] diff --git a/src/main.rs b/src/main.rs index 59e3614..59bfa16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,6 @@ use commands::*; use std::{env, sync::Arc}; use anyhow::Result; -use openai::set_key; use parking_lot::Mutex; use poise::serenity_prelude as serenity; use reqwest::Client as HttpClient; @@ -54,9 +53,6 @@ async fn main() -> Result<()> { env::var("OPENAI_API_KEY") .expect("Expected an OpenAI API key in the environment: OPENAI_API_KEY"); - // OLD - set_key(env::var("OPENAI_KEY").expect("Expected an OpenAI key in the environment: OPENAI_KEY")); - let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN");