Commit Graph

27 Commits

Author SHA1 Message Date
Ayush Sawant
fb15ff9dcd Handling for non-json response (#881)
* removed handling for non-json response

* added response body in RequestError.Error() and updated tests

* done linting
2024-10-21 21:49:34 +01:00
eiixy
38bdc812df Optimize Client Error Return (#856)
* update client error return

* update client_test.go

* update client_test.go

* update file_api_test.go

* update client_test.go

* update client_test.go
2024-09-26 13:25:56 +03:00
floodwm
e095df5325 run_id string Optional (#855)
Filter messages by the run ID that generated them.

Co-authored-by: wappi <support@wappi.pro>
2024-09-20 21:54:25 +01:00
Yamagami ken-ichi
6d021190f0 feat: Support Delete Message API (#799)
* feat: Add DeleteMessage function to API client

* fix: linter

nolint : Deprecated method
split function: cognitive complexity 21

* rename func name for unit-test
2024-08-22 15:27:44 +01:00
eiixy
dd7f5824f9 fix: fullURL endpoint generation (#817) 2024-08-16 18:11:38 +01:00
eiixy
99cc170b54 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
2024-06-13 19:24:37 +04:00
Andreas Deininger
ea551f422e Fixing typos (#706) 2024-04-13 15:32:38 +04:00
Qiying Wang
eff8dc1118 fix(audio): fix audioTextResponse decode (#638)
* fix(audio): fix audioTextResponse decode

* test(audio): add audioTextResponse decode test

* test(audio): simplify code
2024-01-17 21:42:07 +04:00
Donnie Flood
71848ccf69 feat: support direct bytes for file upload (#568)
* feat: support direct bytes for file upload

* add test for errors

* add coverage
2023-11-15 20:08:48 +04:00
Chris Hua
515de0219d feat: initial TTS support (#528)
* feat: initial TTS support

* chore: lint, omitempty

* chore: dont use pointer in struct

* fix: add mocked server tests to speech_test.go

Co-authored-by: Lachlan Laycock <supagroova@gmail.com>

* chore: update imports

* chore: fix lint

* chore: add an error check

* chore: ignore lint

* chore: add error checks in package

* chore: add test

* chore: fix test

---------

Co-authored-by: Lachlan Laycock <supagroova@gmail.com>
2023-11-13 18:35:34 +04:00
Urjit Singh Bhatia
b7cac703ac Feat/messages api (#546)
* fix test server setup:
- go map access is not deterministic
- this can lead to a route: /foo/bar/1 matching /foo/bar before matching /foo/bar/1 if the map iteration go through /foo/bar first since the regex match wasn't bound to start and end anchors
- registering handlers now converts * in routes to .* for proper regex matching
- test server route handling now tries to fully match the handler route

* add missing /v1 prefix to fine-tuning job cancel test server handler

* add create message call

* add messages list call

* add get message call

* add modify message call, fix return types for other message calls

* add message file retrieve call

* add list message files call

* code style fixes

* add test for list messages with pagination options

* add beta header to msg calls now that #545 is merged

* Update messages.go

Co-authored-by: Simone Vellei <henomis@gmail.com>

* Update messages.go

Co-authored-by: Simone Vellei <henomis@gmail.com>

* add missing object details for message, fix tests

* fix merge formatting

* minor style fixes

---------

Co-authored-by: Simone Vellei <henomis@gmail.com>
2023-11-13 18:33:26 +04:00
Simone Vellei
d6f3bdcdac Feat implement Run APIs (#560)
* chore: first commit

* add apis

* chore: add tests

* feat add apis

* chore: add api and tests

* chore: add tests

* fix

* trigger build

* fix

* chore: formatting code

* chore: add pagination type
2023-11-09 23:17:30 +04:00
Simone Vellei
bc89139c1d Feat Implement threads API (#536)
* feat: implement threads API

* fix

* add tests

* fix

* trigger£

* trigger

* chore: add beta header
2023-11-09 12:05:44 +04:00
Simone Vellei
3063e676bf Feat Implement assistants API (#535)
* chore: implement assistants API

* fix

* fix

* chore: add tests

* fix tests

* fix linting
2023-11-07 19:20:59 +04:00
Brendan Martin
0d5256fb82 added delete fine tune model endpoint (#497) 2023-09-25 12:08:45 +04:00
Simone Vellei
a2ca01bb6d feat: implement new fine tuning job API (#479)
* feat: implement new fine tuning job API

* fix: export ListFineTuningJobEventsParameter

* fix: lint errors

* fix: test errors

* fix: code test coverage

* fix: code test coverage

* fix: use any

* chore: use url.Values
2023-08-29 16:04:27 +04:00
渡邉祐一 / Yuichi Watanabe
f1b66967a4 refactor: refactoring http request creation and sending (#395)
* refactoring http request creation and sending

* fix lint error

* increase the test coverage of client.go

* refactor: Change the style of HTTPRequestBuilder.Build func to one-argument-per-line.
2023-06-22 13:57:52 +04:00
渡邉祐一 / Yuichi Watanabe
b616090e69 refactoring tests with mock servers (#30) (#356) 2023-06-12 17:40:26 +04:00
渡邉祐一 / Yuichi Watanabe
a243e7331f Support Retrieve file content API (#347) (#348)
* Support Retrieve file content API (#347)

* add timeout test for GetFileContent (#347)
2023-06-11 12:49:57 +04:00
渡邉祐一 / Yuichi Watanabe
06b16a7281 fix json marshaling error response of azure openai (#343) (#345)
* fix json marshaling error response of azure openai (#343)

* add a test case for handleErrorResp func (#343)
2023-06-08 19:32:03 +04:00
渡邉祐一 / Yuichi Watanabe
6830e00406 Support Retrieve model API (#340) (#341)
* Support Retrieve model API (#340)

* Test for GetModel error cases. (#340)

* Reduce the cognitive complexity of TestClientReturnsRequestBuilderErrors (#340)
2023-06-05 18:37:08 +04:00
渡邉祐一 / Yuichi Watanabe
61ba5f3369 move request_builder into internal pkg (#304) (#329)
* move request_builder into internal pkg (#304)

* add some test for internal.RequestBuilder

* add a test for openai.GetEngine
2023-05-31 12:01:42 +04:00
Quest Henkart
a24581dce2 maintain underlying error structs to allow for type conversion (#293)
* maintain underlying error structs to allow for type conversion and
defensive error checking

* allow Error.Is for Azure responses

* update readme, add tests to ensure type conversion

* fix whitespacing

* read me

* add import to readme example
2023-05-03 22:48:59 +04:00
sashabaranov
af9ff51077 fix expected error message (#289) 2023-05-01 02:41:40 +04:00
xuanming.zhang
67aef196d2 Fix OpenAI or Azure returns an undefined error message return (#283)
* Fix OpenAI or Azure returns an undefined error message return

* Fix: OpenAI or Azure returns an undefined error message return
#280

* Fix: OpenAI or Azure returns an undefined error message return
#280

* Fix: OpenAI or Azure returns an undefined error message return
#280

Handle long line

* Fix: OpenAI or Azure returns an undefined error message return
#280

Add unit test ErrorResponse nil pointer check

* Fix: OpenAI or Azure returns an undefined error message return
#280

Add unit test ErrorResponse nil pointer check

---------

Co-authored-by: zhangxm <xuanming_zhang@qingsongchou.com>
2023-05-01 01:21:15 +04:00
Hoani Bryson
ecdea45b67 Adds support for audio captioning with Whisper (#267)
* Add speech to text example in docs

* Add caption formats for audio transcription

* Add caption example to README

* Address sanity check errors

* Add tests for decodeResponse

* Use typechecker for audio response format

* Decoding response refactors
2023-04-20 14:07:04 +01:00
sashabaranov
9a1ecf5f4a Add more tests (#241)
* add form builder tests

* lint

* add client tests

* lint

* add non-existent file test
2023-04-09 18:36:15 +04:00