Skip to content

Commit a292c3c

Browse files
authored
add query param to list files (#172)
1 parent 73c71cb commit a292c3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

async-openai/src/file.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use serde::Serialize;
2+
13
use crate::{
24
config::Config,
35
error::OpenAIError,
@@ -25,8 +27,11 @@ impl<'c, C: Config> Files<'c, C> {
2527
}
2628

2729
/// Returns a list of files that belong to the user's organization.
28-
pub async fn list(&self) -> Result<ListFilesResponse, OpenAIError> {
29-
self.client.get("/files").await
30+
pub async fn list<Q>(&self, query: &Q) -> Result<ListFilesResponse, OpenAIError>
31+
where
32+
Q: Serialize + ?Sized,
33+
{
34+
self.client.get_with_query("/files", query).await
3035
}
3136

3237
/// Returns information about a specific file.

0 commit comments

Comments
 (0)