openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
specification/client/models/common.models.tsp
148lines · modecode
| 1 | import "../../base/typespec/common/main.tsp"; |
| 2 | import "@azure-tools/typespec-client-generator-core"; |
| 3 | import "@typespec/http"; |
| 4 | |
| 5 | using Azure.ClientGenerator.Core; |
| 6 | using TypeSpec.Http; |
| 7 | |
| 8 | namespace OpenAI; |
| 9 | |
| 10 | // Here, we create scenario-specific copies of types for the .NET SDK. |
| 11 | |
| 12 | @access(Access.public) |
| 13 | @usage(Usage.input | Usage.output) |
| 14 | union DotNetResponseReasoningEffortLevel { |
| 15 | ReasoningEffort, |
| 16 | } |
| 17 | |
| 18 | // ResponseFormat |
| 19 | |
| 20 | @access(Access.public) |
| 21 | @usage(Usage.input | Usage.output) |
| 22 | @discriminator("type") |
| 23 | model DotNetChatResponseFormat { |
| 24 | ...ResponseFormat; |
| 25 | } |
| 26 | |
| 27 | @access(Access.public) |
| 28 | @usage(Usage.input | Usage.output) |
| 29 | model DotNetChatResponseFormatText extends DotNetChatResponseFormat { |
| 30 | ...ResponseFormatText; |
| 31 | } |
| 32 | |
| 33 | @access(Access.public) |
| 34 | @usage(Usage.input | Usage.output) |
| 35 | model DotNetChatResponseFormatJsonObject extends DotNetChatResponseFormat { |
| 36 | ...ResponseFormatJsonObject; |
| 37 | } |
| 38 | |
| 39 | @access(Access.public) |
| 40 | @usage(Usage.input | Usage.output) |
| 41 | model DotNetChatResponseFormatJsonSchema extends DotNetChatResponseFormat { |
| 42 | type: "json_schema"; |
| 43 | json_schema: { |
| 44 | description?: string; |
| 45 | name: string; |
| 46 | schema?: unknown; |
| 47 | strict?: boolean | null = false; |
| 48 | }; |
| 49 | } |
| 50 | |
| 51 | // DotNetAssistantResponseFormat |
| 52 | |
| 53 | @access(Access.public) |
| 54 | @usage(Usage.input | Usage.output) |
| 55 | @discriminator("type") |
| 56 | model DotNetAssistantResponseFormat { |
| 57 | ...ResponseFormat; |
| 58 | } |
| 59 | |
| 60 | @access(Access.public) |
| 61 | @usage(Usage.input | Usage.output) |
| 62 | model DotNetAssistantResponseFormatText extends DotNetAssistantResponseFormat { |
| 63 | ...ResponseFormatText; |
| 64 | } |
| 65 | |
| 66 | @access(Access.public) |
| 67 | @usage(Usage.input | Usage.output) |
| 68 | model DotNetAssistantResponseFormatJsonObject |
| 69 | extends DotNetAssistantResponseFormat { |
| 70 | ...ResponseFormatJsonObject; |
| 71 | } |
| 72 | |
| 73 | @access(Access.public) |
| 74 | @usage(Usage.input | Usage.output) |
| 75 | model DotNetAssistantResponseFormatJsonSchema |
| 76 | extends DotNetAssistantResponseFormat { |
| 77 | type: "json_schema"; |
| 78 | json_schema: { |
| 79 | description?: string; |
| 80 | name: string; |
| 81 | schema?: unknown; |
| 82 | strict?: boolean | null = false; |
| 83 | }; |
| 84 | } |
| 85 | |
| 86 | // LogProbProperties |
| 87 | |
| 88 | @access(Access.public) |
| 89 | @usage(Usage.output) |
| 90 | model DotNetAudioLogProbsProperties { |
| 91 | ...LogProbProperties; |
| 92 | } |
| 93 | |
| 94 | @access(Access.public) |
| 95 | @usage(Usage.output) |
| 96 | model DotNetRealtimeLogProbsProperties { |
| 97 | ...LogProbProperties; |
| 98 | } |
| 99 | |
| 100 | // VoiceIdsShared |
| 101 | |
| 102 | @access(Access.public) |
| 103 | @usage(Usage.input | Usage.output) |
| 104 | union DotNetAudioVoiceIds { |
| 105 | VoiceIdsShared, |
| 106 | } |
| 107 | |
| 108 | @access(Access.public) |
| 109 | @usage(Usage.input | Usage.output) |
| 110 | union DotNetChatVoiceIds { |
| 111 | VoiceIdsShared, |
| 112 | } |
| 113 | |
| 114 | // CollectionQueryParameters |
| 115 | |
| 116 | alias DotNetCollectionLimitQueryParameter = { |
| 117 | /** |
| 118 | * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the |
| 119 | * default is 20. |
| 120 | */ |
| 121 | @query pageSizeLimit?: int32 = 20; |
| 122 | }; |
| 123 | |
| 124 | alias DotNetCollectionAfterQueryParameter = { |
| 125 | /** |
| 126 | * A cursor for use in pagination. `after` is an object ID that defines your place in the list. |
| 127 | * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your |
| 128 | * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
| 129 | */ |
| 130 | @query @continuationToken afterId?: string; |
| 131 | }; |
| 132 | |
| 133 | alias DotNetCollectionBeforeQueryParameter = { |
| 134 | /** |
| 135 | * A cursor for use in pagination. `before` is an object ID that defines your place in the list. |
| 136 | * For instance, if you make a list request and receive 100 objects, starting with obj_foo, your |
| 137 | * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
| 138 | */ |
| 139 | @query beforeId?: string; |
| 140 | }; |
| 141 | |
| 142 | union DotNetChatServiceTier { |
| 143 | ServiceTier |
| 144 | } |
| 145 | |
| 146 | union DotNetResponseServiceTier { |
| 147 | ServiceTier |
| 148 | } |
| 149 | |