openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
specification/client/conversations.client.tsp
30lines · modecode
| 1 | import "../base/typespec/conversations/main.tsp"; |
| 2 | import "@azure-tools/typespec-client-generator-core"; |
| 3 | import "@typespec/http-client-csharp"; |
| 4 | |
| 5 | using OpenAI; |
| 6 | using Azure.ClientGenerator.Core; |
| 7 | using TypeSpec.HttpClient.CSharp; |
| 8 | |
| 9 | // Move operations into their corresponding interface |
| 10 | @@clientLocation(createConversation, "Conversations"); |
| 11 | @@clientLocation(getConversation, "Conversations"); |
| 12 | @@clientLocation(updateConversation, "Conversations"); |
| 13 | @@clientLocation(deleteConversation, "Conversations"); |
| 14 | @@clientLocation(listConversationItems, "Conversations"); |
| 15 | @@clientLocation(createConversationItems, "Conversations"); |
| 16 | @@clientLocation(getConversationItem, "Conversations"); |
| 17 | @@clientLocation(deleteConversationItem, "Conversations"); |
| 18 | |
| 19 | // Not generate convenience methods for these operations |
| 20 | @@convenientAPI(createConversation, false); |
| 21 | @@convenientAPI(getConversation, false); |
| 22 | @@convenientAPI(updateConversation, false); |
| 23 | @@convenientAPI(deleteConversation, false); |
| 24 | @@convenientAPI(listConversationItems, false); |
| 25 | @@convenientAPI(createConversationItems, false); |
| 26 | @@convenientAPI(getConversationItem, false); |
| 27 | @@convenientAPI(deleteConversationItem, false); |
| 28 | |
| 29 | // Rename method |
| 30 | @@clientName(listConversationItems, "GetConversationItems"); |