Skip to content

docs: document new chat completion request params in Go SDK - #254

Merged
edenreich merged 1 commit into
mainfrom
docs/issue-252-20260618-2110
Jun 18, 2026
Merged

edenreich merged 1 commit into
mainfrom
docs/issue-252-20260618-2110

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

Adds a Request parameters section to the Go SDK docs in sdks.md, documenting the optional CreateChatCompletionRequest fields now exposed by the regenerated Go SDK (inference-gateway/sdk#85) and set via client.WithOptions(...).

Covers all the fields from the issue:

  • Scalar pointer fields: temperature, top_p, n, frequency_penalty, presence_penalty, seed, logprobs, top_logprobs, user, max_completion_tokens
  • logit_bias (*map[string]int)
  • reasoning_effort enum (sdk.Minimal/Low/Medium/High)
  • The three oneOf unions with their generated From... constructors: stop (string or array), response_format (text / json_object / json_schema, incl. Structured Outputs), and tool_choice (none/auto/required or named function)
  • max_tokens deprecation in favor of max_completion_tokens

Also documents the WithOptions merge rules (Stream is always overwritten, method-level model/messages win, options persist until WithOptions(nil)), and includes a full field reference table.

Notes

  • The REST contract in api-reference.md already listed these fields; this PR fills the matching gap in the Go SDK quick reference, which never showed how to set them.
  • Examples use a small local ptr[T any] helper - the exact pattern the SDK's own request_fields_test.go uses. The SDK does not export a Ptr helper, so the previously published sdk.Ptr(...) reference in the Go tool-calls example is not actually buildable; new examples avoid relying on it.
  • Drive-by fix: the vision example referenced &sdk.High/&sdk.Low for image detail, but those are reasoning_effort constants. Corrected to &sdk.ImageURLDetailHigh/&sdk.ImageURLDetailLow (the type NewImageContentPart actually expects), which also avoids sdk.Low meaning two different things on the same page.

Verification

  • bun run lint:md - pass
  • bun run format:check - pass
  • bun run build - pass

Closes #252

Add a "Request parameters" section to the Go SDK docs covering the
optional CreateChatCompletionRequest fields exposed via WithOptions:
temperature, top_p, n, stop, frequency_penalty, presence_penalty,
seed, logprobs, top_logprobs, logit_bias, response_format,
tool_choice, user, reasoning_effort, and max_completion_tokens, plus
the max_tokens deprecation. Documents the oneOf union constructors
for stop, response_format, and tool_choice.

Also corrects the vision example to reference the ImageURLDetail
constants instead of the unrelated reasoning-effort constants.

Closes #252
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner June 18, 2026 21:24
@edenreich
edenreich merged commit 5305291 into main Jun 18, 2026
1 check passed
@edenreich
edenreich deleted the docs/issue-252-20260618-2110 branch June 18, 2026 21:34
inference-gateway-releaser Bot added a commit that referenced this pull request Jun 24, 2026
## [0.6.113](0.6.112...0.6.113) (2026-06-24)

### 👷 CI

* **deps:** upgrade actions/checkout from v6.0.3 to v7.0.0 across workflows ([f78b17d](f78b17d))
* **infer:** centralize infer.yml + sync .infer config ([#260](#260)) ([9df8702](9df8702))
* **release:** update GitHub App user ID handling and configure Git settings ([a480285](a480285))

### 📚 Documentation

* add .agents/skills open standard location ([#264](#264)) ([f3ee843](f3ee843))
* add cloudflare d1 conversation storage to cli.md ([#274](#274)) ([00f8698](00f8698))
* document Claude Code subscription mode for infer-action ([#277](#277)) ([03c67da](03c67da))
* document cloudflare workers deployment target in adl-cli ([#248](#248)) ([b530f13](b530f13))
* document MCP_INCLUDE_TOOLS/MCP_EXCLUDE_TOOLS config ([#253](#253)) ([0b37b2a](0b37b2a))
* document new chat completion request params in go sdk ([#254](#254)) ([5305291](5305291)), closes [#252](#252)
* document new chat completion request params in python sdk ([#255](#255)) ([a7f1509](a7f1509))
* document new chat completion request params in rust sdk ([#256](#256)) ([3dfd850](3dfd850))
* document new chat completion request params in typescript sdk ([#257](#257)) ([7c6cb94](7c6cb94))
* document parallel_tool_calls request parameter ([#258](#258)) ([ecbcf2e](ecbcf2e))
* update schema version and codex version in manifest files ([ac0ae96](ac0ae96))

### 🔧 Miscellaneous

* **deps-dev:** bump @types/node from 25.9.3 to 26.0.0 in the bun group ([#267](#267)) ([00f21a8](00f21a8))
* **deps:** bump claude-code-action v1.0.150 -> v1.0.152 ([#259](#259)) ([8a40c05](8a40c05))
* **deps:** bump infer CLI v0.121.1 -> v0.122.2, infer-action v0.15.1 -> v0.15.4 ([#265](#265)) ([4456d69](4456d69))
* **deps:** bump inference-gateway/.github/.github/workflows/claude.yml ([#266](#266)) ([6be8146](6be8146))
* **infer:** remove default configuration ([5ee4690](5ee4690))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.6.113 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Document new chat completion request params in Go SDK

1 participant