From 49a527fc22447b85a0fe6fb945a6ece4e18de260 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 21 Oct 2026 22:14:10 +0000 Subject: Thread idempotency key through the request path Propagate the per-request Idempotency-Key (generated once in the retry loop) through request construction so every retry attempt reuses the same key rather than minting a new one. - Add field to ChatCompletionsData. - Generate a single key per logical request in chat_completions and chat_completions_streaming. - Thread the key through request_builder (macro-based clients), Bedrock, and VertexAI so the header is attached once and reused on retries. --- src/client/openai.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/openai.rs') diff --git a/src/client/openai.rs b/src/client/openai.rs index 0c46fc3..61293ab 100644 --- a/src/client/openai.rs +++ b/src/client/openai.rs @@ -230,6 +230,7 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod top_p, functions, stream, + idempotency_key: _, } = data; let messages_len = messages.len(); -- cgit v1.2.3