Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions async-openai/src/types/admin/api_keys/api_keys_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// The ID of the last admin API key in the list.
pub last_id: String,
pub last_id: Option<String>,
}

/// Represents the request object for creating an admin API key.
Expand Down
4 changes: 2 additions & 2 deletions async-openai/src/types/admin/audit_logs/audit_logs_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ pub struct ListAuditLogsResponse {
/// A list of `AuditLog` objects.
pub data: Vec<AuditLog>,
/// The first `audit_log_id` in the retrieved `list`.
pub first_id: String,
pub first_id: Option<String>,
/// The last `audit_log_id` in the retrieved `list`.
pub last_id: String,
pub last_id: Option<String>,
/// The `has_more` property is used for pagination to indicate there are additional results.
pub has_more: bool,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pub struct ProjectApiKeyListResponse {
/// The list of project API keys.
pub data: Vec<ProjectApiKey>,
/// The ID of the first project API key in the list.
pub first_id: String,
pub first_id: Option<String>,
/// The ID of the last project API key in the list.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates if there are more project API keys available.
pub has_more: bool,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub struct ProjectRateLimitListResponse {
/// The list of project rate limits.
pub data: Vec<ProjectRateLimit>,
/// The ID of the first project rate limit in the list.
pub first_id: String,
pub first_id: Option<String>,
/// The ID of the last project rate limit in the list.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates if there are more project rate limits available.
pub has_more: bool,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub struct ProjectServiceAccountListResponse {
/// The list of project service accounts.
pub data: Vec<ProjectServiceAccount>,
/// The ID of the first project service account in the list.
pub first_id: String,
pub first_id: Option<String>,
/// The ID of the last project service account in the list.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates if there are more project service accounts available.
pub has_more: bool,
}
Expand Down
4 changes: 2 additions & 2 deletions async-openai/src/types/admin/project_users/project_users_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub enum ProjectUserRole {
pub struct ProjectUserListResponse {
pub object: String,
pub data: Vec<ProjectUser>,
pub first_id: String,
pub last_id: String,
pub first_id: Option<String>,
pub last_id: Option<String>,
pub has_more: String,
}

Expand Down
4 changes: 2 additions & 2 deletions async-openai/src/types/admin/projects/projects_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pub struct Project {
pub struct ProjectListResponse {
pub object: String,
pub data: Vec<Project>,
pub first_id: String,
pub last_id: String,
pub first_id: Option<String>,
pub last_id: Option<String>,
pub has_more: String,
}

Expand Down
4 changes: 2 additions & 2 deletions async-openai/src/types/admin/users/users_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub struct User {
pub struct UserListResponse {
pub object: String,
pub data: Vec<User>,
pub first_id: String,
pub last_id: String,
pub first_id: Option<String>,
pub last_id: Option<String>,
pub has_more: bool,
}

Expand Down
8 changes: 4 additions & 4 deletions async-openai/src/types/chat/chat_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,9 +1203,9 @@ pub struct ChatCompletionList {
/// An array of chat completion objects.
pub data: Vec<CreateChatCompletionResponse>,
/// The identifier of the first chat completion in the data array.
pub first_id: String,
pub first_id: Option<String>,
/// The identifier of the last chat completion in the data array.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates whether there are more Chat Completions available.
pub has_more: bool,
}
Expand Down Expand Up @@ -1250,9 +1250,9 @@ pub struct ChatCompletionMessageList {
/// An array of chat completion message objects.
pub data: Vec<ChatCompletionMessageListItem>,
/// The identifier of the first chat message in the data array.
pub first_id: String,
pub first_id: Option<String>,
/// The identifier of the last chat message in the data array.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates whether there are more chat messages available.
pub has_more: bool,
}
Expand Down
12 changes: 6 additions & 6 deletions async-openai/src/types/evals/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ pub struct EvalList {
/// An array of eval objects.
pub data: Vec<Eval>,
/// The identifier of the first eval in the data array.
pub first_id: String,
pub first_id: Option<String>,
/// The identifier of the last eval in the data array.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates whether there are more evals available.
pub has_more: bool,
}
Expand Down Expand Up @@ -756,9 +756,9 @@ pub struct EvalRunList {
/// An array of eval run objects.
pub data: Vec<EvalRun>,
/// The identifier of the first eval run in the data array.
pub first_id: String,
pub first_id: Option<String>,
/// The identifier of the last eval run in the data array.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates whether there are more evals available.
pub has_more: bool,
}
Expand Down Expand Up @@ -904,9 +904,9 @@ pub struct EvalRunOutputItemList {
/// An array of eval run output item objects.
pub data: Vec<EvalRunOutputItem>,
/// The identifier of the first eval run output item in the data array.
pub first_id: String,
pub first_id: Option<String>,
/// The identifier of the last eval run output item in the data array.
pub last_id: String,
pub last_id: Option<String>,
/// Indicates whether there are more eval run output items available.
pub has_more: bool,
}
Expand Down
4 changes: 2 additions & 2 deletions async-openai/src/types/responses/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// The ID of the last item in the list.
pub last_id: String,
pub last_id: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
Expand Down
19 changes: 10 additions & 9 deletions examples/conversations/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.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...");
Expand All @@ -80,13 +80,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// 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
Expand Down
Loading