feat: support batches api (#746)

* feat: support batches api

* update batch_test.go

* fix golangci-lint check

* fix golangci-lint check

* fix tests coverage

* fix tests coverage

* fix tests coverage

* fix tests coverage

* fix tests coverage

* fix tests coverage

* fix tests coverage

* fix: create batch api

* update batch_test.go

* feat: add `CreateBatchWithUploadFile`

* feat: add `UploadBatchFile`

* optimize variable and type naming

* expose `BatchLineItem` interface

* update batches const
This commit is contained in:
eiixy
2024-06-13 23:24:37 +08:00
committed by GitHub
parent c69c3bb1d2
commit 99cc170b54
4 changed files with 655 additions and 0 deletions

View File

@@ -396,6 +396,17 @@ func TestClientReturnsRequestBuilderErrors(t *testing.T) {
{"CreateSpeech", func() (any, error) {
return client.CreateSpeech(ctx, CreateSpeechRequest{Model: TTSModel1, Voice: VoiceAlloy})
}},
{"CreateBatch", func() (any, error) {
return client.CreateBatch(ctx, CreateBatchRequest{})
}},
{"CreateBatchWithUploadFile", func() (any, error) {
return client.CreateBatchWithUploadFile(ctx, CreateBatchWithUploadFileRequest{})
}},
{"RetrieveBatch", func() (any, error) {
return client.RetrieveBatch(ctx, "")
}},
{"CancelBatch", func() (any, error) { return client.CancelBatch(ctx, "") }},
{"ListBatch", func() (any, error) { return client.ListBatch(ctx, nil, nil) }},
}
for _, testCase := range testCases {