fix(api): Claude thinking beta 헤더를 허용한다
This commit is contained in:
parent
1ce97136ac
commit
3a83f6a7ad
3 changed files with 4 additions and 1 deletions
|
|
@ -261,10 +261,11 @@ anthropic-version: 2023-06-01
|
|||
- `prompt-caching-scope-2026-01-05`
|
||||
- `redact-thinking-2026-02-12`
|
||||
- `structured-outputs-2025-12-15`
|
||||
- `thinking-token-count-2026-05-13`
|
||||
|
||||
지원하지 않는 beta 값을 보내면 `400 invalid_request_error`를 반환한다.
|
||||
Native Messages 경로는 지원 beta 헤더를 upstream으로 전달한다. Chat bridge 경로는 지원 beta 헤더를 upstream으로 전달하지 않고, 아래에 명시한 대응 field만 Chat Completions 형식으로 변환한다.
|
||||
`prompt-caching-scope-2026-01-05`, `advanced-tool-use-2025-11-20`, `redact-thinking-2026-02-12` 수용은 Claude Code 호출 호환성만 제공한다. 이 beta들은 Chat bridge에서 cache, route, stage, provider, workspace 또는 authorization 권한을 만들지 않으며 normalized Chat provider 요청으로 전달되지 않는다.
|
||||
`prompt-caching-scope-2026-01-05`, `advanced-tool-use-2025-11-20`, `redact-thinking-2026-02-12`, `thinking-token-count-2026-05-13` 수용은 Claude Code 호출 호환성만 제공한다. 이 beta들은 Chat bridge에서 cache, route, stage, provider, workspace 또는 authorization 권한을 만들지 않으며 normalized Chat provider 요청으로 전달되지 않는다.
|
||||
|
||||
## Routes
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ var supportedAnthropicBetas = map[string]struct{}{
|
|||
"prompt-caching-scope-2026-01-05": {},
|
||||
"redact-thinking-2026-02-12": {},
|
||||
"structured-outputs-2025-12-15": {},
|
||||
"thinking-token-count-2026-05-13": {},
|
||||
}
|
||||
|
||||
type anthropicRequestEnvelope struct {
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ func TestAnthropicSingleRequestUsesOnePost(t *testing.T) {
|
|||
defer cancel()
|
||||
body := `{"model":"` + testSingleRequestModel + `","max_tokens":128,"messages":[{"role":"user","content":"` + privatePrompt + `"}],"tools":[{"name":"caller_tool","input_schema":{"type":"object"}}]}`
|
||||
req := newAnthropicSingleRequestHTTPReq(t, ctx, httpServer.URL, "/v1/messages", body)
|
||||
req.Header.Set(anthropicBetaHeader, "thinking-token-count-2026-05-13")
|
||||
response, err := httpServer.Client().Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("POST /v1/messages: %v", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue