Skip to content
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

Starting point for AOAI + OAI #5

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

johanste
Copy link
Contributor

@johanste johanste commented Oct 28, 2023

Added starting point/skeleton for how we can include both Azure OpenAI and OpenAI endpoints in the same TSP compilation/set of files.

  • I am using typespec versioning for models. And I use the feature we were going to deprecate (or at least not use for Azure Core) to facilitate the delta between OAI and AOAI. It works in limited scenarios (e.g. two targets where one is consistently a super set of the other). It does not scale (well) to more branches (e.g. OAI public, OAI internal, AOAI public, AOAI internal) - or even OAI individually versioned and AOAI individually versioned. I think it will work in this specific scenario, however.
  • I made the namespace for models versioned. And have two separate services that reference a specific version from the versioned model namespace. The fact that I wanted the models namespace versioned meant I had to drag it out of the OpenAI namespace. Which is a bit unfortunate, but not at all crazy for the openapi emitter....
  • I am redefining routes for the AOAI endpoints (because the routes are, in fact, different).
  • I have not separated the Azure specific models into separate files.

There are still many endpoints that need to be added on the Azure side/models to be augmented. But I'd like to get feedback on the approach first.

@@ -0,0 +1,9 @@
import "@typespec/versioning";

@Versioning.versioned(OpenAIFlavors)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke out the models into a separate, versioned namespace so the individual @service-decorated namespaces could reference the specific version they needed.

versions.tsp Outdated

enum OpenAIFlavors {
OpenAI,
Azure,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All models in Azure should be super-sets of OpenAI. And if they are not, we could accommodate that with marking them as @removed(OpenAIFlavors.Azure).

@johanste
Copy link
Contributor Author

The outputs as provided in the PR are the result of tsp compileing azuremain.tsp.

annelo-msft referenced this pull request in annelo-msft/openai-in-typespec Mar 11, 2024
- 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
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.

1 participant