Skip to content

Commit d172cf7

Browse files
authored
Update README.md (Azure#39326)
Fix missing comma. Thank you @jerryshia for reporting this
1 parent 194a84b commit d172cf7

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ from azure.core.credentials import AzureKeyCredential
165165
# For Serverless API or Managed Compute endpoints
166166
client = ChatCompletionsClient(
167167
endpoint=endpoint,
168-
credential=AzureKeyCredential(key)
168+
credential=AzureKeyCredential(key),
169169
temperature=0.5,
170170
max_tokens=1000
171171
)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def load_client(
115115
"""
116116
Load a client from a given endpoint URL. The method makes a REST API call to the `/info` route
117117
on the given endpoint, to determine the model type and therefore which client to instantiate.
118+
Keyword arguments are passed to the appropriate client's constructor, so if you need to set things like
119+
`api_version`, `logging_enable`, `user_agent`, etc., you can do so here.
118120
This method will only work when using Serverless API or Managed Compute endpoint.
119121
It will not work for GitHub Models endpoint or Azure OpenAI endpoint.
120122
@@ -124,10 +126,6 @@ def load_client(
124126
AzureKeyCredential type or a TokenCredential type. Required.
125127
:type credential: ~azure.core.credentials.AzureKeyCredential or
126128
~azure.core.credentials.TokenCredential
127-
:keyword api_version: The API version to use for this operation. Default value is
128-
"2024-05-01-preview". Note that overriding this default value may result in unsupported
129-
behavior.
130-
:paramtype api_version: str
131129
:return: The appropriate synchronous client associated with the given endpoint
132130
:rtype: ~azure.ai.inference.ChatCompletionsClient or ~azure.ai.inference.EmbeddingsClient
133131
or ~azure.ai.inference.ImageEmbeddingsClient

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,20 @@
5555
async def load_client(
5656
endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any
5757
) -> Union["ChatCompletionsClient", "EmbeddingsClient", "ImageEmbeddingsClient"]:
58-
# pylint: disable=line-too-long
5958
"""
6059
Load a client from a given endpoint URL. The method makes a REST API call to the `/info` route
6160
on the given endpoint, to determine the model type and therefore which client to instantiate.
61+
Keyword arguments are passed to the appropriate client constructor, so if you need to set things like
62+
`api_version`, `logging_enable`, `user_agent`, etc., you can do so here.
63+
This method will only work when using Serverless API or Managed Compute endpoint.
64+
It will not work for GitHub Models endpoint or Azure OpenAI endpoint.
6265
6366
:param endpoint: Service host. Required.
6467
:type endpoint: str
6568
:param credential: Credential used to authenticate requests to the service. Is either a
6669
AzureKeyCredential type or a AsyncTokenCredential type. Required.
6770
:type credential: ~azure.core.credentials.AzureKeyCredential or
6871
~azure.core.credentials_async.AsyncTokenCredential
69-
:keyword api_version: The API version to use for this operation. Default value is
70-
"2024-05-01-preview". Note that overriding this default value may result in unsupported
71-
behavior.
72-
:paramtype api_version: str
7372
:return: The appropriate asynchronous client associated with the given endpoint
7473
:rtype: ~azure.ai.inference.aio.ChatCompletionsClient or ~azure.ai.inference.aio.EmbeddingsClient
7574
or ~azure.ai.inference.aio.ImageEmbeddingsClient

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ def load(
267267
file and encodes it as a base64 string, which together with the image format
268268
is then used to format the JSON `url` value passed in the request payload.
269269
270-
:ivar image_file: The name of the local image file to load. Required.
271-
:vartype image_file: str
272-
:ivar image_format: The MIME type format of the image. For example: "jpeg", "png". Required.
273-
:vartype image_format: str
274-
:ivar detail: The evaluation quality setting to use, which controls relative prioritization of
270+
:keyword image_file: The name of the local image file to load. Required.
271+
:paramtype image_file: str
272+
:keyword image_format: The MIME type format of the image. For example: "jpeg", "png". Required.
273+
:paramtype image_format: str
274+
:keyword detail: The evaluation quality setting to use, which controls relative prioritization of
275275
speed, token consumption, and accuracy. Known values are: "auto", "low", and "high".
276-
:vartype detail: str or ~azure.ai.inference.models.ImageDetailLevel
276+
:paramtype detail: str or ~azure.ai.inference.models.ImageDetailLevel
277277
:return: An ImageUrl object with the image data encoded as a base64 string.
278278
:rtype: ~azure.ai.inference.models.ImageUrl
279279
:raises FileNotFoundError: when the image file could not be opened.
@@ -293,13 +293,13 @@ def load(cls, *, image_file: str, image_format: str, text: Optional[str] = None)
293293
file and encodes it as a base64 string, which together with the image format
294294
is then used to format the JSON `url` value passed in the request payload.
295295
296-
:ivar image_file: The name of the local image file to load. Required.
297-
:vartype image_file: str
298-
:ivar image_format: The MIME type format of the image. For example: "jpeg", "png". Required.
299-
:vartype image_format: str
300-
:ivar text: Optional. The text input to feed into the model (like DINO, CLIP).
296+
:keyword image_file: The name of the local image file to load. Required.
297+
:paramtype image_file: str
298+
:keyword image_format: The MIME type format of the image. For example: "jpeg", "png". Required.
299+
:paramtype image_format: str
300+
:keyword text: Optional. The text input to feed into the model (like DINO, CLIP).
301301
Returns a 422 error if the model doesn't support the value or parameter.
302-
:vartype text: str
302+
:paramtype text: str
303303
:return: An ImageEmbeddingInput object with the image data encoded as a base64 string.
304304
:rtype: ~azure.ai.inference.models.EmbeddingsInput
305305
:raises FileNotFoundError: when the image file could not be opened.

0 commit comments

Comments
 (0)