Skip to content

Initial store changes #39677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sdk/ai/azure-ai-inference/azure/ai/inference/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def __init__(
seed: Optional[int] = None,
model: Optional[str] = None,
model_extras: Optional[Dict[str, Any]] = None,
store: Optional[bool] = None,
**kwargs: Any,
) -> None:

Expand All @@ -313,6 +314,7 @@ def __init__(
self._seed = seed
self._model = model
self._model_extras = model_extras
self._store = store

# For Key auth, we need to send these two auth HTTP request headers simultaneously:
# 1. "Authorization: Bearer <key>"
Expand Down Expand Up @@ -349,6 +351,7 @@ def complete(
seed: Optional[int] = None,
model: Optional[str] = None,
model_extras: Optional[Dict[str, Any]] = None,
store: Optional[bool] = None,
**kwargs: Any,
) -> _models.ChatCompletions: ...

Expand All @@ -372,6 +375,7 @@ def complete(
seed: Optional[int] = None,
model: Optional[str] = None,
model_extras: Optional[Dict[str, Any]] = None,
store: Optional[bool] = None,
**kwargs: Any,
) -> Iterable[_models.StreamingChatCompletionsUpdate]: ...

Expand All @@ -395,6 +399,7 @@ def complete(
seed: Optional[int] = None,
model: Optional[str] = None,
model_extras: Optional[Dict[str, Any]] = None,
store: Optional[bool] = None,
**kwargs: Any,
) -> Union[Iterable[_models.StreamingChatCompletionsUpdate], _models.ChatCompletions]:
# pylint: disable=line-too-long
Expand Down Expand Up @@ -558,6 +563,7 @@ def complete(
seed: Optional[int] = None,
model: Optional[str] = None,
model_extras: Optional[Dict[str, Any]] = None,
store: Optional[bool] = None,
**kwargs: Any,
) -> Union[Iterable[_models.StreamingChatCompletionsUpdate], _models.ChatCompletions]:
# pylint: disable=line-too-long
Expand Down Expand Up @@ -687,6 +693,7 @@ def complete(
"tool_choice": tool_choice if tool_choice is not None else self._tool_choice,
"tools": tools if tools is not None else self._tools,
"top_p": top_p if top_p is not None else self._top_p,
"store": store if store is not None else self._store,
}
if model_extras is not None and bool(model_extras):
body.update(model_extras)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_chat_completions_request_payload(self, **kwargs):
tools=[ModelClientTestBase.TOOL1, ModelClientTestBase.TOOL2],
top_p=9.876,
raw_request_hook=self.request_callback,
store=True,
)
assert False
except ServiceRequestError as _:
Expand Down Expand Up @@ -129,6 +130,7 @@ def test_chat_completions_request_payload_with_defaults(self, **kwargs):
tool_choice=sdk.models.ChatCompletionsToolChoicePreset.AUTO,
tools=[ModelClientTestBase.TOOL1, ModelClientTestBase.TOOL2],
top_p=9.876,
store=True,
)

for _ in range(2):
Expand Down Expand Up @@ -206,6 +208,7 @@ def test_chat_completions_request_payload_with_defaults_and_overrides(self, **kw
),
tools=[ModelClientTestBase.TOOL2],
top_p=3.456,
store=False,
)

for _ in range(2):
Expand Down Expand Up @@ -265,6 +268,7 @@ def test_chat_completions_request_payload_with_defaults_and_overrides(self, **kw
tools=[ModelClientTestBase.TOOL1, ModelClientTestBase.TOOL2],
top_p=9.876,
raw_request_hook=self.request_callback,
store=True
)
assert False
except ServiceRequestError as _:
Expand Down
Loading