Commit Graph

61 Commits

Author SHA1 Message Date
rory malcolm
bb5bc27567 Add support for 4o-mini and 3o (#968)
- This adds supports, and tests, for the 3o and 4o-mini class of models
2025-04-29 14:34:33 +01:00
Takahiro Ikeuchi
d68a683815 feat: add new GPT-4.1 model variants to completion.go (#966)
* feat: add new GPT-4.1 model variants to completion.go

* feat: add tests for unsupported models in completion endpoint

* fix: add missing periods to test function comments in completion_test.go
2025-04-23 22:50:47 +01:00
Liu Shuang
74d6449f22 feat: add gpt-4.5-preview models (#947) 2025-03-04 08:26:59 +00: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
Trevor Creech
9823a8bbbd Chat Completion API: add ReasoningEffort and new o1 models (#928)
* add reasoning_effort param

* add o1 model

* fix lint
2025-01-31 18:57:57 +00:00
Liu Shuang
21fa42c18d feat: add gpt-4o-2024-11-20 model (#905) 2024-11-30 09:39:47 +00:00
LinYushen
1687616165 o1 model support stream (#904) 2024-11-20 20:26:10 +00:00
Ayush Sawant
6e087322b7 Updated checkPromptType function to handle prompt list in completions (#885)
* updated checkPromptType function to handle prompt list in completions

* removed generated test file

* added corresponding unit testcases

* Updated to use less nesting with early returns
2024-10-25 14:41:45 +01:00
Sander Mack-Crane
9fe2c6ce1f Completion API: add Store and Metadata parameters (#878) 2024-10-15 21:16:57 +01:00
Isaac Seymour
991326480f Completion API: add new params (#870)
* Completion API: add 'store' param

This param allows you to opt a completion request in to being stored,
for use in distillations and evals.

* Add cached and audio tokens to usage structs

These have been added to the completions API recently:
https://platform.openai.com/docs/api-reference/chat/object#chat/object-usage
2024-10-09 10:50:27 +01:00
Winston Liu
bac7d59361 fix MaxCompletionTokens typo (#862)
* fix spelling error

* fix lint

* Update chat.go

* Update chat.go
2024-10-03 20:17:16 +01: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
Aaron Batilo
a5fb55321b Support OpenAI reasoning models (#850)
These model strings are now available for use.

More info:
https://openai.com/index/introducing-openai-o1-preview/
https://platform.openai.com/docs/guides/reasoning
2024-09-17 21:19:47 +01:00
Tommy Mathisen
c37cf9ab5b Dynamic model (#838) 2024-09-01 16:30:29 +01:00
eiixy
dd7f5824f9 fix: fullURL endpoint generation (#817) 2024-08-16 18:11:38 +01:00
eiixy
2c6889e081 fix: #788 (#800) 2024-08-10 22:05:06 +01:00
Daniel Chalef
dbe726c59f Add support for gpt-4o-2024-08-06 (#812)
* feat: Add GPT-4o Mini model support

* feat: Add GPT-4o-2024-08-06 model support
2024-08-07 11:21:38 +01:00
Daniel Chalef
27c1c56f0b feat: Add GPT-4o Mini model support (#796) 2024-07-19 15:06:51 +01:00
Adam Smith
fd41f7a5f4 Fix integration test (#762)
* added TestCompletionStream test

moved completion stream testing to seperate function
added NoErrorF
fixes nil pointer reference on stream object

* update integration test models
2024-06-13 17:23:07 +04:00
nullswan
9f19d1c93b Add gpt4o (#742)
* Add gpt4o

* disabled model for endpoint

seen in e0d0801ac7

* Update completion.go

---------

Co-authored-by: Alexander Baranov <677093+sashabaranov@users.noreply.github.com>
2024-05-13 23:07:07 +04:00
Kevin Mesiab
3b25e09da9 enhancement: Add new GPT4-o and alias to completion enums (#744) 2024-05-13 22:48:14 +04:00
Liu Shuang
e0d0801ac7 feat: add GPT4Turbo and GPT4Turbo20240409 (#703) 2024-04-11 12:39:10 +04:00
Liu Shuang
bc8cdd33d1 add GPT3Dot5Turbo0125 model (#648) 2024-02-02 14:30:24 +04:00
Daniil
4c41f24a99 Support January 25, 2024, models update. (#644) 2024-01-26 12:41:48 +04:00
Simon Klee
6c52952b69 feat(completion): add constants for new GPT models (#520)
Added constants for new GPT models including `gpt-4-1106-preview`,
`gpt-4-vision-preview` and `gpt-3.5-turbo-1106`.

The models were announced in the following blog post: https://openai.com/blog/new-models-and-developer-products-announced-at-devday
2023-11-07 00:22:48 +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
181fc2ade9 docs: explanation about LogitBias. (129) (#426) 2023-07-09 12:11:39 +03:00
Liu Shuang
7b22898f5d Implement OpenAI July 2023 Updates (#427)
* Implement OpenAI July 2023 Updates

* fix: golangci-lint

* add comment

* fix: remove some model Deprecated
2023-07-09 12:09:50 +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
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
beichideyuwan
7e76a682a9 Add 16k 0613 model (#365)
* add 16k_0613 model

* add 16k_0613 model

* add model:
2023-06-14 18:23:03 +04:00
Simon Klee
3f4e3bb0ca models: add *-0613 models (#361)
Added GPT3Dot5Turbo0613, GPT3Dot5Turbo16K, GPT40613, and GPT432K0613
models from June update
(https://openai.com/blog/function-calling-and-other-api-updates)

Issue #360
2023-06-14 00:32:26 +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
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
sashabaranov
d94c5e7edd Test request builder + streams (#242)
* test request builder + streams

* provide prompt to test
2023-04-09 18:46:58 +04:00
NullpointerW
bee0656174 CompletionBatchingRequestSupport (#220)
* completionBatchingRequestSupport

* lint fix

* fix Run test fail

* fix TestClientReturnsRequestBuilderErrors fail

* fix Codecov  check

* ignore TestClientReturnsRequestBuilderErrors lint

* fix lint again

* lint again*2

* replace checkPromptType  implementation

* remove nil check

---------

Co-authored-by: W <825708370@qq.com>
2023-04-03 11:05:33 +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
sashabaranov
a6b35c3ab5 Check for Stream parameter usage (#174)
* check for stream:true usage

* lint
2023-03-18 19:31:54 +04:00
sashabaranov
c34bc77f1a Add testable request builder (#162)
* Add testable request builder

* improve tests
2023-03-15 13:16:33 +04:00
sashabaranov
53d195cf5a add testable json marshaller (#161) 2023-03-15 12:16:47 +04:00
jooyyy.eth
98807ecba6 Feat: Add support for gpt-4 models (#157) 2023-03-15 11:43:08 +04:00
sashabaranov
522ae20999 Warn about GPT3.5-turbo models in regular completion (#127) 2023-03-06 12:55:21 +04:00
Alexander Baranov
9eea94730a rename internally 2023-03-04 15:29:42 +04:00
bestgopher
58d99eb220 refactor: use http.NewRequestWithContext instead of http.NewRequest (#97) 2023-03-02 10:27:09 +04:00
sashabaranov
c8261c5638 Add chat completions (#90) 2023-03-02 00:47:25 +04:00
sashabaranov
3695eb3ade use int64 timestamps everywhere (#59) 2023-01-28 23:18:59 +04:00
zacherystuart
0f9f4aa343 Add Suffix to CompletionRequest for insert mode (#36)
Add "Suffix" to "CompletionRequest" to support the new insert mode.

Insert mode info: https://openai.com/blog/gpt-3-edit-insert/
New Completion Request API Reference: https://beta.openai.com/docs/api-reference/completions/create#completions/create-prompt
2022-12-02 14:54:56 +04:00
Matt Trefilek
3697bf4a97 Add new text-davinci-003 model to constants (#35) 2022-11-30 13:07:31 +04:00
Oleg
d63df93c65 Add OpenAI Mock Server (#31)
* add constants for completions, refactor usage, add test server

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* append v1 endpoint to test

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* add makefile for easy targets

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* lint files & add linter

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* disable real API tests in short mode

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
2022-08-11 15:29:23 +06:00
Oleg
53212c71df Migrate From Old Completions + Embedding Endpoint (#28)
* migrate away from deprecated OpenAI endpoints

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* test embedding correctness

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
2022-08-02 14:16:54 +06:00