diff --git a/async-openai/src/types/admin/api_keys/api_keys_.rs b/async-openai/src/types/admin/api_keys/api_keys_.rs index 2eee47be..db6450bb 100644 --- a/async-openai/src/types/admin/api_keys/api_keys_.rs +++ b/async-openai/src/types/admin/api_keys/api_keys_.rs @@ -50,9 +50,9 @@ pub struct ApiKeyList { /// Indicates if there are more admin API keys available. pub has_more: bool, /// The ID of the first admin API key in the list. - pub first_id: String, + pub first_id: Option, /// The ID of the last admin API key in the list. - pub last_id: String, + pub last_id: Option, } /// Represents the request object for creating an admin API key. diff --git a/async-openai/src/types/admin/audit_logs/audit_logs_.rs b/async-openai/src/types/admin/audit_logs/audit_logs_.rs index 1d3b137e..703c33ac 100644 --- a/async-openai/src/types/admin/audit_logs/audit_logs_.rs +++ b/async-openai/src/types/admin/audit_logs/audit_logs_.rs @@ -53,9 +53,9 @@ pub struct ListAuditLogsResponse { /// A list of `AuditLog` objects. pub data: Vec, /// The first `audit_log_id` in the retrieved `list`. - pub first_id: String, + pub first_id: Option, /// The last `audit_log_id` in the retrieved `list`. - pub last_id: String, + pub last_id: Option, /// The `has_more` property is used for pagination to indicate there are additional results. pub has_more: bool, } diff --git a/async-openai/src/types/admin/project_api_keys/project_api_keys_.rs b/async-openai/src/types/admin/project_api_keys/project_api_keys_.rs index 2d339d7b..85e34e29 100644 --- a/async-openai/src/types/admin/project_api_keys/project_api_keys_.rs +++ b/async-openai/src/types/admin/project_api_keys/project_api_keys_.rs @@ -46,9 +46,9 @@ pub struct ProjectApiKeyListResponse { /// The list of project API keys. pub data: Vec, /// The ID of the first project API key in the list. - pub first_id: String, + pub first_id: Option, /// The ID of the last project API key in the list. - pub last_id: String, + pub last_id: Option, /// Indicates if there are more project API keys available. pub has_more: bool, } diff --git a/async-openai/src/types/admin/project_rate_limits/project_rate_limits_.rs b/async-openai/src/types/admin/project_rate_limits/project_rate_limits_.rs index 5f4ac7ed..af5c6b5a 100644 --- a/async-openai/src/types/admin/project_rate_limits/project_rate_limits_.rs +++ b/async-openai/src/types/admin/project_rate_limits/project_rate_limits_.rs @@ -37,9 +37,9 @@ pub struct ProjectRateLimitListResponse { /// The list of project rate limits. pub data: Vec, /// The ID of the first project rate limit in the list. - pub first_id: String, + pub first_id: Option, /// The ID of the last project rate limit in the list. - pub last_id: String, + pub last_id: Option, /// Indicates if there are more project rate limits available. pub has_more: bool, } diff --git a/async-openai/src/types/admin/project_service_accounts/project_service_accounts_.rs b/async-openai/src/types/admin/project_service_accounts/project_service_accounts_.rs index 1ec1ae6a..87277e36 100644 --- a/async-openai/src/types/admin/project_service_accounts/project_service_accounts_.rs +++ b/async-openai/src/types/admin/project_service_accounts/project_service_accounts_.rs @@ -25,9 +25,9 @@ pub struct ProjectServiceAccountListResponse { /// The list of project service accounts. pub data: Vec, /// The ID of the first project service account in the list. - pub first_id: String, + pub first_id: Option, /// The ID of the last project service account in the list. - pub last_id: String, + pub last_id: Option, /// Indicates if there are more project service accounts available. pub has_more: bool, } diff --git a/async-openai/src/types/admin/project_users/project_users_.rs b/async-openai/src/types/admin/project_users/project_users_.rs index 5ab9eefe..dbb636bc 100644 --- a/async-openai/src/types/admin/project_users/project_users_.rs +++ b/async-openai/src/types/admin/project_users/project_users_.rs @@ -31,8 +31,8 @@ pub enum ProjectUserRole { pub struct ProjectUserListResponse { pub object: String, pub data: Vec, - pub first_id: String, - pub last_id: String, + pub first_id: Option, + pub last_id: Option, pub has_more: String, } diff --git a/async-openai/src/types/admin/projects/projects_.rs b/async-openai/src/types/admin/projects/projects_.rs index 8e4be725..b191276f 100644 --- a/async-openai/src/types/admin/projects/projects_.rs +++ b/async-openai/src/types/admin/projects/projects_.rs @@ -32,8 +32,8 @@ pub struct Project { pub struct ProjectListResponse { pub object: String, pub data: Vec, - pub first_id: String, - pub last_id: String, + pub first_id: Option, + pub last_id: Option, pub has_more: String, } diff --git a/async-openai/src/types/admin/users/users_.rs b/async-openai/src/types/admin/users/users_.rs index 7094c414..50b517f4 100644 --- a/async-openai/src/types/admin/users/users_.rs +++ b/async-openai/src/types/admin/users/users_.rs @@ -26,8 +26,8 @@ pub struct User { pub struct UserListResponse { pub object: String, pub data: Vec, - pub first_id: String, - pub last_id: String, + pub first_id: Option, + pub last_id: Option, pub has_more: bool, } diff --git a/async-openai/src/types/chat/chat_.rs b/async-openai/src/types/chat/chat_.rs index 4fc7128c..fdce8a85 100644 --- a/async-openai/src/types/chat/chat_.rs +++ b/async-openai/src/types/chat/chat_.rs @@ -1203,9 +1203,9 @@ pub struct ChatCompletionList { /// An array of chat completion objects. pub data: Vec, /// The identifier of the first chat completion in the data array. - pub first_id: String, + pub first_id: Option, /// The identifier of the last chat completion in the data array. - pub last_id: String, + pub last_id: Option, /// Indicates whether there are more Chat Completions available. pub has_more: bool, } @@ -1250,9 +1250,9 @@ pub struct ChatCompletionMessageList { /// An array of chat completion message objects. pub data: Vec, /// The identifier of the first chat message in the data array. - pub first_id: String, + pub first_id: Option, /// The identifier of the last chat message in the data array. - pub last_id: String, + pub last_id: Option, /// Indicates whether there are more chat messages available. pub has_more: bool, } diff --git a/async-openai/src/types/evals/eval.rs b/async-openai/src/types/evals/eval.rs index 7fec5399..808de54d 100644 --- a/async-openai/src/types/evals/eval.rs +++ b/async-openai/src/types/evals/eval.rs @@ -250,9 +250,9 @@ pub struct EvalList { /// An array of eval objects. pub data: Vec, /// The identifier of the first eval in the data array. - pub first_id: String, + pub first_id: Option, /// The identifier of the last eval in the data array. - pub last_id: String, + pub last_id: Option, /// Indicates whether there are more evals available. pub has_more: bool, } @@ -756,9 +756,9 @@ pub struct EvalRunList { /// An array of eval run objects. pub data: Vec, /// The identifier of the first eval run in the data array. - pub first_id: String, + pub first_id: Option, /// The identifier of the last eval run in the data array. - pub last_id: String, + pub last_id: Option, /// Indicates whether there are more evals available. pub has_more: bool, } @@ -904,9 +904,9 @@ pub struct EvalRunOutputItemList { /// An array of eval run output item objects. pub data: Vec, /// The identifier of the first eval run output item in the data array. - pub first_id: String, + pub first_id: Option, /// The identifier of the last eval run output item in the data array. - pub last_id: String, + pub last_id: Option, /// Indicates whether there are more eval run output items available. pub has_more: bool, } diff --git a/async-openai/src/types/responses/conversation.rs b/async-openai/src/types/responses/conversation.rs index bd87c435..fb0c69d2 100644 --- a/async-openai/src/types/responses/conversation.rs +++ b/async-openai/src/types/responses/conversation.rs @@ -91,9 +91,9 @@ pub struct ConversationItemList { /// Whether there are more items available. pub has_more: bool, /// The ID of the first item in the list. - pub first_id: String, + pub first_id: Option, /// The ID of the last item in the list. - pub last_id: String, + pub last_id: Option, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] diff --git a/examples/conversations/src/main.rs b/examples/conversations/src/main.rs index cdbcf3bb..611fd5fb 100644 --- a/examples/conversations/src/main.rs +++ b/examples/conversations/src/main.rs @@ -52,8 +52,8 @@ async fn main() -> Result<(), Box> { .await?; println!("Added {} items", items_list.data.len()); - println!("First item ID: {}", items_list.first_id); - println!("Last item ID: {}\n", items_list.last_id); + println!("First item ID: {:?}", items_list.first_id); + println!("Last item ID: {:?}\n", items_list.last_id); // 3. List all items in the conversation println!("3. Listing conversation items..."); @@ -80,13 +80,14 @@ async fn main() -> Result<(), Box> { // 4. Retrieve a specific item if !all_items.data.is_empty() { println!("4. Retrieving a specific item..."); - let first_item_id = &all_items.first_id; - let item = client - .conversations() - .items(&conversation.id) - .retrieve(first_item_id) - .await?; - println!("Retrieved item: {:?}\n", item); + if let Some(first_item_id) = all_items.first_id { + let item = client + .conversations() + .items(&conversation.id) + .retrieve(&first_item_id) + .await?; + println!("Retrieved item: {:?}\n", item); + } } // 5. Update conversation metadata