Skip to content

Commit 7cb57e8

Browse files
feat: change Prompt integer variants from u16 to u32 for future compatibility (#392)
1 parent be059c2 commit 7cb57e8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

async-openai/src/types/chat.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use crate::error::OpenAIError;
1111
pub enum Prompt {
1212
String(String),
1313
StringArray(Vec<String>),
14-
// Minimum value is 0, maximum value is 50256 (inclusive).
15-
IntegerArray(Vec<u16>),
16-
ArrayOfIntegerArray(Vec<Vec<u16>>),
14+
// Minimum value is 0, maximum value is 4_294_967_295 (inclusive).
15+
IntegerArray(Vec<u32>),
16+
ArrayOfIntegerArray(Vec<Vec<u32>>),
1717
}
1818

1919
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]

async-openai/src/types/impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ macro_rules! impl_from_for_integer_array {
372372
}
373373

374374
impl_from_for_integer_array!(u32, EmbeddingInput);
375-
impl_from_for_integer_array!(u16, Prompt);
375+
impl_from_for_integer_array!(u32, Prompt);
376376

377377
macro_rules! impl_from_for_array_of_integer_array {
378378
($from_typ:ty, $to_typ:ty) => {
@@ -469,7 +469,7 @@ macro_rules! impl_from_for_array_of_integer_array {
469469
}
470470

471471
impl_from_for_array_of_integer_array!(u32, EmbeddingInput);
472-
impl_from_for_array_of_integer_array!(u16, Prompt);
472+
impl_from_for_array_of_integer_array!(u32, Prompt);
473473

474474
impl From<&str> for ChatCompletionFunctionCall {
475475
fn from(value: &str) -> Self {

0 commit comments

Comments
 (0)