Python: [BREAKING] Removed default "store" value (#2443)

* Removed default store value

* Small fix
This commit is contained in:
Dmytro Struk
2025-11-25 17:53:08 +00:00
committed by GitHub
parent d302bffc63
commit b8260ae24c
5 changed files with 38 additions and 36 deletions
@@ -308,12 +308,14 @@ class AzureAIClient(OpenAIBaseResponsesClient):
return result, instructions
async def prepare_options(
self, messages: MutableSequence[ChatMessage], chat_options: ChatOptions
self,
messages: MutableSequence[ChatMessage],
chat_options: ChatOptions,
**kwargs: Any,
) -> dict[str, Any]:
"""Take ChatOptions and create the specific options for Azure AI."""
chat_options.store = bool(chat_options.store or chat_options.store is None)
prepared_messages, instructions = self._prepare_input(messages)
run_options = await super().prepare_options(prepared_messages, chat_options)
run_options = await super().prepare_options(prepared_messages, chat_options, **kwargs)
agent_reference = await self._get_agent_reference_or_create(run_options, instructions)
run_options["extra_body"] = {"agent": agent_reference}
@@ -378,12 +380,12 @@ class AzureAIClient(OpenAIBaseResponsesClient):
self, response: OpenAIResponse | ParsedResponse[BaseModel], store: bool | None
) -> str | None:
"""Get the conversation ID from the response if store is True."""
if store:
# If conversation ID exists, it means that we operate with conversation
# so we use conversation ID as input and output.
if response.conversation and response.conversation.id:
return response.conversation.id
# If conversation ID doesn't exist, we operate with responses
# so we use response ID as input and output.
return response.id
return None
if store is False:
return None
# If conversation ID exists, it means that we operate with conversation
# so we use conversation ID as input and output.
if response.conversation and response.conversation.id:
return response.conversation.id
# If conversation ID doesn't exist, we operate with responses
# so we use response ID as input and output.
return response.id