Merge pull request #2136 from ksylvan/opus-4-8-sampling-params-fix

chore: extend sampling param exclusion to Opus 4.8 models
This commit is contained in:
Kayvan Sylvan 2026-06-02 16:29:14 -07:00 committed by GitHub
commit 8e452510e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
### PR [#2136](https://github.com/danielmiessler/Fabric/pull/2136) by [ksylvan](https://github.com/ksylvan): chore: extend sampling param exclusion to Opus 4.8 models
- Extends the sampling parameter exclusion logic to cover Opus 4.8 models, ensuring consistent behavior alongside the existing Opus 4.7 exclusion.
- Adds the `claude-opus-4-8` model prefix to the sampling parameter exclusion check.
- Updates the associated code comment to explicitly reference Opus 4.8 models.

View file

@ -25,9 +25,9 @@ const webSearchToolType = "web_search_20250305"
const sourcesHeader = "## Sources"
func modelDisallowsSamplingParams(model string) bool {
// Anthropic's Opus 4.7 models reject non-default sampling parameters.
// Anthropic's Opus 4.7 and Opus 4.8 models reject non-default sampling parameters.
// Omit these params entirely for safest compatibility.
return strings.HasPrefix(model, "claude-opus-4-7")
return strings.HasPrefix(model, "claude-opus-4-7") || strings.HasPrefix(model, "claude-opus-4-8")
}
func NewClient() (ret *Client) {