Skip to content

OpenAI: investigation for StreamingClientResult<T>#8

Closed
annelo-msft wants to merge 51 commits intobterlson:mainfrom
annelo-msft:openai-streaming-result
Closed

OpenAI: investigation for StreamingClientResult<T>#8
annelo-msft wants to merge 51 commits intobterlson:mainfrom
annelo-msft:openai-streaming-result

Conversation

@annelo-msft
Copy link
Copy Markdown

Depends on this change to ClientModel: Azure/azure-sdk-for-net#42873

joseharriaga and others added 30 commits February 6, 2024 14:59
…it Update-ClietModel.ps1 script to System.ClientModel 1.1.0-alpha.20240227.1
- Fix issue in AssistantClient where `SubmitToolOutputsAsync` was not returning a `ThreadRun` as it should.
- Add missing async sample for function calling
- Clean up function calling samples to make them more genuine
The objective is to eventually stop depending on these scripts and remove them entirely. With this in mind, I refactored the scripts to split them into smaller parts so that it's easier to remove them incrementally.
* Exposed missing protocol methods publicly
* Removed protocol methods that use multipart/form-data for now (`TranscribeAudio`, `TranslateAudio`, `UploadFile`, `GenerateImageEdit`, and `GenerateImageVariation`)
* Removed `[EditorBrowsable(EditorBrowsableState.Never)]` attribute from existing protocol methods that do not have a convenience method counterpart
* Renamed `RequestOptions` parameter from "context" to "options" in existing protocol methods
* Added missing `async` keyword to existing protocol methods when applicable (also `await` and `.ConfigureAwait(false)`)
* Added doc comments to protocol methods
* Created the `FineTuningClient` to organize the library in a way that aligns more closely to OpenAI's REST API and documentation
* Made a small fix to the fine-tuning TypeSpec (the `limit` query parameter should be defined as an `int32`)
Implement support for image edits and variations as convenience methods that do multipart/form-data.
Making sure that the README is up-to-date with the latest samples.
Due to our codegen workarounds, we cannot have a method with the following signature in the custom public `OpenAIClient` class:

```csharp
public FineTuningClient GetFineTuningClient()
```

This is because we need codegen to generate a different method that happens to have this same signature in the generated internal `OpenAIClient` class. Because making the generated `OpenAIClient` class internal is part of post-codegen processing, codegen has no way to know that these two are not the same class, so it skips generating the method thinking it has been customized instead. 

For now, we rename the `FineTuningClient` to `FineTuningManagementClient` to avoid this conflict. We will be able to fix it once we have codegen customizations available.
hallipr and others added 21 commits March 13, 2024 12:47
* Add workflow actions for build, pack and test
* Add strong name key
* Add update-client script
* Add assembly strong naming to Directory.Build.props
* Use dev nuget feed
* Add version properties
* Rename workflow to Build and Test
* Remove validation job from workflow
* Move empty string to false result in ternary
* Upload the nuget package as a release asset
* Remove workflow_dispatch trigger from release
* Use `published` type for release event triggering
* Add contents: write permission to release workflow
* Added `ModifyMessage` and `ModifyMessageAsync` protocol and convenience methods to `AssistantClient`.
* Fixed typo: `GetAssistantFileAssociation` --> `GetAssistantFileAssociations`
* Fixed typo: `GetAssistantFileAssociationAsync` --> `GetAssistantFileAssociationsAsync`
* Added missing usages of `ConfigureAwait(false)` in `AssistantClient`.
* Add convenience methods for image edits and variations

* investigation

* WIP

* rework to depend on local implementation of ClientModel

* go back to using BCL type

* WIP

* WIP

* file client

* update for filename

* Add model implementation prototype

* backup WIP

* unlink demo client

* refactor

* move content creation routine to model

* null

* revert

* cleanup

* revert

* Add clean generated client using System.ClientModel 1.0.0-beta.2

* delete files not used for diff

* move to public clientmodel package

* Create transcription

* Create translation

* tidy

* tidy

* Add Stream overloads for audio service methods

* file endpoints

* nits

* nits

* image edits

* image variations

* nits

* stream overloads for file upload

* stream overloads for image operations

* nits

* update for Content-Length

* rework file name APIs

* rework file name APIs

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

* Update from @joseharriaga

Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>

---------

Co-authored-by: Jose Arriaga Maldonado <josar@microsoft.com>
Co-authored-by: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com>
…ent (#17)

* polyfill ExperimentalAttribute and use it for AssistantClient

* polyfill update from source, parallel #if directive

* PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants