Commit Graph

361 Commits

Author SHA1 Message Date
Liu Shuang
74d6449f22 feat: add gpt-4.5-preview models (#947) 2025-03-04 08:26:59 +00:00
Alex Baranov
261721bfdb Fix linter (#943)
* fix lint

* remove linters
2025-02-25 16:56:35 +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
Liu Shuang
85f578b865 fix: remove validateO1Specific (#939)
* fix: remove validateO1Specific

* update golangci-lint-action version

* fix actions

* fix actions

* fix actions

* fix actions

* remove some o1 test
2025-02-17 11:29:18 +00:00
Liu Shuang
c0a9a75fe0 feat: add developer role (#936) 2025-02-12 15:05:44 +00:00
Mazyar Yousefiniyae shad
a62919e8c6 ref: add image url support to messages (#933)
Some checks failed
Integration tests / Run integration tests (push) Has been cancelled
Sanity check / Sanity check (push) Has been cancelled
* ref: add image url support to messages

* fix linter error

* fix linter error
2025-02-09 18:36:44 +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
saileshd1402
45aa99607b Make "Content" field in "ChatCompletionMessage" omitempty (#926) 2025-01-31 19:05:29 +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
Oleksandr Redko
7a2915a37d Simplify tests with T.TempDir (#929) 2025-01-31 18:55:41 +00:00
Sabuhi Gurbani
2a0ff5ac63 Added additional_messages (#914) 2024-12-27 10:01:16 +00:00
Alex Baranov
56a9acf86f Ignore test.mp3 (#913) 2024-12-08 13:16:48 +00:00
Tim Misiak
af5355f5b1 Fix ID field to be optional (#911)
The ID field is not always present for streaming responses. Without omitempty, the entire ToolCall struct will be missing.
2024-12-08 13:12:05 +00:00
Qiying Wang
c203ca001f feat: add RecvRaw (#896) 2024-11-30 10:29:05 +00:00
Liu Shuang
21fa42c18d feat: add gpt-4o-2024-11-20 model (#905) 2024-11-30 09:39:47 +00:00
nagar-ajay
74ed75f291 Make user field optional in embedding request (#899)
* make user optional in embedding request

* fix unit test
2024-11-20 20:39:44 +00:00
LinYushen
1687616165 o1 model support stream (#904) 2024-11-20 20:26:10 +00:00
Ayush Sawant
b3ece4d32e Updated client_test to solve lint error (#900)
* updated client_test to solve lint error

* modified golangci yml to solve linter issues

* minor change
2024-11-19 20:37:10 +00:00
Denny Depok
6d066bb12d Support Attachments in MessageRequest (#890)
* add attachments in MessageRequest

* Move tools const to message

* remove const, just use assistanttool const
2024-11-08 13:54:27 +00:00
Matt Davis
f5e6e0e4fe Added Vector Store File List properties that allow for pagination (#891) 2024-11-08 13:53:02 +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
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
Edin Ćoralić
3672c0dec6 fix: Updated Assistent struct with latest fields based on OpenAI docs (#883) 2024-10-21 21:57:02 +01: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
Sander Mack-Crane
9fe2c6ce1f Completion API: add Store and Metadata parameters (#878) 2024-10-15 21:16:57 +01:00
Alex Baranov
b162541513 Cleanup (#879)
* remove obsolete files

* update readme
2024-10-15 20:09:34 +01:00
Matt Jacobs
21f7134574 Adding new moderation model constants (#875) 2024-10-14 14:21:39 +01:00
Ayush Sawant
cfe15ffd00 return response body as byte slice for RequestError type (#873) 2024-10-14 14:20:39 +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
Julio Martins
7c145ebb4b add jailbreak filter result, add ContentFilterResults on output (#864)
* add jailbreak filter result

* add content filter results on completion output

* add profanity content filter
2024-10-03 20:19:48 +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
Liu Shuang
fdd59d9341 feat: usage struct add CompletionTokensDetails (#863) 2024-09-26 13:30:56 +03:00
Jialin Tian
e9d8485e90 fix: ParallelToolCalls should be added to RunRequest (#861) 2024-09-26 13:26:54 +03:00
Alex Philipp
7f80303cc3 Fix max_completion_tokens (#860)
The json tag is incorrect, and results in an error from the API when using the o1 model.  

I didn't modify the struct field name to maintain compatibility if anyone else had started using it, but it wouldn't work for them either.
2024-09-26 13:26:22 +03: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
Jialin Tian
9a4f3a7dbf feat: add ParallelToolCalls to RunRequest (#847) 2024-09-20 21:49:28 +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
Wei-An Yen
1ec8c24ea7 fix: jsonschema integer validation (#852) 2024-09-20 19:22:01 +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
Quest Henkart
194a03e763 Add refusal (#844)
* add custom marshaller, documentation and isolate tests

* fix linter

* add missing field
2024-09-11 21:24:49 +01:00
Arun Das
643da8d650 depricated model GPT3Ada changed to GPT3Babbage002 (#843)
* depricated model GPT3Ada changed to GPT3Babbage002

* Delete test.mp3
2024-09-04 12:49:57 +01:00
Tommy Mathisen
c37cf9ab5b Dynamic model (#838) 2024-09-01 16:30:29 +01:00
Alex Baranov
030b7cb7ed fix integration tests (#834) 2024-08-24 18:11:27 +01:00
eiixy
a3bd2569ac Improve handling of JSON Schema in OpenAI API Response Context (#819)
* feat: add jsonschema.Validate and jsonschema.Unmarshal

* fix Sanity check

* remove slices.Contains

* fix Sanity check

* add SchemaWrapper

* update api_integration_test.go

* update method 'reflectSchema' to support 'omitempty' in JSON tag

* add GenerateSchemaForType

* update json_test.go

* update `Warp` to `Wrap`

* fix Sanity check

* fix Sanity check

* update api_internal_test.go

* update README.md

* update README.md

* remove jsonschema.SchemaWrapper

* remove jsonschema.SchemaWrapper

* fix Sanity check

* optimize code formatting
2024-08-24 18:06:08 +01:00
Alexey Michurin
5162adbbf9 Support http client middlewareing (#830) 2024-08-23 11:47:11 +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
Grey Baker
d86425a5cf Allow structured outputs via function calling (#828) 2024-08-16 18:41:39 +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