* fix test server setup:
- go map access is not deterministic
- this can lead to a route: /foo/bar/1 matching /foo/bar before matching /foo/bar/1 if the map iteration go through /foo/bar first since the regex match wasn't bound to start and end anchors
- registering handlers now converts * in routes to .* for proper regex matching
- test server route handling now tries to fully match the handler route
* add missing /v1 prefix to fine-tuning job cancel test server handler
* add create message call
* add messages list call
* add get message call
* add modify message call, fix return types for other message calls
* add message file retrieve call
* add list message files call
* code style fixes
* add test for list messages with pagination options
* add beta header to msg calls now that #545 is merged
* Update messages.go
Co-authored-by: Simone Vellei <henomis@gmail.com>
* Update messages.go
Co-authored-by: Simone Vellei <henomis@gmail.com>
* add missing object details for message, fix tests
* fix merge formatting
* minor style fixes
---------
Co-authored-by: Simone Vellei <henomis@gmail.com>
* fix test server setup:
- go map access is not deterministic
- this can lead to a route: /foo/bar/1 matching /foo/bar before matching /foo/bar/1 if the map iteration go through /foo/bar first since the regex match wasn't bound to start and end anchors
- registering handlers now converts * in routes to .* for proper regex matching
- test server route handling now tries to fully match the handler route
* add missing /v1 prefix to fine-tuning job cancel test server handler
* 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
* Add DotProduct Method and README Example for Embedding Similarity Search
- Implement a DotProduct() method for the Embedding struct to calculate the dot product between two embeddings.
- Add a custom error type for vector length mismatch.
- Update README.md with a complete example demonstrating how to perform an embedding similarity search for user queries.
- Add unit tests to validate the new DotProduct() method and error handling.
* Update README to focus on Embedding Semantic Similarity
* feat: implement new fine tuning job API
* fix: export ListFineTuningJobEventsParameter
* fix: lint errors
* fix: test errors
* fix: code test coverage
* fix: code test coverage
* fix: use any
* chore: use url.Values
* Compatible with Azure Openai's 2023-07-01-preview version API interface about the error information returned by the intercepted interface
* Compatible with the 2023-07-01-preview API interface of Azure Openai, when content interception is triggered, the error message will contain innererror.InnerError struct is only valid for Azure OpenAI Service.
* chore: check for models before sending moderation requets to openai endpoint
* chore: table driven tests to include more model cases for moderations endpoint
* fix: invalid schema for function 'func_name': None is not of type 'object' (#429)(#432)
* test: add integration test for function call (#429)(#432)
* style: remove duplicate import (#429)(#432)