27 Commits

Author SHA1 Message Date
goodenough
306fbbbe6f Add support for reasoning_content field in chat completion messages for DeepSeek R1 (#925)
* support deepseek field "reasoning_content"

* support deepseek field "reasoning_content"

* Comment ends in a period (godot)

* add comment on field reasoning_content

* fix go lint error

* chore: trigger CI

* make field "content" in MarshalJSON function omitempty

* remove reasoning_content in TestO1ModelChatCompletions func

* feat: Add test and handler for deepseek-reasoner chat model completions, including support for reasoning content in responses.

* feat: Add test and handler for deepseek-reasoner chat model completions, including support for reasoning content in responses.

* feat: Add test and handler for deepseek-reasoner chat model completions, including support for reasoning content in responses.
2025-04-29 14:24:45 +01:00
rory malcolm
2054db016c Add support for O3-mini (#930)
* Add support for O3-mini

- Add support for the o3 mini set of models, including tests that match the constraints in OpenAI's API docs (https://platform.openai.com/docs/models#o3-mini).

* Deprecate and refactor

- Deprecate `ErrO1BetaLimitationsLogprobs` and `ErrO1BetaLimitationsOther`

- Implement `validationRequestForReasoningModels`, which works on both o1 & o3, and has per-model-type restrictions on functionality (eg, o3 class are allowed function calls and system messages, o1 isn't)

* Move reasoning validation to `reasoning_validator.go`

- Add a `NewReasoningValidator` which exposes a `Validate()` method for a given request

- Also adds a test for chat streams

* Final nits
2025-02-06 14:53:19 +00:00
genglixia
d10f1b8199 add chatcompletion stream delta refusal and logprobs (#882)
* add chatcompletion stream refusal and logprobs

* fix slice to struct

* add  integration test

* fix lint

* fix lint

* fix: the object should be pointer

---------

Co-authored-by: genglixia <genglixia@enjoypartytime.com>
2024-10-29 07:22:52 +00:00
Ivan Timofeev
9add1c3486 add max_completions_tokens for o1 series models (#857)
* add max_completions_tokens for o1 series models

* add validation for o1 series models validataion + beta limitations
2024-09-20 21:40:24 +01:00
eiixy
dd7f5824f9 fix: fullURL endpoint generation (#817) 2024-08-16 18:11:38 +01:00
Liu Shuang
6af32202d1 feat: support stream_options (#736)
* feat: support stream_options

* fix lint

* fix lint
2024-05-07 16:42:24 +04:00
往日。
2d58f8f4b8 chore: add SystemFingerprint for chat completion stream response (#716)
* chore: add SystemFingerprint for stream response

* chore: add test

* lint: format for test
2024-04-24 16:02:03 +04:00
Mike Chaykowsky
c6a63ed19a Add PromptFilterResult (#702) 2024-04-16 23:28:06 +04:00
Simone Vellei
1ad6b6f53d Feat Support tools and tools choice new fileds (#526)
* feat: support tools and tools choice new fileds

* fix: use value not pointers
2023-11-07 19:53:24 +04:00
ZeroDeng
1153eb2595 Add support for azure openai new version API (2023-07-01-preview) (#451) 2023-07-20 19:25:58 +03: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
cem-unuvar
720377087f feat: added function call info to chat completions (#390) 2023-06-20 19:33:53 +04:00
Liu Shuang
0bd14f9584 refactor: ChatCompletionStreamChoice.FinishReason from string to FinishReason (#372) 2023-06-15 13:58:26 +04:00
Ccheers
2bd65aa720 feat(chat): support function call api (#369)
* feat(chat): support function call api

* rename struct & add const ChatMessageRoleFunction
2023-06-15 12:49:54 +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
1394329e44 move error_accumulator into internal pkg (#304) (#335)
* move error_accumulator into internal pkg (#304)

* move error_accumulator into internal pkg (#304)

* add a test for ErrTooManyEmptyStreamMessages in stream_reader (#304)
2023-06-05 18:35:46 +04:00
渡邉祐一 / Yuichi Watanabe
62eb4beed2 move marshaller and unmarshaler into internal pkg (#304) (#325) 2023-05-28 05:51:07 +04: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
quzard
1b8feae0b6 Do not return when not present (#294) 2023-05-02 21:41:21 +04:00
Liu Shuang
d6ab1b3a4f fix: chat stream resp error (#259) 2023-04-19 13:05:00 +01:00
harry
2f3700f4c5 to fix v1.5.8 Usage return (#223)
* add ChatCompletionStream Usage return

* ChatCompletionStreamResponse will bot return Usage

* remove the Usage field from the response, it would not be there anyway.

---------

Co-authored-by: lihang <nasa.li@deepres.com>
2023-04-04 16:10:54 +04:00
harry
b542086cbb add ChatCompletionStream Usage return (#215)
Co-authored-by: lihang <nasa.li@deepres.com>
2023-04-01 20:06:22 +04:00
Jo
2ebb265e71 refactor: Refactor endpoint and model compatibility check (#180)
* Add model check for chat stream

* Sync model checks

* Fix typo

* Fix functino

* refactor: Refactor endpoint and model compatibility check

* apply review suggestions

* minor fix

* invert return boolean flag

* fix test
2023-03-22 17:46:08 +04:00
Liu Shuang
a5a945ad14 fix: stream return EOF when openai return error (#184)
* fix: stream return EOF when openai return error

* perf: add error accumulator

* fix: golangci-lint

* fix: unmarshal error possibly null

* fix: error accumulator

* test: error accumulator use interface and add test code

* test: error accumulator add test code

* refactor: use stream reader to re-use stream code

* refactor: stream reader use generics
2023-03-22 09:32:47 +04:00
sashabaranov
a8acb5f63b Add tests (#171)
* test models listing

* remove non-needed method

* test for .streamFinished

* add more error tests

* improve stream testing

* fix typo
2023-03-16 19:10:27 +04:00
Alexander Baranov
9eea94730a rename internally 2023-03-04 15:29:42 +04:00
Afeyer
39ca4e9488 Implement chat completion streaming (#101)
* Implement chat completion streaming

* Optimize the implementation of chat completion stream

* Fix linter error
2023-03-03 09:52:02 +04:00