diff --git a/services/chatgpt-plugin/apim-management/openai-yaml.xml b/services/chatgpt-plugin/apim-management/openai-yaml.xml new file mode 100644 index 00000000..9d498140 --- /dev/null +++ b/services/chatgpt-plugin/apim-management/openai-yaml.xml @@ -0,0 +1,29 @@ + + + + + + @("https://management.azure.com/subscriptions/{{subscription-id}}/resourceGroups/{{resource-group-name}}/providers/Microsoft.ApiManagement/service/{{service-id}}/apis/" + context.Api.Id + "?export=true&format=openapi&api-version=2022-09-01-preview") + GET + + + + + + application/yaml + + @((string)(((IResponse)context.Variables["result"]).Body.As()["value"])) + + + + + + + + + + + + \ No newline at end of file diff --git a/services/chatgpt-plugin/apim-management/well-known-ai-plugin.xml b/services/chatgpt-plugin/apim-management/well-known-ai-plugin.xml new file mode 100644 index 00000000..0daac46c --- /dev/null +++ b/services/chatgpt-plugin/apim-management/well-known-ai-plugin.xml @@ -0,0 +1,51 @@ + + + + + + + + application/json + + @{ + + var apiInfo = new JObject(); + + // Metadata + apiInfo.Add("schema_version","v1"); + apiInfo.Add("name_for_human","Miyagi calculator"); + apiInfo.Add("name_for_model","calculator"); + apiInfo.Add("description_for_human","Perform arithmetic operations"); + apiInfo.Add("description_for_model", "Use the Calculator plugin to perform basic arithmetic operations"); + apiInfo.Add("contact_email", "frank@rizzo.com"); + apiInfo.Add("logo_url", "https://raw.githubusercontent.com/Azure-Samples/miyagi/main/assets/images/1.png"); + apiInfo.Add("legal_info_url", "http://example.com/legal"); + + // Auth + var authType = new JObject(); + authType.Add("type", "none"); + apiInfo.Add("auth", authType); + + // API + var apiDetails = new JObject(); + apiDetails.Add("type", "openapi"); + apiDetails.Add("url", "https://{{apim-service-name}}.azure-api.net/openai.yaml"); + apiInfo.Add("api", apiDetails); + + return apiInfo.ToString(); + + } + + + + + + + + + + + + \ No newline at end of file