Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers, and the stream request helper is now a generic method on
Client; omitzero is not applied, since it changes what the JSON says.
Co-authored-by: Hanzo Dev <[email protected]>
github.com held commits this host lacked, which refuses the mirror push
("fetch first") and stops github receiving anything at all. Merging rather
than overwriting, so the mirror is a fast-forward again and neither side's
work is dropped.
Adds .hanzo/workflows/cicd.yml calling the canonical pipeline and drops the
GitHub-hosted workflows it replaces. Lands here because this is where the repo
is written — git.hanzo.ai is upstream and github.com is its push mirror, so the
same change made on github.com never reaches the runner fleet.
Apache-2.0 §4(c) asks a derivative work to carry the attribution of what it was
built from. This tree carried none: LICENSE was the unmodified boilerplate with
its copyright line still the [yyyy] [name of copyright owner] placeholder, and
no NOTICE existed. The upstream is named directly here.
.hanzo/workflows already exists, and the forge resolves the first workflow
directory that exists rather than the union — so these three have run nothing
here since it landed. Removing them makes that visible in the tree.
The sanity check's real content is now in hanzo.yml: `go vet` and the race
detector join the build and test that were already there. Lost with it:
golangci-lint and the Codecov upload, which reports to a SaaS bound to GitHub.
close-inactive-issues.yml drops as GitHub issue automation. integration-tests.yml
drops because it drives the live OpenAI API and no key is declared on this repo
or the hanzoai org, so it could only ever have failed; API-contract coverage is
lost until one exists.
github.com has no runner for hanzo-build-linux-amd64, so a caller under
.github/workflows is a gate that can never be scheduled. This is the ~7-line
caller on the plane that can (git.hanzo.ai git-runner fleet), pinned @v1.
Co-authored-by: Hanzo Dev <[email protected]>
MarshalJSON had drifted to a pointer receiver while Properties gained
`,omitempty`. Together those defeated the nil->empty-map fill: encoding/json
never invokes a pointer-receiver MarshalJSON on non-addressable values (map
entries, a Definition passed by value), and omitempty drops the empty map even
when it does. Nested schemas therefore lost the "properties":{} that OpenAI
requires on object schemas — the exact bug #419/#434 fixed.
Value receiver restores the guarantee for map entries and by-value marshals;
dropping omitempty lets the filled empty map through. TestDefinition_MarshalJSON
(got and gotPtr) passes again.
Co-authored-by: Hanzo Dev <[email protected]>
The fork kept the upstream module path (module github.com/sashabaranov/
go-openai), so every consumer could only reach it through a
"replace github.com/sashabaranov/go-openai => github.com/hanzoai/go-openai"
directive — and Go replace directives do NOT propagate to consumers, so each
downstream repo had to copy the same replace or fail to compile against
fork-only fields (e.g. ReasoningContent). That is the opposite of one-and-
only-one-way.
Declare the fork's OWN module path so it can be required directly and inherited
transitively. Package name stays 'openai' (import identifier unchanged); only
the module path + internal self-imports (/internal, /jsonschema) are renamed.
Upstream issue-URL comments are left intact as attribution. Builds + vets clean.
Co-authored-by: Hanzo Dev <[email protected]>
* 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
* 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
* 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
* 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
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.