Skip to content

Commit

Permalink
fix: send correct Accept header for certain endpoints (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 21, 2025
1 parent 151fe16 commit 5668abf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/resources/beta/messages/batches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export class Batches extends APIResource {
...options,
headers: {
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
Expand Down
9 changes: 8 additions & 1 deletion src/resources/messages/batches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ export class Batches extends APIResource {
}

return this._client
.get(batch.results_url, { ...options, __binaryResponse: true })
.get(batch.results_url, {
...options,
headers: {
Accept: 'application/binary',
...options?.headers,
},
__binaryResponse: true,
})
._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
}
}
Expand Down

0 comments on commit 5668abf

Please sign in to comment.