Skip to content

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

Closed

Description

The Go SDK (github.com/inference-gateway/sdk) regenerated its types from the updated openapi.yaml (inference-gateway/schemas#71), exposing new optional request parameters on CreateChatCompletionRequest.

User-facing change: the following fields are now available to SDK callers and may want documentation / examples.

New / changed request fields:

  • temperature (number 0-2, default 1)
  • top_p (number 0-1, default 1)
  • n (integer 1-128, default 1)
  • stop (oneOf: string or array of 1-4 strings)
  • frequency_penalty (number -2..2, default 0)
  • presence_penalty (number -2..2, default 0)
  • seed (integer)
  • logprobs (boolean, default false)
  • top_logprobs (integer 0-20)
  • response_format (oneOf: text, json_schema, json_object)
  • tool_choice (oneOf: string enum none/auto/required, or named tool choice)
  • logit_bias (object mapping token id to integer bias)
  • user (string)
  • reasoning_effort (enum: minimal/low/medium/high)
  • max_completion_tokens (integer)
  • max_tokens is now deprecated (use max_completion_tokens)

Affected pages: Go SDK usage / reference docs, and any chat-completions request examples.

Source PR: inference-gateway/sdk#85

Activity

  1. added
    documentation
    on Jun 18, 2026
  2. edenreich commented on Jun 18, 2026

    @edenreich
    Contributor

    @claude Can you document it?

  3. added theissue type on Jun 18, 2026
  4. moved this to Todo in 2026on Jun 18, 2026
  5. inference-gateway-maintainer commented on Jun 18, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 14m 2s —— View job • docs/issue-252-20260618-2110 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-252-20260618-2110?quick_pull=1&title=Issue%20%23252%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23252%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documenting new chat completion request params in Go SDK

    • Gather context (read Go SDK docs + chat completion examples)
    • Understand the request
    • Verify the real Go SDK API against the SDK source
    • Document new request params in the Go section of sdks.md
    • Run lint / format / build checks
    • Commit and open PR

    Done. Opened PR #254.

    What changed

    Added a Request parameters section to the Go SDK part of sdks.md, documenting the optional CreateChatCompletionRequest fields the regenerated SDK now exposes via client.WithOptions(...):

    • Scalar pointer fields - temperature, top_p, n, frequency_penalty, presence_penalty, seed, logprobs, top_logprobs, user, max_completion_tokens
    • logit_bias (*map[string]int) and the 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
    • The WithOptions merge rules + a full field reference table

    Notes

    • api-reference.md already documented these at the REST level; this fills the matching gap in the Go SDK quick reference.
    • 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, so the page's prior sdk.Ptr(...) reference isn't actually buildable; the new examples don't rely on it.
    • Drive-by fix: the vision example used &sdk.High/&sdk.Low for image detail, but those are reasoning_effort constants - corrected to &sdk.ImageURLDetailHigh/&sdk.ImageURLDetailLow (what NewImageContentPart expects).

    Verification

    bun run lint:md, bun run format:check, and bun run build all pass.


    • branch docs/issue-252-20260618-2110 - PR #254
  6. moved this from Todo to In progress in 2026on Jun 18, 2026
  7. added a commit that references this issue on Jun 18, 2026
    b724728
  8. moved this from In progress to QA in 2026on Jun 18, 2026
  9. moved this from QA to Done in 2026on Jun 18, 2026
  10. inference-gateway-releaser commented on Jun 24, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.6.113 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions