Skip to content

tsp, internal model generate to implementation package #2293

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

Merged

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Sep 6, 2023

link #2286

main code

  • 82fa9f3 for internal model
  • a992538 for internal API (currently only cover the models used -- any model used by internal API is treated as internal model)
  • 241890a for rename SchemaContext.ConvenienceApi to SchemaContext.Public

model/class would have either Public or Internal (and optionally External for class from other lib), but not both.

API could have ConvenienceAPI and Internal (currently if Internal, it is not ConvenienceAPI -- this can change when we decide to generate "package private" Convenience method for Internal).

@weidongxu-microsoft weidongxu-microsoft changed the title tsp, generate internal model to implementation package tsp, internal model generate to implementation package Sep 6, 2023
@weidongxu-microsoft
Copy link
Member Author

weidongxu-microsoft commented Sep 6, 2023

openai need to have change to client.tsp to move some internal to public

  1. remove them from "implementation.models" (as they currently in "models")
  2. keep them in sync with TypeSpec models
@@access(Azure.OpenAI.FunctionName, Access.public, "java");
@@access(Azure.OpenAI.AzureChatExtensionConfiguration, Access.public, "java");
@@access(Azure.OpenAI.AzureChatExtensionsMessageContext, Access.public, "java");
@@access(Azure.OpenAI.ChatCompletions, Access.public, "java");
@@access(Azure.OpenAI.FunctionDefinition, Access.public, "java");
@@access(Azure.OpenAI.ImageSize, Access.public, "java");

result Azure/azure-sdk-for-java#36642

PS: there maybe more to add to Access.public, to help them get synced


Also we probably no longer need these "custom-types" configure.

It should be covered by API marked as @@access(op, Access.internal) (which make all related class Access.internal as well, and by default in "implementation.models")

    custom-types-subpackage: "implementation.models"
    custom-types: "FunctionCallModelBase,FunctionCallPreset,FunctionCallPresetFunctionCallModel,FunctionNameFunctionCallModel"

This be delayed to #2300

@weidongxu-microsoft weidongxu-microsoft merged commit 9c62c66 into Azure:main Sep 8, 2023
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