I've seen the dev day update for this and attempted a basic upgrade to my own project to enable the use of DALL-E 3 rather than DALL-E 2 but I've been unable to compile the changes due to errors that are coming from this library.
I've put the cargo.toml and output of cargo build below and can confirm that I'm using rustc 1.73.0 which I updated today
I wouldn't doubt that I did something wrong but I can't figure out what it is.
[dependencies]
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }
serenity = { default-features = false, features = ["client", "gateway", "model", "rustls_backend", "cache"], version = "0.11.5"}
async-openai = "0.16.0"
rusqlite = { version = "0.29.0", features = ["bundled"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.11", features = ["blocking"]}
uuid = "1.4.1"
rand = "0.8.5"
[profile.release.package."*"]
strip = true
opt-level = "z"
[profile.release]
lto = true
Compiling async-openai v0.16.0
error: unknown serde variant attribute `untagged`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:59:13
|
59 | #[serde(untagged)]
| ^^^^^^^^
error: unknown serde variant attribute `untagged`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:309:13
|
309 | #[serde(untagged)]
| ^^^^^^^^
error: unknown serde variant attribute `untagged`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1364:13
|
1364 | #[serde(untagged)]
| ^^^^^^^^
error: unknown serde variant attribute `untagged`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1619:13
|
1619 | #[serde(untagged)]
| ^^^^^^^^
error: unknown serde variant attribute `untagged`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1630:13
|
1630 | #[serde(untagged)]
| ^^^^^^^^
error[E0277]: the trait bound `types::types::ImageModel: Serialize` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:329:24
|
329 | #[derive(Debug, Clone, Serialize, Default, Builder, PartialEq)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `types::types::ImageModel`
...
340 | /// The model to use for image generation.
| ------------------------------------------ required by a bound introduced by this call
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 289 others
= note: required for `std::option::Option<types::types::ImageModel>` to implement `Serialize`
note: required by a bound in `config::_::_serde::ser::SerializeStruct::serialize_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\ser\mod.rs:1901:12
|
1901 | T: Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
error[E0277]: the trait bound `types::types::ChatCompletionToolChoiceOption: Serialize` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1368:17
|
1368 | #[derive(Clone, Serialize, Default, Debug, Builder, Deserialize, PartialEq)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `types::types::ChatCompletionToolChoiceOption`
...
1454 | #[serde(skip_serializing_if = "Option::is_none")]
| - required by a bound introduced by this call
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 289 others
= note: required for `std::option::Option<types::types::ChatCompletionToolChoiceOption>` to implement `Serialize`
note: required by a bound in `config::_::_serde::ser::SerializeStruct::serialize_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\ser\mod.rs:1901:12
|
1901 | T: Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
error[E0277]: the trait bound `types::types::ChatCompletionFunctionCall: Serialize` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1368:17
|
1368 | #[derive(Clone, Serialize, Default, Debug, Builder, Deserialize, PartialEq)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `types::types::ChatCompletionFunctionCall`
...
1461 | /// Controls how the model responds to function calls.
| ------------------------------------------------------ required by a bound introduced by this call
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 289 others
= note: required for `std::option::Option<types::types::ChatCompletionFunctionCall>` to implement `Serialize`
note: required by a bound in `config::_::_serde::ser::SerializeStruct::serialize_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\ser\mod.rs:1901:12
|
1901 | T: Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
error[E0277]: the trait bound `types::types::ChatCompletionToolChoiceOption: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1455:22
|
1455 | pub tool_choice: Option<ChatCompletionToolChoiceOption>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionToolChoiceOption`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionToolChoiceOption>` to implement `Deserialize<'_>`
note: required by a bound in `next_element`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\de\mod.rs:1729:12
|
1729 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `SeqAccess::next_element`
error[E0277]: the trait bound `types::types::ChatCompletionFunctionCall: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1468:24
|
1468 | pub function_call: Option<ChatCompletionFunctionCall>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionFunctionCall`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionFunctionCall>` to implement `Deserialize<'_>`
note: required by a bound in `next_element`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\de\mod.rs:1729:12
|
1729 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `SeqAccess::next_element`
error[E0277]: the trait bound `types::types::ChatCompletionToolChoiceOption: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1455:22
|
1455 | pub tool_choice: Option<ChatCompletionToolChoiceOption>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionToolChoiceOption`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionToolChoiceOption>` to implement `Deserialize<'_>`
note: required by a bound in `next_value`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\de\mod.rs:1868:12
|
1868 | V: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `MapAccess::next_value`
error[E0277]: the trait bound `types::types::ChatCompletionFunctionCall: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1468:24
|
1468 | pub function_call: Option<ChatCompletionFunctionCall>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionFunctionCall`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionFunctionCall>` to implement `Deserialize<'_>`
note: required by a bound in `next_value`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\de\mod.rs:1868:12
|
1868 | V: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `MapAccess::next_value`
error[E0277]: the trait bound `types::types::ChatCompletionToolChoiceOption: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1454:5
|
1454 | #[serde(skip_serializing_if = "Option::is_none")]
| ^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionToolChoiceOption`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionToolChoiceOption>` to implement `Deserialize<'_>`
note: required by a bound in `config::_::_serde::__private::de::missing_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\private\de.rs:22:8
|
22 | V: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `missing_field`
error[E0277]: the trait bound `types::types::ChatCompletionFunctionCall: Deserialize<'_>` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1461:5
|
1461 | /// Controls how the model responds to function calls.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `types::types::ChatCompletionFunctionCall`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and 341 others
= note: required for `std::option::Option<types::types::ChatCompletionFunctionCall>` to implement `Deserialize<'_>`
note: required by a bound in `config::_::_serde::__private::de::missing_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\private\de.rs:22:8
|
22 | V: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `missing_field`
error[E0277]: the trait bound `SpeechModel: Serialize` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1665:53
|
1665 | #[derive(Clone, Default, Debug, Builder, PartialEq, Serialize)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `SpeechModel`
...
1675 | /// One of the available [TTS models](https://platform.openai.com/docs/models/tts): `tts-1` or `tts-1-hd`
| --------------------------------------------------------------------------------------------------------- required by a bound introduced by this call
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 289 others
note: required by a bound in `config::_::_serde::ser::SerializeStruct::serialize_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\ser\mod.rs:1901:12
|
1901 | T: Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
error[E0277]: the trait bound `Voice: Serialize` is not satisfied
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\async-openai-0.16.0\src\types\types.rs:1665:53
|
1665 | #[derive(Clone, Default, Debug, Builder, PartialEq, Serialize)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `Voice`
...
1678 | /// The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`.
| ----------------------------------------------------------------------------------------------------------------------------- required by a bound introduced by this call
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 289 others
note: required by a bound in `config::_::_serde::ser::SerializeStruct::serialize_field`
--> C:\Users\[USERNAME]\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.163\src\ser\mod.rs:1901:12
|
1901 | T: Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `async-openai` due to 16 previous errors