31 Commits

Author SHA1 Message Date
VaalaCat
3640274cd1 feat: change repo name 2025-06-15 12:58:45 +00:00
Dan Ackerson
be2e2387d4 feat: add Anthropic API support with custom version header (#934)
* feat: add Anthropic API support with custom version header

* refactor: use switch statement for API type header handling

* refactor: add OpenAI & AzureAD types to be exhaustive

* Update client.go

need explicit fallthrough in empty case statements

* constant for APIVersion; addtl tests
2025-02-25 11:03:38 +00:00
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
Ayush Sawant
cfe15ffd00 return response body as byte slice for RequestError type (#873) 2024-10-14 14:20:39 +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
eiixy
dd7f5824f9 fix: fullURL endpoint generation (#817) 2024-08-16 18:11:38 +01:00
eiixy
92f483055f fix: #794 (#797) 2024-07-19 15:10:17 +01:00
ando-masaki
211cb49fc2 Update client.go to get response header whether there is an error or not. (#751)
Update client.go to get response header whether there is an error or not. Because 429 Too Many Requests error response has "Retry-After" header.
2024-05-24 11:18:47 +04:00
wurui
c84ab5f6ae feat: support cloudflare AI Gateway flavored azure openai (#715)
* feat: support cloudflare AI Gateway flavored azure openai

Signed-off-by: STRRL <im@strrl.dev>

* test: add test for cloudflare azure fullURL

---------

Signed-off-by: STRRL <im@strrl.dev>
Co-authored-by: STRRL <im@strrl.dev>
2024-04-24 16:08:58 +04:00
Danai Antoniou
8d15a377ec Remove hardcoded assistants version (#719) 2024-04-24 15:59:50 +04:00
Qiying Wang
2646bce71c feat: get header from sendRequestRaw (#694)
* feat: get header from sendRequestRaw

* Fix ci lint
2024-04-05 23:15:54 +04:00
Rich Coggins
c5401e9e64 Fix for broken Azure Threads url (#668) 2024-02-26 12:46:35 +04:00
Rich Coggins
7381d18a75 Fix for broken Azure Assistants url (#665)
* fix:fix url for Azure assistants api

* test:add unit tests for Azure Assistants api

* fix:minor liniting issue
2024-02-21 16:45:15 +04:00
Igor Berlenko
69e3bbb1eb Update client.go - allow to skip Authorization header (#658)
* Update client.go - allow to skip Authorization header

* Update client.go
2024-02-16 14:22:38 +04:00
grulex
66bae3ee73 Content-type fix (#659)
* charset fixes

* make linter happy (#661)

---------

Co-authored-by: grulex <god@vk.com>
Co-authored-by: Alexander Baranov <677093+sashabaranov@users.noreply.github.com>
2024-02-15 20:11:58 +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
Simone Vellei
a2d2bf6851 Fix Refactor assistant api (#545)
* fix: refactor assistant API

* fix

* trigger build

* fix: use AssistantDeleteResponse
2023-11-08 13:20:20 +04:00
Liu Shuang
b77d01edca Support get http header and x-ratelimit-* headers (#507)
* feat: add headers to http response

* feat: support rate limit headers

* fix: go lint

* fix: test coverage

* refactor streamReader

* refactor streamReader

* refactor: NewRateLimitHeaders to newRateLimitHeaders

* refactor: RateLimitHeaders Resets filed

* refactor: move RateLimitHeaders struct
2023-10-10 19:29:41 +04:00
Simone Vellei
8e165dc9aa Feat Add headers to openai responses (#506)
* feat: add headers to http response

* chore: add test

* fix: rename to httpHeader
2023-10-09 19:41:54 +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
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
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
JoyShi
21eef5bc8d Move form_builder into internal pkg. (#311)
* Move form_uilder into internal pkg.

* Fix import of audio.go

* Reorganize.

* Fix import.

* Fix

---------

Co-authored-by: JoyShi <joy.shi@sap.com>
2023-05-16 13:38:09 -07:00
GargantuaX
be253c2d63 change azure engine config to modelMapper (#306)
* change azure engine config to azure modelMapper config

* Update go.mod

* Revert "Update go.mod"

This reverts commit 78d14c58f2a9ce668da43f6adbe20b60afcfe0d7.

* lint fix

* add test

* lint fix

* lint fix

* lint fix

* opt

* opt

* opt

* opt
2023-05-11 01:30:24 +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
Juan
104c0c0b63 Azure openai list models (#290)
* feat(models): include flow for azure openai endpoint

* feat(models): include flow for azure openai endpoint

* feat(models): include flow for azure openai endpoint

* chore(fullURL): update logic to run in fullURL function

* chore(fullURL): update based on pr comments to use c.config.APIVersion
2023-05-03 13:02:35 +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
biubiu7
c2b58e77ed Fixing missing OrgId assignment issue in the ChatCompletionStream (#268)
* Update client.go

* Add test

---------

Co-authored-by: panjiajia <panjiajia@haoshuo.com>
2023-04-20 14:08:29 +01: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
Liu Shuang
d6ab1b3a4f fix: chat stream resp error (#259) 2023-04-19 13:05:00 +01:00
sashabaranov
226ff328e2 Add form builder (#235)
* add form builder

* cover VariImage

* test for closing errors

* simplify tests

* add audio api test coverage

* don't leak authToken when printed

* rename api->client

* fix test
2023-04-08 19:26:26 +04:00