Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
18b5021
auto-gen files
dargilco Mar 26, 2024
b8ea0cd
first pass at writing tests
dargilco Mar 27, 2024
ee78c9c
Re-emit client library with fixed variable name
dargilco Mar 27, 2024
25b5c6b
Fix test
dargilco Mar 27, 2024
5072f00
First test working!
dargilco Mar 28, 2024
62c476a
Re-emit after adding tools. Add async test
dargilco Mar 29, 2024
2bdb446
Add basic samples
dargilco Mar 29, 2024
ad9992c
Ignore spelling errors
dargilco Mar 29, 2024
59bf4f3
fix `tox run -e sphinx` errors
dargilco Mar 29, 2024
1613b37
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco Mar 29, 2024
8d3948c
Update SDK to support embeddings. Add sample. Add root README.md
dargilco Mar 30, 2024
fff460e
Fix typo
dargilco Apr 2, 2024
9d171a7
After re-emit using flat input arguments
dargilco Apr 2, 2024
7efa800
Update README.md code snippets
dargilco Apr 2, 2024
8008505
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco Apr 4, 2024
61b62ac
Re-emit
dargilco Apr 4, 2024
675ba6d
Samples for image generation
dargilco Apr 4, 2024
c5ea2fc
Add dictionary of extra parameters
dargilco Apr 4, 2024
45c7ca1
Re-emit
dargilco Apr 4, 2024
8ee88aa
Example of setting extra parameters
dargilco Apr 4, 2024
bad14c9
Fix README.md title
dargilco Apr 5, 2024
b49acb6
Placeholder patch for streaming chat method
dargilco Apr 5, 2024
708e4c4
Re-emit, to get two new streaming 'Delta' classes
dargilco Apr 5, 2024
da8a678
first go at streaming
dargilco Apr 10, 2024
ed2b227
Latest re-emit, removing 'extra_parameters'
dargilco Apr 10, 2024
0428d95
async streaming support
dargilco Apr 11, 2024
9d98958
A few quality gates fixes
dargilco Apr 11, 2024
37c3599
Use aclose() for async interator
dargilco Apr 11, 2024
58b3669
Update env-variable names
dargilco Apr 11, 2024
0f79e70
First set of updates following SDK review meeting
dargilco Apr 12, 2024
e70da4b
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco Apr 12, 2024
8e274b6
New client names. Other minor model name changes
dargilco Apr 12, 2024
159d82f
Minor fixes to root README.md
dargilco Apr 12, 2024
5326bba
Update tests
dargilco Apr 15, 2024
27b555f
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco Apr 15, 2024
1e42647
Minor test updates
dargilco Apr 16, 2024
65b2bf1
Add assets.json
dargilco Apr 16, 2024
32368f2
Fix test name
dargilco Apr 16, 2024
18d6baa
First round of Pylint fixes
dargilco Apr 16, 2024
1243048
Fix pyright errors
dargilco Apr 16, 2024
3c84d22
Fix all pyright errors
dargilco Apr 16, 2024
c951405
Fix more quality gates
dargilco Apr 17, 2024
e18d79c
Add streaming tests
dargilco Apr 17, 2024
51f30d3
Fix streaming to work with small HTTP buffers (tested down to 64 bytes)
dargilco Apr 18, 2024
2578c8d
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco Apr 18, 2024
3090bae
Update ci.yml
dargilco Apr 18, 2024
84ad0b5
Add samples for chat history, JSON input, IO[bytes] input
dargilco Apr 19, 2024
6b87862
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 6, 2024
6aaa1c4
Draft sample for chat completion with tools
dargilco May 8, 2024
11a1c78
Grab latest TypeSpec changes
dargilco May 8, 2024
6a6cbc5
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 8, 2024
5864275
Re-emit SDK to pick up TypeSpec tools changes. Fix result.id check to…
dargilco May 8, 2024
9e18146
New test for tool, new recordings
dargilco May 8, 2024
2c97356
use logger for detailed SSE streaming debug spew
dargilco May 9, 2024
37d1e35
Don't build azure-ai-generative and azure-ai-resources packages, as t…
dargilco May 9, 2024
e79c4b5
Split streaming response class to two, one for sync, one for async
dargilco May 9, 2024
06e11f7
Update test timeout. Rename /templates/stages/platform-matrix-ai.json…
dargilco May 9, 2024
610b4eb
Mark azure-ai-generative and azure-ai-resources as in-active
dargilco May 9, 2024
9def3bb
Fix mypy and pylint errors
dargilco May 10, 2024
fb7612b
Sample for getting model info
dargilco May 10, 2024
cd30a48
Remove image generation
dargilco May 10, 2024
a6ae407
Re-emit from TypeSpec without Image Generation
dargilco May 10, 2024
78331f7
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 10, 2024
943faa9
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 13, 2024
a1ebd6b
Update auth
dargilco May 13, 2024
f0b773c
Add get_model_info tests
dargilco May 14, 2024
e4f3089
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 14, 2024
deb3d16
Add sample for ClientGenerator
dargilco May 14, 2024
c6b3bc2
Remove /v1
dargilco May 14, 2024
042c06a
Use new test recording assests without /v1
dargilco May 14, 2024
56450c9
Pick up TypeSpec with /v1 removed from route
dargilco May 14, 2024
a36fbee
Support Image Embeddings and version 2024-05
dargilco May 14, 2024
82168b5
Update test recordings
dargilco May 14, 2024
e788873
Fix quality some quality gates
dargilco May 15, 2024
2c18488
Fix broken link ('link verification check')
dargilco May 15, 2024
2ac893f
Use 'response' instead of 'result' in samples, as this is what I see …
dargilco May 15, 2024
b56ca82
Implement load_client and load_async_client
dargilco May 16, 2024
aafcc37
Make three BaseStreamingChatCompletions variables (constants) private)
dargilco May 16, 2024
b5484ee
sync and async versions of load_client
dargilco May 17, 2024
0a82fe2
Remove wait loop in async samples. Simplify tool sample. Other minor …
dargilco May 17, 2024
3dbca9e
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 17, 2024
bf93525
Re-emit with new operator names
dargilco May 17, 2024
ca2f4ff
Minor change to sample
dargilco May 20, 2024
9db8bce
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 20, 2024
673f27b
Add support for hyper_parameters
dargilco May 21, 2024
0ed9d7b
Update root README.md
dargilco May 21, 2024
7c5424f
Save work - unknown_params header, hyper_params input, cached model_info
dargilco May 22, 2024
1faf123
Some test changes
dargilco May 22, 2024
71bd71d
Many changes
dargilco May 23, 2024
712dfcc
New test recordings
dargilco May 23, 2024
d6012b7
Minor samples and README.md changes
dargilco May 23, 2024
3f52d6f
Update names of streaming response classes
dargilco May 23, 2024
62c5d8a
Update Entra ID sample, document Entra ID in README, use ttps://ml.az…
dargilco May 23, 2024
8a3a167
use model_extras instead of hyper_params. Update client __str__ to no…
dargilco May 24, 2024
092f91b
Fix all pylint errors. Minor updates to root README.md
dargilco May 28, 2024
8e610c2
Example of JSON messages in the root README.md
dargilco May 28, 2024
6d1e7ce
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 28, 2024
a738ff5
Some MyPy fixes. Also fix wrong package name in root README.md
dargilco May 28, 2024
44e94d0
Same work before re-emitting SDK
dargilco May 29, 2024
27ac7b0
Merge remote-tracking branch 'origin/main' into dargilco/azure-ai-inf…
dargilco May 30, 2024
a825db4
Use `embed` instead of `embedding`. Update Entra ID and AOAI samples
dargilco May 30, 2024
c4814d8
Fix some mypy errors. Use different terms for MaaS/MaaP
dargilco May 31, 2024
2df88dc
Re-emit, now with pyproject.toml
dargilco May 31, 2024
89d92d3
Fix/supress mypy & pyright errors
dargilco May 31, 2024
e20d003
Fix missing Etra ID auth in load_client
dargilco May 31, 2024
d7ef3b7
Use vanity link for samples folder
dargilco Jun 3, 2024
63fefdf
Revert "Use vanity link for samples folder"
dargilco Jun 3, 2024
ab6973f
Fix mypy and pyright errors
dargilco Jun 3, 2024
efbcf5c
Update root README.md. Update operator ref doc comments
dargilco Jun 3, 2024
6f69018
Re-emit
dargilco Jun 3, 2024
aed30bf
Fix mypy error in sample
dargilco Jun 3, 2024
c327403
Fix missing ranges in ref-doc comments
dargilco Jun 3, 2024
27f2ed6
Remove unneeded cast
dargilco Jun 3, 2024
2c92e9d
Fix pylint error
dargilco Jun 3, 2024
98cd4fd
Fix typos & method names. Thanks Jarno!
dargilco Jun 4, 2024
a44df4e
Address Johan's code review comments. Thanks Johan!
dargilco Jun 5, 2024
c0958e3
Fix mypy errors
dargilco Jun 5, 2024
2cbb1cf
Minor update to root README.md
dargilco Jun 5, 2024
73c836e
Remove capacity_type
dargilco Jun 6, 2024
0883400
Fix public patched methods not showing up in intellisense, when using…
dargilco Jun 6, 2024
d0930a8
Import 'Self' from Typing package starting from Python 3.11
dargilco Jun 6, 2024
13e8ed6
Fix pylint error, line too long
dargilco Jun 6, 2024
223238c
More AOAI samples. Update package README with regards to AOAI support
dargilco Jun 6, 2024
0d03ad2
Add overloads with `stream: Literal[..]` to fix mypy and pyright erro…
dargilco Jun 6, 2024
8647964
Override all client __init__ methods so you can define and initialize…
dargilco Jun 6, 2024
3715766
Cleanup: delete now unused platform-matrix-ai.json.old
dargilco Jun 7, 2024
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
Prev Previous commit
Next Next commit
Re-emit client library with fixed variable name
  • Loading branch information
