Skip to content

Commit f7e63b2

Browse files
committed
Exclude reasoning and thinking configuration parameters from API request body hashing to improve request queuing
- reasoning effort on some providers is applied differently, thus our way of doing [Fragment] doesn't bring the intended effect for them.
1 parent 18a0a66 commit f7e63b2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/editor/src/services/api-manager.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ export class ApiManager {
3030
const cancel_token_source = axios.CancelToken.source()
3131
this.cancel_token_sources.set(request_id, cancel_token_source)
3232

33-
const body_to_hash = { ...params.body }
33+
const body_to_hash = JSON.parse(JSON.stringify(params.body))
3434
delete body_to_hash.reasoning_effort
35+
delete body_to_hash.reasoning
36+
if (body_to_hash.extra_body?.google?.thinking_config) {
37+
delete body_to_hash.extra_body.google.thinking_config
38+
}
3539

3640
const body_hash = createHash('md5')
3741
.update(JSON.stringify(body_to_hash))

0 commit comments

Comments
 (0)