* 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
* Add support for multi part chat messages
OpenAI has recently introduced a new model called gpt-4-visual-preview,
which now supports images as input. The chat completion endpoint accepts
multi-part chat messages, where the content can be an array of structs
in addition to the usual string format.
This commit introduces new structures and constants to represent
different types of content parts. It also implements the json.Marshaler
and json.Unmarshaler interfaces on ChatCompletionMessage.
* Add ImageURLDetail and ChatMessagePartType types
* Optimize ChatCompletionMessage deserialization
* Add ErrContentFieldsMisused error
* fix ToolChoiche typo
* add tool_call_id to ChatCompletionMessage
* add /chat system_fingerprint response field
* check empty ToolCallID JSON marshaling
and add omitempty for tool_call_id
* messages also required; don't omitempty
* add Type to ToolCall, required by the API
* fix test, omitempty for response_format ptr
* fix casing of role values in comments
* feat: use json.rawMessage, test functions
* chore: lint
* fix: tests
the ChatCompletion mock server doesn't actually run otherwise. N=0
is the default request but the server will treat it as n=1
* fix: tests should default to n=1 completions
* chore: add back removed interfaces, custom marshal
* chore: lint
* chore: lint
* chore: add some tests
* chore: appease lint
* clean up JSON schema + tests
* chore: lint
* feat: remove backwards compatible functions
for illustrative purposes
* fix: revert params change
* chore: use interface{}
* chore: add test
* chore: add back FunctionDefine
* chore: /s/interface{}/any
* chore: add back jsonschemadefinition
* chore: testcov
* chore: lint
* chore: remove pointers
* chore: update comment
* chore: address CR
added test for compatibility as well
---------
Co-authored-by: James <jmacwhyte@MacBooger-II.local>
* 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