dargilco committed Mar 27, 2024
commit ee78c9cf1a8bf506992c1bce1b8f3e7911035670
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ModelClientOperationsMixin(ModelClientMixinABC):
@overload
def get_chat_completions(
self,
chat_completion_options: _models.ChatCompletionsOptions,
chat_completions_options: _models.ChatCompletionsOptions,
*,
content_type: str = "application/json",
**kwargs: Any
Expand All @@ -78,8 +78,8 @@ def get_chat_completions(
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: ~azure.ai.inference.models.ChatCompletionsOptions
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: ~azure.ai.inference.models.ChatCompletionsOptions
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -104,7 +104,7 @@ def get_chat_completions(
}

# JSON input template you can fill out and use as your body input.
chat_completion_options = {
chat_completions_options = {
"messages": [
chat_request_message
],
Expand Down Expand Up @@ -190,16 +190,16 @@ def get_chat_completions(

@overload
def get_chat_completions(
self, chat_completion_options: JSON, *, content_type: str = "application/json", **kwargs: Any
self, chat_completions_options: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: JSON
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand Down Expand Up @@ -256,16 +256,16 @@ def get_chat_completions(

@overload
def get_chat_completions(
self, chat_completion_options: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
self, chat_completions_options: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: IO[bytes]
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
Expand Down Expand Up @@ -322,17 +322,17 @@ def get_chat_completions(

@distributed_trace
def get_chat_completions(
self, chat_completion_options: Union[_models.ChatCompletionsOptions, JSON, IO[bytes]], **kwargs: Any
self, chat_completions_options: Union[_models.ChatCompletionsOptions, JSON, IO[bytes]], **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Is one of
:param chat_completions_options: The JSON payload containing chat completion options. Is one of
the following types: ChatCompletionsOptions, JSON, IO[bytes] Required.
:type chat_completion_options: ~azure.ai.inference.models.ChatCompletionsOptions or JSON or
:type chat_completions_options: ~azure.ai.inference.models.ChatCompletionsOptions or JSON or
IO[bytes]
:return: ChatCompletions. The ChatCompletions is compatible with MutableMapping
:rtype: ~azure.ai.inference.models.ChatCompletions
Expand All @@ -355,7 +355,7 @@ def get_chat_completions(
}

# JSON input template you can fill out and use as your body input.
chat_completion_options = {
chat_completions_options = {
"messages": [
chat_request_message
],
Expand Down Expand Up @@ -454,10 +454,10 @@ def get_chat_completions(

content_type = content_type or "application/json"
_content = None
if isinstance(chat_completion_options, (IOBase, bytes)):
_content = chat_completion_options
if isinstance(chat_completions_options, (IOBase, bytes)):
_content = chat_completions_options
else:
_content = json.dumps(chat_completion_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(chat_completions_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_model_get_chat_completions_request(
content_type=content_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ModelClientOperationsMixin(ModelClientMixinABC):
@overload
async def get_chat_completions(
self,
chat_completion_options: _models.ChatCompletionsOptions,
chat_completions_options: _models.ChatCompletionsOptions,
*,
content_type: str = "application/json",
**kwargs: Any
Expand All @@ -53,8 +53,8 @@ async def get_chat_completions(
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: ~azure.ai.inference.models.ChatCompletionsOptions
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: ~azure.ai.inference.models.ChatCompletionsOptions
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -79,7 +79,7 @@ async def get_chat_completions(
}

# JSON input template you can fill out and use as your body input.
chat_completion_options = {
chat_completions_options = {
"messages": [
chat_request_message
],
Expand Down Expand Up @@ -165,16 +165,16 @@ async def get_chat_completions(

@overload
async def get_chat_completions(
self, chat_completion_options: JSON, *, content_type: str = "application/json", **kwargs: Any
self, chat_completions_options: JSON, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: JSON
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: JSON
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand Down Expand Up @@ -231,16 +231,16 @@ async def get_chat_completions(

@overload
async def get_chat_completions(
self, chat_completion_options: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
self, chat_completions_options: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Required.
:type chat_completion_options: IO[bytes]
:param chat_completions_options: The JSON payload containing chat completion options. Required.
:type chat_completions_options: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
Expand Down Expand Up @@ -297,17 +297,17 @@ async def get_chat_completions(

@distributed_trace_async
async def get_chat_completions(
self, chat_completion_options: Union[_models.ChatCompletionsOptions, JSON, IO[bytes]], **kwargs: Any
self, chat_completions_options: Union[_models.ChatCompletionsOptions, JSON, IO[bytes]], **kwargs: Any
) -> _models.ChatCompletions:
# pylint: disable=line-too-long
"""Gets chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or
"completes"
provided prompt data.

:param chat_completion_options: The JSON payload containing chat completion options. Is one of
:param chat_completions_options: The JSON payload containing chat completion options. Is one of
the following types: ChatCompletionsOptions, JSON, IO[bytes] Required.
:type chat_completion_options: ~azure.ai.inference.models.ChatCompletionsOptions or JSON or
:type chat_completions_options: ~azure.ai.inference.models.ChatCompletionsOptions or JSON or
IO[bytes]
:return: ChatCompletions. The ChatCompletions is compatible with MutableMapping
:rtype: ~azure.ai.inference.models.ChatCompletions
Expand All @@ -330,7 +330,7 @@ async def get_chat_completions(
}

# JSON input template you can fill out and use as your body input.
chat_completion_options = {
chat_completions_options = {
"messages": [
chat_request_message
],
Expand Down Expand Up @@ -429,10 +429,10 @@ async def get_chat_completions(

content_type = content_type or "application/json"
_content = None
if isinstance(chat_completion_options, (IOBase, bytes)):
_content = chat_completion_options
if isinstance(chat_completions_options, (IOBase, bytes)):
_content = chat_completions_options
else:
_content = json.dumps(chat_completion_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
_content = json.dumps(chat_completions_options, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_model_get_chat_completions_request(
content_type=content_type,
Expand Down