Skip to content

Commit d4bf0a8

Browse files
committed
Cargo fmt
1 parent 1e0e951 commit d4bf0a8

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

src/v1/api.rs

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl OpenAIClient {
233233
Ok(parsed) => {
234234
self.headers = Some(headers);
235235
Ok(parsed)
236-
},
236+
}
237237
Err(e) => Err(APIError::CustomError {
238238
message: format!("Failed to parse JSON: {} / response {}", e, text),
239239
}),
@@ -249,7 +249,10 @@ impl OpenAIClient {
249249
}
250250
}
251251

252-
pub async fn completion(&mut self, req: CompletionRequest) -> Result<CompletionResponse, APIError> {
252+
pub async fn completion(
253+
&mut self,
254+
req: CompletionRequest,
255+
) -> Result<CompletionResponse, APIError> {
253256
self.post("completions", &req).await
254257
}
255258

@@ -264,7 +267,10 @@ impl OpenAIClient {
264267
self.post("images/generations", &req).await
265268
}
266269

267-
pub async fn image_edit(&mut self, req: ImageEditRequest) -> Result<ImageEditResponse, APIError> {
270+
pub async fn image_edit(
271+
&mut self,
272+
req: ImageEditRequest,
273+
) -> Result<ImageEditResponse, APIError> {
268274
self.post("images/edits", &req).await
269275
}
270276

@@ -275,7 +281,10 @@ impl OpenAIClient {
275281
self.post("images/variations", &req).await
276282
}
277283

278-
pub async fn embedding(&mut self, req: EmbeddingRequest) -> Result<EmbeddingResponse, APIError> {
284+
pub async fn embedding(
285+
&mut self,
286+
req: EmbeddingRequest,
287+
) -> Result<EmbeddingResponse, APIError> {
279288
self.post("embeddings", &req).await
280289
}
281290

@@ -298,7 +307,10 @@ impl OpenAIClient {
298307
self.delete(&format!("files/{}", req.file_id)).await
299308
}
300309

301-
pub async fn retrieve_file(&mut self, file_id: String) -> Result<FileRetrieveResponse, APIError> {
310+
pub async fn retrieve_file(
311+
&mut self,
312+
file_id: String,
313+
) -> Result<FileRetrieveResponse, APIError> {
302314
self.get(&format!("files/{}", file_id)).await
303315
}
304316

@@ -486,7 +498,10 @@ impl OpenAIClient {
486498
.await
487499
}
488500

489-
pub async fn delete_assistant(&mut self, assistant_id: String) -> Result<DeletionStatus, APIError> {
501+
pub async fn delete_assistant(
502+
&mut self,
503+
assistant_id: String,
504+
) -> Result<DeletionStatus, APIError> {
490505
self.delete(&format!("assistants/{}", assistant_id)).await
491506
}
492507

@@ -546,7 +561,10 @@ impl OpenAIClient {
546561
self.get(&url).await
547562
}
548563

549-
pub async fn create_thread(&mut self, req: CreateThreadRequest) -> Result<ThreadObject, APIError> {
564+
pub async fn create_thread(
565+
&mut self,
566+
req: CreateThreadRequest,
567+
) -> Result<ThreadObject, APIError> {
550568
self.post("threads", &req).await
551569
}
552570

@@ -730,7 +748,10 @@ impl OpenAIClient {
730748
self.get(&url).await
731749
}
732750

733-
pub async fn create_batch(&mut self, req: CreateBatchRequest) -> Result<BatchResponse, APIError> {
751+
pub async fn create_batch(
752+
&mut self,
753+
req: CreateBatchRequest,
754+
) -> Result<BatchResponse, APIError> {
734755
self.post("batches", &req).await
735756
}
736757

0 commit comments

Comments
 (0)