376 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 2e39f0248d Go 1.27.1, and the code it can say more simply
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]>
2026-09-16 19:23:22 -07:00
zeekay 8f73ecd09a carry the github copy onto the forge
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.
2026-08-20 21:54:25 -07:00
zeekay 47adbe3635 run on the native fleet
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.
2026-08-20 20:12:21 -07:00
zeekay de6af5dce6 add the NOTICE this fork owes its upstream
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.
2026-08-20 09:59:55 -07:00
zeekay ce1d2c7960 ci: retire the dead .github lane, fold its gate into hanzo.yml
.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.
2026-08-13 21:12:10 -07:00
zeekayandHanzo Dev c8ca2910d4 ci: canonical pair — hanzo.yml + forge caller
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]>
2026-08-06 02:38:24 -07:00
zeekayandHanzo Dev f83e1080f5 chore(go): bump go directive to 1.26.5
Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 11:07:44 -07:00
zeekayandHanzo Dev 6168c092c9 jsonschema: emit properties:{} again — value receiver + no omitempty
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]>
2026-07-27 15:43:22 -07:00
zeekayandHanzo Dev 88762272c3 refactor(module): declare own import path github.com/hanzoai/go-openai
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]>
v1.41.0
2026-07-17 21:55:51 -07:00
zeekay fc6a641ca6 docs(brand): add hero banner 2026-06-28 20:31:49 -07:00
zeekay c954e4f6fd chore(brand): dynamic hero banner 2026-06-28 20:31:48 -07:00
zooqueenandHanzo Dev a3a3060f3d docs: tidy LLM.md indexes; CLAUDE.md -> LLM.md symlink convention
Co-authored-by: Hanzo Dev <[email protected]>
2026-06-17 09:34:01 -07:00
zooqueenandHanzo Dev 05ae43d01e Add agent project docs (CLAUDE.md, LLM.md)
Co-authored-by: Hanzo Dev <[email protected]>
2026-05-31 21:39:47 -07:00
zeekay 4a7c62c270 fix: restore original module path for replace directive compatibility v1.39.0 v1.40.0 2026-02-22 12:29:32 -08:00
hsluoyzandGitHub 0258c20376 feat: Update go.mod to our repo 2025-03-01 09:48:07 +08:00
Dark-qyandGitHub b9d80b3b26 feat: add reason content (#1) 2025-03-01 09:47:38 +08:00
Alex BaranovandGitHub 80c2de9df3 Fix linter (#943)
* fix lint

* remove linters
2025-02-25 16:56:35 +00:00
Dan AckersonandGitHub c1c8c11413 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 ShuangandGitHub adcbec02f5 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 ShuangandGitHub 21fda71212 feat: add developer role (#936) 2025-02-12 15:05:44 +00:00
Mazyar Yousefiniyae shadandGitHub 8c6a2f1dfd ref: add image url support to messages (#933)
* ref: add image url support to messages

* fix linter error

* fix linter error
2025-02-09 18:36:44 +00:00
rory malcolmandGitHub 419a197b1f 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
saileshd1402andGitHub bb96345a95 Make "Content" field in "ChatCompletionMessage" omitempty (#926) 2025-01-31 19:05:29 +00:00
Trevor CreechandGitHub 3f0537b37b 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 RedkoandGitHub 4b2b7add52 Simplify tests with T.TempDir (#929) 2025-01-31 18:55:41 +00:00
Sabuhi GurbaniandGitHub ec7717bfab Added additional_messages (#914) 2024-12-27 10:01:16 +00:00
Alex BaranovandGitHub 3915ee3181 Ignore test.mp3 (#913) 2024-12-08 13:16:48 +00:00
Tim MisiakandGitHub b333bf6216 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 WangandGitHub 6d4326b56c feat: add RecvRaw (#896) 2024-11-30 10:29:05 +00:00
Liu ShuangandGitHub 93c79ce775 feat: add gpt-4o-2024-11-20 model (#905) 2024-11-30 09:39:47 +00:00
nagar-ajayandGitHub 64eac09769 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
LinYushenandGitHub 7c1fd05756 o1 model support stream (#904) 2024-11-20 20:26:10 +00:00
Ayush SawantandGitHub ec299e601a 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 DepokandGitHub 7137a36e95 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 DavisandGitHub 6428f8d7ac Added Vector Store File List properties that allow for pagination (#891) 2024-11-08 13:53:02 +00:00
6e1421c916 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 <[email protected]>
2024-10-29 07:22:52 +00:00
Ayush SawantandGitHub 6e9def30fc 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ćandGitHub e70c414645 fix: Updated Assistent struct with latest fields based on OpenAI docs (#883) 2024-10-21 21:57:02 +01:00
Ayush SawantandGitHub 1900d04ea5 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-CraneandGitHub d0e35c29df Completion API: add Store and Metadata parameters (#878) 2024-10-15 21:16:57 +01:00
Alex BaranovandGitHub fbea48625d Cleanup (#879)
* remove obsolete files

* update readme
2024-10-15 20:09:34 +01:00
Matt JacobsandGitHub b03ad926e8 Adding new moderation model constants (#875) 2024-10-14 14:21:39 +01:00
Ayush SawantandGitHub 92c038c2a8 return response body as byte slice for RequestError type (#873) 2024-10-14 14:20:39 +01:00
Isaac SeymourandGitHub e14e1128d6 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 MartinsandGitHub 9369557d5c 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 LiuandGitHub 1971ef42fb fix MaxCompletionTokens typo (#862)
* fix spelling error

* fix lint

* Update chat.go

* Update chat.go
2024-10-03 20:17:16 +01:00
Liu ShuangandGitHub 803b44db6d feat: usage struct add CompletionTokensDetails (#863) 2024-09-26 13:30:56 +03:00
Jialin TianandGitHub 24f3b0e636 fix: ParallelToolCalls should be added to RunRequest (#861) 2024-09-26 13:26:54 +03:00
Alex PhilippandGitHub 6206fa862c 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
eiixyandGitHub 132ca1057d 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