Skip to content

Commit 0c2a270

Browse files
Strict sphinx ai (#36402)
* strict sphinx ai * few fixes
1 parent e0385ad commit 0c2a270

File tree

5 files changed

+39
-36
lines changed

5 files changed

+39
-36
lines changed

sdk/ai/azure-ai-inference/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ for item in response.data:
345345

346346
The length of the embedding vector depends on the model, but you should see something like this:
347347

348-
```txt
348+
```text
349349
data[0]: length=1024, [0.0013399124, -0.01576233, ..., 0.007843018, 0.000238657]
350350
data[1]: length=1024, [0.036590576, -0.0059547424, ..., 0.011405945, 0.004863739]
351351
data[2]: length=1024, [0.04196167, 0.029083252, ..., -0.0027484894, 0.0073127747]

sdk/ai/azure-ai-inference/azure/ai/inference/_patch.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def load_client(
9393
:return: The appropriate synchronous client associated with the given endpoint
9494
:rtype: ~azure.ai.inference.ChatCompletionsClient or ~azure.ai.inference.EmbeddingsClient
9595
or ~azure.ai.inference.ImageEmbeddingsClient
96-
:raises ~azure.core.exceptions.HttpResponseError
96+
:raises ~azure.core.exceptions.HttpResponseError:
9797
"""
9898

9999
with ChatCompletionsClient(
@@ -309,7 +309,7 @@ def complete(
309309
:paramtype model: str
310310
:return: ChatCompletions for non-streaming, or Iterable[StreamingChatCompletionsUpdate] for streaming.
311311
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.StreamingChatCompletions
312-
:raises ~azure.core.exceptions.HttpResponseError
312+
:raises ~azure.core.exceptions.HttpResponseError:
313313
"""
314314

315315
@overload
@@ -333,7 +333,7 @@ def complete(
333333
:paramtype content_type: str
334334
:return: ChatCompletions for non-streaming, or Iterable[StreamingChatCompletionsUpdate] for streaming.
335335
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.StreamingChatCompletions
336-
:raises ~azure.core.exceptions.HttpResponseError
336+
:raises ~azure.core.exceptions.HttpResponseError:
337337
"""
338338

339339
@overload
@@ -357,7 +357,7 @@ def complete(
357357
:paramtype content_type: str
358358
:return: ChatCompletions for non-streaming, or Iterable[StreamingChatCompletionsUpdate] for streaming.
359359
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.StreamingChatCompletions
360-
:raises ~azure.core.exceptions.HttpResponseError
360+
:raises ~azure.core.exceptions.HttpResponseError:
361361
"""
362362

363363
@distributed_trace
@@ -388,7 +388,7 @@ def complete(
388388
"""Gets chat completions for the provided chat messages.
389389
Completions support a wide variety of tasks and generate text that continues from or
390390
"completes" provided prompt data. When using this method with `stream=True`, the response is streamed
391-
back to the client. Iterate over the resulting ~azure.ai.inference.models.StreamingChatCompletions
391+
back to the client. Iterate over the resulting :class:`~azure.ai.inference.models.StreamingChatCompletions`
392392
object to get content updates as they arrive.
393393
394394
:param body: Is either a MutableMapping[str, Any] type (like a dictionary) or a IO[bytes] type
@@ -470,7 +470,7 @@ def complete(
470470
:paramtype model: str
471471
:return: ChatCompletions for non-streaming, or Iterable[StreamingChatCompletionsUpdate] for streaming.
472472
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.StreamingChatCompletions
473-
:raises ~azure.core.exceptions.HttpResponseError
473+
:raises ~azure.core.exceptions.HttpResponseError:
474474
"""
475475
error_map = {
476476
401: ClientAuthenticationError,
@@ -555,7 +555,7 @@ def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
555555
556556
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
557557
:rtype: ~azure.ai.inference.models.ModelInfo
558-
:raises ~azure.core.exceptions.HttpResponseError
558+
:raises ~azure.core.exceptions.HttpResponseError:
559559
"""
560560
if not self._model_info:
561561
self._model_info = self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init
@@ -634,7 +634,7 @@ def embed(
634634
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
635635
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
636636
:rtype: ~azure.ai.inference.models.EmbeddingsResult
637-
:raises ~azure.core.exceptions.HttpResponseError
637+
:raises ~azure.core.exceptions.HttpResponseError:
638638
"""
639639

640640
@overload
@@ -656,7 +656,7 @@ def embed(
656656
:paramtype content_type: str
657657
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
658658
:rtype: ~azure.ai.inference.models.EmbeddingsResult
659-
:raises ~azure.core.exceptions.HttpResponseError
659+
:raises ~azure.core.exceptions.HttpResponseError:
660660
"""
661661

662662
@overload
@@ -677,7 +677,7 @@ def embed(
677677
:paramtype content_type: str
678678
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
679679
:rtype: ~azure.ai.inference.models.EmbeddingsResult
680-
:raises ~azure.core.exceptions.HttpResponseError
680+
:raises ~azure.core.exceptions.HttpResponseError:
681681
"""
682682

683683
@distributed_trace
@@ -724,7 +724,7 @@ def embed(
724724
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
725725
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
726726
:rtype: ~azure.ai.inference.models.EmbeddingsResult
727-
:raises ~azure.core.exceptions.HttpResponseError
727+
:raises ~azure.core.exceptions.HttpResponseError:
728728
"""
729729
error_map: MutableMapping[int, Type[HttpResponseError]] = {
730730
401: ClientAuthenticationError,
@@ -800,7 +800,7 @@ def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
800800
801801
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
802802
:rtype: ~azure.ai.inference.models.ModelInfo
803-
:raises ~azure.core.exceptions.HttpResponseError
803+
:raises ~azure.core.exceptions.HttpResponseError:
804804
"""
805805
if not self._model_info:
806806
self._model_info = self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init
@@ -879,7 +879,7 @@ def embed(
879879
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
880880
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
881881
:rtype: ~azure.ai.inference.models.EmbeddingsResult
882-
:raises ~azure.core.exceptions.HttpResponseError
882+
:raises ~azure.core.exceptions.HttpResponseError:
883883
"""
884884

885885
@overload
@@ -901,7 +901,7 @@ def embed(
901901
:paramtype content_type: str
902902
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
903903
:rtype: ~azure.ai.inference.models.EmbeddingsResult
904-
:raises ~azure.core.exceptions.HttpResponseError
904+
:raises ~azure.core.exceptions.HttpResponseError:
905905
"""
906906

907907
@overload
@@ -922,7 +922,7 @@ def embed(
922922
:paramtype content_type: str
923923
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
924924
:rtype: ~azure.ai.inference.models.EmbeddingsResult
925-
:raises ~azure.core.exceptions.HttpResponseError
925+
:raises ~azure.core.exceptions.HttpResponseError:
926926
"""
927927

928928
@distributed_trace
@@ -969,7 +969,7 @@ def embed(
969969
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
970970
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
971971
:rtype: ~azure.ai.inference.models.EmbeddingsResult
972-
:raises ~azure.core.exceptions.HttpResponseError
972+
:raises ~azure.core.exceptions.HttpResponseError:
973973
"""
974974
error_map: MutableMapping[int, Type[HttpResponseError]] = {
975975
401: ClientAuthenticationError,
@@ -1045,7 +1045,7 @@ def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
10451045
10461046
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
10471047
:rtype: ~azure.ai.inference.models.ModelInfo
1048-
:raises ~azure.core.exceptions.HttpResponseError
1048+
:raises ~azure.core.exceptions.HttpResponseError:
10491049
"""
10501050
if not self._model_info:
10511051
self._model_info = self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init

sdk/ai/azure-ai-inference/azure/ai/inference/aio/_patch.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async def load_client(
7777
:return: The appropriate asynchronous client associated with the given endpoint
7878
:rtype: ~azure.ai.inference.aio.ChatCompletionsClient or ~azure.ai.inference.aio.EmbeddingsClient
7979
or ~azure.ai.inference.aio.ImageEmbeddingsClient
80-
:raises ~azure.core.exceptions.HttpResponseError
80+
:raises ~azure.core.exceptions.HttpResponseError:
8181
"""
8282

8383
async with ChatCompletionsClient(
@@ -295,7 +295,7 @@ async def complete(
295295
:paramtype model: str
296296
:return: ChatCompletions for non-streaming, or AsyncIterable[StreamingChatCompletionsUpdate] for streaming.
297297
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.AsyncStreamingChatCompletions
298-
:raises ~azure.core.exceptions.HttpResponseError
298+
:raises ~azure.core.exceptions.HttpResponseError:
299299
"""
300300

301301
@overload
@@ -319,7 +319,7 @@ async def complete(
319319
:paramtype content_type: str
320320
:return: ChatCompletions for non-streaming, or AsyncIterable[StreamingChatCompletionsUpdate] for streaming.
321321
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.AsyncStreamingChatCompletions
322-
:raises ~azure.core.exceptions.HttpResponseError
322+
:raises ~azure.core.exceptions.HttpResponseError:
323323
"""
324324

325325
@overload
@@ -342,7 +342,7 @@ async def complete(
342342
:paramtype content_type: str
343343
:return: ChatCompletions for non-streaming, or AsyncIterable[StreamingChatCompletionsUpdate] for streaming.
344344
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.AsyncStreamingChatCompletions
345-
:raises ~azure.core.exceptions.HttpResponseError
345+
:raises ~azure.core.exceptions.HttpResponseError:
346346
"""
347347

348348
@distributed_trace_async
@@ -373,7 +373,7 @@ async def complete(
373373
"""Gets chat completions for the provided chat messages.
374374
Completions support a wide variety of tasks and generate text that continues from or
375375
"completes" provided prompt data. When using this method with `stream=True`, the response is streamed
376-
back to the client. Iterate over the resulting ~azure.ai.inference.models.StreamingChatCompletions
376+
back to the client. Iterate over the resulting :class:`~azure.ai.inference.models.StreamingChatCompletions`
377377
object to get content updates as they arrive.
378378
379379
:param body: Is either a MutableMapping[str, Any] type (like a dictionary) or a IO[bytes] type
@@ -455,7 +455,7 @@ async def complete(
455455
:paramtype model: str
456456
:return: ChatCompletions for non-streaming, or AsyncIterable[StreamingChatCompletionsUpdate] for streaming.
457457
:rtype: ~azure.ai.inference.models.ChatCompletions or ~azure.ai.inference.models.AsyncStreamingChatCompletions
458-
:raises ~azure.core.exceptions.HttpResponseError
458+
:raises ~azure.core.exceptions.HttpResponseError:
459459
"""
460460
error_map = {
461461
401: ClientAuthenticationError,
@@ -540,7 +540,7 @@ async def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
540540
541541
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
542542
:rtype: ~azure.ai.inference.models.ModelInfo
543-
:raises ~azure.core.exceptions.HttpResponseError
543+
:raises ~azure.core.exceptions.HttpResponseError:
544544
"""
545545
if not self._model_info:
546546
self._model_info = await self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init
@@ -621,7 +621,7 @@ async def embed(
621621
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
622622
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
623623
:rtype: ~azure.ai.inference.models.EmbeddingsResult
624-
:raises ~azure.core.exceptions.HttpResponseError
624+
:raises ~azure.core.exceptions.HttpResponseError:
625625
"""
626626

627627
@overload
@@ -643,7 +643,7 @@ async def embed(
643643
:paramtype content_type: str
644644
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
645645
:rtype: ~azure.ai.inference.models.EmbeddingsResult
646-
:raises ~azure.core.exceptions.HttpResponseError
646+
:raises ~azure.core.exceptions.HttpResponseError:
647647
"""
648648

649649
@overload
@@ -664,7 +664,7 @@ async def embed(
664664
:paramtype content_type: str
665665
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
666666
:rtype: ~azure.ai.inference.models.EmbeddingsResult
667-
:raises ~azure.core.exceptions.HttpResponseError
667+
:raises ~azure.core.exceptions.HttpResponseError:
668668
"""
669669

670670
@distributed_trace_async
@@ -711,7 +711,7 @@ async def embed(
711711
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
712712
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
713713
:rtype: ~azure.ai.inference.models.EmbeddingsResult
714-
:raises ~azure.core.exceptions.HttpResponseError
714+
:raises ~azure.core.exceptions.HttpResponseError:
715715
"""
716716
error_map: MutableMapping[int, Type[HttpResponseError]] = {
717717
401: ClientAuthenticationError,
@@ -787,7 +787,7 @@ async def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
787787
788788
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
789789
:rtype: ~azure.ai.inference.models.ModelInfo
790-
:raises ~azure.core.exceptions.HttpResponseError
790+
:raises ~azure.core.exceptions.HttpResponseError:
791791
"""
792792
if not self._model_info:
793793
self._model_info = await self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init
@@ -868,7 +868,7 @@ async def embed(
868868
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
869869
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
870870
:rtype: ~azure.ai.inference.models.EmbeddingsResult
871-
:raises ~azure.core.exceptions.HttpResponseError
871+
:raises ~azure.core.exceptions.HttpResponseError:
872872
"""
873873

874874
@overload
@@ -890,7 +890,7 @@ async def embed(
890890
:paramtype content_type: str
891891
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
892892
:rtype: ~azure.ai.inference.models.EmbeddingsResult
893-
:raises ~azure.core.exceptions.HttpResponseError
893+
:raises ~azure.core.exceptions.HttpResponseError:
894894
"""
895895

896896
@overload
@@ -911,7 +911,7 @@ async def embed(
911911
:paramtype content_type: str
912912
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
913913
:rtype: ~azure.ai.inference.models.EmbeddingsResult
914-
:raises ~azure.core.exceptions.HttpResponseError
914+
:raises ~azure.core.exceptions.HttpResponseError:
915915
"""
916916

917917
@distributed_trace_async
@@ -958,7 +958,7 @@ async def embed(
958958
:paramtype input_type: str or ~azure.ai.inference.models.EmbeddingInputType
959959
:return: EmbeddingsResult. The EmbeddingsResult is compatible with MutableMapping
960960
:rtype: ~azure.ai.inference.models.EmbeddingsResult
961-
:raises ~azure.core.exceptions.HttpResponseError
961+
:raises ~azure.core.exceptions.HttpResponseError:
962962
"""
963963
error_map: MutableMapping[int, Type[HttpResponseError]] = {
964964
401: ClientAuthenticationError,
@@ -1034,7 +1034,7 @@ async def get_model_info(self, **kwargs: Any) -> _models.ModelInfo:
10341034
10351035
:return: ModelInfo. The ModelInfo is compatible with MutableMapping
10361036
:rtype: ~azure.ai.inference.models.ModelInfo
1037-
:raises ~azure.core.exceptions.HttpResponseError
1037+
:raises ~azure.core.exceptions.HttpResponseError:
10381038
"""
10391039
if not self._model_info:
10401040
self._model_info = await self._get_model_info(**kwargs) # pylint: disable=attribute-defined-outside-init

sdk/ai/azure-ai-inference/azure/ai/inference/models/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def load(
4747
:vartype detail: str or ~azure.ai.inference.models.ImageDetailLevel
4848
:return: An ImageUrl object with the image data encoded as a base64 string.
4949
:rtype: ~azure.ai.inference.models.ImageUrl
50-
:raises FileNotFoundError when the image file could not be opened.
50+
:raises FileNotFoundError: when the image file could not be opened.
5151
"""
5252
with open(image_file, "rb") as f:
5353
image_data = base64.b64encode(f.read()).decode("utf-8")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
[tool.azure-sdk-build]
2+
strict_sphinx = true
3+
14
[tool.generate]
25
autorest-post-process = true

0 commit comments

Comments
 (0)