From 4a5cfdbdf5f513c3523823cba6022b19b5c1da96 Mon Sep 17 00:00:00 2001 From: Rodion Mostovoi Date: Sat, 18 Nov 2023 02:55:33 +0800 Subject: [PATCH] Add generated full client for OpenAI and Azure API --- OpenAI_DotNet.sln | 7 + src/OpenAI.ChatGpt/AzureOpenAiClient.cs | 3 +- .../GeneratedClientsFactory.cs | 24 ++ .../OpenAI.GeneratedKiotaClient.csproj | 22 ++ .../Deployments/DeploymentsRequestBuilder.cs | 37 ++ .../Item/Audio/AudioRequestBuilder.cs | 39 +++ .../TranscriptionsRequestBuilder.cs | 259 ++++++++++++++ .../TranslationsRequestBuilder.cs | 259 ++++++++++++++ .../Item/Chat/ChatRequestBuilder.cs | 34 ++ .../Completions/CompletionsRequestBuilder.cs | 121 +++++++ .../Completions/CompletionsPostRequestBody.cs | 226 +++++++++++++ .../CompletionsPostRequestBody_logit_bias.cs | 45 +++ .../Completions/CompletionsPostResponse.cs | 107 ++++++ .../CompletionsPostResponse_choices.cs | 87 +++++ ...ompletionsPostResponse_choices_logprobs.cs | 82 +++++ ...tResponse_choices_logprobs_top_logprobs.cs | 42 +++ .../CompletionsPostResponse_usage.cs | 54 +++ .../Completions/CompletionsRequestBuilder.cs | 143 ++++++++ .../Item/Completions/CompletionsResponse.cs | 20 ++ .../Item/DeploymentItemRequestBuilder.cs | 59 ++++ .../Embeddings/EmbeddingsPostRequestBody.cs | 114 +++++++ .../Item/Embeddings/EmbeddingsPostResponse.cs | 82 +++++ .../Embeddings/EmbeddingsPostResponse_data.cs | 66 ++++ .../EmbeddingsPostResponse_usage.cs | 50 +++ .../Embeddings/EmbeddingsRequestBuilder.cs | 134 ++++++++ .../Item/Embeddings/EmbeddingsResponse.cs | 20 ++ .../Extensions/Chat/ChatRequestBuilder.cs | 34 ++ .../Completions/CompletionsRequestBuilder.cs | 121 +++++++ .../Extensions/ExtensionsRequestBuilder.cs | 34 ++ .../Generations/GenerationsRequestBuilder.cs | 121 +++++++ .../Item/Images/ImagesRequestBuilder.cs | 34 ++ .../GeneratedAzureOpenAiClient.cs | 34 ++ .../azure_openai/Models/AudioResponse.cs | 55 +++ .../Models/AudioVerboseResponse.cs | 37 ++ .../Models/ChatCompletionResponseObject.cs | 12 + .../Models/ChatCompletionsRequestCommon.cs | 138 ++++++++ ...ChatCompletionsRequestCommon_logit_bias.cs | 45 +++ .../Models/ChatCompletionsResponseCommon.cs | 90 +++++ .../azure_openai/Models/CompletionUsage.cs | 57 ++++ .../Models/ContentFilterChoiceResults.cs | 37 ++ .../Models/ContentFilterDetectedResult.cs | 34 ++ ...ContentFilterDetectedWithCitationResult.cs | 34 ++ .../Models/ContentFilterIdResult.cs | 34 ++ .../Models/ContentFilterPromptResults.cs | 47 +++ .../Models/ContentFilterResultBase.cs | 46 +++ .../Models/ContentFilterResultsBase.cs | 115 +++++++ .../Models/ContentFilterSeverityResult.cs | 34 ++ .../Models/CreateChatCompletionRequest.cs | 34 ++ .../Models/CreateChatCompletionResponse.cs | 34 ++ .../generated/azure_openai/Models/Error.cs | 64 ++++ .../azure_openai/Models/ErrorBase.cs | 62 ++++ .../azure_openai/Models/ErrorResponse.cs | 55 +++ .../ExtensionsChatCompletionsRequest.cs | 37 ++ .../ExtensionsChatCompletionsResponse.cs | 37 ++ .../Models/GenerateImagesResponse.cs | 66 ++++ .../Models/ImageGenerationsRequest.cs | 86 +++++ .../azure_openai/Models/ImageQuality.cs | 15 + .../azure_openai/Models/ImageResult.cs | 75 ++++ .../azure_openai/Models/ImageSize.cs | 18 + .../azure_openai/Models/ImageStyle.cs | 15 + .../Models/ImagesResponseFormat.cs | 15 + .../azure_openai/Models/InnerError.cs | 59 ++++ .../azure_openai/Models/InnerErrorCode.cs | 12 + .../azure_openai/Models/PromptFilterResult.cs | 59 ++++ .../generated/azure_openai/kiota-lock.json | 27 ++ .../Assistants/AssistantsRequestBuilder.cs | 209 ++++++++++++ .../Assistants/GetOrderQueryParameterType.cs | 12 + .../Item/Files/FilesRequestBuilder.cs | 209 ++++++++++++ .../Item/Files/GetOrderQueryParameterType.cs | 12 + .../Files/Item/WithFile_ItemRequestBuilder.cs | 151 +++++++++ .../Item/WithAssistant_ItemRequestBuilder.cs | 217 ++++++++++++ .../openai/Audio/AudioRequestBuilder.cs | 44 +++ .../Audio/Speech/SpeechRequestBuilder.cs | 100 ++++++ .../TranscriptionsRequestBuilder.cs | 100 ++++++ .../TranslationsRequestBuilder.cs | 100 ++++++ .../openai/Chat/ChatRequestBuilder.cs | 34 ++ .../Completions/CompletionsRequestBuilder.cs | 100 ++++++ .../Completions/CompletionsRequestBuilder.cs | 100 ++++++ .../openai/Edits/EditsRequestBuilder.cs | 103 ++++++ .../Embeddings/EmbeddingsRequestBuilder.cs | 100 ++++++ .../openai/Files/FilesRequestBuilder.cs | 182 ++++++++++ .../Item/Content/ContentRequestBuilder.cs | 94 ++++++ .../Files/Item/WithFile_ItemRequestBuilder.cs | 156 +++++++++ .../FineTunes/FineTunesRequestBuilder.cs | 170 ++++++++++ .../Item/Cancel/CancelRequestBuilder.cs | 98 ++++++ .../Item/Events/EventsRequestBuilder.cs | 109 ++++++ .../Item/WithFine_tune_ItemRequestBuilder.cs | 110 ++++++ .../Fine_tuning/Fine_tuningRequestBuilder.cs | 34 ++ .../Jobs/Item/Cancel/CancelRequestBuilder.cs | 95 ++++++ .../Jobs/Item/Events/EventsRequestBuilder.cs | 116 +++++++ .../WithFine_tuning_job_ItemRequestBuilder.cs | 105 ++++++ .../Fine_tuning/Jobs/JobsRequestBuilder.cs | 185 ++++++++++ .../generated/openai/GeneratedOpenAiClient.cs | 94 ++++++ .../Images/Edits/EditsRequestBuilder.cs | 100 ++++++ .../Generations/GenerationsRequestBuilder.cs | 100 ++++++ .../openai/Images/ImagesRequestBuilder.cs | 44 +++ .../Variations/VariationsRequestBuilder.cs | 100 ++++++ .../openai/Models/AssistantFileObject.cs | 73 ++++ .../Models/AssistantFileObject_object.cs | 11 + .../openai/Models/AssistantObject.cs | 212 ++++++++++++ .../openai/Models/AssistantObject_metadata.cs | 45 +++ .../openai/Models/AssistantObject_object.cs | 11 + .../openai/Models/AssistantToolsCode.cs | 46 +++ .../openai/Models/AssistantToolsCode_type.cs | 11 + .../openai/Models/AssistantToolsFunction.cs | 56 +++ .../Models/AssistantToolsFunction_type.cs | 11 + .../openai/Models/AssistantToolsRetrieval.cs | 46 +++ .../Models/AssistantToolsRetrieval_type.cs | 11 + .../ChatCompletionFunctionCallOption.cs | 55 +++ .../openai/Models/ChatCompletionFunctions.cs | 73 ++++ .../Models/ChatCompletionMessageToolCall.cs | 66 ++++ .../ChatCompletionMessageToolCall_function.cs | 65 ++++ .../ChatCompletionMessageToolCall_type.cs | 11 + .../Models/ChatCompletionNamedToolChoice.cs | 59 ++++ .../ChatCompletionNamedToolChoice_function.cs | 52 +++ .../ChatCompletionNamedToolChoice_type.cs | 11 + .../ChatCompletionRequestAssistantMessage.cs | 77 +++++ ...onRequestAssistantMessage_function_call.cs | 66 ++++ ...tCompletionRequestAssistantMessage_role.cs | 11 + .../ChatCompletionRequestFunctionMessage.cs | 67 ++++ ...atCompletionRequestFunctionMessage_role.cs | 11 + .../Models/ChatCompletionRequestMessage.cs | 123 +++++++ ...ChatCompletionRequestMessageContentPart.cs | 45 +++ .../ChatCompletionRequestSystemMessage.cs | 56 +++ ...ChatCompletionRequestSystemMessage_role.cs | 11 + .../ChatCompletionRequestToolMessage.cs | 66 ++++ .../ChatCompletionRequestToolMessage_role.cs | 11 + .../ChatCompletionRequestUserMessage.cs | 118 +++++++ .../ChatCompletionRequestUserMessage_role.cs | 11 + .../Models/ChatCompletionResponseMessage.cs | 80 +++++ ...CompletionResponseMessage_function_call.cs | 66 ++++ .../ChatCompletionResponseMessage_role.cs | 11 + .../openai/Models/ChatCompletionTool.cs | 56 +++ .../Models/ChatCompletionToolChoiceOption.cs | 69 ++++ .../openai/Models/ChatCompletionTool_type.cs | 11 + .../openai/Models/CompletionUsage.cs | 57 ++++ .../Models/CreateAssistantFileRequest.cs | 43 +++ .../openai/Models/CreateAssistantRequest.cs | 182 ++++++++++ .../Models/CreateAssistantRequest_metadata.cs | 45 +++ .../Models/CreateChatCompletionRequest.cs | 319 ++++++++++++++++++ .../CreateChatCompletionRequest_logit_bias.cs | 45 +++ ...teChatCompletionRequest_response_format.cs | 50 +++ ...tCompletionRequest_response_format_type.cs | 13 + .../Models/CreateChatCompletionResponse.cs | 103 ++++++ .../CreateChatCompletionResponse_choices.cs | 60 ++++ ...ompletionResponse_choices_finish_reason.cs | 19 ++ .../CreateChatCompletionResponse_object.cs | 11 + .../openai/Models/CreateCompletionRequest.cs | 296 ++++++++++++++++ .../CreateCompletionRequest_logit_bias.cs | 45 +++ .../CreateCompletionRequest_promptMember1.cs | 42 +++ .../openai/Models/CreateCompletionResponse.cs | 103 ++++++ .../CreateCompletionResponse_choices.cs | 70 ++++ ...ompletionResponse_choices_finish_reason.cs | 15 + ...eateCompletionResponse_choices_logprobs.cs | 82 +++++ ...nResponse_choices_logprobs_top_logprobs.cs | 42 +++ .../Models/CreateCompletionResponse_object.cs | 11 + .../openai/Models/CreateEditRequest.cs | 125 +++++++ .../openai/Models/CreateEditResponse.cs | 71 ++++ .../Models/CreateEditResponse_choices.cs | 60 ++++ ...reateEditResponse_choices_finish_reason.cs | 13 + .../Models/CreateEditResponse_object.cs | 11 + .../openai/Models/CreateEmbeddingRequest.cs | 181 ++++++++++ .../CreateEmbeddingRequest_encoding_format.cs | 13 + .../CreateEmbeddingRequest_inputMember1.cs | 42 +++ .../openai/Models/CreateEmbeddingResponse.cs | 76 +++++ .../Models/CreateEmbeddingResponse_object.cs | 11 + .../Models/CreateEmbeddingResponse_usage.cs | 53 +++ .../openai/Models/CreateFineTuneRequest.cs | 173 ++++++++++ .../CreateFineTuneRequest_hyperparameters.cs | 105 ++++++ .../Models/CreateFineTuningJobRequest.cs | 133 ++++++++ ...ateFineTuningJobRequest_hyperparameters.cs | 225 ++++++++++++ .../openai/Models/CreateImageRequest.cs | 137 ++++++++ .../Models/CreateImageRequest_quality.cs | 13 + .../CreateImageRequest_response_format.cs | 13 + .../openai/Models/CreateImageRequest_size.cs | 19 ++ .../openai/Models/CreateImageRequest_style.cs | 13 + .../openai/Models/CreateMessageRequest.cs | 67 ++++ .../Models/CreateMessageRequest_metadata.cs | 45 +++ .../Models/CreateMessageRequest_role.cs | 11 + .../openai/Models/CreateModerationRequest.cs | 145 ++++++++ .../openai/Models/CreateModerationResponse.cs | 75 ++++ .../CreateModerationResponse_results.cs | 66 ++++ ...teModerationResponse_results_categories.cs | 89 +++++ ...erationResponse_results_category_scores.cs | 89 +++++ .../openai/Models/CreateRunRequest.cs | 162 +++++++++ .../Models/CreateRunRequest_metadata.cs | 45 +++ .../openai/Models/CreateSpeechRequest.cs | 112 ++++++ .../CreateSpeechRequest_response_format.cs | 17 + .../Models/CreateSpeechRequest_voice.cs | 21 ++ .../Models/CreateThreadAndRunRequest.cs | 172 ++++++++++ .../CreateThreadAndRunRequest_metadata.cs | 45 +++ .../openai/Models/CreateThreadRequest.cs | 53 +++ .../Models/CreateThreadRequest_metadata.cs | 45 +++ .../Models/CreateTranscriptionResponse.cs | 52 +++ .../Models/CreateTranslationResponse.cs | 52 +++ .../Models/DeleteAssistantFileResponse.cs | 63 ++++ .../DeleteAssistantFileResponse_object.cs | 10 + .../openai/Models/DeleteAssistantResponse.cs | 60 ++++ .../Models/DeleteAssistantResponse_object.cs | 10 + .../openai/Models/DeleteFileResponse.cs | 60 ++++ .../Models/DeleteFileResponse_object.cs | 10 + .../openai/Models/DeleteModelResponse.cs | 66 ++++ .../openai/Models/DeleteThreadResponse.cs | 60 ++++ .../Models/DeleteThreadResponse_object.cs | 10 + .../generated/openai/Models/Embedding.cs | 63 ++++ .../openai/Models/Embedding_object.cs | 11 + .../generated/openai/Models/FineTune.cs | 158 +++++++++ .../generated/openai/Models/FineTuneEvent.cs | 74 ++++ .../openai/Models/FineTuneEvent_object.cs | 10 + .../openai/Models/FineTune_hyperparams.cs | 79 +++++ .../openai/Models/FineTune_object.cs | 11 + .../generated/openai/Models/FineTuningJob.cs | 155 +++++++++ .../openai/Models/FineTuningJobEvent.cs | 77 +++++ .../openai/Models/FineTuningJobEvent_level.cs | 14 + .../Models/FineTuningJobEvent_object.cs | 10 + .../openai/Models/FineTuningJob_error.cs | 75 ++++ .../Models/FineTuningJob_hyperparameters.cs | 105 ++++++ .../openai/Models/FineTuningJob_object.cs | 11 + .../openai/Models/FineTuningJob_status.cs | 21 ++ .../generated/openai/Models/FunctionObject.cs | 72 ++++ .../openai/Models/FunctionParameters.cs | 45 +++ .../generated/openai/Models/Image.cs | 75 ++++ .../generated/openai/Models/ImagesResponse.cs | 56 +++ .../Models/ListAssistantFilesResponse.cs | 86 +++++ .../openai/Models/ListAssistantsResponse.cs | 86 +++++ .../openai/Models/ListFilesResponse.cs | 56 +++ .../openai/Models/ListFilesResponse_object.cs | 10 + .../Models/ListFineTuneEventsResponse.cs | 56 +++ .../ListFineTuneEventsResponse_object.cs | 10 + .../openai/Models/ListFineTunesResponse.cs | 56 +++ .../Models/ListFineTunesResponse_object.cs | 10 + .../Models/ListFineTuningJobEventsResponse.cs | 56 +++ .../ListFineTuningJobEventsResponse_object.cs | 10 + .../openai/Models/ListMessageFilesResponse.cs | 86 +++++ .../openai/Models/ListMessagesResponse.cs | 86 +++++ .../openai/Models/ListModelsResponse.cs | 56 +++ .../Models/ListModelsResponse_object.cs | 10 + .../ListPaginatedFineTuningJobsResponse.cs | 60 ++++ ...tPaginatedFineTuningJobsResponse_object.cs | 10 + .../openai/Models/ListRunStepsResponse.cs | 86 +++++ .../openai/Models/ListRunsResponse.cs | 86 +++++ .../Models/MessageContentImageFileObject.cs | 59 ++++ ...essageContentImageFileObject_image_file.cs | 52 +++ .../MessageContentImageFileObject_type.cs | 11 + ...ontentTextAnnotationsFileCitationObject.cs | 77 +++++ ...tationsFileCitationObject_file_citation.cs | 62 ++++ ...tTextAnnotationsFileCitationObject_type.cs | 11 + ...ageContentTextAnnotationsFilePathObject.cs | 77 +++++ ...TextAnnotationsFilePathObject_file_path.cs | 52 +++ ...ntentTextAnnotationsFilePathObject_type.cs | 11 + .../openai/Models/MessageContentTextObject.cs | 59 ++++ .../Models/MessageContentTextObject_text.cs | 124 +++++++ .../Models/MessageContentTextObject_type.cs | 11 + .../openai/Models/MessageFileObject.cs | 73 ++++ .../openai/Models/MessageFileObject_object.cs | 11 + .../generated/openai/Models/MessageObject.cs | 189 +++++++++++ .../openai/Models/MessageObject_metadata.cs | 45 +++ .../openai/Models/MessageObject_object.cs | 11 + .../openai/Models/MessageObject_role.cs | 13 + .../generated/openai/Models/Model.cs | 73 ++++ .../generated/openai/Models/Model_object.cs | 11 + .../openai/Models/ModifyAssistantRequest.cs | 182 ++++++++++ .../Models/ModifyAssistantRequest_metadata.cs | 45 +++ .../openai/Models/ModifyMessageRequest.cs | 43 +++ .../Models/ModifyMessageRequest_metadata.cs | 45 +++ .../openai/Models/ModifyRunRequest.cs | 43 +++ .../Models/ModifyRunRequest_metadata.cs | 45 +++ .../openai/Models/ModifyThreadRequest.cs | 43 +++ .../Models/ModifyThreadRequest_metadata.cs | 45 +++ .../generated/openai/Models/OpenAIFile.cs | 97 ++++++ .../openai/Models/OpenAIFile_object.cs | 11 + .../openai/Models/OpenAIFile_purpose.cs | 17 + .../openai/Models/OpenAIFile_status.cs | 16 + .../generated/openai/Models/RunObject.cs | 256 ++++++++++++++ .../openai/Models/RunObject_last_error.cs | 59 ++++ .../Models/RunObject_last_error_code.cs | 13 + .../openai/Models/RunObject_metadata.cs | 45 +++ .../openai/Models/RunObject_object.cs | 11 + .../Models/RunObject_required_action.cs | 59 ++++ ...ect_required_action_submit_tool_outputs.cs | 55 +++ .../Models/RunObject_required_action_type.cs | 11 + .../openai/Models/RunObject_status.cs | 25 ++ .../RunStepDetailsMessageCreationObject.cs | 59 ++++ ...sMessageCreationObject_message_creation.cs | 52 +++ ...unStepDetailsMessageCreationObject_type.cs | 11 + .../RunStepDetailsToolCallsCodeObject.cs | 69 ++++ ...ilsToolCallsCodeObject_code_interpreter.cs | 127 +++++++ .../RunStepDetailsToolCallsCodeObject_type.cs | 11 + ...epDetailsToolCallsCodeOutputImageObject.cs | 56 +++ ...ilsToolCallsCodeOutputImageObject_image.cs | 52 +++ ...ailsToolCallsCodeOutputImageObject_type.cs | 11 + ...tepDetailsToolCallsCodeOutputLogsObject.cs | 59 ++++ ...tailsToolCallsCodeOutputLogsObject_type.cs | 11 + .../RunStepDetailsToolCallsFunctionObject.cs | 66 ++++ ...DetailsToolCallsFunctionObject_function.cs | 75 ++++ ...StepDetailsToolCallsFunctionObject_type.cs | 11 + .../Models/RunStepDetailsToolCallsObject.cs | 138 ++++++++ .../RunStepDetailsToolCallsObject_type.cs | 11 + .../RunStepDetailsToolCallsRetrievalObject.cs | 66 ++++ ...tailsToolCallsRetrievalObject_retrieval.cs | 45 +++ ...tepDetailsToolCallsRetrievalObject_type.cs | 11 + .../generated/openai/Models/RunStepObject.cs | 209 ++++++++++++ .../openai/Models/RunStepObject_last_error.cs | 59 ++++ .../Models/RunStepObject_last_error_code.cs | 13 + .../openai/Models/RunStepObject_metadata.cs | 45 +++ .../openai/Models/RunStepObject_object.cs | 11 + .../openai/Models/RunStepObject_status.cs | 19 ++ .../openai/Models/RunStepObject_type.cs | 13 + .../openai/Models/RunToolCallObject.cs | 69 ++++ .../Models/RunToolCallObject_function.cs | 65 ++++ .../openai/Models/RunToolCallObject_type.cs | 11 + .../Models/SubmitToolOutputsRunRequest.cs | 43 +++ ...ubmitToolOutputsRunRequest_tool_outputs.cs | 62 ++++ .../generated/openai/Models/TextContent.cs | 45 +++ .../generated/openai/Models/ThreadObject.cs | 73 ++++ .../openai/Models/ThreadObject_metadata.cs | 45 +++ .../openai/Models/ThreadObject_object.cs | 11 + .../Item/WithModelItemRequestBuilder.cs | 151 +++++++++ .../ModelsRequests/ModelsRequestBuilder.cs | 103 ++++++ .../Moderations/ModerationsRequestBuilder.cs | 100 ++++++ .../Messages/GetOrderQueryParameterType.cs | 12 + .../Item/Files/FilesRequestBuilder.cs | 148 ++++++++ .../Item/Files/GetOrderQueryParameterType.cs | 12 + .../Files/Item/WithFile_ItemRequestBuilder.cs | 95 ++++++ .../Item/WithMessage_ItemRequestBuilder.cs | 161 +++++++++ .../Item/Messages/MessagesRequestBuilder.cs | 209 ++++++++++++ .../Item/Runs/GetOrderQueryParameterType.cs | 12 + .../Runs/Item/Cancel/CancelRequestBuilder.cs | 95 ++++++ .../Item/Steps/GetOrderQueryParameterType.cs | 12 + .../Steps/Item/WithStep_ItemRequestBuilder.cs | 95 ++++++ .../Runs/Item/Steps/StepsRequestBuilder.cs | 148 ++++++++ .../Submit_tool_outputsRequestBuilder.cs | 100 ++++++ .../Runs/Item/WithRun_ItemRequestBuilder.cs | 171 ++++++++++ .../Threads/Item/Runs/RunsRequestBuilder.cs | 209 ++++++++++++ .../Item/WithThread_ItemRequestBuilder.cs | 222 ++++++++++++ .../openai/Threads/Runs/RunsRequestBuilder.cs | 100 ++++++ .../openai/Threads/ThreadsRequestBuilder.cs | 113 +++++++ .../generated/openai/kiota-lock.json | 27 ++ .../OpenAI.GeneratedKiotaClient/readme.md | 36 ++ .../scripts/public_to_internal.ps1 | 41 +++ 340 files changed, 22665 insertions(+), 2 deletions(-) create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/GeneratedClientsFactory.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/OpenAI.GeneratedKiotaClient.csproj create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/DeploymentsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/AudioRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Transcriptions/TranscriptionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Translations/TranslationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/ChatRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/Completions/CompletionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody_logit_bias.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs_top_logprobs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_usage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/DeploymentItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostRequestBody.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_data.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_usage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/ChatRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/Completions/CompletionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/ExtensionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/Generations/GenerationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/ImagesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/GeneratedAzureOpenAiClient.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioVerboseResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionResponseObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon_logit_bias.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsResponseCommon.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CompletionUsage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterChoiceResults.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedWithCitationResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterIdResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterPromptResults.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultBase.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultsBase.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterSeverityResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/Error.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorBase.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/GenerateImagesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageGenerationsRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageQuality.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageSize.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageStyle.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImagesResponseFormat.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerError.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerErrorCode.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/PromptFilterResult.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/kiota-lock.json create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/AssistantsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/FilesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/Item/WithFile_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/WithAssistant_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/AudioRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Speech/SpeechRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Transcriptions/TranscriptionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Translations/TranslationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/ChatRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/Completions/CompletionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Completions/CompletionsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Edits/EditsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Embeddings/EmbeddingsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/FilesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/Content/ContentRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/WithFile_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/FineTunesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Cancel/CancelRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Events/EventsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/WithFine_tune_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Fine_tuningRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Cancel/CancelRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Events/EventsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/WithFine_tuning_job_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/JobsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/GeneratedOpenAiClient.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Edits/EditsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Generations/GenerationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/ImagesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Variations/VariationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctionCallOption.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctions.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_function.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_function.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_function_call.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessageContentPart.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_function_call.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionToolChoiceOption.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CompletionUsage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantFileRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_logit_bias.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices_finish_reason.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_logit_bias.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_promptMember1.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_finish_reason.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs_top_logprobs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices_finish_reason.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_encoding_format.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_inputMember1.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_usage.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest_hyperparameters.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest_hyperparameters.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_quality.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_response_format.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_size.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_style.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_categories.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_category_scores.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_response_format.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_voice.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranscriptionResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranslationResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteModelResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_hyperparams.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_level.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_error.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_hyperparameters.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_status.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionParameters.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Image.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ImagesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantFilesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessageFilesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessagesResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunStepsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunsResponse.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_image_file.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_file_citation.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_file_path.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_text.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_role.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_purpose.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_status.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error_code.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_submit_tool_outputs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_status.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_message_creation.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_code_interpreter.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_image.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_function.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_retrieval.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error_code.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_status.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_function.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_type.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest_tool_outputs.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/TextContent.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_metadata.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_object.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/Item/WithModelItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/ModelsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Moderations/ModerationsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/FilesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/Item/WithFile_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/WithMessage_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/MessagesRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Cancel/CancelRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/GetOrderQueryParameterType.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/Item/WithStep_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/StepsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Submit_tool_outputs/Submit_tool_outputsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/WithRun_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/RunsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/WithThread_ItemRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Runs/RunsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/ThreadsRequestBuilder.cs create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/generated/openai/kiota-lock.json create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/readme.md create mode 100644 src/internal/OpenAI.GeneratedKiotaClient/scripts/public_to_internal.ps1 diff --git a/OpenAI_DotNet.sln b/OpenAI_DotNet.sln index f2f7b54..101a143 100644 --- a/OpenAI_DotNet.sln +++ b/OpenAI_DotNet.sln @@ -42,6 +42,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{130D40E9-8E3 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "internal", "internal", "{B28033FF-A6F3-48AC-824F-99996B1AC85E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAI.GeneratedKiotaClient", "src\internal\OpenAI.GeneratedKiotaClient\OpenAI.GeneratedKiotaClient.csproj", "{095A8BD6-7B1F-4FB3-AD9E-2B98B138190B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -96,6 +98,10 @@ Global {F2968A66-5672-439E-823E-D35100CA067D}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2968A66-5672-439E-823E-D35100CA067D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F2968A66-5672-439E-823E-D35100CA067D}.Release|Any CPU.Build.0 = Release|Any CPU + {095A8BD6-7B1F-4FB3-AD9E-2B98B138190B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {095A8BD6-7B1F-4FB3-AD9E-2B98B138190B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {095A8BD6-7B1F-4FB3-AD9E-2B98B138190B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {095A8BD6-7B1F-4FB3-AD9E-2B98B138190B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -115,5 +121,6 @@ Global {DB6D8BCB-F003-4624-9277-3B4E1B7CDBCD} = {130D40E9-8E33-4EBA-8AE1-8B9479BC286A} {068E9E67-C2FC-4F8C-B27C-CB3A8FA44BD8} = {130D40E9-8E33-4EBA-8AE1-8B9479BC286A} {B28033FF-A6F3-48AC-824F-99996B1AC85E} = {130D40E9-8E33-4EBA-8AE1-8B9479BC286A} + {095A8BD6-7B1F-4FB3-AD9E-2B98B138190B} = {B28033FF-A6F3-48AC-824F-99996B1AC85E} EndGlobalSection EndGlobal diff --git a/src/OpenAI.ChatGpt/AzureOpenAiClient.cs b/src/OpenAI.ChatGpt/AzureOpenAiClient.cs index 6a8e3c1..b57b99e 100644 --- a/src/OpenAI.ChatGpt/AzureOpenAiClient.cs +++ b/src/OpenAI.ChatGpt/AzureOpenAiClient.cs @@ -12,8 +12,6 @@ public class AzureOpenAiClient : OpenAiClient private readonly string _apiVersion; private const string DefaultApiVersion = "2023-12-01-preview"; - //https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference - /// /// Creates Azure OpenAI services client /// @@ -23,6 +21,7 @@ public class AzureOpenAiClient : OpenAiClient /// Azure OpenAI API version /// /// See currently available API versions: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions + /// Specifications: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference /// public AzureOpenAiClient( string endpointUrl, diff --git a/src/internal/OpenAI.GeneratedKiotaClient/GeneratedClientsFactory.cs b/src/internal/OpenAI.GeneratedKiotaClient/GeneratedClientsFactory.cs new file mode 100644 index 0000000..36dc1d7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/GeneratedClientsFactory.cs @@ -0,0 +1,24 @@ +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenAI.Azure.GeneratedKiotaClient; + +namespace OpenAI.GeneratedKiotaClient; + +internal static class GeneratedClientsFactory +{ + public static GeneratedOpenAiClient CreateGeneratedOpenAiClient(HttpClient httpClient) + { + ArgumentNullException.ThrowIfNull(httpClient); + var authProvider = new AnonymousAuthenticationProvider(); + var adapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient); + return new GeneratedOpenAiClient(adapter); + } + + public static GeneratedAzureOpenAiClient CreateGeneratedAzureOpenAiClient(HttpClient httpClient) + { + ArgumentNullException.ThrowIfNull(httpClient); + var authProvider = new AnonymousAuthenticationProvider(); + var adapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient); + return new GeneratedAzureOpenAiClient(adapter); + } +} \ No newline at end of file diff --git a/src/internal/OpenAI.GeneratedKiotaClient/OpenAI.GeneratedKiotaClient.csproj b/src/internal/OpenAI.GeneratedKiotaClient/OpenAI.GeneratedKiotaClient.csproj new file mode 100644 index 0000000..664fb8e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/OpenAI.GeneratedKiotaClient.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + enable + enable + false + $(NoWarn);CS0618 + + + + + + + + + + + + + + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/DeploymentsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/DeploymentsRequestBuilder.cs new file mode 100644 index 0000000..b20e4e2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/DeploymentsRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments { + /// + /// Builds and executes requests for operations under \deployments + /// + internal class DeploymentsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.Azure.GeneratedKiotaClient.deployments.item collection + /// Unique identifier of the item + public DeploymentItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("deployment%2Did", position); + return new DeploymentItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new DeploymentsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DeploymentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments", pathParameters) { + } + /// + /// Instantiates a new DeploymentsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DeploymentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/AudioRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/AudioRequestBuilder.cs new file mode 100644 index 0000000..ab587b4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/AudioRequestBuilder.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Transcriptions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Translations; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\audio + /// + internal class AudioRequestBuilder : BaseRequestBuilder { + /// The transcriptions property + public TranscriptionsRequestBuilder Transcriptions { get => + new TranscriptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The translations property + public TranslationsRequestBuilder Translations { get => + new TranslationsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio", pathParameters) { + } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Transcriptions/TranscriptionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Transcriptions/TranscriptionsRequestBuilder.cs new file mode 100644 index 0000000..7cf6329 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Transcriptions/TranscriptionsRequestBuilder.cs @@ -0,0 +1,259 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Transcriptions { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\audio\transcriptions + /// + internal class TranscriptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TranscriptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TranscriptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio/transcriptions{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new TranscriptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TranscriptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio/transcriptions{?api%2Dversion*}", rawUrl) { + } + /// + /// Transcribes audio into the input language. + /// + /// Transcription request. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsTranscriptionsPostResponseAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsTranscriptionsPostResponseAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TranscriptionsPostResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Transcribes audio into the input language. + /// + /// Transcription request. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("This method is obsolete. Use PostAsTranscriptionsPostResponse instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TranscriptionsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Transcribes audio into the input language. + /// + /// Transcription request. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new TranscriptionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TranscriptionsRequestBuilder WithUrl(string rawUrl) { + return new TranscriptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes audioResponse, audioVerboseResponse + /// + internal class TranscriptionsPostResponse : IComposedTypeWrapper, IParsable { + /// Composed type representation for type audioResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse? AudioResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse AudioResponse { get; set; } +#endif + /// Composed type representation for type audioVerboseResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse? AudioVerboseResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse AudioVerboseResponse { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranscriptionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new TranscriptionsPostResponse(); + if("audioResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse(); + } + else if("audioVerboseResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioVerboseResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AudioResponse != null) { + return AudioResponse.GetFieldDeserializers(); + } + else if(AudioVerboseResponse != null) { + return AudioVerboseResponse.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AudioResponse != null) { + writer.WriteObjectValue(null, AudioResponse); + } + else if(AudioVerboseResponse != null) { + writer.WriteObjectValue(null, AudioVerboseResponse); + } + } + } + /// + /// Transcribes audio into the input language. + /// + internal class TranscriptionsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class TranscriptionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public TranscriptionsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new TranscriptionsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new transcriptionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public TranscriptionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Composed type wrapper for classes audioResponse, audioVerboseResponse + /// + internal class TranscriptionsResponse : IComposedTypeWrapper, IParsable { + /// Composed type representation for type audioResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse? AudioResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse AudioResponse { get; set; } +#endif + /// Composed type representation for type audioVerboseResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse? AudioVerboseResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse AudioVerboseResponse { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranscriptionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new TranscriptionsResponse(); + if("audioResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse(); + } + else if("audioVerboseResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioVerboseResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AudioResponse != null) { + return AudioResponse.GetFieldDeserializers(); + } + else if(AudioVerboseResponse != null) { + return AudioVerboseResponse.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AudioResponse != null) { + writer.WriteObjectValue(null, AudioResponse); + } + else if(AudioVerboseResponse != null) { + writer.WriteObjectValue(null, AudioVerboseResponse); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Translations/TranslationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Translations/TranslationsRequestBuilder.cs new file mode 100644 index 0000000..07f9f23 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Audio/Translations/TranslationsRequestBuilder.cs @@ -0,0 +1,259 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio.Translations { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\audio\translations + /// + internal class TranslationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TranslationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TranslationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio/translations{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new TranslationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TranslationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/audio/translations{?api%2Dversion*}", rawUrl) { + } + /// + /// Transcribes and translates input audio into English text. + /// + /// Translation request. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsTranslationsPostResponseAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsTranslationsPostResponseAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TranslationsPostResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Transcribes and translates input audio into English text. + /// + /// Translation request. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("This method is obsolete. Use PostAsTranslationsPostResponse instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TranslationsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Transcribes and translates input audio into English text. + /// + /// Translation request. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new TranslationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TranslationsRequestBuilder WithUrl(string rawUrl) { + return new TranslationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Composed type wrapper for classes audioResponse, audioVerboseResponse + /// + internal class TranslationsPostResponse : IComposedTypeWrapper, IParsable { + /// Composed type representation for type audioResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse? AudioResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse AudioResponse { get; set; } +#endif + /// Composed type representation for type audioVerboseResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse? AudioVerboseResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse AudioVerboseResponse { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranslationsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new TranslationsPostResponse(); + if("audioResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse(); + } + else if("audioVerboseResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioVerboseResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AudioResponse != null) { + return AudioResponse.GetFieldDeserializers(); + } + else if(AudioVerboseResponse != null) { + return AudioVerboseResponse.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AudioResponse != null) { + writer.WriteObjectValue(null, AudioResponse); + } + else if(AudioVerboseResponse != null) { + writer.WriteObjectValue(null, AudioVerboseResponse); + } + } + } + /// + /// Transcribes and translates input audio into English text. + /// + internal class TranslationsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class TranslationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public TranslationsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new TranslationsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new translationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public TranslationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Composed type wrapper for classes audioResponse, audioVerboseResponse + /// + internal class TranslationsResponse : IComposedTypeWrapper, IParsable { + /// Composed type representation for type audioResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse? AudioResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse AudioResponse { get; set; } +#endif + /// Composed type representation for type audioVerboseResponse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse? AudioVerboseResponse { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse AudioVerboseResponse { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranslationsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new TranslationsResponse(); + if("audioResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioResponse(); + } + else if("audioVerboseResponse".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AudioVerboseResponse = new OpenAI.Azure.GeneratedKiotaClient.Models.AudioVerboseResponse(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AudioResponse != null) { + return AudioResponse.GetFieldDeserializers(); + } + else if(AudioVerboseResponse != null) { + return AudioVerboseResponse.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AudioResponse != null) { + writer.WriteObjectValue(null, AudioResponse); + } + else if(AudioVerboseResponse != null) { + writer.WriteObjectValue(null, AudioVerboseResponse); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/ChatRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/ChatRequestBuilder.cs new file mode 100644 index 0000000..2d8fd1d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/ChatRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Chat.Completions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Chat { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\chat + /// + internal class ChatRequestBuilder : BaseRequestBuilder { + /// The completions property + public CompletionsRequestBuilder Completions { get => + new CompletionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/chat", pathParameters) { + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/chat", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/Completions/CompletionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/Completions/CompletionsRequestBuilder.cs new file mode 100644 index 0000000..ee8de8b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Chat/Completions/CompletionsRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Chat.Completions { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\chat\completions + /// + internal class CompletionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/chat/completions{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/chat/completions{?api%2Dversion*}", rawUrl) { + } + /// + /// Creates a completion for the chat message + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateChatCompletionRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateChatCompletionRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"4XX", ErrorResponse.CreateFromDiscriminatorValue}, + {"5XX", ErrorResponse.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, CreateChatCompletionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a completion for the chat message + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateChatCompletionRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateChatCompletionRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CompletionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompletionsRequestBuilder WithUrl(string rawUrl) { + return new CompletionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates a completion for the chat message + /// + internal class CompletionsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CompletionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public CompletionsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new CompletionsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new completionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CompletionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody.cs new file mode 100644 index 0000000..7cace50 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody.cs @@ -0,0 +1,226 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostRequestBody : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.When used with n, best_of controls the number of candidate completions and n specifies how many to return - best_of must be greater than n.Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. Has maximum value of 128. + public int? BestOf { get; set; } + /// The completion_config property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CompletionConfig { get; set; } +#nullable restore +#else + public string CompletionConfig { get; set; } +#endif + /// Echo back the prompt in addition to the completion + public bool? Echo { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + public double? FrequencyPenalty { get; set; } + /// Defaults to null. Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256" &#58; -100} to prevent the <|endoftext|> token from being generated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionsPostRequestBody_logit_bias? LogitBias { get; set; } +#nullable restore +#else + public CompletionsPostRequestBody_logit_bias LogitBias { get; set; } +#endif + /// Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.Minimum of 0 and maximum of 5 allowed. + public int? Logprobs { get; set; } + /// The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). Has minimum of 0. + public int? MaxTokens { get; set; } + /// How many completions to generate for each prompt. Minimum of 1 and maximum of 128 allowed.Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop. + public int? N { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + public double? PresencePenalty { get; set; } + /// The prompt(s) to generate completions for, encoded as a string or array of strings.Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. Maximum allowed size of string list is 2048. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionsPostRequestBody_prompt? Prompt { get; set; } +#nullable restore +#else + public CompletionsPostRequestBody_prompt Prompt { get; set; } +#endif + /// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionsPostRequestBody_stop? Stop { get; set; } +#nullable restore +#else + public CompletionsPostRequestBody_stop Stop { get; set; } +#endif + /// Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. + public bool? Stream { get; set; } + /// The suffix that comes after a completion of inserted text. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Suffix { get; set; } +#nullable restore +#else + public string Suffix { get; set; } +#endif + /// What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.We generally recommend altering this or top_p but not both. + public double? Temperature { get; set; } + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or temperature but not both. + public double? TopP { get; set; } + /// A unique identifier representing your end-user, which can help monitoring and detecting abuse +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new completionsPostRequestBody and sets the default values. + /// + public CompletionsPostRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"best_of", n => { BestOf = n.GetIntValue(); } }, + {"completion_config", n => { CompletionConfig = n.GetStringValue(); } }, + {"echo", n => { Echo = n.GetBoolValue(); } }, + {"frequency_penalty", n => { FrequencyPenalty = n.GetDoubleValue(); } }, + {"logit_bias", n => { LogitBias = n.GetObjectValue(CompletionsPostRequestBody_logit_bias.CreateFromDiscriminatorValue); } }, + {"logprobs", n => { Logprobs = n.GetIntValue(); } }, + {"max_tokens", n => { MaxTokens = n.GetIntValue(); } }, + {"n", n => { N = n.GetIntValue(); } }, + {"presence_penalty", n => { PresencePenalty = n.GetDoubleValue(); } }, + {"prompt", n => { Prompt = n.GetObjectValue(CompletionsPostRequestBody_prompt.CreateFromDiscriminatorValue); } }, + {"stop", n => { Stop = n.GetObjectValue(CompletionsPostRequestBody_stop.CreateFromDiscriminatorValue); } }, + {"stream", n => { Stream = n.GetBoolValue(); } }, + {"suffix", n => { Suffix = n.GetStringValue(); } }, + {"temperature", n => { Temperature = n.GetDoubleValue(); } }, + {"top_p", n => { TopP = n.GetDoubleValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("best_of", BestOf); + writer.WriteStringValue("completion_config", CompletionConfig); + writer.WriteBoolValue("echo", Echo); + writer.WriteDoubleValue("frequency_penalty", FrequencyPenalty); + writer.WriteObjectValue("logit_bias", LogitBias); + writer.WriteIntValue("logprobs", Logprobs); + writer.WriteIntValue("max_tokens", MaxTokens); + writer.WriteIntValue("n", N); + writer.WriteDoubleValue("presence_penalty", PresencePenalty); + writer.WriteObjectValue("prompt", Prompt); + writer.WriteObjectValue("stop", Stop); + writer.WriteBoolValue("stream", Stream); + writer.WriteStringValue("suffix", Suffix); + writer.WriteDoubleValue("temperature", Temperature); + writer.WriteDoubleValue("top_p", TopP); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CompletionsPostRequestBody_prompt : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostRequestBody_prompt CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CompletionsPostRequestBody_prompt(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CompletionsPostRequestBody_stop : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostRequestBody_stop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CompletionsPostRequestBody_stop(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody_logit_bias.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody_logit_bias.cs new file mode 100644 index 0000000..8653ad0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostRequestBody_logit_bias.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + /// + /// Defaults to null. Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256" &#58; -100} to prevent the <|endoftext|> token from being generated. + /// + internal class CompletionsPostRequestBody_logit_bias : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new completionsPostRequestBody_logit_bias and sets the default values. + /// + public CompletionsPostRequestBody_logit_bias() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostRequestBody_logit_bias CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostRequestBody_logit_bias(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse.cs new file mode 100644 index 0000000..1ed1185 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse.cs @@ -0,0 +1,107 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The choices property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Choices { get; set; } +#nullable restore +#else + public List Choices { get; set; } +#endif + /// The created property + public int? Created { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The model property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PromptFilterResults { get; set; } +#nullable restore +#else + public List PromptFilterResults { get; set; } +#endif + /// The usage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionsPostResponse_usage? Usage { get; set; } +#nullable restore +#else + public CompletionsPostResponse_usage Usage { get; set; } +#endif + /// + /// Instantiates a new completionsPostResponse and sets the default values. + /// + public CompletionsPostResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"choices", n => { Choices = n.GetCollectionOfObjectValues(CompletionsPostResponse_choices.CreateFromDiscriminatorValue)?.ToList(); } }, + {"created", n => { Created = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + {"prompt_filter_results", n => { PromptFilterResults = n.GetCollectionOfObjectValues(PromptFilterResult.CreateFromDiscriminatorValue)?.ToList(); } }, + {"usage", n => { Usage = n.GetObjectValue(CompletionsPostResponse_usage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("choices", Choices); + writer.WriteIntValue("created", Created); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteStringValue("object", Object); + writer.WriteCollectionOfObjectValues("prompt_filter_results", PromptFilterResults); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices.cs new file mode 100644 index 0000000..4b96d4a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostResponse_choices : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about third party text and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterChoiceResults? ContentFilterResults { get; set; } +#nullable restore +#else + public ContentFilterChoiceResults ContentFilterResults { get; set; } +#endif + /// The finish_reason property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FinishReason { get; set; } +#nullable restore +#else + public string FinishReason { get; set; } +#endif + /// The index property + public int? Index { get; set; } + /// The logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionsPostResponse_choices_logprobs? Logprobs { get; set; } +#nullable restore +#else + public CompletionsPostResponse_choices_logprobs Logprobs { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new completionsPostResponse_choices and sets the default values. + /// + public CompletionsPostResponse_choices() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostResponse_choices CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostResponse_choices(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content_filter_results", n => { ContentFilterResults = n.GetObjectValue(ContentFilterChoiceResults.CreateFromDiscriminatorValue); } }, + {"finish_reason", n => { FinishReason = n.GetStringValue(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"logprobs", n => { Logprobs = n.GetObjectValue(CompletionsPostResponse_choices_logprobs.CreateFromDiscriminatorValue); } }, + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("content_filter_results", ContentFilterResults); + writer.WriteStringValue("finish_reason", FinishReason); + writer.WriteIntValue("index", Index); + writer.WriteObjectValue("logprobs", Logprobs); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs.cs new file mode 100644 index 0000000..44fd3ae --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostResponse_choices_logprobs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text_offset property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TextOffset { get; set; } +#nullable restore +#else + public List TextOffset { get; set; } +#endif + /// The token_logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TokenLogprobs { get; set; } +#nullable restore +#else + public List TokenLogprobs { get; set; } +#endif + /// The tokens property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tokens { get; set; } +#nullable restore +#else + public List Tokens { get; set; } +#endif + /// The top_logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TopLogprobs { get; set; } +#nullable restore +#else + public List TopLogprobs { get; set; } +#endif + /// + /// Instantiates a new completionsPostResponse_choices_logprobs and sets the default values. + /// + public CompletionsPostResponse_choices_logprobs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostResponse_choices_logprobs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostResponse_choices_logprobs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text_offset", n => { TextOffset = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"token_logprobs", n => { TokenLogprobs = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"tokens", n => { Tokens = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"top_logprobs", n => { TopLogprobs = n.GetCollectionOfObjectValues(CompletionsPostResponse_choices_logprobs_top_logprobs.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("text_offset", TextOffset); + writer.WriteCollectionOfPrimitiveValues("token_logprobs", TokenLogprobs); + writer.WriteCollectionOfPrimitiveValues("tokens", Tokens); + writer.WriteCollectionOfObjectValues("top_logprobs", TopLogprobs); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs_top_logprobs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs_top_logprobs.cs new file mode 100644 index 0000000..2c2b5b6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_choices_logprobs_top_logprobs.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostResponse_choices_logprobs_top_logprobs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new completionsPostResponse_choices_logprobs_top_logprobs and sets the default values. + /// + public CompletionsPostResponse_choices_logprobs_top_logprobs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostResponse_choices_logprobs_top_logprobs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostResponse_choices_logprobs_top_logprobs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_usage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_usage.cs new file mode 100644 index 0000000..c6345ae --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsPostResponse_usage.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + internal class CompletionsPostResponse_usage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The completion_tokens property + public int? CompletionTokens { get; set; } + /// The prompt_tokens property + public int? PromptTokens { get; set; } + /// The total_tokens property + public int? TotalTokens { get; set; } + /// + /// Instantiates a new completionsPostResponse_usage and sets the default values. + /// + public CompletionsPostResponse_usage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionsPostResponse_usage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsPostResponse_usage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"completion_tokens", n => { CompletionTokens = n.GetIntValue(); } }, + {"prompt_tokens", n => { PromptTokens = n.GetIntValue(); } }, + {"total_tokens", n => { TotalTokens = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("completion_tokens", CompletionTokens); + writer.WriteIntValue("prompt_tokens", PromptTokens); + writer.WriteIntValue("total_tokens", TotalTokens); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsRequestBuilder.cs new file mode 100644 index 0000000..3b9add7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsRequestBuilder.cs @@ -0,0 +1,143 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\completions + /// + internal class CompletionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/completions{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/completions{?api%2Dversion*}", rawUrl) { + } + /// + /// Creates a completion for the provided prompt, parameters and chosen model. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsCompletionsPostResponseAsync(CompletionsPostRequestBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsCompletionsPostResponseAsync(CompletionsPostRequestBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"4XX", ErrorResponse.CreateFromDiscriminatorValue}, + {"5XX", ErrorResponse.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, CompletionsPostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a completion for the provided prompt, parameters and chosen model. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("This method is obsolete. Use PostAsCompletionsPostResponse instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CompletionsPostRequestBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CompletionsPostRequestBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"4XX", ErrorResponse.CreateFromDiscriminatorValue}, + {"5XX", ErrorResponse.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, CompletionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a completion for the provided prompt, parameters and chosen model. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CompletionsPostRequestBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CompletionsPostRequestBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CompletionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompletionsRequestBuilder WithUrl(string rawUrl) { + return new CompletionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates a completion for the provided prompt, parameters and chosen model. + /// + internal class CompletionsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CompletionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public CompletionsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new CompletionsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new completionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CompletionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsResponse.cs new file mode 100644 index 0000000..b73d043 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Completions/CompletionsResponse.cs @@ -0,0 +1,20 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions { + [Obsolete("This class is obsolete. Use completionsPostResponse instead.")] + internal class CompletionsResponse : CompletionsPostResponse, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new CompletionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionsResponse(); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/DeploymentItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/DeploymentItemRequestBuilder.cs new file mode 100644 index 0000000..5458bee --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/DeploymentItemRequestBuilder.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Audio; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Chat; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Completions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Images; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id} + /// + internal class DeploymentItemRequestBuilder : BaseRequestBuilder { + /// The audio property + public AudioRequestBuilder Audio { get => + new AudioRequestBuilder(PathParameters, RequestAdapter); + } + /// The chat property + public ChatRequestBuilder Chat { get => + new ChatRequestBuilder(PathParameters, RequestAdapter); + } + /// The completions property + public CompletionsRequestBuilder Completions { get => + new CompletionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The embeddings property + public EmbeddingsRequestBuilder Embeddings { get => + new EmbeddingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The extensions property + public ExtensionsRequestBuilder Extensions { get => + new ExtensionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new DeploymentItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DeploymentItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}", pathParameters) { + } + /// + /// Instantiates a new DeploymentItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DeploymentItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostRequestBody.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostRequestBody.cs new file mode 100644 index 0000000..7d09b35 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostRequestBody.cs @@ -0,0 +1,114 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + internal class EmbeddingsPostRequestBody : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Input text to get embeddings for, encoded as a string. To get embeddings for multiple inputs in a single request, pass an array of strings. Each input must not exceed 2048 tokens in length.Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public EmbeddingsPostRequestBody_input? Input { get; set; } +#nullable restore +#else + public EmbeddingsPostRequestBody_input Input { get; set; } +#endif + /// input type of embedding search to use +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InputType { get; set; } +#nullable restore +#else + public string InputType { get; set; } +#endif + /// A unique identifier representing your end-user, which can help monitoring and detecting abuse. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new embeddingsPostRequestBody and sets the default values. + /// + public EmbeddingsPostRequestBody() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EmbeddingsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmbeddingsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"input", n => { Input = n.GetObjectValue(EmbeddingsPostRequestBody_input.CreateFromDiscriminatorValue); } }, + {"input_type", n => { InputType = n.GetStringValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("input", Input); + writer.WriteStringValue("input_type", InputType); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class EmbeddingsPostRequestBody_input : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EmbeddingsPostRequestBody_input CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new EmbeddingsPostRequestBody_input(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse.cs new file mode 100644 index 0000000..332ee3c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + internal class EmbeddingsPostResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The model property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// The usage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public EmbeddingsPostResponse_usage? Usage { get; set; } +#nullable restore +#else + public EmbeddingsPostResponse_usage Usage { get; set; } +#endif + /// + /// Instantiates a new embeddingsPostResponse and sets the default values. + /// + public EmbeddingsPostResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EmbeddingsPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmbeddingsPostResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(EmbeddingsPostResponse_data.CreateFromDiscriminatorValue)?.ToList(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(EmbeddingsPostResponse_usage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("model", Model); + writer.WriteStringValue("object", Object); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_data.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_data.cs new file mode 100644 index 0000000..0f6c8c6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_data.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + internal class EmbeddingsPostResponse_data : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The embedding property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Embedding { get; set; } +#nullable restore +#else + public List Embedding { get; set; } +#endif + /// The index property + public int? Index { get; set; } + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new embeddingsPostResponse_data and sets the default values. + /// + public EmbeddingsPostResponse_data() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EmbeddingsPostResponse_data CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmbeddingsPostResponse_data(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"embedding", n => { Embedding = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("embedding", Embedding); + writer.WriteIntValue("index", Index); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_usage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_usage.cs new file mode 100644 index 0000000..5283cc5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsPostResponse_usage.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + internal class EmbeddingsPostResponse_usage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The prompt_tokens property + public int? PromptTokens { get; set; } + /// The total_tokens property + public int? TotalTokens { get; set; } + /// + /// Instantiates a new embeddingsPostResponse_usage and sets the default values. + /// + public EmbeddingsPostResponse_usage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EmbeddingsPostResponse_usage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmbeddingsPostResponse_usage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"prompt_tokens", n => { PromptTokens = n.GetIntValue(); } }, + {"total_tokens", n => { TotalTokens = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("prompt_tokens", PromptTokens); + writer.WriteIntValue("total_tokens", TotalTokens); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsRequestBuilder.cs new file mode 100644 index 0000000..b2d8ce2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsRequestBuilder.cs @@ -0,0 +1,134 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\embeddings + /// + internal class EmbeddingsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EmbeddingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EmbeddingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/embeddings{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new EmbeddingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EmbeddingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/embeddings{?api%2Dversion*}", rawUrl) { + } + /// + /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsEmbeddingsPostResponseAsync(EmbeddingsPostRequestBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsEmbeddingsPostResponseAsync(EmbeddingsPostRequestBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, EmbeddingsPostResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("This method is obsolete. Use PostAsEmbeddingsPostResponse instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(EmbeddingsPostRequestBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(EmbeddingsPostRequestBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, EmbeddingsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(EmbeddingsPostRequestBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(EmbeddingsPostRequestBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EmbeddingsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EmbeddingsRequestBuilder WithUrl(string rawUrl) { + return new EmbeddingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + /// + internal class EmbeddingsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EmbeddingsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public EmbeddingsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new EmbeddingsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new embeddingsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public EmbeddingsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsResponse.cs new file mode 100644 index 0000000..e9cf801 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Embeddings/EmbeddingsResponse.cs @@ -0,0 +1,20 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Embeddings { + [Obsolete("This class is obsolete. Use embeddingsPostResponse instead.")] + internal class EmbeddingsResponse : EmbeddingsPostResponse, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new EmbeddingsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EmbeddingsResponse(); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/ChatRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/ChatRequestBuilder.cs new file mode 100644 index 0000000..9c55ada --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/ChatRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions.Chat.Completions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions.Chat { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\extensions\chat + /// + internal class ChatRequestBuilder : BaseRequestBuilder { + /// The completions property + public CompletionsRequestBuilder Completions { get => + new CompletionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions/chat", pathParameters) { + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions/chat", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/Completions/CompletionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/Completions/CompletionsRequestBuilder.cs new file mode 100644 index 0000000..e206d8a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/Chat/Completions/CompletionsRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions.Chat.Completions { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\extensions\chat\completions + /// + internal class CompletionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions/chat/completions{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions/chat/completions{?api%2Dversion*}", rawUrl) { + } + /// + /// Using extensions to creates a completion for the chat messages. + /// + /// Request for the chat completions using extensions + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ExtensionsChatCompletionsRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ExtensionsChatCompletionsRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"4XX", ErrorResponse.CreateFromDiscriminatorValue}, + {"5XX", ErrorResponse.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, ExtensionsChatCompletionsResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Using extensions to creates a completion for the chat messages. + /// + /// Request for the chat completions using extensions + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ExtensionsChatCompletionsRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ExtensionsChatCompletionsRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CompletionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompletionsRequestBuilder WithUrl(string rawUrl) { + return new CompletionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Using extensions to creates a completion for the chat messages. + /// + internal class CompletionsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CompletionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public CompletionsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new CompletionsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new completionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CompletionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/ExtensionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/ExtensionsRequestBuilder.cs new file mode 100644 index 0000000..e0325df --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Extensions/ExtensionsRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions.Chat; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Extensions { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\extensions + /// + internal class ExtensionsRequestBuilder : BaseRequestBuilder { + /// The chat property + public ChatRequestBuilder Chat { get => + new ChatRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ExtensionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ExtensionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions", pathParameters) { + } + /// + /// Instantiates a new ExtensionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ExtensionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/extensions", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/Generations/GenerationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/Generations/GenerationsRequestBuilder.cs new file mode 100644 index 0000000..3d34392 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/Generations/GenerationsRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Images.Generations { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\images\generations + /// + internal class GenerationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new GenerationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GenerationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/images/generations{?api%2Dversion*}", pathParameters) { + } + /// + /// Instantiates a new GenerationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GenerationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/images/generations{?api%2Dversion*}", rawUrl) { + } + /// + /// Generates a batch of images from a text caption on a given DALLE model deployment + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ImageGenerationsRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ImageGenerationsRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"4XX", ErrorResponse.CreateFromDiscriminatorValue}, + {"5XX", ErrorResponse.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, GenerateImagesResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Generates a batch of images from a text caption on a given DALLE model deployment + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImageGenerationsRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImageGenerationsRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new GenerationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GenerationsRequestBuilder WithUrl(string rawUrl) { + return new GenerationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Generates a batch of images from a text caption on a given DALLE model deployment + /// + internal class GenerationsRequestBuilderPostQueryParameters { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("api%2Dversion")] + public string? ApiVersion { get; set; } +#nullable restore +#else + [QueryParameter("api%2Dversion")] + public string ApiVersion { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class GenerationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public GenerationsRequestBuilderPostQueryParameters QueryParameters { get; set; } = new GenerationsRequestBuilderPostQueryParameters(); + /// + /// Instantiates a new generationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public GenerationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/ImagesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..a1cc4c5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Deployments/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Images.Generations; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Deployments.Item.Images { + /// + /// Builds and executes requests for operations under \deployments\{deployment-id}\images + /// + internal class ImagesRequestBuilder : BaseRequestBuilder { + /// The generations property + public GenerationsRequestBuilder Generations { get => + new GenerationsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/deployments/{deployment%2Did}/images", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/GeneratedAzureOpenAiClient.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/GeneratedAzureOpenAiClient.cs new file mode 100644 index 0000000..4898b08 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/GeneratedAzureOpenAiClient.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Serialization.Json; +using OpenAI.Azure.GeneratedKiotaClient.Deployments; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient { + /// + /// The main entry point of the SDK, exposes the configuration and the fluent API. + /// + internal class GeneratedAzureOpenAiClient : BaseRequestBuilder { + /// The deployments property + public DeploymentsRequestBuilder Deployments { get => + new DeploymentsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new GeneratedAzureOpenAiClient and sets the default values. + /// + /// The request adapter to use to execute the requests. + public GeneratedAzureOpenAiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary()) { + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) { + RequestAdapter.BaseUrl = "https://{endpoint}/openai"; + } + PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioResponse.cs new file mode 100644 index 0000000..3d44379 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioResponse.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Translation or transcription response when response_format was json + /// + internal class AudioResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Translated or transcribed text. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new audioResponse and sets the default values. + /// + public AudioResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AudioResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AudioResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioVerboseResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioVerboseResponse.cs new file mode 100644 index 0000000..0cbd857 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/AudioVerboseResponse.cs @@ -0,0 +1,37 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Translation or transcription response when response_format was verbose_json + /// + internal class AudioVerboseResponse : AudioResponse, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new AudioVerboseResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AudioVerboseResponse(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionResponseObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionResponseObject.cs new file mode 100644 index 0000000..f69a32f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionResponseObject.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// The object type. + internal enum ChatCompletionResponseObject { + /// The object type is chat completion. + [EnumMember(Value = "chat.completion")] + ChatCompletion, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon.cs new file mode 100644 index 0000000..797613a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon.cs @@ -0,0 +1,138 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ChatCompletionsRequestCommon : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + public double? FrequencyPenalty { get; set; } + /// Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionsRequestCommon_logit_bias? LogitBias { get; set; } +#nullable restore +#else + public ChatCompletionsRequestCommon_logit_bias LogitBias { get; set; } +#endif + /// The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). + public int? MaxTokens { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + public double? PresencePenalty { get; set; } + /// Up to 4 sequences where the API will stop generating further tokens. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionsRequestCommon_stop? Stop { get; set; } +#nullable restore +#else + public ChatCompletionsRequestCommon_stop Stop { get; set; } +#endif + /// If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a `data: [DONE]` message. + public bool? Stream { get; set; } + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.We generally recommend altering this or `top_p` but not both. + public double? Temperature { get; set; } + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or `temperature` but not both. + public double? TopP { get; set; } + /// A unique identifier representing your end-user, which can help Azure OpenAI to monitor and detect abuse. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new chatCompletionsRequestCommon and sets the default values. + /// + public ChatCompletionsRequestCommon() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionsRequestCommon CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionsRequestCommon(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"frequency_penalty", n => { FrequencyPenalty = n.GetDoubleValue(); } }, + {"logit_bias", n => { LogitBias = n.GetObjectValue(ChatCompletionsRequestCommon_logit_bias.CreateFromDiscriminatorValue); } }, + {"max_tokens", n => { MaxTokens = n.GetIntValue(); } }, + {"presence_penalty", n => { PresencePenalty = n.GetDoubleValue(); } }, + {"stop", n => { Stop = n.GetObjectValue(ChatCompletionsRequestCommon_stop.CreateFromDiscriminatorValue); } }, + {"stream", n => { Stream = n.GetBoolValue(); } }, + {"temperature", n => { Temperature = n.GetDoubleValue(); } }, + {"top_p", n => { TopP = n.GetDoubleValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDoubleValue("frequency_penalty", FrequencyPenalty); + writer.WriteObjectValue("logit_bias", LogitBias); + writer.WriteIntValue("max_tokens", MaxTokens); + writer.WriteDoubleValue("presence_penalty", PresencePenalty); + writer.WriteObjectValue("stop", Stop); + writer.WriteBoolValue("stream", Stream); + writer.WriteDoubleValue("temperature", Temperature); + writer.WriteDoubleValue("top_p", TopP); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class ChatCompletionsRequestCommon_stop : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionsRequestCommon_stop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new ChatCompletionsRequestCommon_stop(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon_logit_bias.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon_logit_bias.cs new file mode 100644 index 0000000..f9b6fe1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsRequestCommon_logit_bias.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + /// + internal class ChatCompletionsRequestCommon_logit_bias : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new chatCompletionsRequestCommon_logit_bias and sets the default values. + /// + public ChatCompletionsRequestCommon_logit_bias() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionsRequestCommon_logit_bias CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionsRequestCommon_logit_bias(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsResponseCommon.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsResponseCommon.cs new file mode 100644 index 0000000..894fc7f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ChatCompletionsResponseCommon.cs @@ -0,0 +1,90 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ChatCompletionsResponseCommon : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) of when the chat completion was created. + public int? Created { get; set; } + /// A unique identifier for the chat completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The model used for the chat completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type. + public ChatCompletionResponseObject? Object { get; set; } + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SystemFingerprint { get; set; } +#nullable restore +#else + public string SystemFingerprint { get; set; } +#endif + /// Usage statistics for the completion request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionUsage? Usage { get; set; } +#nullable restore +#else + public CompletionUsage Usage { get; set; } +#endif + /// + /// Instantiates a new chatCompletionsResponseCommon and sets the default values. + /// + public ChatCompletionsResponseCommon() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionsResponseCommon CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionsResponseCommon(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created", n => { Created = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"system_fingerprint", n => { SystemFingerprint = n.GetStringValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(CompletionUsage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created", Created); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("system_fingerprint", SystemFingerprint); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CompletionUsage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CompletionUsage.cs new file mode 100644 index 0000000..4faec91 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CompletionUsage.cs @@ -0,0 +1,57 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Usage statistics for the completion request. + /// + internal class CompletionUsage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number of tokens in the generated completion. + public int? CompletionTokens { get; set; } + /// Number of tokens in the prompt. + public int? PromptTokens { get; set; } + /// Total number of tokens used in the request (prompt + completion). + public int? TotalTokens { get; set; } + /// + /// Instantiates a new completionUsage and sets the default values. + /// + public CompletionUsage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionUsage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionUsage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"completion_tokens", n => { CompletionTokens = n.GetIntValue(); } }, + {"prompt_tokens", n => { PromptTokens = n.GetIntValue(); } }, + {"total_tokens", n => { TotalTokens = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("completion_tokens", CompletionTokens); + writer.WriteIntValue("prompt_tokens", PromptTokens); + writer.WriteIntValue("total_tokens", TotalTokens); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterChoiceResults.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterChoiceResults.cs new file mode 100644 index 0000000..f022515 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterChoiceResults.cs @@ -0,0 +1,37 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about third party text and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. + /// + internal class ContentFilterChoiceResults : ContentFilterResultsBase, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterChoiceResults CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterChoiceResults(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedResult.cs new file mode 100644 index 0000000..c0dee2e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedResult.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ContentFilterDetectedResult : ContentFilterResultBase, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterDetectedResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterDetectedResult(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedWithCitationResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedWithCitationResult.cs new file mode 100644 index 0000000..b1a6db1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterDetectedWithCitationResult.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ContentFilterDetectedWithCitationResult : ContentFilterDetectedResult, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterDetectedWithCitationResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterDetectedWithCitationResult(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterIdResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterIdResult.cs new file mode 100644 index 0000000..51cf3bf --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterIdResult.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ContentFilterIdResult : ContentFilterResultBase, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterIdResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterIdResult(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterPromptResults.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterPromptResults.cs new file mode 100644 index 0000000..965af28 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterPromptResults.cs @@ -0,0 +1,47 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. + /// + internal class ContentFilterPromptResults : ContentFilterResultsBase, IParsable { + /// The jailbreak property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterDetectedResult? Jailbreak { get; set; } +#nullable restore +#else + public ContentFilterDetectedResult Jailbreak { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterPromptResults CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterPromptResults(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"jailbreak", n => { Jailbreak = n.GetObjectValue(ContentFilterDetectedResult.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("jailbreak", Jailbreak); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultBase.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultBase.cs new file mode 100644 index 0000000..9d7449d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultBase.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ContentFilterResultBase : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The filtered property + public bool? Filtered { get; set; } + /// + /// Instantiates a new contentFilterResultBase and sets the default values. + /// + public ContentFilterResultBase() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ContentFilterResultBase CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterResultBase(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"filtered", n => { Filtered = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("filtered", Filtered); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultsBase.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultsBase.cs new file mode 100644 index 0000000..e0de0b3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterResultsBase.cs @@ -0,0 +1,115 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Information about the content filtering results. + /// + internal class ContentFilterResultsBase : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The custom_blocklists property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CustomBlocklists { get; set; } +#nullable restore +#else + public List CustomBlocklists { get; set; } +#endif + /// The error property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ErrorBase? Error { get; set; } +#nullable restore +#else + public ErrorBase Error { get; set; } +#endif + /// The hate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterSeverityResult? Hate { get; set; } +#nullable restore +#else + public ContentFilterSeverityResult Hate { get; set; } +#endif + /// The profanity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterDetectedResult? Profanity { get; set; } +#nullable restore +#else + public ContentFilterDetectedResult Profanity { get; set; } +#endif + /// The self_harm property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterSeverityResult? SelfHarm { get; set; } +#nullable restore +#else + public ContentFilterSeverityResult SelfHarm { get; set; } +#endif + /// The sexual property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterSeverityResult? Sexual { get; set; } +#nullable restore +#else + public ContentFilterSeverityResult Sexual { get; set; } +#endif + /// The violence property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterSeverityResult? Violence { get; set; } +#nullable restore +#else + public ContentFilterSeverityResult Violence { get; set; } +#endif + /// + /// Instantiates a new contentFilterResultsBase and sets the default values. + /// + public ContentFilterResultsBase() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ContentFilterResultsBase CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterResultsBase(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"custom_blocklists", n => { CustomBlocklists = n.GetCollectionOfObjectValues(ContentFilterIdResult.CreateFromDiscriminatorValue)?.ToList(); } }, + {"error", n => { Error = n.GetObjectValue(ErrorBase.CreateFromDiscriminatorValue); } }, + {"hate", n => { Hate = n.GetObjectValue(ContentFilterSeverityResult.CreateFromDiscriminatorValue); } }, + {"profanity", n => { Profanity = n.GetObjectValue(ContentFilterDetectedResult.CreateFromDiscriminatorValue); } }, + {"self_harm", n => { SelfHarm = n.GetObjectValue(ContentFilterSeverityResult.CreateFromDiscriminatorValue); } }, + {"sexual", n => { Sexual = n.GetObjectValue(ContentFilterSeverityResult.CreateFromDiscriminatorValue); } }, + {"violence", n => { Violence = n.GetObjectValue(ContentFilterSeverityResult.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("custom_blocklists", CustomBlocklists); + writer.WriteObjectValue("error", Error); + writer.WriteObjectValue("hate", Hate); + writer.WriteObjectValue("profanity", Profanity); + writer.WriteObjectValue("self_harm", SelfHarm); + writer.WriteObjectValue("sexual", Sexual); + writer.WriteObjectValue("violence", Violence); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterSeverityResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterSeverityResult.cs new file mode 100644 index 0000000..e1c5a5b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ContentFilterSeverityResult.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ContentFilterSeverityResult : ContentFilterResultBase, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ContentFilterSeverityResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContentFilterSeverityResult(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionRequest.cs new file mode 100644 index 0000000..50c49fd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionRequest.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class CreateChatCompletionRequest : ChatCompletionsRequestCommon, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new CreateChatCompletionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionRequest(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionResponse.cs new file mode 100644 index 0000000..50c3305 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/CreateChatCompletionResponse.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class CreateChatCompletionResponse : ChatCompletionsResponseCommon, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new CreateChatCompletionResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionResponse(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/Error.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/Error.cs new file mode 100644 index 0000000..7937f4e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/Error.cs @@ -0,0 +1,64 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class Error : ErrorBase, IParsable { + /// Inner error with additional details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.InnerError? InnerError { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.InnerError InnerError { get; set; } +#endif + /// The param property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Param { get; set; } +#nullable restore +#else + public string Param { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new Error CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Error(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + {"inner_error", n => { InnerError = n.GetObjectValue(OpenAI.Azure.GeneratedKiotaClient.Models.InnerError.CreateFromDiscriminatorValue); } }, + {"param", n => { Param = n.GetStringValue(); } }, + {"type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("inner_error", InnerError); + writer.WriteStringValue("param", Param); + writer.WriteStringValue("type", Type); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorBase.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorBase.cs new file mode 100644 index 0000000..bb07567 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorBase.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ErrorBase : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new errorBase and sets the default values. + /// + public ErrorBase() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ErrorBase CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ErrorBase(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code", n => { Code = n.GetStringValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorResponse.cs new file mode 100644 index 0000000..cae05d5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ErrorResponse.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ErrorResponse : ApiException, IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The error property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.Error? Error { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.Error Error { get; set; } +#endif + /// The primary error message. + public override string Message { get => base.Message; } + /// + /// Instantiates a new errorResponse and sets the default values. + /// + public ErrorResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ErrorResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ErrorResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"error", n => { Error = n.GetObjectValue(OpenAI.Azure.GeneratedKiotaClient.Models.Error.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("error", Error); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsRequest.cs new file mode 100644 index 0000000..3c72bf4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsRequest.cs @@ -0,0 +1,37 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Request for the chat completions using extensions + /// + internal class ExtensionsChatCompletionsRequest : ChatCompletionsRequestCommon, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ExtensionsChatCompletionsRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExtensionsChatCompletionsRequest(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsResponse.cs new file mode 100644 index 0000000..6b2e1db --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ExtensionsChatCompletionsResponse.cs @@ -0,0 +1,37 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// The response of the extensions chat completions. + /// + internal class ExtensionsChatCompletionsResponse : ChatCompletionsResponseCommon, IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static new ExtensionsChatCompletionsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExtensionsChatCompletionsResponse(); + } + /// + /// The deserialization information for the current model + /// + public override IDictionary> GetFieldDeserializers() { + return new Dictionary>(base.GetFieldDeserializers()) { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/GenerateImagesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/GenerateImagesResponse.cs new file mode 100644 index 0000000..a95e294 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/GenerateImagesResponse.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class GenerateImagesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The unix timestamp when the operation was created. + public int? Created { get; set; } + /// The result data of the operation, if successful +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The error property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.Azure.GeneratedKiotaClient.Models.Error? Error { get; set; } +#nullable restore +#else + public OpenAI.Azure.GeneratedKiotaClient.Models.Error Error { get; set; } +#endif + /// + /// Instantiates a new generateImagesResponse and sets the default values. + /// + public GenerateImagesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GenerateImagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GenerateImagesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created", n => { Created = n.GetIntValue(); } }, + {"data", n => { Data = n.GetCollectionOfObjectValues(ImageResult.CreateFromDiscriminatorValue)?.ToList(); } }, + {"error", n => { Error = n.GetObjectValue(OpenAI.Azure.GeneratedKiotaClient.Models.Error.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created", Created); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("error", Error); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageGenerationsRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageGenerationsRequest.cs new file mode 100644 index 0000000..5003484 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageGenerationsRequest.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + internal class ImageGenerationsRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of images to generate. + public int? N { get; set; } + /// A text description of the desired image(s). The maximum length is 4000 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prompt { get; set; } +#nullable restore +#else + public string Prompt { get; set; } +#endif + /// The quality of the image that will be generated. + public ImageQuality? Quality { get; set; } + /// The format in which the generated images are returned. + public ImagesResponseFormat? ResponseFormat { get; set; } + /// The size of the generated images. + public ImageSize? Size { get; set; } + /// The style of the generated images. + public ImageStyle? Style { get; set; } + /// A unique identifier representing your end-user, which can help to monitor and detect abuse. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new imageGenerationsRequest and sets the default values. + /// + public ImageGenerationsRequest() { + AdditionalData = new Dictionary(); + Quality = ImageQuality.Standard; + ResponseFormat = ImagesResponseFormat.Url; + Size = ImageSize.Size1024x1024; + Style = ImageStyle.Vivid; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageGenerationsRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageGenerationsRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"n", n => { N = n.GetIntValue(); } }, + {"prompt", n => { Prompt = n.GetStringValue(); } }, + {"quality", n => { Quality = n.GetEnumValue(); } }, + {"response_format", n => { ResponseFormat = n.GetEnumValue(); } }, + {"size", n => { Size = n.GetEnumValue(); } }, + {"style", n => { Style = n.GetEnumValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("n", N); + writer.WriteStringValue("prompt", Prompt); + writer.WriteEnumValue("quality", Quality); + writer.WriteEnumValue("response_format", ResponseFormat); + writer.WriteEnumValue("size", Size); + writer.WriteEnumValue("style", Style); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageQuality.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageQuality.cs new file mode 100644 index 0000000..e51d194 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageQuality.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// The quality of the image that will be generated. + internal enum ImageQuality { + /// Standard quality creates images with standard quality. + [EnumMember(Value = "standard")] + Standard, + /// HD quality creates images with finer details and greater consistency across the image. + [EnumMember(Value = "hd")] + HD, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageResult.cs new file mode 100644 index 0000000..bad3835 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageResult.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// The image url or encoded image if successful, and an error otherwise. + /// + internal class ImageResult : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The base64 encoded image +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? B64Json { get; set; } +#nullable restore +#else + public string B64Json { get; set; } +#endif + /// The prompt that was used to generate the image, if there was any revision to the prompt. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RevisedPrompt { get; set; } +#nullable restore +#else + public string RevisedPrompt { get; set; } +#endif + /// The image url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new imageResult and sets the default values. + /// + public ImageResult() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"b64_json", n => { B64Json = n.GetStringValue(); } }, + {"revised_prompt", n => { RevisedPrompt = n.GetStringValue(); } }, + {"url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("b64_json", B64Json); + writer.WriteStringValue("revised_prompt", RevisedPrompt); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageSize.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageSize.cs new file mode 100644 index 0000000..e8ce4a2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageSize.cs @@ -0,0 +1,18 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// The size of the generated images. + internal enum ImageSize { + /// The desired size of the generated image is 1792x1024 pixels. + [EnumMember(Value = "1792x1024")] + Size1792x1024, + /// The desired size of the generated image is 1024x1792 pixels. + [EnumMember(Value = "1024x1792")] + Size1024x1792, + /// The desired size of the generated image is 1024x1024 pixels. + [EnumMember(Value = "1024x1024")] + Size1024x1024, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageStyle.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageStyle.cs new file mode 100644 index 0000000..96552f4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImageStyle.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// The style of the generated images. + internal enum ImageStyle { + /// Vivid creates images that are hyper-realistic and dramatic. + [EnumMember(Value = "vivid")] + Vivid, + /// Natural creates images that are more natural and less hyper-realistic. + [EnumMember(Value = "natural")] + Natural, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImagesResponseFormat.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImagesResponseFormat.cs new file mode 100644 index 0000000..80e0a98 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/ImagesResponseFormat.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// The format in which the generated images are returned. + internal enum ImagesResponseFormat { + /// The URL that provides temporary access to download the generated images. + [EnumMember(Value = "url")] + Url, + /// The generated images are returned as base64 encoded string. + [EnumMember(Value = "b64_json")] + Base64Json, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerError.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerError.cs new file mode 100644 index 0000000..908e232 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerError.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Inner error with additional details. + /// + internal class InnerError : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Error codes for the inner error object. + public InnerErrorCode? Code { get; set; } + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterPromptResults? ContentFilterResults { get; set; } +#nullable restore +#else + public ContentFilterPromptResults ContentFilterResults { get; set; } +#endif + /// + /// Instantiates a new innerError and sets the default values. + /// + public InnerError() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static InnerError CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InnerError(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code", n => { Code = n.GetEnumValue(); } }, + {"content_filter_results", n => { ContentFilterResults = n.GetObjectValue(ContentFilterPromptResults.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("code", Code); + writer.WriteObjectValue("content_filter_results", ContentFilterResults); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerErrorCode.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerErrorCode.cs new file mode 100644 index 0000000..53461da --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/InnerErrorCode.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// Error codes for the inner error object. + internal enum InnerErrorCode { + /// The prompt violated one of more content filter rules. + [EnumMember(Value = "ResponsibleAIPolicyViolation")] + ResponsibleAIPolicyViolation, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/PromptFilterResult.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/PromptFilterResult.cs new file mode 100644 index 0000000..0b35db8 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/Models/PromptFilterResult.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.Azure.GeneratedKiotaClient.Models { + /// + /// Content filtering results for a single prompt in the request. + /// + internal class PromptFilterResult : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ContentFilterPromptResults? ContentFilterResults { get; set; } +#nullable restore +#else + public ContentFilterPromptResults ContentFilterResults { get; set; } +#endif + /// The prompt_index property + public int? PromptIndex { get; set; } + /// + /// Instantiates a new promptFilterResult and sets the default values. + /// + public PromptFilterResult() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PromptFilterResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PromptFilterResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content_filter_results", n => { ContentFilterResults = n.GetObjectValue(ContentFilterPromptResults.CreateFromDiscriminatorValue); } }, + {"prompt_index", n => { PromptIndex = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("content_filter_results", ContentFilterResults); + writer.WriteIntValue("prompt_index", PromptIndex); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/kiota-lock.json b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/kiota-lock.json new file mode 100644 index 0000000..ebe6f85 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/azure_openai/kiota-lock.json @@ -0,0 +1,27 @@ +{ + "descriptionHash": "06D2A3F53A44B5F0DC31D99F750D72D89F16D0A9B10962029864C7F2AD8A75D037883CD5FDFEAF701D00DF00EDA582E7774EA93A233CC955ADA05BFD20562D75", + "descriptionLocation": "https://github.com/Azure/azure-rest-api-specs/raw/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.yaml", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.8.2", + "clientClassName": "GeneratedAzureOpenAiClient", + "clientNamespaceName": "OpenAI.Azure.GeneratedKiotaClient", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/AssistantsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/AssistantsRequestBuilder.cs new file mode 100644 index 0000000..c4d7509 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/AssistantsRequestBuilder.cs @@ -0,0 +1,209 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Assistants.Item; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants { + /// + /// Builds and executes requests for operations under \assistants + /// + internal class AssistantsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.assistants.item collection + /// The ID of the assistant to retrieve. + public WithAssistant_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("assistant_id", position); + return new WithAssistant_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new AssistantsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AssistantsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new AssistantsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AssistantsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of assistants. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListAssistantsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create an assistant with a model and instructions. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateAssistantRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateAssistantRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AssistantObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of assistants. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new AssistantsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create an assistant with a model and instructions. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateAssistantRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateAssistantRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new AssistantsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AssistantsRequestBuilder WithUrl(string rawUrl) { + return new AssistantsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of assistants. + /// + internal class AssistantsRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class AssistantsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public AssistantsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new AssistantsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new assistantsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public AssistantsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class AssistantsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new assistantsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public AssistantsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..6b757e1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/FilesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/FilesRequestBuilder.cs new file mode 100644 index 0000000..dd9e61e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/FilesRequestBuilder.cs @@ -0,0 +1,209 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Assistants.Item.Files.Item; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants.Item.Files { + /// + /// Builds and executes requests for operations under \assistants\{assistant_id}\files + /// + internal class FilesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.assistants.item.files.item collection + /// The ID of the file we're getting. + public WithFile_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("file_id", position); + return new WithFile_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}/files{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}/files{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of assistant files. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListAssistantFilesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants). + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateAssistantFileRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateAssistantFileRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AssistantFileObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of assistant files. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FilesRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants). + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateAssistantFileRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateAssistantFileRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FilesRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FilesRequestBuilder WithUrl(string rawUrl) { + return new FilesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of assistant files. + /// + internal class FilesRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FilesRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public FilesRequestBuilderGetQueryParameters QueryParameters { get; set; } = new FilesRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new filesRequestBuilderGetRequestConfiguration and sets the default values. + /// + public FilesRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FilesRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new filesRequestBuilderPostRequestConfiguration and sets the default values. + /// + public FilesRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..f230484 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants.Item.Files { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/Item/WithFile_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/Item/WithFile_ItemRequestBuilder.cs new file mode 100644 index 0000000..3d130e4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/Files/Item/WithFile_ItemRequestBuilder.cs @@ -0,0 +1,151 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants.Item.Files.Item { + /// + /// Builds and executes requests for operations under \assistants\{assistant_id}\files\{file_id} + /// + internal class WithFile_ItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}/files/{file_id}", pathParameters) { + } + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}/files/{file_id}", rawUrl) { + } + /// + /// Delete an assistant file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeleteAssistantFileResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an AssistantFile. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AssistantFileObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete an assistant file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFile_ItemRequestBuilderDeleteRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieves an AssistantFile. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFile_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFile_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithFile_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFile_ItemRequestBuilderDeleteRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFile_ItemRequestBuilderDeleteRequestConfiguration and sets the default values. + /// + public WithFile_ItemRequestBuilderDeleteRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFile_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFile_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithFile_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/WithAssistant_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/WithAssistant_ItemRequestBuilder.cs new file mode 100644 index 0000000..21bb822 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Assistants/Item/WithAssistant_ItemRequestBuilder.cs @@ -0,0 +1,217 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Assistants.Item.Files; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Assistants.Item { + /// + /// Builds and executes requests for operations under \assistants\{assistant_id} + /// + internal class WithAssistant_ItemRequestBuilder : BaseRequestBuilder { + /// The files property + public FilesRequestBuilder Files { get => + new FilesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithAssistant_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithAssistant_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}", pathParameters) { + } + /// + /// Instantiates a new WithAssistant_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithAssistant_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/assistants/{assistant_id}", rawUrl) { + } + /// + /// Delete an assistant. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeleteAssistantResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an assistant. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AssistantObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Modifies an assistant. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ModifyAssistantRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ModifyAssistantRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AssistantObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete an assistant. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithAssistant_ItemRequestBuilderDeleteRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieves an assistant. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithAssistant_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Modifies an assistant. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ModifyAssistantRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ModifyAssistantRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithAssistant_ItemRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithAssistant_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithAssistant_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithAssistant_ItemRequestBuilderDeleteRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithAssistant_ItemRequestBuilderDeleteRequestConfiguration and sets the default values. + /// + public WithAssistant_ItemRequestBuilderDeleteRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithAssistant_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithAssistant_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithAssistant_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithAssistant_ItemRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithAssistant_ItemRequestBuilderPostRequestConfiguration and sets the default values. + /// + public WithAssistant_ItemRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/AudioRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/AudioRequestBuilder.cs new file mode 100644 index 0000000..5fcc6d9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/AudioRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Audio.Speech; +using OpenAI.GeneratedKiotaClient.Audio.Transcriptions; +using OpenAI.GeneratedKiotaClient.Audio.Translations; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.GeneratedKiotaClient.Audio { + /// + /// Builds and executes requests for operations under \audio + /// + internal class AudioRequestBuilder : BaseRequestBuilder { + /// The speech property + public SpeechRequestBuilder Speech { get => + new SpeechRequestBuilder(PathParameters, RequestAdapter); + } + /// The transcriptions property + public TranscriptionsRequestBuilder Transcriptions { get => + new TranscriptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The translations property + public TranslationsRequestBuilder Translations { get => + new TranslationsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio", pathParameters) { + } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Speech/SpeechRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Speech/SpeechRequestBuilder.cs new file mode 100644 index 0000000..af8e687 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Speech/SpeechRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Audio.Speech { + /// + /// Builds and executes requests for operations under \audio\speech + /// + internal class SpeechRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SpeechRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SpeechRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/speech", pathParameters) { + } + /// + /// Instantiates a new SpeechRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SpeechRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/speech", rawUrl) { + } + /// + /// Generates audio from the input text. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateSpeechRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateSpeechRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Generates audio from the input text. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateSpeechRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateSpeechRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new SpeechRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/octet-stream"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SpeechRequestBuilder WithUrl(string rawUrl) { + return new SpeechRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class SpeechRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new speechRequestBuilderPostRequestConfiguration and sets the default values. + /// + public SpeechRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Transcriptions/TranscriptionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Transcriptions/TranscriptionsRequestBuilder.cs new file mode 100644 index 0000000..0af6f42 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Transcriptions/TranscriptionsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Audio.Transcriptions { + /// + /// Builds and executes requests for operations under \audio\transcriptions + /// + internal class TranscriptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TranscriptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TranscriptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/transcriptions", pathParameters) { + } + /// + /// Instantiates a new TranscriptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TranscriptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/transcriptions", rawUrl) { + } + /// + /// Transcribes audio into the input language. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateTranscriptionResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Transcribes audio into the input language. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new TranscriptionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TranscriptionsRequestBuilder WithUrl(string rawUrl) { + return new TranscriptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class TranscriptionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new transcriptionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public TranscriptionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Translations/TranslationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Translations/TranslationsRequestBuilder.cs new file mode 100644 index 0000000..1263239 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Audio/Translations/TranslationsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Audio.Translations { + /// + /// Builds and executes requests for operations under \audio\translations + /// + internal class TranslationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TranslationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TranslationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/translations", pathParameters) { + } + /// + /// Instantiates a new TranslationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TranslationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/audio/translations", rawUrl) { + } + /// + /// Translates audio into English. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateTranslationResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Translates audio into English. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new TranslationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TranslationsRequestBuilder WithUrl(string rawUrl) { + return new TranslationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class TranslationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new translationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public TranslationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/ChatRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/ChatRequestBuilder.cs new file mode 100644 index 0000000..2a1a91b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/ChatRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Chat.Completions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.GeneratedKiotaClient.Chat { + /// + /// Builds and executes requests for operations under \chat + /// + internal class ChatRequestBuilder : BaseRequestBuilder { + /// The completions property + public CompletionsRequestBuilder Completions { get => + new CompletionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chat", pathParameters) { + } + /// + /// Instantiates a new ChatRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChatRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chat", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/Completions/CompletionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/Completions/CompletionsRequestBuilder.cs new file mode 100644 index 0000000..fbba1d6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Chat/Completions/CompletionsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Chat.Completions { + /// + /// Builds and executes requests for operations under \chat\completions + /// + internal class CompletionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chat/completions", pathParameters) { + } + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chat/completions", rawUrl) { + } + /// + /// Creates a model response for the given chat conversation. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateChatCompletionRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateChatCompletionRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateChatCompletionResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a model response for the given chat conversation. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateChatCompletionRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateChatCompletionRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CompletionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompletionsRequestBuilder WithUrl(string rawUrl) { + return new CompletionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CompletionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new completionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CompletionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Completions/CompletionsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Completions/CompletionsRequestBuilder.cs new file mode 100644 index 0000000..1feb49c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Completions/CompletionsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Completions { + /// + /// Builds and executes requests for operations under \completions + /// + internal class CompletionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/completions", pathParameters) { + } + /// + /// Instantiates a new CompletionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompletionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/completions", rawUrl) { + } + /// + /// Creates a completion for the provided prompt and parameters. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateCompletionRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateCompletionRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateCompletionResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a completion for the provided prompt and parameters. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateCompletionRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateCompletionRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CompletionsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompletionsRequestBuilder WithUrl(string rawUrl) { + return new CompletionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CompletionsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new completionsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CompletionsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Edits/EditsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Edits/EditsRequestBuilder.cs new file mode 100644 index 0000000..a2172dd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Edits/EditsRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Edits { + /// + /// Builds and executes requests for operations under \edits + /// + internal class EditsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EditsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EditsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/edits", pathParameters) { + } + /// + /// Instantiates a new EditsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EditsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/edits", rawUrl) { + } + /// + /// Creates a new edit for the provided input, instruction, and parameters. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateEditRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateEditRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateEditResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new edit for the provided input, instruction, and parameters. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateEditRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateEditRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EditsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public EditsRequestBuilder WithUrl(string rawUrl) { + return new EditsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EditsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new editsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public EditsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Embeddings/EmbeddingsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Embeddings/EmbeddingsRequestBuilder.cs new file mode 100644 index 0000000..1ba9ba0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Embeddings/EmbeddingsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Embeddings { + /// + /// Builds and executes requests for operations under \embeddings + /// + internal class EmbeddingsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EmbeddingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EmbeddingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/embeddings", pathParameters) { + } + /// + /// Instantiates a new EmbeddingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EmbeddingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/embeddings", rawUrl) { + } + /// + /// Creates an embedding vector representing the input text. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateEmbeddingRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateEmbeddingRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateEmbeddingResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an embedding vector representing the input text. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateEmbeddingRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateEmbeddingRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EmbeddingsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EmbeddingsRequestBuilder WithUrl(string rawUrl) { + return new EmbeddingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EmbeddingsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new embeddingsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public EmbeddingsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/FilesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/FilesRequestBuilder.cs new file mode 100644 index 0000000..d93f8da --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/FilesRequestBuilder.cs @@ -0,0 +1,182 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Files.Item; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Files { + /// + /// Builds and executes requests for operations under \files + /// + internal class FilesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.files.item collection + /// The ID of the file to use for this request. + public WithFile_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("file_id", position); + return new WithFile_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files{?purpose*}", pathParameters) { + } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files{?purpose*}", rawUrl) { + } + /// + /// Returns a list of files that belong to the user's organization. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListFilesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Upload a file that can be used across various endpoints/features. The size of all the files uploaded by one organization can be up to 100 GB.The size of individual files for can be a maximum of 512MB. See the [Assistants Tools guide](/docs/assistants/tools) to learn more about the types of files supported. The Fine-tuning API only supports `.jsonl` files.Please [contact us](https://help.openai.com/) if you need to increase these storage limits. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, OpenAIFile.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of files that belong to the user's organization. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FilesRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Upload a file that can be used across various endpoints/features. The size of all the files uploaded by one organization can be up to 100 GB.The size of individual files for can be a maximum of 512MB. See the [Assistants Tools guide](/docs/assistants/tools) to learn more about the types of files supported. The Fine-tuning API only supports `.jsonl` files.Please [contact us](https://help.openai.com/) if you need to increase these storage limits. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FilesRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FilesRequestBuilder WithUrl(string rawUrl) { + return new FilesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of files that belong to the user's organization. + /// + internal class FilesRequestBuilderGetQueryParameters { + /// Only return files with the given purpose. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("purpose")] + public string? Purpose { get; set; } +#nullable restore +#else + [QueryParameter("purpose")] + public string Purpose { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FilesRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public FilesRequestBuilderGetQueryParameters QueryParameters { get; set; } = new FilesRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new filesRequestBuilderGetRequestConfiguration and sets the default values. + /// + public FilesRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FilesRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new filesRequestBuilderPostRequestConfiguration and sets the default values. + /// + public FilesRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/Content/ContentRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000..013e093 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,94 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Files.Item.Content { + /// + /// Builds and executes requests for operations under \files\{file_id}\content + /// + internal class ContentRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ContentRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ContentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files/{file_id}/content", pathParameters) { + } + /// + /// Instantiates a new ContentRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ContentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files/{file_id}/content", rawUrl) { + } + /// + /// Returns the contents of the specified file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns the contents of the specified file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new ContentRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder WithUrl(string rawUrl) { + return new ContentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class ContentRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new contentRequestBuilderGetRequestConfiguration and sets the default values. + /// + public ContentRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/WithFile_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/WithFile_ItemRequestBuilder.cs new file mode 100644 index 0000000..075ef00 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Files/Item/WithFile_ItemRequestBuilder.cs @@ -0,0 +1,156 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Files.Item.Content; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Files.Item { + /// + /// Builds and executes requests for operations under \files\{file_id} + /// + internal class WithFile_ItemRequestBuilder : BaseRequestBuilder { + /// The content property + public ContentRequestBuilder Content { get => + new ContentRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files/{file_id}", pathParameters) { + } + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/files/{file_id}", rawUrl) { + } + /// + /// Delete a file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeleteFileResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns information about a specific file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, OpenAIFile.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete a file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFile_ItemRequestBuilderDeleteRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns information about a specific file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFile_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFile_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithFile_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFile_ItemRequestBuilderDeleteRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFile_ItemRequestBuilderDeleteRequestConfiguration and sets the default values. + /// + public WithFile_ItemRequestBuilderDeleteRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFile_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFile_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithFile_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/FineTunesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/FineTunesRequestBuilder.cs new file mode 100644 index 0000000..f7f5a7c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/FineTunesRequestBuilder.cs @@ -0,0 +1,170 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.FineTunes.Item; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.FineTunes { + /// + /// Builds and executes requests for operations under \fine-tunes + /// + internal class FineTunesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.fineTunes.item collection + /// The ID of the fine-tune job + [Obsolete("")] + public WithFine_tune_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("fine_tune_id", position); + return new WithFine_tune_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FineTunesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FineTunesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes", pathParameters) { + } + /// + /// Instantiates a new FineTunesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FineTunesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes", rawUrl) { + } + /// + /// List your organization's fine-tuning jobs + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListFineTunesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a job that fine-tunes a specified model from a given dataset.Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.[Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateFineTuneRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateFineTuneRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTune.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// List your organization's fine-tuning jobs + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FineTunesRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Creates a job that fine-tunes a specified model from a given dataset.Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.[Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateFineTuneRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateFineTuneRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FineTunesRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public FineTunesRequestBuilder WithUrl(string rawUrl) { + return new FineTunesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FineTunesRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new fineTunesRequestBuilderGetRequestConfiguration and sets the default values. + /// + public FineTunesRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FineTunesRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new fineTunesRequestBuilderPostRequestConfiguration and sets the default values. + /// + public FineTunesRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Cancel/CancelRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 0000000..e91f827 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.FineTunes.Item.Cancel { + /// + /// Builds and executes requests for operations under \fine-tunes\{fine_tune_id}\cancel + /// + internal class CancelRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}/cancel", pathParameters) { + } + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}/cancel", rawUrl) { + } + /// + /// Immediately cancel a fine-tune job. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTune.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Immediately cancel a fine-tune job. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CancelRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public CancelRequestBuilder WithUrl(string rawUrl) { + return new CancelRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CancelRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new cancelRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CancelRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Events/EventsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Events/EventsRequestBuilder.cs new file mode 100644 index 0000000..875134e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/Events/EventsRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.FineTunes.Item.Events { + /// + /// Builds and executes requests for operations under \fine-tunes\{fine_tune_id}\events + /// + internal class EventsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EventsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}/events{?stream*}", pathParameters) { + } + /// + /// Instantiates a new EventsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}/events{?stream*}", rawUrl) { + } + /// + /// Get fine-grained status updates for a fine-tune job. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListFineTuneEventsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get fine-grained status updates for a fine-tune job. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EventsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public EventsRequestBuilder WithUrl(string rawUrl) { + return new EventsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get fine-grained status updates for a fine-tune job. + /// + internal class EventsRequestBuilderGetQueryParameters { + /// Whether to stream events for the fine-tune job. If set to true,events will be sent as data-only[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)as they become available. The stream will terminate with a`data: [DONE]` message when the job is finished (succeeded, cancelled,or failed).If set to false, only events generated so far will be returned. + [QueryParameter("stream")] + public bool? Stream { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EventsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public EventsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new EventsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new eventsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public EventsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/WithFine_tune_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/WithFine_tune_ItemRequestBuilder.cs new file mode 100644 index 0000000..65dc7ed --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/FineTunes/Item/WithFine_tune_ItemRequestBuilder.cs @@ -0,0 +1,110 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.FineTunes.Item.Cancel; +using OpenAI.GeneratedKiotaClient.FineTunes.Item.Events; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.FineTunes.Item { + /// + /// Builds and executes requests for operations under \fine-tunes\{fine_tune_id} + /// + internal class WithFine_tune_ItemRequestBuilder : BaseRequestBuilder { + /// The cancel property + [Obsolete("")] + public CancelRequestBuilder Cancel { get => + new CancelRequestBuilder(PathParameters, RequestAdapter); + } + /// The events property + [Obsolete("")] + public EventsRequestBuilder Events { get => + new EventsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithFine_tune_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFine_tune_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}", pathParameters) { + } + /// + /// Instantiates a new WithFine_tune_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFine_tune_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine-tunes/{fine_tune_id}", rawUrl) { + } + /// + /// Gets info about the fine-tune job.[Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTune.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets info about the fine-tune job.[Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFine_tune_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public WithFine_tune_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithFine_tune_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFine_tune_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFine_tune_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithFine_tune_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Fine_tuningRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Fine_tuningRequestBuilder.cs new file mode 100644 index 0000000..1b1ec48 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Fine_tuningRequestBuilder.cs @@ -0,0 +1,34 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.GeneratedKiotaClient.Fine_tuning { + /// + /// Builds and executes requests for operations under \fine_tuning + /// + internal class Fine_tuningRequestBuilder : BaseRequestBuilder { + /// The jobs property + public JobsRequestBuilder Jobs { get => + new JobsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new Fine_tuningRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Fine_tuningRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning", pathParameters) { + } + /// + /// Instantiates a new Fine_tuningRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Fine_tuningRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Cancel/CancelRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 0000000..1287d6a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item.Cancel { + /// + /// Builds and executes requests for operations under \fine_tuning\jobs\{fine_tuning_job_id}\cancel + /// + internal class CancelRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}/cancel", pathParameters) { + } + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}/cancel", rawUrl) { + } + /// + /// Immediately cancel a fine-tune job. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTuningJob.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Immediately cancel a fine-tune job. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CancelRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CancelRequestBuilder WithUrl(string rawUrl) { + return new CancelRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CancelRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new cancelRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CancelRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Events/EventsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Events/EventsRequestBuilder.cs new file mode 100644 index 0000000..25da2c7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/Events/EventsRequestBuilder.cs @@ -0,0 +1,116 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item.Events { + /// + /// Builds and executes requests for operations under \fine_tuning\jobs\{fine_tuning_job_id}\events + /// + internal class EventsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EventsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}/events{?after*,limit*}", pathParameters) { + } + /// + /// Instantiates a new EventsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EventsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}/events{?after*,limit*}", rawUrl) { + } + /// + /// Get status updates for a fine-tuning job. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListFineTuningJobEventsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get status updates for a fine-tuning job. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EventsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EventsRequestBuilder WithUrl(string rawUrl) { + return new EventsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get status updates for a fine-tuning job. + /// + internal class EventsRequestBuilderGetQueryParameters { + /// Identifier for the last event from the previous pagination request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// Number of events to retrieve. + [QueryParameter("limit")] + public int? Limit { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EventsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public EventsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new EventsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new eventsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public EventsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/WithFine_tuning_job_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/WithFine_tuning_job_ItemRequestBuilder.cs new file mode 100644 index 0000000..c099366 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/Item/WithFine_tuning_job_ItemRequestBuilder.cs @@ -0,0 +1,105 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item.Cancel; +using OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item.Events; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item { + /// + /// Builds and executes requests for operations under \fine_tuning\jobs\{fine_tuning_job_id} + /// + internal class WithFine_tuning_job_ItemRequestBuilder : BaseRequestBuilder { + /// The cancel property + public CancelRequestBuilder Cancel { get => + new CancelRequestBuilder(PathParameters, RequestAdapter); + } + /// The events property + public EventsRequestBuilder Events { get => + new EventsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithFine_tuning_job_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFine_tuning_job_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}", pathParameters) { + } + /// + /// Instantiates a new WithFine_tuning_job_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFine_tuning_job_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs/{fine_tuning_job_id}", rawUrl) { + } + /// + /// Get info about a fine-tuning job.[Learn more about fine-tuning](/docs/guides/fine-tuning) + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTuningJob.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get info about a fine-tuning job.[Learn more about fine-tuning](/docs/guides/fine-tuning) + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFine_tuning_job_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFine_tuning_job_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithFine_tuning_job_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFine_tuning_job_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFine_tuning_job_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithFine_tuning_job_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/JobsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/JobsRequestBuilder.cs new file mode 100644 index 0000000..ca2572b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Fine_tuning/Jobs/JobsRequestBuilder.cs @@ -0,0 +1,185 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs.Item; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Fine_tuning.Jobs { + /// + /// Builds and executes requests for operations under \fine_tuning\jobs + /// + internal class JobsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.fine_tuning.jobs.item collection + /// The ID of the fine-tuning job. + public WithFine_tuning_job_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("fine_tuning_job_id", position); + return new WithFine_tuning_job_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new JobsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public JobsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs{?after*,limit*}", pathParameters) { + } + /// + /// Instantiates a new JobsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public JobsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/fine_tuning/jobs{?after*,limit*}", rawUrl) { + } + /// + /// List your organization's fine-tuning jobs + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListPaginatedFineTuningJobsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a job that fine-tunes a specified model from a given dataset.Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.[Learn more about fine-tuning](/docs/guides/fine-tuning) + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateFineTuningJobRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateFineTuningJobRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, FineTuningJob.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// List your organization's fine-tuning jobs + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new JobsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Creates a job that fine-tunes a specified model from a given dataset.Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.[Learn more about fine-tuning](/docs/guides/fine-tuning) + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateFineTuningJobRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateFineTuningJobRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new JobsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public JobsRequestBuilder WithUrl(string rawUrl) { + return new JobsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// List your organization's fine-tuning jobs + /// + internal class JobsRequestBuilderGetQueryParameters { + /// Identifier for the last job from the previous pagination request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// Number of fine-tuning jobs to retrieve. + [QueryParameter("limit")] + public int? Limit { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class JobsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public JobsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new JobsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new jobsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public JobsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class JobsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new jobsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public JobsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/GeneratedOpenAiClient.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/GeneratedOpenAiClient.cs new file mode 100644 index 0000000..9da310e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/GeneratedOpenAiClient.cs @@ -0,0 +1,94 @@ +// +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Serialization.Json; +using OpenAI.GeneratedKiotaClient.Assistants; +using OpenAI.GeneratedKiotaClient.Audio; +using OpenAI.GeneratedKiotaClient.Chat; +using OpenAI.GeneratedKiotaClient.Completions; +using OpenAI.GeneratedKiotaClient.Edits; +using OpenAI.GeneratedKiotaClient.Embeddings; +using OpenAI.GeneratedKiotaClient.Files; +using OpenAI.GeneratedKiotaClient.FineTunes; +using OpenAI.GeneratedKiotaClient.Fine_tuning; +using OpenAI.GeneratedKiotaClient.Images; +using OpenAI.GeneratedKiotaClient.ModelsRequests; +using OpenAI.GeneratedKiotaClient.Moderations; +using OpenAI.GeneratedKiotaClient.Threads; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.GeneratedKiotaClient { + /// + /// The main entry point of the SDK, exposes the configuration and the fluent API. + /// + internal class GeneratedOpenAiClient : BaseRequestBuilder { + /// The assistants property + public AssistantsRequestBuilder Assistants { get => + new AssistantsRequestBuilder(PathParameters, RequestAdapter); + } + /// The audio property + public AudioRequestBuilder Audio { get => + new AudioRequestBuilder(PathParameters, RequestAdapter); + } + /// The chat property + public ChatRequestBuilder Chat { get => + new ChatRequestBuilder(PathParameters, RequestAdapter); + } + /// The completions property + public CompletionsRequestBuilder Completions { get => + new CompletionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The edits property + public EditsRequestBuilder Edits { get => + new EditsRequestBuilder(PathParameters, RequestAdapter); + } + /// The embeddings property + public EmbeddingsRequestBuilder Embeddings { get => + new EmbeddingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The files property + public FilesRequestBuilder Files { get => + new FilesRequestBuilder(PathParameters, RequestAdapter); + } + /// The fine_tuning property + public Fine_tuningRequestBuilder Fine_tuning { get => + new Fine_tuningRequestBuilder(PathParameters, RequestAdapter); + } + /// The fineTunes property + public FineTunesRequestBuilder FineTunes { get => + new FineTunesRequestBuilder(PathParameters, RequestAdapter); + } + /// The images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The models property + public ModelsRequestBuilder Models { get => + new ModelsRequestBuilder(PathParameters, RequestAdapter); + } + /// The moderations property + public ModerationsRequestBuilder Moderations { get => + new ModerationsRequestBuilder(PathParameters, RequestAdapter); + } + /// The threads property + public ThreadsRequestBuilder Threads { get => + new ThreadsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new GeneratedOpenAiClient and sets the default values. + /// + /// The request adapter to use to execute the requests. + public GeneratedOpenAiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary()) { + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) { + RequestAdapter.BaseUrl = "https://api.openai.com/v1"; + } + PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Edits/EditsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Edits/EditsRequestBuilder.cs new file mode 100644 index 0000000..f4677b9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Edits/EditsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Images.Edits { + /// + /// Builds and executes requests for operations under \images\edits + /// + internal class EditsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EditsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EditsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/edits", pathParameters) { + } + /// + /// Instantiates a new EditsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EditsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/edits", rawUrl) { + } + /// + /// Creates an edited or extended image given an original image and a prompt. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ImagesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an edited or extended image given an original image and a prompt. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new EditsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EditsRequestBuilder WithUrl(string rawUrl) { + return new EditsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class EditsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new editsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public EditsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Generations/GenerationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Generations/GenerationsRequestBuilder.cs new file mode 100644 index 0000000..28e1f15 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Generations/GenerationsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Images.Generations { + /// + /// Builds and executes requests for operations under \images\generations + /// + internal class GenerationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new GenerationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GenerationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/generations", pathParameters) { + } + /// + /// Instantiates a new GenerationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GenerationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/generations", rawUrl) { + } + /// + /// Creates an image given a prompt. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateImageRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateImageRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ImagesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an image given a prompt. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateImageRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateImageRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new GenerationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GenerationsRequestBuilder WithUrl(string rawUrl) { + return new GenerationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class GenerationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new generationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public GenerationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/ImagesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..4ccd934 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/ImagesRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Images.Edits; +using OpenAI.GeneratedKiotaClient.Images.Generations; +using OpenAI.GeneratedKiotaClient.Images.Variations; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenAI.GeneratedKiotaClient.Images { + /// + /// Builds and executes requests for operations under \images + /// + internal class ImagesRequestBuilder : BaseRequestBuilder { + /// The edits property + public EditsRequestBuilder Edits { get => + new EditsRequestBuilder(PathParameters, RequestAdapter); + } + /// The generations property + public GenerationsRequestBuilder Generations { get => + new GenerationsRequestBuilder(PathParameters, RequestAdapter); + } + /// The variations property + public VariationsRequestBuilder Variations { get => + new VariationsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images", rawUrl) { + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Variations/VariationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Variations/VariationsRequestBuilder.cs new file mode 100644 index 0000000..82dddeb --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Images/Variations/VariationsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Images.Variations { + /// + /// Builds and executes requests for operations under \images\variations + /// + internal class VariationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new VariationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VariationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/variations", pathParameters) { + } + /// + /// Instantiates a new VariationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VariationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/images/variations", rawUrl) { + } + /// + /// Creates a variation of a given image. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MultipartBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MultipartBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ImagesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a variation of a given image. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultipartBody body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultipartBody body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new VariationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public VariationsRequestBuilder WithUrl(string rawUrl) { + return new VariationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class VariationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new variationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public VariationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject.cs new file mode 100644 index 0000000..5171fea --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A list of [Files](/docs/api-reference/files) attached to an `assistant`. + /// + internal class AssistantFileObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The assistant ID that the file is attached to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the assistant file was created. + public int? CreatedAt { get; set; } + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object type, which is always `assistant.file`. + public AssistantFileObject_object? Object { get; set; } + /// + /// Instantiates a new AssistantFileObject and sets the default values. + /// + public AssistantFileObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantFileObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantFileObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject_object.cs new file mode 100644 index 0000000..2e9126a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantFileObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `assistant.file`. + internal enum AssistantFileObject_object { + [EnumMember(Value = "assistant.file")] + AssistantFile, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject.cs new file mode 100644 index 0000000..d05a112 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject.cs @@ -0,0 +1,212 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents an `assistant` that can call the model and use tools. + /// + internal class AssistantObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) for when the assistant was created. + public int? CreatedAt { get; set; } + /// The description of the assistant. The maximum length is 512 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The system instructions that the assistant uses. The maximum length is 32768 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AssistantObject_metadata? Metadata { get; set; } +#nullable restore +#else + public AssistantObject_metadata Metadata { get; set; } +#endif + /// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The name of the assistant. The maximum length is 256 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The object type, which is always `assistant`. + public AssistantObject_object? Object { get; set; } + /// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Instantiates a new AssistantObject and sets the default values. + /// + public AssistantObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"description", n => { Description = n.GetStringValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(AssistantObject_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(AssistantObject_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("description", Description); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("object", Object); + writer.WriteCollectionOfObjectValues("tools", Tools); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class AssistantObject_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantObject_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new AssistantObject_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_metadata.cs new file mode 100644 index 0000000..e48a7df --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class AssistantObject_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new AssistantObject_metadata and sets the default values. + /// + public AssistantObject_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantObject_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantObject_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_object.cs new file mode 100644 index 0000000..26b8a1e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `assistant`. + internal enum AssistantObject_object { + [EnumMember(Value = "assistant")] + Assistant, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode.cs new file mode 100644 index 0000000..31b46a3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class AssistantToolsCode : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type of tool being defined: `code_interpreter` + public AssistantToolsCode_type? Type { get; set; } + /// + /// Instantiates a new AssistantToolsCode and sets the default values. + /// + public AssistantToolsCode() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantToolsCode CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantToolsCode(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode_type.cs new file mode 100644 index 0000000..66132af --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsCode_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool being defined: `code_interpreter` + internal enum AssistantToolsCode_type { + [EnumMember(Value = "code_interpreter")] + Code_interpreter, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction.cs new file mode 100644 index 0000000..eff77ca --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class AssistantToolsFunction : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The function property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FunctionObject? Function { get; set; } +#nullable restore +#else + public FunctionObject Function { get; set; } +#endif + /// The type of tool being defined: `function` + public AssistantToolsFunction_type? Type { get; set; } + /// + /// Instantiates a new AssistantToolsFunction and sets the default values. + /// + public AssistantToolsFunction() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantToolsFunction CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantToolsFunction(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(FunctionObject.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction_type.cs new file mode 100644 index 0000000..971d600 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsFunction_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool being defined: `function` + internal enum AssistantToolsFunction_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval.cs new file mode 100644 index 0000000..5323d91 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class AssistantToolsRetrieval : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The type of tool being defined: `retrieval` + public AssistantToolsRetrieval_type? Type { get; set; } + /// + /// Instantiates a new AssistantToolsRetrieval and sets the default values. + /// + public AssistantToolsRetrieval() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AssistantToolsRetrieval CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssistantToolsRetrieval(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval_type.cs new file mode 100644 index 0000000..bcc533a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/AssistantToolsRetrieval_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool being defined: `retrieval` + internal enum AssistantToolsRetrieval_type { + [EnumMember(Value = "retrieval")] + Retrieval, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctionCallOption.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctionCallOption.cs new file mode 100644 index 0000000..cd142f3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctionCallOption.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + /// + internal class ChatCompletionFunctionCallOption : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionFunctionCallOption and sets the default values. + /// + public ChatCompletionFunctionCallOption() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionFunctionCallOption CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionFunctionCallOption(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctions.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctions.cs new file mode 100644 index 0000000..266bc94 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionFunctions.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + [Obsolete("")] + internal class ChatCompletionFunctions : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A description of what the function does, used by the model to choose when and how to call the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.To describe a function that accepts no parameters, provide the value `{"type": "object", "properties": {}}`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FunctionParameters? Parameters { get; set; } +#nullable restore +#else + public FunctionParameters Parameters { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionFunctions and sets the default values. + /// + public ChatCompletionFunctions() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionFunctions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionFunctions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"description", n => { Description = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"parameters", n => { Parameters = n.GetObjectValue(FunctionParameters.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("parameters", Parameters); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall.cs new file mode 100644 index 0000000..39d8800 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionMessageToolCall : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The function that the model called. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionMessageToolCall_function? Function { get; set; } +#nullable restore +#else + public ChatCompletionMessageToolCall_function Function { get; set; } +#endif + /// The ID of the tool call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The type of the tool. Currently, only `function` is supported. + public ChatCompletionMessageToolCall_type? Type { get; set; } + /// + /// Instantiates a new ChatCompletionMessageToolCall and sets the default values. + /// + public ChatCompletionMessageToolCall() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionMessageToolCall CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionMessageToolCall(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(ChatCompletionMessageToolCall_function.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_function.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_function.cs new file mode 100644 index 0000000..3560ebe --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_function.cs @@ -0,0 +1,65 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The function that the model called. + /// + internal class ChatCompletionMessageToolCall_function : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Arguments { get; set; } +#nullable restore +#else + public string Arguments { get; set; } +#endif + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionMessageToolCall_function and sets the default values. + /// + public ChatCompletionMessageToolCall_function() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionMessageToolCall_function CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionMessageToolCall_function(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"arguments", n => { Arguments = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("arguments", Arguments); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_type.cs new file mode 100644 index 0000000..04f01c0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionMessageToolCall_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of the tool. Currently, only `function` is supported. + internal enum ChatCompletionMessageToolCall_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice.cs new file mode 100644 index 0000000..530bd75 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Specifies a tool the model should use. Use to force the model to call a specific function. + /// + internal class ChatCompletionNamedToolChoice : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The function property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionNamedToolChoice_function? Function { get; set; } +#nullable restore +#else + public ChatCompletionNamedToolChoice_function Function { get; set; } +#endif + /// The type of the tool. Currently, only `function` is supported. + public ChatCompletionNamedToolChoice_type? Type { get; set; } + /// + /// Instantiates a new ChatCompletionNamedToolChoice and sets the default values. + /// + public ChatCompletionNamedToolChoice() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionNamedToolChoice CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionNamedToolChoice(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(ChatCompletionNamedToolChoice_function.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_function.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_function.cs new file mode 100644 index 0000000..818ccc0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_function.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionNamedToolChoice_function : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionNamedToolChoice_function and sets the default values. + /// + public ChatCompletionNamedToolChoice_function() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionNamedToolChoice_function CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionNamedToolChoice_function(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_type.cs new file mode 100644 index 0000000..3bc7eda --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionNamedToolChoice_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of the tool. Currently, only `function` is supported. + internal enum ChatCompletionNamedToolChoice_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage.cs new file mode 100644 index 0000000..7962e44 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage.cs @@ -0,0 +1,77 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionRequestAssistantMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contents of the assistant message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionRequestAssistantMessage_function_call? FunctionCall { get; set; } +#nullable restore +#else + public ChatCompletionRequestAssistantMessage_function_call FunctionCall { get; set; } +#endif + /// The role of the messages author, in this case `assistant`. + public ChatCompletionRequestAssistantMessage_role? Role { get; set; } + /// The tool calls generated by the model, such as function calls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ToolCalls { get; set; } +#nullable restore +#else + public List ToolCalls { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionRequestAssistantMessage and sets the default values. + /// + public ChatCompletionRequestAssistantMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestAssistantMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestAssistantMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"function_call", n => { FunctionCall = n.GetObjectValue(ChatCompletionRequestAssistantMessage_function_call.CreateFromDiscriminatorValue); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + {"tool_calls", n => { ToolCalls = n.GetCollectionOfObjectValues(ChatCompletionMessageToolCall.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteObjectValue("function_call", FunctionCall); + writer.WriteEnumValue("role", Role); + writer.WriteCollectionOfObjectValues("tool_calls", ToolCalls); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_function_call.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_function_call.cs new file mode 100644 index 0000000..730f1be --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_function_call.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + /// + [Obsolete("")] + internal class ChatCompletionRequestAssistantMessage_function_call : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Arguments { get; set; } +#nullable restore +#else + public string Arguments { get; set; } +#endif + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionRequestAssistantMessage_function_call and sets the default values. + /// + public ChatCompletionRequestAssistantMessage_function_call() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestAssistantMessage_function_call CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestAssistantMessage_function_call(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"arguments", n => { Arguments = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("arguments", Arguments); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_role.cs new file mode 100644 index 0000000..fbc516a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestAssistantMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the messages author, in this case `assistant`. + internal enum ChatCompletionRequestAssistantMessage_role { + [EnumMember(Value = "assistant")] + Assistant, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage.cs new file mode 100644 index 0000000..c277253 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + [Obsolete("")] + internal class ChatCompletionRequestFunctionMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The return value from the function call, to return to the model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The role of the messages author, in this case `function`. + public ChatCompletionRequestFunctionMessage_role? Role { get; set; } + /// + /// Instantiates a new ChatCompletionRequestFunctionMessage and sets the default values. + /// + public ChatCompletionRequestFunctionMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestFunctionMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestFunctionMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteStringValue("name", Name); + writer.WriteEnumValue("role", Role); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage_role.cs new file mode 100644 index 0000000..84634f9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestFunctionMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the messages author, in this case `function`. + internal enum ChatCompletionRequestFunctionMessage_role { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessage.cs new file mode 100644 index 0000000..7105af1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessage.cs @@ -0,0 +1,123 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Composed type wrapper for classes ChatCompletionRequestAssistantMessage, ChatCompletionRequestFunctionMessage, ChatCompletionRequestSystemMessage, ChatCompletionRequestToolMessage, ChatCompletionRequestUserMessage + /// + internal class ChatCompletionRequestMessage : IComposedTypeWrapper, IParsable { + /// Composed type representation for type ChatCompletionRequestAssistantMessage +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestAssistantMessage? ChatCompletionRequestAssistantMessage { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestAssistantMessage ChatCompletionRequestAssistantMessage { get; set; } +#endif + /// Composed type representation for type ChatCompletionRequestFunctionMessage +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestFunctionMessage? ChatCompletionRequestFunctionMessage { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestFunctionMessage ChatCompletionRequestFunctionMessage { get; set; } +#endif + /// Composed type representation for type ChatCompletionRequestSystemMessage +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestSystemMessage? ChatCompletionRequestSystemMessage { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestSystemMessage ChatCompletionRequestSystemMessage { get; set; } +#endif + /// Composed type representation for type ChatCompletionRequestToolMessage +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestToolMessage? ChatCompletionRequestToolMessage { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestToolMessage ChatCompletionRequestToolMessage { get; set; } +#endif + /// Composed type representation for type ChatCompletionRequestUserMessage +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestUserMessage? ChatCompletionRequestUserMessage { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestUserMessage ChatCompletionRequestUserMessage { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new ChatCompletionRequestMessage(); + if("ChatCompletionRequestAssistantMessage".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestAssistantMessage = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestAssistantMessage(); + } + else if("ChatCompletionRequestFunctionMessage".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestFunctionMessage = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestFunctionMessage(); + } + else if("ChatCompletionRequestSystemMessage".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestSystemMessage = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestSystemMessage(); + } + else if("ChatCompletionRequestToolMessage".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestToolMessage = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestToolMessage(); + } + else if("ChatCompletionRequestUserMessage".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestUserMessage = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestUserMessage(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(ChatCompletionRequestAssistantMessage != null) { + return ChatCompletionRequestAssistantMessage.GetFieldDeserializers(); + } + else if(ChatCompletionRequestFunctionMessage != null) { + return ChatCompletionRequestFunctionMessage.GetFieldDeserializers(); + } + else if(ChatCompletionRequestSystemMessage != null) { + return ChatCompletionRequestSystemMessage.GetFieldDeserializers(); + } + else if(ChatCompletionRequestToolMessage != null) { + return ChatCompletionRequestToolMessage.GetFieldDeserializers(); + } + else if(ChatCompletionRequestUserMessage != null) { + return ChatCompletionRequestUserMessage.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ChatCompletionRequestAssistantMessage != null) { + writer.WriteObjectValue(null, ChatCompletionRequestAssistantMessage); + } + else if(ChatCompletionRequestFunctionMessage != null) { + writer.WriteObjectValue(null, ChatCompletionRequestFunctionMessage); + } + else if(ChatCompletionRequestSystemMessage != null) { + writer.WriteObjectValue(null, ChatCompletionRequestSystemMessage); + } + else if(ChatCompletionRequestToolMessage != null) { + writer.WriteObjectValue(null, ChatCompletionRequestToolMessage); + } + else if(ChatCompletionRequestUserMessage != null) { + writer.WriteObjectValue(null, ChatCompletionRequestUserMessage); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessageContentPart.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessageContentPart.cs new file mode 100644 index 0000000..ec674ba --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestMessageContentPart.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// An array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Image input is only supported when using the `gpt-4-visual-preview` model. + /// + internal class ChatCompletionRequestMessageContentPart : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ChatCompletionRequestMessageContentPart and sets the default values. + /// + public ChatCompletionRequestMessageContentPart() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestMessageContentPart CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestMessageContentPart(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage.cs new file mode 100644 index 0000000..33fc411 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionRequestSystemMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contents of the system message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// The role of the messages author, in this case `system`. + public ChatCompletionRequestSystemMessage_role? Role { get; set; } + /// + /// Instantiates a new ChatCompletionRequestSystemMessage and sets the default values. + /// + public ChatCompletionRequestSystemMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestSystemMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestSystemMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteEnumValue("role", Role); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage_role.cs new file mode 100644 index 0000000..40f5004 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestSystemMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the messages author, in this case `system`. + internal enum ChatCompletionRequestSystemMessage_role { + [EnumMember(Value = "system")] + System, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage.cs new file mode 100644 index 0000000..d03760e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionRequestToolMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contents of the tool message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// The role of the messages author, in this case `tool`. + public ChatCompletionRequestToolMessage_role? Role { get; set; } + /// Tool call that this message is responding to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ToolCallId { get; set; } +#nullable restore +#else + public string ToolCallId { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionRequestToolMessage and sets the default values. + /// + public ChatCompletionRequestToolMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestToolMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestToolMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + {"tool_call_id", n => { ToolCallId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteEnumValue("role", Role); + writer.WriteStringValue("tool_call_id", ToolCallId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage_role.cs new file mode 100644 index 0000000..f2888d2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestToolMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the messages author, in this case `tool`. + internal enum ChatCompletionRequestToolMessage_role { + [EnumMember(Value = "tool")] + Tool, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage.cs new file mode 100644 index 0000000..462fb5a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage.cs @@ -0,0 +1,118 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionRequestUserMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contents of the user message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionRequestUserMessage_content? Content { get; set; } +#nullable restore +#else + public ChatCompletionRequestUserMessage_content Content { get; set; } +#endif + /// The role of the messages author, in this case `user`. + public ChatCompletionRequestUserMessage_role? Role { get; set; } + /// + /// Instantiates a new ChatCompletionRequestUserMessage and sets the default values. + /// + public ChatCompletionRequestUserMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestUserMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionRequestUserMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetObjectValue(ChatCompletionRequestUserMessage_content.CreateFromDiscriminatorValue); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("content", Content); + writer.WriteEnumValue("role", Role); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes ChatCompletionRequestMessageContentPart, TextContent + /// + internal class ChatCompletionRequestUserMessage_content : IComposedTypeWrapper, IParsable { + /// Composed type representation for type ChatCompletionRequestMessageContentPart +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestMessageContentPart? ChatCompletionRequestMessageContentPart { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestMessageContentPart ChatCompletionRequestMessageContentPart { get; set; } +#endif + /// Composed type representation for type TextContent +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.TextContent? TextContent { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.TextContent TextContent { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionRequestUserMessage_content CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new ChatCompletionRequestUserMessage_content(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionRequestMessageContentPart = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionRequestMessageContentPart(); + } + else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.TextContent = new OpenAI.GeneratedKiotaClient.Models.TextContent(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(ChatCompletionRequestMessageContentPart != null) { + return ChatCompletionRequestMessageContentPart.GetFieldDeserializers(); + } + else if(TextContent != null) { + return TextContent.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ChatCompletionRequestMessageContentPart != null) { + writer.WriteObjectValue(null, ChatCompletionRequestMessageContentPart); + } + else if(TextContent != null) { + writer.WriteObjectValue(null, TextContent); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage_role.cs new file mode 100644 index 0000000..741ac83 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionRequestUserMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the messages author, in this case `user`. + internal enum ChatCompletionRequestUserMessage_role { + [EnumMember(Value = "user")] + User, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage.cs new file mode 100644 index 0000000..32a1d8c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage.cs @@ -0,0 +1,80 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A chat completion message generated by the model. + /// + internal class ChatCompletionResponseMessage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contents of the message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionResponseMessage_function_call? FunctionCall { get; set; } +#nullable restore +#else + public ChatCompletionResponseMessage_function_call FunctionCall { get; set; } +#endif + /// The role of the author of this message. + public ChatCompletionResponseMessage_role? Role { get; set; } + /// The tool calls generated by the model, such as function calls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ToolCalls { get; set; } +#nullable restore +#else + public List ToolCalls { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionResponseMessage and sets the default values. + /// + public ChatCompletionResponseMessage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionResponseMessage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionResponseMessage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"function_call", n => { FunctionCall = n.GetObjectValue(ChatCompletionResponseMessage_function_call.CreateFromDiscriminatorValue); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + {"tool_calls", n => { ToolCalls = n.GetCollectionOfObjectValues(ChatCompletionMessageToolCall.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteObjectValue("function_call", FunctionCall); + writer.WriteEnumValue("role", Role); + writer.WriteCollectionOfObjectValues("tool_calls", ToolCalls); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_function_call.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_function_call.cs new file mode 100644 index 0000000..2e5a874 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_function_call.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + /// + [Obsolete("")] + internal class ChatCompletionResponseMessage_function_call : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Arguments { get; set; } +#nullable restore +#else + public string Arguments { get; set; } +#endif + /// The name of the function to call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new ChatCompletionResponseMessage_function_call and sets the default values. + /// + public ChatCompletionResponseMessage_function_call() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionResponseMessage_function_call CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionResponseMessage_function_call(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"arguments", n => { Arguments = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("arguments", Arguments); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_role.cs new file mode 100644 index 0000000..2df3caf --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionResponseMessage_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the author of this message. + internal enum ChatCompletionResponseMessage_role { + [EnumMember(Value = "assistant")] + Assistant, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool.cs new file mode 100644 index 0000000..a38a7b3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ChatCompletionTool : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The function property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FunctionObject? Function { get; set; } +#nullable restore +#else + public FunctionObject Function { get; set; } +#endif + /// The type of the tool. Currently, only `function` is supported. + public ChatCompletionTool_type? Type { get; set; } + /// + /// Instantiates a new ChatCompletionTool and sets the default values. + /// + public ChatCompletionTool() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionTool CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChatCompletionTool(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(FunctionObject.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionToolChoiceOption.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionToolChoiceOption.cs new file mode 100644 index 0000000..462b01a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionToolChoiceOption.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Composed type wrapper for classes ChatCompletionNamedToolChoice, string + /// + internal class ChatCompletionToolChoiceOption : IComposedTypeWrapper, IParsable { + /// Composed type representation for type ChatCompletionNamedToolChoice +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionNamedToolChoice? ChatCompletionNamedToolChoice { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionNamedToolChoice ChatCompletionNamedToolChoice { get; set; } +#endif + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChatCompletionToolChoiceOption CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new ChatCompletionToolChoiceOption(); + if("ChatCompletionNamedToolChoice".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionNamedToolChoice = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionNamedToolChoice(); + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(ChatCompletionNamedToolChoice != null) { + return ChatCompletionNamedToolChoice.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ChatCompletionNamedToolChoice != null) { + writer.WriteObjectValue(null, ChatCompletionNamedToolChoice); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool_type.cs new file mode 100644 index 0000000..8192541 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ChatCompletionTool_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of the tool. Currently, only `function` is supported. + internal enum ChatCompletionTool_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CompletionUsage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CompletionUsage.cs new file mode 100644 index 0000000..6cd5136 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CompletionUsage.cs @@ -0,0 +1,57 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Usage statistics for the completion request. + /// + internal class CompletionUsage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number of tokens in the generated completion. + public int? CompletionTokens { get; set; } + /// Number of tokens in the prompt. + public int? PromptTokens { get; set; } + /// Total number of tokens used in the request (prompt + completion). + public int? TotalTokens { get; set; } + /// + /// Instantiates a new CompletionUsage and sets the default values. + /// + public CompletionUsage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CompletionUsage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CompletionUsage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"completion_tokens", n => { CompletionTokens = n.GetIntValue(); } }, + {"prompt_tokens", n => { PromptTokens = n.GetIntValue(); } }, + {"total_tokens", n => { TotalTokens = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("completion_tokens", CompletionTokens); + writer.WriteIntValue("prompt_tokens", PromptTokens); + writer.WriteIntValue("total_tokens", TotalTokens); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantFileRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantFileRequest.cs new file mode 100644 index 0000000..b15affa --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantFileRequest.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateAssistantFileRequest : IParsable { + /// A [File](/docs/api-reference/files) ID (with `purpose="assistants"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileId { get; set; } +#nullable restore +#else + public string FileId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateAssistantFileRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateAssistantFileRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"file_id", n => { FileId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("file_id", FileId); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest.cs new file mode 100644 index 0000000..a6a51cc --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest.cs @@ -0,0 +1,182 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateAssistantRequest : IParsable { + /// The description of the assistant. The maximum length is 512 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// The system instructions that the assistant uses. The maximum length is 32768 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateAssistantRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public CreateAssistantRequest_metadata Metadata { get; set; } +#endif + /// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The name of the assistant. The maximum length is 256 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateAssistantRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateAssistantRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"description", n => { Description = n.GetStringValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(CreateAssistantRequest_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(CreateAssistantRequest_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfObjectValues("tools", Tools); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class CreateAssistantRequest_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateAssistantRequest_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateAssistantRequest_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest_metadata.cs new file mode 100644 index 0000000..d6b99d1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateAssistantRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class CreateAssistantRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateAssistantRequest_metadata and sets the default values. + /// + public CreateAssistantRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateAssistantRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateAssistantRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest.cs new file mode 100644 index 0000000..3de550e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest.cs @@ -0,0 +1,319 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateChatCompletionRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.[See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details) + public double? FrequencyPenalty { get; set; } + /// Deprecated in favor of `tool_choice`.Controls which (if any) function is called by the model.`none` means the model will not call a function and instead generates a message.`auto` means the model can pick between generating a message or calling a function.Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.`none` is the default when no functions are present. `auto`` is the default if functions are present. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateChatCompletionRequest_function_call? FunctionCall { get; set; } +#nullable restore +#else + public CreateChatCompletionRequest_function_call FunctionCall { get; set; } +#endif + /// Deprecated in favor of `tools`.A list of functions the model may generate JSON inputs for. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Functions { get; set; } +#nullable restore +#else + public List Functions { get; set; } +#endif + /// Modify the likelihood of specified tokens appearing in the completion.Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateChatCompletionRequest_logit_bias? LogitBias { get; set; } +#nullable restore +#else + public CreateChatCompletionRequest_logit_bias LogitBias { get; set; } +#endif + /// The maximum number of [tokens](/tokenizer) to generate in the chat completion.The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + public int? MaxTokens { get; set; } + /// A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Messages { get; set; } +#nullable restore +#else + public List Messages { get; set; } +#endif + /// ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateChatCompletionRequest_model? Model { get; set; } +#nullable restore +#else + public CreateChatCompletionRequest_model Model { get; set; } +#endif + /// How many chat completion choices to generate for each input message. + public int? N { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.[See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details) + public double? PresencePenalty { get; set; } + /// An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in increased latency and appearance of a "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateChatCompletionRequest_response_format? ResponseFormat { get; set; } +#nullable restore +#else + public CreateChatCompletionRequest_response_format ResponseFormat { get; set; } +#endif + /// This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + public int? Seed { get; set; } + /// Up to 4 sequences where the API will stop generating further tokens. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateChatCompletionRequest_stop? Stop { get; set; } +#nullable restore +#else + public CreateChatCompletionRequest_stop Stop { get; set; } +#endif + /// If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + public bool? Stream { get; set; } + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.We generally recommend altering this or `top_p` but not both. + public double? Temperature { get; set; } + /// Controls which (if any) function is called by the model.`none` means the model will not call a function and instead generates a message.`auto` means the model can pick between generating a message or calling a function.Specifying a particular function via `{"type: "function", "function": {"name": "my_function"}}` forces the model to call that function.`none` is the default when no functions are present. `auto` is the default if functions are present. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionToolChoiceOption? ToolChoice { get; set; } +#nullable restore +#else + public ChatCompletionToolChoiceOption ToolChoice { get; set; } +#endif + /// A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or `temperature` but not both. + public double? TopP { get; set; } + /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new CreateChatCompletionRequest and sets the default values. + /// + public CreateChatCompletionRequest() { + AdditionalData = new Dictionary(); + MaxTokens = 128; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"frequency_penalty", n => { FrequencyPenalty = n.GetDoubleValue(); } }, + {"function_call", n => { FunctionCall = n.GetObjectValue(CreateChatCompletionRequest_function_call.CreateFromDiscriminatorValue); } }, + {"functions", n => { Functions = n.GetCollectionOfObjectValues(ChatCompletionFunctions.CreateFromDiscriminatorValue)?.ToList(); } }, + {"logit_bias", n => { LogitBias = n.GetObjectValue(CreateChatCompletionRequest_logit_bias.CreateFromDiscriminatorValue); } }, + {"max_tokens", n => { MaxTokens = n.GetIntValue(); } }, + {"messages", n => { Messages = n.GetCollectionOfObjectValues(ChatCompletionRequestMessage.CreateFromDiscriminatorValue)?.ToList(); } }, + {"model", n => { Model = n.GetObjectValue(CreateChatCompletionRequest_model.CreateFromDiscriminatorValue); } }, + {"n", n => { N = n.GetIntValue(); } }, + {"presence_penalty", n => { PresencePenalty = n.GetDoubleValue(); } }, + {"response_format", n => { ResponseFormat = n.GetObjectValue(CreateChatCompletionRequest_response_format.CreateFromDiscriminatorValue); } }, + {"seed", n => { Seed = n.GetIntValue(); } }, + {"stop", n => { Stop = n.GetObjectValue(CreateChatCompletionRequest_stop.CreateFromDiscriminatorValue); } }, + {"stream", n => { Stream = n.GetBoolValue(); } }, + {"temperature", n => { Temperature = n.GetDoubleValue(); } }, + {"tool_choice", n => { ToolChoice = n.GetObjectValue(ChatCompletionToolChoiceOption.CreateFromDiscriminatorValue); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(ChatCompletionTool.CreateFromDiscriminatorValue)?.ToList(); } }, + {"top_p", n => { TopP = n.GetDoubleValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDoubleValue("frequency_penalty", FrequencyPenalty); + writer.WriteObjectValue("function_call", FunctionCall); + writer.WriteCollectionOfObjectValues("functions", Functions); + writer.WriteObjectValue("logit_bias", LogitBias); + writer.WriteIntValue("max_tokens", MaxTokens); + writer.WriteCollectionOfObjectValues("messages", Messages); + writer.WriteObjectValue("model", Model); + writer.WriteIntValue("n", N); + writer.WriteDoubleValue("presence_penalty", PresencePenalty); + writer.WriteObjectValue("response_format", ResponseFormat); + writer.WriteIntValue("seed", Seed); + writer.WriteObjectValue("stop", Stop); + writer.WriteBoolValue("stream", Stream); + writer.WriteDoubleValue("temperature", Temperature); + writer.WriteObjectValue("tool_choice", ToolChoice); + writer.WriteCollectionOfObjectValues("tools", Tools); + writer.WriteDoubleValue("top_p", TopP); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes ChatCompletionFunctionCallOption, string + /// + internal class CreateChatCompletionRequest_function_call : IComposedTypeWrapper, IParsable { + /// Composed type representation for type ChatCompletionFunctionCallOption +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionFunctionCallOption? ChatCompletionFunctionCallOption { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.ChatCompletionFunctionCallOption ChatCompletionFunctionCallOption { get; set; } +#endif + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest_function_call CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateChatCompletionRequest_function_call(); + if("ChatCompletionFunctionCallOption".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.ChatCompletionFunctionCallOption = new OpenAI.GeneratedKiotaClient.Models.ChatCompletionFunctionCallOption(); + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(ChatCompletionFunctionCallOption != null) { + return ChatCompletionFunctionCallOption.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(ChatCompletionFunctionCallOption != null) { + writer.WriteObjectValue(null, ChatCompletionFunctionCallOption); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateChatCompletionRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateChatCompletionRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateChatCompletionRequest_stop : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest_stop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateChatCompletionRequest_stop(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_logit_bias.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_logit_bias.cs new file mode 100644 index 0000000..b8ef6cf --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_logit_bias.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Modify the likelihood of specified tokens appearing in the completion.Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + /// + internal class CreateChatCompletionRequest_logit_bias : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateChatCompletionRequest_logit_bias and sets the default values. + /// + public CreateChatCompletionRequest_logit_bias() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest_logit_bias CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionRequest_logit_bias(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format.cs new file mode 100644 index 0000000..a9ae196 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in increased latency and appearance of a "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + /// + internal class CreateChatCompletionRequest_response_format : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Must be one of `text` or `json_object`. + public CreateChatCompletionRequest_response_format_type? Type { get; set; } + /// + /// Instantiates a new CreateChatCompletionRequest_response_format and sets the default values. + /// + public CreateChatCompletionRequest_response_format() { + AdditionalData = new Dictionary(); + Type = CreateChatCompletionRequest_response_format_type.Text; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionRequest_response_format CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionRequest_response_format(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format_type.cs new file mode 100644 index 0000000..7ec46e7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionRequest_response_format_type.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Must be one of `text` or `json_object`. + internal enum CreateChatCompletionRequest_response_format_type { + [EnumMember(Value = "text")] + Text, + [EnumMember(Value = "json_object")] + Json_object, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse.cs new file mode 100644 index 0000000..c9e95ef --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents a chat completion response returned by model, based on the provided input. + /// + internal class CreateChatCompletionResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of chat completion choices. Can be more than one if `n` is greater than 1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Choices { get; set; } +#nullable restore +#else + public List Choices { get; set; } +#endif + /// The Unix timestamp (in seconds) of when the chat completion was created. + public int? Created { get; set; } + /// A unique identifier for the chat completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The model used for the chat completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always `chat.completion`. + public CreateChatCompletionResponse_object? Object { get; set; } + /// This fingerprint represents the backend configuration that the model runs with.Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SystemFingerprint { get; set; } +#nullable restore +#else + public string SystemFingerprint { get; set; } +#endif + /// Usage statistics for the completion request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionUsage? Usage { get; set; } +#nullable restore +#else + public CompletionUsage Usage { get; set; } +#endif + /// + /// Instantiates a new CreateChatCompletionResponse and sets the default values. + /// + public CreateChatCompletionResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"choices", n => { Choices = n.GetCollectionOfObjectValues(CreateChatCompletionResponse_choices.CreateFromDiscriminatorValue)?.ToList(); } }, + {"created", n => { Created = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"system_fingerprint", n => { SystemFingerprint = n.GetStringValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(CompletionUsage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("choices", Choices); + writer.WriteIntValue("created", Created); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("system_fingerprint", SystemFingerprint); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices.cs new file mode 100644 index 0000000..e5f05e6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateChatCompletionResponse_choices : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,`content_filter` if content was omitted due to a flag from our content filters,`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + public CreateChatCompletionResponse_choices_finish_reason? FinishReason { get; set; } + /// The index of the choice in the list of choices. + public int? Index { get; set; } + /// A chat completion message generated by the model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ChatCompletionResponseMessage? Message { get; set; } +#nullable restore +#else + public ChatCompletionResponseMessage Message { get; set; } +#endif + /// + /// Instantiates a new CreateChatCompletionResponse_choices and sets the default values. + /// + public CreateChatCompletionResponse_choices() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateChatCompletionResponse_choices CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateChatCompletionResponse_choices(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"finish_reason", n => { FinishReason = n.GetEnumValue(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"message", n => { Message = n.GetObjectValue(ChatCompletionResponseMessage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("finish_reason", FinishReason); + writer.WriteIntValue("index", Index); + writer.WriteObjectValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices_finish_reason.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices_finish_reason.cs new file mode 100644 index 0000000..86face4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_choices_finish_reason.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,`content_filter` if content was omitted due to a flag from our content filters,`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + internal enum CreateChatCompletionResponse_choices_finish_reason { + [EnumMember(Value = "stop")] + Stop, + [EnumMember(Value = "length")] + Length, + [EnumMember(Value = "tool_calls")] + Tool_calls, + [EnumMember(Value = "content_filter")] + Content_filter, + [EnumMember(Value = "function_call")] + Function_call, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_object.cs new file mode 100644 index 0000000..4888fe1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateChatCompletionResponse_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `chat.completion`. + internal enum CreateChatCompletionResponse_object { + [EnumMember(Value = "chat.completion")] + ChatCompletion, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest.cs new file mode 100644 index 0000000..181f866 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest.cs @@ -0,0 +1,296 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateCompletionRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + public int? BestOf { get; set; } + /// Echo back the prompt in addition to the completion + public bool? Echo { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.[See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details) + public double? FrequencyPenalty { get; set; } + /// Modify the likelihood of specified tokens appearing in the completion.Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionRequest_logit_bias? LogitBias { get; set; } +#nullable restore +#else + public CreateCompletionRequest_logit_bias LogitBias { get; set; } +#endif + /// Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.The maximum value for `logprobs` is 5. + public int? Logprobs { get; set; } + /// The maximum number of [tokens](/tokenizer) to generate in the completion.The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + public int? MaxTokens { get; set; } + /// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionRequest_model? Model { get; set; } +#nullable restore +#else + public CreateCompletionRequest_model Model { get; set; } +#endif + /// How many completions to generate for each prompt.**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + public int? N { get; set; } + /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.[See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details) + public double? PresencePenalty { get; set; } + /// The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionRequest_prompt? Prompt { get; set; } +#nullable restore +#else + public CreateCompletionRequest_prompt Prompt { get; set; } +#endif + /// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + public int? Seed { get; set; } + /// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionRequest_stop? Stop { get; set; } +#nullable restore +#else + public CreateCompletionRequest_stop Stop { get; set; } +#endif + /// Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + public bool? Stream { get; set; } + /// The suffix that comes after a completion of inserted text. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Suffix { get; set; } +#nullable restore +#else + public string Suffix { get; set; } +#endif + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.We generally recommend altering this or `top_p` but not both. + public double? Temperature { get; set; } + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or `temperature` but not both. + public double? TopP { get; set; } + /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new CreateCompletionRequest and sets the default values. + /// + public CreateCompletionRequest() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"best_of", n => { BestOf = n.GetIntValue(); } }, + {"echo", n => { Echo = n.GetBoolValue(); } }, + {"frequency_penalty", n => { FrequencyPenalty = n.GetDoubleValue(); } }, + {"logit_bias", n => { LogitBias = n.GetObjectValue(CreateCompletionRequest_logit_bias.CreateFromDiscriminatorValue); } }, + {"logprobs", n => { Logprobs = n.GetIntValue(); } }, + {"max_tokens", n => { MaxTokens = n.GetIntValue(); } }, + {"model", n => { Model = n.GetObjectValue(CreateCompletionRequest_model.CreateFromDiscriminatorValue); } }, + {"n", n => { N = n.GetIntValue(); } }, + {"presence_penalty", n => { PresencePenalty = n.GetDoubleValue(); } }, + {"prompt", n => { Prompt = n.GetObjectValue(CreateCompletionRequest_prompt.CreateFromDiscriminatorValue); } }, + {"seed", n => { Seed = n.GetIntValue(); } }, + {"stop", n => { Stop = n.GetObjectValue(CreateCompletionRequest_stop.CreateFromDiscriminatorValue); } }, + {"stream", n => { Stream = n.GetBoolValue(); } }, + {"suffix", n => { Suffix = n.GetStringValue(); } }, + {"temperature", n => { Temperature = n.GetDoubleValue(); } }, + {"top_p", n => { TopP = n.GetDoubleValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("best_of", BestOf); + writer.WriteBoolValue("echo", Echo); + writer.WriteDoubleValue("frequency_penalty", FrequencyPenalty); + writer.WriteObjectValue("logit_bias", LogitBias); + writer.WriteIntValue("logprobs", Logprobs); + writer.WriteIntValue("max_tokens", MaxTokens); + writer.WriteObjectValue("model", Model); + writer.WriteIntValue("n", N); + writer.WriteDoubleValue("presence_penalty", PresencePenalty); + writer.WriteObjectValue("prompt", Prompt); + writer.WriteIntValue("seed", Seed); + writer.WriteObjectValue("stop", Stop); + writer.WriteBoolValue("stream", Stream); + writer.WriteStringValue("suffix", Suffix); + writer.WriteDoubleValue("temperature", Temperature); + writer.WriteDoubleValue("top_p", TopP); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateCompletionRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateCompletionRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes CreateCompletionRequest_promptMember1, integer, string + /// + internal class CreateCompletionRequest_prompt : IComposedTypeWrapper, IParsable { + /// Composed type representation for type CreateCompletionRequest_promptMember1 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionRequest_promptMember1? CreateCompletionRequestPromptMember1 { get; set; } +#nullable restore +#else + public CreateCompletionRequest_promptMember1 CreateCompletionRequestPromptMember1 { get; set; } +#endif + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest_prompt CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateCompletionRequest_prompt(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.CreateCompletionRequestPromptMember1 = new CreateCompletionRequest_promptMember1(); + } + else if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(CreateCompletionRequestPromptMember1 != null) { + return CreateCompletionRequestPromptMember1.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(CreateCompletionRequestPromptMember1 != null) { + writer.WriteObjectValue(null, CreateCompletionRequestPromptMember1); + } + else if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateCompletionRequest_stop : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest_stop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateCompletionRequest_stop(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_logit_bias.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_logit_bias.cs new file mode 100644 index 0000000..9891316 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_logit_bias.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Modify the likelihood of specified tokens appearing in the completion.Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + /// + internal class CreateCompletionRequest_logit_bias : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateCompletionRequest_logit_bias and sets the default values. + /// + public CreateCompletionRequest_logit_bias() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest_logit_bias CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionRequest_logit_bias(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_promptMember1.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_promptMember1.cs new file mode 100644 index 0000000..4b6ba25 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionRequest_promptMember1.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateCompletionRequest_promptMember1 : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateCompletionRequest_promptMember1 and sets the default values. + /// + public CreateCompletionRequest_promptMember1() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionRequest_promptMember1 CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionRequest_promptMember1(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse.cs new file mode 100644 index 0000000..e8e748c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). + /// + internal class CreateCompletionResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The list of completion choices the model generated for the input prompt. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Choices { get; set; } +#nullable restore +#else + public List Choices { get; set; } +#endif + /// The Unix timestamp (in seconds) of when the completion was created. + public int? Created { get; set; } + /// A unique identifier for the completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The model used for completion. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always "text_completion" + public CreateCompletionResponse_object? Object { get; set; } + /// This fingerprint represents the backend configuration that the model runs with.Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SystemFingerprint { get; set; } +#nullable restore +#else + public string SystemFingerprint { get; set; } +#endif + /// Usage statistics for the completion request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionUsage? Usage { get; set; } +#nullable restore +#else + public CompletionUsage Usage { get; set; } +#endif + /// + /// Instantiates a new CreateCompletionResponse and sets the default values. + /// + public CreateCompletionResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"choices", n => { Choices = n.GetCollectionOfObjectValues(CreateCompletionResponse_choices.CreateFromDiscriminatorValue)?.ToList(); } }, + {"created", n => { Created = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"system_fingerprint", n => { SystemFingerprint = n.GetStringValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(CompletionUsage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("choices", Choices); + writer.WriteIntValue("created", Created); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("system_fingerprint", SystemFingerprint); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices.cs new file mode 100644 index 0000000..6a26596 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateCompletionResponse_choices : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,or `content_filter` if content was omitted due to a flag from our content filters. + public CreateCompletionResponse_choices_finish_reason? FinishReason { get; set; } + /// The index property + public int? Index { get; set; } + /// The logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateCompletionResponse_choices_logprobs? Logprobs { get; set; } +#nullable restore +#else + public CreateCompletionResponse_choices_logprobs Logprobs { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new CreateCompletionResponse_choices and sets the default values. + /// + public CreateCompletionResponse_choices() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionResponse_choices CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionResponse_choices(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"finish_reason", n => { FinishReason = n.GetEnumValue(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"logprobs", n => { Logprobs = n.GetObjectValue(CreateCompletionResponse_choices_logprobs.CreateFromDiscriminatorValue); } }, + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("finish_reason", FinishReason); + writer.WriteIntValue("index", Index); + writer.WriteObjectValue("logprobs", Logprobs); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_finish_reason.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_finish_reason.cs new file mode 100644 index 0000000..87cf09a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_finish_reason.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,or `content_filter` if content was omitted due to a flag from our content filters. + internal enum CreateCompletionResponse_choices_finish_reason { + [EnumMember(Value = "stop")] + Stop, + [EnumMember(Value = "length")] + Length, + [EnumMember(Value = "content_filter")] + Content_filter, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs.cs new file mode 100644 index 0000000..ccfe8a8 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateCompletionResponse_choices_logprobs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text_offset property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TextOffset { get; set; } +#nullable restore +#else + public List TextOffset { get; set; } +#endif + /// The token_logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TokenLogprobs { get; set; } +#nullable restore +#else + public List TokenLogprobs { get; set; } +#endif + /// The tokens property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tokens { get; set; } +#nullable restore +#else + public List Tokens { get; set; } +#endif + /// The top_logprobs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TopLogprobs { get; set; } +#nullable restore +#else + public List TopLogprobs { get; set; } +#endif + /// + /// Instantiates a new CreateCompletionResponse_choices_logprobs and sets the default values. + /// + public CreateCompletionResponse_choices_logprobs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionResponse_choices_logprobs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionResponse_choices_logprobs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text_offset", n => { TextOffset = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"token_logprobs", n => { TokenLogprobs = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"tokens", n => { Tokens = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"top_logprobs", n => { TopLogprobs = n.GetCollectionOfObjectValues(CreateCompletionResponse_choices_logprobs_top_logprobs.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("text_offset", TextOffset); + writer.WriteCollectionOfPrimitiveValues("token_logprobs", TokenLogprobs); + writer.WriteCollectionOfPrimitiveValues("tokens", Tokens); + writer.WriteCollectionOfObjectValues("top_logprobs", TopLogprobs); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs_top_logprobs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs_top_logprobs.cs new file mode 100644 index 0000000..4009a73 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_choices_logprobs_top_logprobs.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateCompletionResponse_choices_logprobs_top_logprobs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateCompletionResponse_choices_logprobs_top_logprobs and sets the default values. + /// + public CreateCompletionResponse_choices_logprobs_top_logprobs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateCompletionResponse_choices_logprobs_top_logprobs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateCompletionResponse_choices_logprobs_top_logprobs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_object.cs new file mode 100644 index 0000000..672b4fa --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateCompletionResponse_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "text_completion" + internal enum CreateCompletionResponse_object { + [EnumMember(Value = "text_completion")] + Text_completion, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditRequest.cs new file mode 100644 index 0000000..0e46a61 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditRequest.cs @@ -0,0 +1,125 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateEditRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The input text to use as a starting point for the edit. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Input { get; set; } +#nullable restore +#else + public string Input { get; set; } +#endif + /// The instruction that tells the model how to edit the prompt. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instruction { get; set; } +#nullable restore +#else + public string Instruction { get; set; } +#endif + /// ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateEditRequest_model? Model { get; set; } +#nullable restore +#else + public CreateEditRequest_model Model { get; set; } +#endif + /// How many edits to generate for the input and instruction. + public int? N { get; set; } + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.We generally recommend altering this or `top_p` but not both. + public double? Temperature { get; set; } + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or `temperature` but not both. + public double? TopP { get; set; } + /// + /// Instantiates a new CreateEditRequest and sets the default values. + /// + public CreateEditRequest() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEditRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEditRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"input", n => { Input = n.GetStringValue(); } }, + {"instruction", n => { Instruction = n.GetStringValue(); } }, + {"model", n => { Model = n.GetObjectValue(CreateEditRequest_model.CreateFromDiscriminatorValue); } }, + {"n", n => { N = n.GetIntValue(); } }, + {"temperature", n => { Temperature = n.GetDoubleValue(); } }, + {"top_p", n => { TopP = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("input", Input); + writer.WriteStringValue("instruction", Instruction); + writer.WriteObjectValue("model", Model); + writer.WriteIntValue("n", N); + writer.WriteDoubleValue("temperature", Temperature); + writer.WriteDoubleValue("top_p", TopP); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateEditRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEditRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateEditRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse.cs new file mode 100644 index 0000000..bc8db60 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse.cs @@ -0,0 +1,71 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + [Obsolete("")] + internal class CreateEditResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of edit choices. Can be more than one if `n` is greater than 1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Choices { get; set; } +#nullable restore +#else + public List Choices { get; set; } +#endif + /// The Unix timestamp (in seconds) of when the edit was created. + public int? Created { get; set; } + /// The object type, which is always `edit`. + public CreateEditResponse_object? Object { get; set; } + /// Usage statistics for the completion request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CompletionUsage? Usage { get; set; } +#nullable restore +#else + public CompletionUsage Usage { get; set; } +#endif + /// + /// Instantiates a new CreateEditResponse and sets the default values. + /// + public CreateEditResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEditResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEditResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"choices", n => { Choices = n.GetCollectionOfObjectValues(CreateEditResponse_choices.CreateFromDiscriminatorValue)?.ToList(); } }, + {"created", n => { Created = n.GetIntValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(CompletionUsage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("choices", Choices); + writer.WriteIntValue("created", Created); + writer.WriteEnumValue("object", Object); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices.cs new file mode 100644 index 0000000..bf9371e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateEditResponse_choices : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,or `content_filter` if content was omitted due to a flag from our content filters. + public CreateEditResponse_choices_finish_reason? FinishReason { get; set; } + /// The index of the choice in the list of choices. + public int? Index { get; set; } + /// The edited result. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new CreateEditResponse_choices and sets the default values. + /// + public CreateEditResponse_choices() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEditResponse_choices CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEditResponse_choices(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"finish_reason", n => { FinishReason = n.GetEnumValue(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("finish_reason", FinishReason); + writer.WriteIntValue("index", Index); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices_finish_reason.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices_finish_reason.cs new file mode 100644 index 0000000..7718873 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_choices_finish_reason.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,`length` if the maximum number of tokens specified in the request was reached,or `content_filter` if content was omitted due to a flag from our content filters. + internal enum CreateEditResponse_choices_finish_reason { + [EnumMember(Value = "stop")] + Stop, + [EnumMember(Value = "length")] + Length, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_object.cs new file mode 100644 index 0000000..fe67700 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEditResponse_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `edit`. + internal enum CreateEditResponse_object { + [EnumMember(Value = "edit")] + Edit, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest.cs new file mode 100644 index 0000000..f1f63e1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest.cs @@ -0,0 +1,181 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateEmbeddingRequest : IParsable { + /// The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). + public CreateEmbeddingRequest_encoding_format? EncodingFormat { get; set; } + /// Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`) and cannot be an empty string. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateEmbeddingRequest_input? Input { get; set; } +#nullable restore +#else + public CreateEmbeddingRequest_input Input { get; set; } +#endif + /// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateEmbeddingRequest_model? Model { get; set; } +#nullable restore +#else + public CreateEmbeddingRequest_model Model { get; set; } +#endif + /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new CreateEmbeddingRequest and sets the default values. + /// + public CreateEmbeddingRequest() { + EncodingFormat = CreateEmbeddingRequest_encoding_format.Float; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEmbeddingRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"encoding_format", n => { EncodingFormat = n.GetEnumValue(); } }, + {"input", n => { Input = n.GetObjectValue(CreateEmbeddingRequest_input.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetObjectValue(CreateEmbeddingRequest_model.CreateFromDiscriminatorValue); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("encoding_format", EncodingFormat); + writer.WriteObjectValue("input", Input); + writer.WriteObjectValue("model", Model); + writer.WriteStringValue("user", User); + } + /// + /// Composed type wrapper for classes CreateEmbeddingRequest_inputMember1, integer, string + /// + internal class CreateEmbeddingRequest_input : IComposedTypeWrapper, IParsable { + /// Composed type representation for type CreateEmbeddingRequest_inputMember1 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateEmbeddingRequest_inputMember1? CreateEmbeddingRequestInputMember1 { get; set; } +#nullable restore +#else + public CreateEmbeddingRequest_inputMember1 CreateEmbeddingRequestInputMember1 { get; set; } +#endif + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingRequest_input CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateEmbeddingRequest_input(); + if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.CreateEmbeddingRequestInputMember1 = new CreateEmbeddingRequest_inputMember1(); + } + else if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(CreateEmbeddingRequestInputMember1 != null) { + return CreateEmbeddingRequestInputMember1.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(CreateEmbeddingRequestInputMember1 != null) { + writer.WriteObjectValue(null, CreateEmbeddingRequestInputMember1); + } + else if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateEmbeddingRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateEmbeddingRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_encoding_format.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_encoding_format.cs new file mode 100644 index 0000000..df96430 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_encoding_format.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). + internal enum CreateEmbeddingRequest_encoding_format { + [EnumMember(Value = "float")] + Float, + [EnumMember(Value = "base64")] + Base64, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_inputMember1.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_inputMember1.cs new file mode 100644 index 0000000..fe47da9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingRequest_inputMember1.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateEmbeddingRequest_inputMember1 : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateEmbeddingRequest_inputMember1 and sets the default values. + /// + public CreateEmbeddingRequest_inputMember1() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingRequest_inputMember1 CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEmbeddingRequest_inputMember1(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse.cs new file mode 100644 index 0000000..92b5458 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse.cs @@ -0,0 +1,76 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateEmbeddingResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The list of embeddings generated by the model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The name of the model used to generate the embedding. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always "list". + public CreateEmbeddingResponse_object? Object { get; set; } + /// The usage information for the request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateEmbeddingResponse_usage? Usage { get; set; } +#nullable restore +#else + public CreateEmbeddingResponse_usage Usage { get; set; } +#endif + /// + /// Instantiates a new CreateEmbeddingResponse and sets the default values. + /// + public CreateEmbeddingResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEmbeddingResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(Embedding.CreateFromDiscriminatorValue)?.ToList(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"usage", n => { Usage = n.GetObjectValue(CreateEmbeddingResponse_usage.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteObjectValue("usage", Usage); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_object.cs new file mode 100644 index 0000000..faaa008 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "list". + internal enum CreateEmbeddingResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_usage.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_usage.cs new file mode 100644 index 0000000..4d8fdc9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateEmbeddingResponse_usage.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The usage information for the request. + /// + internal class CreateEmbeddingResponse_usage : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of tokens used by the prompt. + public int? PromptTokens { get; set; } + /// The total number of tokens used by the request. + public int? TotalTokens { get; set; } + /// + /// Instantiates a new CreateEmbeddingResponse_usage and sets the default values. + /// + public CreateEmbeddingResponse_usage() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateEmbeddingResponse_usage CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateEmbeddingResponse_usage(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"prompt_tokens", n => { PromptTokens = n.GetIntValue(); } }, + {"total_tokens", n => { TotalTokens = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("prompt_tokens", PromptTokens); + writer.WriteIntValue("total_tokens", TotalTokens); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest.cs new file mode 100644 index 0000000..15b628d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest.cs @@ -0,0 +1,173 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateFineTuneRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The batch size to use for training. The batch size is the number oftraining examples used to train a single forward and backward pass.By default, the batch size will be dynamically configured to be~0.2% of the number of examples in the training set, capped at 256 -in general, we've found that larger batch sizes tend to work betterfor larger datasets. + public int? BatchSize { get; set; } + /// If this is provided, we calculate F-beta scores at the specifiedbeta values. The F-beta score is a generalization of F-1 score.This is only used for binary classification.With a beta of 1 (i.e. the F-1 score), precision and recall aregiven the same weight. A larger beta score puts more weight onrecall and less on precision. A smaller beta score puts more weighton precision and less on recall. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ClassificationBetas { get; set; } +#nullable restore +#else + public List ClassificationBetas { get; set; } +#endif + /// The number of classes in a classification task.This parameter is required for multiclass classification. + public int? ClassificationNClasses { get; set; } + /// The positive class in binary classification.This parameter is needed to generate precision, recall, and F1metrics when doing binary classification. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClassificationPositiveClass { get; set; } +#nullable restore +#else + public string ClassificationPositiveClass { get; set; } +#endif + /// If set, we calculate classification-specific metrics such as accuracyand F-1 score using the validation set at the end of every epoch.These metrics can be viewed in the [results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).In order to compute classification metrics, you must provide a`validation_file`. Additionally, you mustspecify `classification_n_classes` for multiclass classification or`classification_positive_class` for binary classification. + public bool? ComputeClassificationMetrics { get; set; } + /// The hyperparameters used for the fine-tuning job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuneRequest_hyperparameters? Hyperparameters { get; set; } +#nullable restore +#else + public CreateFineTuneRequest_hyperparameters Hyperparameters { get; set; } +#endif + /// The learning rate multiplier to use for training.The fine-tuning learning rate is the original learning rate used forpretraining multiplied by this value.By default, the learning rate multiplier is the 0.05, 0.1, or 0.2depending on final `batch_size` (larger learning rates tend toperform better with larger batch sizes). We recommend experimentingwith values in the range 0.02 to 0.2 to see what produces the bestresults. + public double? LearningRateMultiplier { get; set; } + /// The name of the base model to fine-tune. You can select one of "ada","babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21 and before 2023-08-22.To learn more about these models, see the[Models](/docs/models) documentation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuneRequest_model? Model { get; set; } +#nullable restore +#else + public CreateFineTuneRequest_model Model { get; set; } +#endif + /// The weight to use for loss on the prompt tokens. This controls howmuch the model tries to learn to generate the prompt (as comparedto the completion which always has a weight of 1.0), and can adda stabilizing effect to training when completions are short.If prompts are extremely long (relative to completions), it may makesense to reduce this weight so as to avoid over-prioritizinglearning the prompt. + public double? PromptLossWeight { get; set; } + /// A string of up to 40 characters that will be added to your fine-tuned model name.For example, a `suffix` of "custom-model-name" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Suffix { get; set; } +#nullable restore +#else + public string Suffix { get; set; } +#endif + /// The ID of an uploaded file that contains training data.See [upload file](/docs/api-reference/files/upload) for how to upload a file.Your dataset must be formatted as a JSONL file, where each trainingexample is a JSON object with the keys "prompt" and "completion".Additionally, you must upload your file with the purpose `fine-tune`.See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TrainingFile { get; set; } +#nullable restore +#else + public string TrainingFile { get; set; } +#endif + /// The ID of an uploaded file that contains validation data.If you provide this file, the data is used to generate validationmetrics periodically during fine-tuning. These metrics can be viewed inthe [fine-tuning results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model).Your train and validation data should be mutually exclusive.Your dataset must be formatted as a JSONL file, where each validationexample is a JSON object with the keys "prompt" and "completion".Additionally, you must upload your file with the purpose `fine-tune`.See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ValidationFile { get; set; } +#nullable restore +#else + public string ValidationFile { get; set; } +#endif + /// + /// Instantiates a new CreateFineTuneRequest and sets the default values. + /// + public CreateFineTuneRequest() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuneRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateFineTuneRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"batch_size", n => { BatchSize = n.GetIntValue(); } }, + {"classification_betas", n => { ClassificationBetas = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"classification_n_classes", n => { ClassificationNClasses = n.GetIntValue(); } }, + {"classification_positive_class", n => { ClassificationPositiveClass = n.GetStringValue(); } }, + {"compute_classification_metrics", n => { ComputeClassificationMetrics = n.GetBoolValue(); } }, + {"hyperparameters", n => { Hyperparameters = n.GetObjectValue(CreateFineTuneRequest_hyperparameters.CreateFromDiscriminatorValue); } }, + {"learning_rate_multiplier", n => { LearningRateMultiplier = n.GetDoubleValue(); } }, + {"model", n => { Model = n.GetObjectValue(CreateFineTuneRequest_model.CreateFromDiscriminatorValue); } }, + {"prompt_loss_weight", n => { PromptLossWeight = n.GetDoubleValue(); } }, + {"suffix", n => { Suffix = n.GetStringValue(); } }, + {"training_file", n => { TrainingFile = n.GetStringValue(); } }, + {"validation_file", n => { ValidationFile = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("batch_size", BatchSize); + writer.WriteCollectionOfPrimitiveValues("classification_betas", ClassificationBetas); + writer.WriteIntValue("classification_n_classes", ClassificationNClasses); + writer.WriteStringValue("classification_positive_class", ClassificationPositiveClass); + writer.WriteBoolValue("compute_classification_metrics", ComputeClassificationMetrics); + writer.WriteObjectValue("hyperparameters", Hyperparameters); + writer.WriteDoubleValue("learning_rate_multiplier", LearningRateMultiplier); + writer.WriteObjectValue("model", Model); + writer.WriteDoubleValue("prompt_loss_weight", PromptLossWeight); + writer.WriteStringValue("suffix", Suffix); + writer.WriteStringValue("training_file", TrainingFile); + writer.WriteStringValue("validation_file", ValidationFile); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateFineTuneRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuneRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateFineTuneRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest_hyperparameters.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest_hyperparameters.cs new file mode 100644 index 0000000..182ce14 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuneRequest_hyperparameters.cs @@ -0,0 +1,105 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The hyperparameters used for the fine-tuning job. + /// + internal class CreateFineTuneRequest_hyperparameters : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of epochs to train the model for. An epoch refers to onefull cycle through the training dataset. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuneRequest_hyperparameters_n_epochs? NEpochs { get; set; } +#nullable restore +#else + public CreateFineTuneRequest_hyperparameters_n_epochs NEpochs { get; set; } +#endif + /// + /// Instantiates a new CreateFineTuneRequest_hyperparameters and sets the default values. + /// + public CreateFineTuneRequest_hyperparameters() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuneRequest_hyperparameters CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateFineTuneRequest_hyperparameters(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"n_epochs", n => { NEpochs = n.GetObjectValue(CreateFineTuneRequest_hyperparameters_n_epochs.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n_epochs", NEpochs); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes integer, string + /// + internal class CreateFineTuneRequest_hyperparameters_n_epochs : IComposedTypeWrapper, IParsable { + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuneRequest_hyperparameters_n_epochs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateFineTuneRequest_hyperparameters_n_epochs(); + if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest.cs new file mode 100644 index 0000000..64b7181 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest.cs @@ -0,0 +1,133 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateFineTuningJobRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hyperparameters used for the fine-tuning job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuningJobRequest_hyperparameters? Hyperparameters { get; set; } +#nullable restore +#else + public CreateFineTuningJobRequest_hyperparameters Hyperparameters { get; set; } +#endif + /// The name of the model to fine-tune. You can select one of the[supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuningJobRequest_model? Model { get; set; } +#nullable restore +#else + public CreateFineTuningJobRequest_model Model { get; set; } +#endif + /// A string of up to 18 characters that will be added to your fine-tuned model name.For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Suffix { get; set; } +#nullable restore +#else + public string Suffix { get; set; } +#endif + /// The ID of an uploaded file that contains training data.See [upload file](/docs/api-reference/files/upload) for how to upload a file.Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TrainingFile { get; set; } +#nullable restore +#else + public string TrainingFile { get; set; } +#endif + /// The ID of an uploaded file that contains validation data.If you provide this file, the data is used to generate validationmetrics periodically during fine-tuning. These metrics can be viewed inthe fine-tuning results file.The same data should not be present in both train and validation files.Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ValidationFile { get; set; } +#nullable restore +#else + public string ValidationFile { get; set; } +#endif + /// + /// Instantiates a new CreateFineTuningJobRequest and sets the default values. + /// + public CreateFineTuningJobRequest() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateFineTuningJobRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"hyperparameters", n => { Hyperparameters = n.GetObjectValue(CreateFineTuningJobRequest_hyperparameters.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetObjectValue(CreateFineTuningJobRequest_model.CreateFromDiscriminatorValue); } }, + {"suffix", n => { Suffix = n.GetStringValue(); } }, + {"training_file", n => { TrainingFile = n.GetStringValue(); } }, + {"validation_file", n => { ValidationFile = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("hyperparameters", Hyperparameters); + writer.WriteObjectValue("model", Model); + writer.WriteStringValue("suffix", Suffix); + writer.WriteStringValue("training_file", TrainingFile); + writer.WriteStringValue("validation_file", ValidationFile); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateFineTuningJobRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateFineTuningJobRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest_hyperparameters.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest_hyperparameters.cs new file mode 100644 index 0000000..8d47b4a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateFineTuningJobRequest_hyperparameters.cs @@ -0,0 +1,225 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The hyperparameters used for the fine-tuning job. + /// + internal class CreateFineTuningJobRequest_hyperparameters : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Number of examples in each batch. A larger batch size means that model parametersare updated less frequently, but with lower variance. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuningJobRequest_hyperparameters_batch_size? BatchSize { get; set; } +#nullable restore +#else + public CreateFineTuningJobRequest_hyperparameters_batch_size BatchSize { get; set; } +#endif + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoidoverfitting. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier? LearningRateMultiplier { get; set; } +#nullable restore +#else + public CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier LearningRateMultiplier { get; set; } +#endif + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateFineTuningJobRequest_hyperparameters_n_epochs? NEpochs { get; set; } +#nullable restore +#else + public CreateFineTuningJobRequest_hyperparameters_n_epochs NEpochs { get; set; } +#endif + /// + /// Instantiates a new CreateFineTuningJobRequest_hyperparameters and sets the default values. + /// + public CreateFineTuningJobRequest_hyperparameters() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest_hyperparameters CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateFineTuningJobRequest_hyperparameters(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"batch_size", n => { BatchSize = n.GetObjectValue(CreateFineTuningJobRequest_hyperparameters_batch_size.CreateFromDiscriminatorValue); } }, + {"learning_rate_multiplier", n => { LearningRateMultiplier = n.GetObjectValue(CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier.CreateFromDiscriminatorValue); } }, + {"n_epochs", n => { NEpochs = n.GetObjectValue(CreateFineTuningJobRequest_hyperparameters_n_epochs.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("batch_size", BatchSize); + writer.WriteObjectValue("learning_rate_multiplier", LearningRateMultiplier); + writer.WriteObjectValue("n_epochs", NEpochs); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes integer, string + /// + internal class CreateFineTuningJobRequest_hyperparameters_batch_size : IComposedTypeWrapper, IParsable { + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest_hyperparameters_batch_size CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateFineTuningJobRequest_hyperparameters_batch_size(); + if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes double, string + /// + internal class CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier : IComposedTypeWrapper, IParsable { + /// Composed type representation for type double + public double? Double { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateFineTuningJobRequest_hyperparameters_learning_rate_multiplier(); + if(parseNode.GetDoubleValue() is double doubleValue) { + result.Double = doubleValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Double != null) { + writer.WriteDoubleValue(null, Double); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes integer, string + /// + internal class CreateFineTuningJobRequest_hyperparameters_n_epochs : IComposedTypeWrapper, IParsable { + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateFineTuningJobRequest_hyperparameters_n_epochs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateFineTuningJobRequest_hyperparameters_n_epochs(); + if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest.cs new file mode 100644 index 0000000..4c818bd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest.cs @@ -0,0 +1,137 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateImageRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The model to use for image generation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateImageRequest_model? Model { get; set; } +#nullable restore +#else + public CreateImageRequest_model Model { get; set; } +#endif + /// The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + public int? N { get; set; } + /// A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prompt { get; set; } +#nullable restore +#else + public string Prompt { get; set; } +#endif + /// The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. + public CreateImageRequest_quality? Quality { get; set; } + /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. + public CreateImageRequest_response_format? ResponseFormat { get; set; } + /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. + public CreateImageRequest_size? Size { get; set; } + /// The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + public CreateImageRequest_style? Style { get; set; } + /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? User { get; set; } +#nullable restore +#else + public string User { get; set; } +#endif + /// + /// Instantiates a new CreateImageRequest and sets the default values. + /// + public CreateImageRequest() { + AdditionalData = new Dictionary(); + Quality = CreateImageRequest_quality.Standard; + ResponseFormat = CreateImageRequest_response_format.Url; + Size = CreateImageRequest_size.OneZeroTwoFourx1024; + Style = CreateImageRequest_style.Vivid; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateImageRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateImageRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"model", n => { Model = n.GetObjectValue(CreateImageRequest_model.CreateFromDiscriminatorValue); } }, + {"n", n => { N = n.GetIntValue(); } }, + {"prompt", n => { Prompt = n.GetStringValue(); } }, + {"quality", n => { Quality = n.GetEnumValue(); } }, + {"response_format", n => { ResponseFormat = n.GetEnumValue(); } }, + {"size", n => { Size = n.GetEnumValue(); } }, + {"style", n => { Style = n.GetEnumValue(); } }, + {"user", n => { User = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("model", Model); + writer.WriteIntValue("n", N); + writer.WriteStringValue("prompt", Prompt); + writer.WriteEnumValue("quality", Quality); + writer.WriteEnumValue("response_format", ResponseFormat); + writer.WriteEnumValue("size", Size); + writer.WriteEnumValue("style", Style); + writer.WriteStringValue("user", User); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateImageRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateImageRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateImageRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_quality.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_quality.cs new file mode 100644 index 0000000..3cc70ad --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_quality.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. + internal enum CreateImageRequest_quality { + [EnumMember(Value = "standard")] + Standard, + [EnumMember(Value = "hd")] + Hd, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_response_format.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_response_format.cs new file mode 100644 index 0000000..d1630c2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_response_format.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The format in which the generated images are returned. Must be one of `url` or `b64_json`. + internal enum CreateImageRequest_response_format { + [EnumMember(Value = "url")] + Url, + [EnumMember(Value = "b64_json")] + B64_json, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_size.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_size.cs new file mode 100644 index 0000000..a34d659 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_size.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. + internal enum CreateImageRequest_size { + [EnumMember(Value = "256x256")] + TwoFiveSixx256, + [EnumMember(Value = "512x512")] + FiveOneTwox512, + [EnumMember(Value = "1024x1024")] + OneZeroTwoFourx1024, + [EnumMember(Value = "1792x1024")] + OneSevenNineTwox1024, + [EnumMember(Value = "1024x1792")] + OneZeroTwoFourx1792, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_style.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_style.cs new file mode 100644 index 0000000..80d5a15 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateImageRequest_style.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + internal enum CreateImageRequest_style { + [EnumMember(Value = "vivid")] + Vivid, + [EnumMember(Value = "natural")] + Natural, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest.cs new file mode 100644 index 0000000..0c7add5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateMessageRequest : IParsable { + /// The content of the message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// A list of [File](/docs/api-reference/files) IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like `retrieval` and `code_interpreter` that can access and use files. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateMessageRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public CreateMessageRequest_metadata Metadata { get; set; } +#endif + /// The role of the entity that is creating the message. Currently only `user` is supported. + public CreateMessageRequest_role? Role { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateMessageRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateMessageRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"content", n => { Content = n.GetStringValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(CreateMessageRequest_metadata.CreateFromDiscriminatorValue); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteEnumValue("role", Role); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_metadata.cs new file mode 100644 index 0000000..e4e5a8b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class CreateMessageRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateMessageRequest_metadata and sets the default values. + /// + public CreateMessageRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateMessageRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateMessageRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_role.cs new file mode 100644 index 0000000..059e945 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateMessageRequest_role.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The role of the entity that is creating the message. Currently only `user` is supported. + internal enum CreateMessageRequest_role { + [EnumMember(Value = "user")] + User, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationRequest.cs new file mode 100644 index 0000000..d3ce69f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationRequest.cs @@ -0,0 +1,145 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateModerationRequest : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The input text to classify +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateModerationRequest_input? Input { get; set; } +#nullable restore +#else + public CreateModerationRequest_input Input { get; set; } +#endif + /// Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateModerationRequest_model? Model { get; set; } +#nullable restore +#else + public CreateModerationRequest_model Model { get; set; } +#endif + /// + /// Instantiates a new CreateModerationRequest and sets the default values. + /// + public CreateModerationRequest() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateModerationRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"input", n => { Input = n.GetObjectValue(CreateModerationRequest_input.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetObjectValue(CreateModerationRequest_model.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("input", Input); + writer.WriteObjectValue("model", Model); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateModerationRequest_input : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationRequest_input CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateModerationRequest_input(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateModerationRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateModerationRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse.cs new file mode 100644 index 0000000..2890f1e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents policy compliance report by OpenAI's content moderation model against a given input. + /// + internal class CreateModerationResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The unique identifier for the moderation request. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The model used to generate the moderation results. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// A list of moderation objects. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Results { get; set; } +#nullable restore +#else + public List Results { get; set; } +#endif + /// + /// Instantiates a new CreateModerationResponse and sets the default values. + /// + public CreateModerationResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateModerationResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"results", n => { Results = n.GetCollectionOfObjectValues(CreateModerationResponse_results.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteCollectionOfObjectValues("results", Results); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results.cs new file mode 100644 index 0000000..23a01b9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateModerationResponse_results : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of the categories, and whether they are flagged or not. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateModerationResponse_results_categories? Categories { get; set; } +#nullable restore +#else + public CreateModerationResponse_results_categories Categories { get; set; } +#endif + /// A list of the categories along with their scores as predicted by model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateModerationResponse_results_category_scores? CategoryScores { get; set; } +#nullable restore +#else + public CreateModerationResponse_results_category_scores CategoryScores { get; set; } +#endif + /// Whether the content violates [OpenAI's usage policies](/policies/usage-policies). + public bool? Flagged { get; set; } + /// + /// Instantiates a new CreateModerationResponse_results and sets the default values. + /// + public CreateModerationResponse_results() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationResponse_results CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateModerationResponse_results(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"categories", n => { Categories = n.GetObjectValue(CreateModerationResponse_results_categories.CreateFromDiscriminatorValue); } }, + {"category_scores", n => { CategoryScores = n.GetObjectValue(CreateModerationResponse_results_category_scores.CreateFromDiscriminatorValue); } }, + {"flagged", n => { Flagged = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("categories", Categories); + writer.WriteObjectValue("category_scores", CategoryScores); + writer.WriteBoolValue("flagged", Flagged); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_categories.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_categories.cs new file mode 100644 index 0000000..4561043 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_categories.cs @@ -0,0 +1,89 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A list of the categories, and whether they are flagged or not. + /// + internal class CreateModerationResponse_results_categories : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Content that expresses, incites, or promotes harassing language towards any target. + public bool? Harassment { get; set; } + /// Harassment content that also includes violence or serious harm towards any target. + public bool? HarassmentThreatening { get; set; } + /// Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harrassment. + public bool? Hate { get; set; } + /// Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. + public bool? HateThreatening { get; set; } + /// Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. + public bool? SelfHarm { get; set; } + /// Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. + public bool? SelfHarmInstructions { get; set; } + /// Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. + public bool? SelfHarmIntent { get; set; } + /// Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). + public bool? Sexual { get; set; } + /// Sexual content that includes an individual who is under 18 years old. + public bool? SexualMinors { get; set; } + /// Content that depicts death, violence, or physical injury. + public bool? Violence { get; set; } + /// Content that depicts death, violence, or physical injury in graphic detail. + public bool? ViolenceGraphic { get; set; } + /// + /// Instantiates a new CreateModerationResponse_results_categories and sets the default values. + /// + public CreateModerationResponse_results_categories() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationResponse_results_categories CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateModerationResponse_results_categories(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"harassment", n => { Harassment = n.GetBoolValue(); } }, + {"harassment/threatening", n => { HarassmentThreatening = n.GetBoolValue(); } }, + {"hate", n => { Hate = n.GetBoolValue(); } }, + {"hate/threatening", n => { HateThreatening = n.GetBoolValue(); } }, + {"self-harm", n => { SelfHarm = n.GetBoolValue(); } }, + {"self-harm/instructions", n => { SelfHarmInstructions = n.GetBoolValue(); } }, + {"self-harm/intent", n => { SelfHarmIntent = n.GetBoolValue(); } }, + {"sexual", n => { Sexual = n.GetBoolValue(); } }, + {"sexual/minors", n => { SexualMinors = n.GetBoolValue(); } }, + {"violence", n => { Violence = n.GetBoolValue(); } }, + {"violence/graphic", n => { ViolenceGraphic = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("harassment", Harassment); + writer.WriteBoolValue("harassment/threatening", HarassmentThreatening); + writer.WriteBoolValue("hate", Hate); + writer.WriteBoolValue("hate/threatening", HateThreatening); + writer.WriteBoolValue("self-harm", SelfHarm); + writer.WriteBoolValue("self-harm/instructions", SelfHarmInstructions); + writer.WriteBoolValue("self-harm/intent", SelfHarmIntent); + writer.WriteBoolValue("sexual", Sexual); + writer.WriteBoolValue("sexual/minors", SexualMinors); + writer.WriteBoolValue("violence", Violence); + writer.WriteBoolValue("violence/graphic", ViolenceGraphic); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_category_scores.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_category_scores.cs new file mode 100644 index 0000000..fcc15d1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateModerationResponse_results_category_scores.cs @@ -0,0 +1,89 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A list of the categories along with their scores as predicted by model. + /// + internal class CreateModerationResponse_results_category_scores : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The score for the category 'harassment'. + public double? Harassment { get; set; } + /// The score for the category 'harassment/threatening'. + public double? HarassmentThreatening { get; set; } + /// The score for the category 'hate'. + public double? Hate { get; set; } + /// The score for the category 'hate/threatening'. + public double? HateThreatening { get; set; } + /// The score for the category 'self-harm'. + public double? SelfHarm { get; set; } + /// The score for the category 'self-harm/instructions'. + public double? SelfHarmInstructions { get; set; } + /// The score for the category 'self-harm/intent'. + public double? SelfHarmIntent { get; set; } + /// The score for the category 'sexual'. + public double? Sexual { get; set; } + /// The score for the category 'sexual/minors'. + public double? SexualMinors { get; set; } + /// The score for the category 'violence'. + public double? Violence { get; set; } + /// The score for the category 'violence/graphic'. + public double? ViolenceGraphic { get; set; } + /// + /// Instantiates a new CreateModerationResponse_results_category_scores and sets the default values. + /// + public CreateModerationResponse_results_category_scores() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateModerationResponse_results_category_scores CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateModerationResponse_results_category_scores(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"harassment", n => { Harassment = n.GetDoubleValue(); } }, + {"harassment/threatening", n => { HarassmentThreatening = n.GetDoubleValue(); } }, + {"hate", n => { Hate = n.GetDoubleValue(); } }, + {"hate/threatening", n => { HateThreatening = n.GetDoubleValue(); } }, + {"self-harm", n => { SelfHarm = n.GetDoubleValue(); } }, + {"self-harm/instructions", n => { SelfHarmInstructions = n.GetDoubleValue(); } }, + {"self-harm/intent", n => { SelfHarmIntent = n.GetDoubleValue(); } }, + {"sexual", n => { Sexual = n.GetDoubleValue(); } }, + {"sexual/minors", n => { SexualMinors = n.GetDoubleValue(); } }, + {"violence", n => { Violence = n.GetDoubleValue(); } }, + {"violence/graphic", n => { ViolenceGraphic = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDoubleValue("harassment", Harassment); + writer.WriteDoubleValue("harassment/threatening", HarassmentThreatening); + writer.WriteDoubleValue("hate", Hate); + writer.WriteDoubleValue("hate/threatening", HateThreatening); + writer.WriteDoubleValue("self-harm", SelfHarm); + writer.WriteDoubleValue("self-harm/instructions", SelfHarmInstructions); + writer.WriteDoubleValue("self-harm/intent", SelfHarmIntent); + writer.WriteDoubleValue("sexual", Sexual); + writer.WriteDoubleValue("sexual/minors", SexualMinors); + writer.WriteDoubleValue("violence", Violence); + writer.WriteDoubleValue("violence/graphic", ViolenceGraphic); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest.cs new file mode 100644 index 0000000..b7f364a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest.cs @@ -0,0 +1,162 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateRunRequest : IParsable { + /// The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateRunRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public CreateRunRequest_metadata Metadata { get; set; } +#endif + /// The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateRunRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateRunRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(CreateRunRequest_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(CreateRunRequest_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteCollectionOfObjectValues("tools", Tools); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class CreateRunRequest_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateRunRequest_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateRunRequest_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest_metadata.cs new file mode 100644 index 0000000..41166cb --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateRunRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class CreateRunRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateRunRequest_metadata and sets the default values. + /// + public CreateRunRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateRunRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateRunRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest.cs new file mode 100644 index 0000000..8ab2afd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateSpeechRequest : IParsable { + /// The text to generate audio for. The maximum length is 4096 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Input { get; set; } +#nullable restore +#else + public string Input { get; set; } +#endif + /// One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd` +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateSpeechRequest_model? Model { get; set; } +#nullable restore +#else + public CreateSpeechRequest_model Model { get; set; } +#endif + /// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`. + public CreateSpeechRequest_response_format? ResponseFormat { get; set; } + /// The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. + public double? Speed { get; set; } + /// The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. + public CreateSpeechRequest_voice? Voice { get; set; } + /// + /// Instantiates a new CreateSpeechRequest and sets the default values. + /// + public CreateSpeechRequest() { + ResponseFormat = CreateSpeechRequest_response_format.Mp3; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateSpeechRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateSpeechRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"input", n => { Input = n.GetStringValue(); } }, + {"model", n => { Model = n.GetObjectValue(CreateSpeechRequest_model.CreateFromDiscriminatorValue); } }, + {"response_format", n => { ResponseFormat = n.GetEnumValue(); } }, + {"speed", n => { Speed = n.GetDoubleValue(); } }, + {"voice", n => { Voice = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("input", Input); + writer.WriteObjectValue("model", Model); + writer.WriteEnumValue("response_format", ResponseFormat); + writer.WriteDoubleValue("speed", Speed); + writer.WriteEnumValue("voice", Voice); + } + /// + /// Composed type wrapper for classes string + /// + internal class CreateSpeechRequest_model : IComposedTypeWrapper, IParsable { + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateSpeechRequest_model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var result = new CreateSpeechRequest_model(); + if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_response_format.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_response_format.cs new file mode 100644 index 0000000..37b89a6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_response_format.cs @@ -0,0 +1,17 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`. + internal enum CreateSpeechRequest_response_format { + [EnumMember(Value = "mp3")] + Mp3, + [EnumMember(Value = "opus")] + Opus, + [EnumMember(Value = "aac")] + Aac, + [EnumMember(Value = "flac")] + Flac, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_voice.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_voice.cs new file mode 100644 index 0000000..b8db843 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateSpeechRequest_voice.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. + internal enum CreateSpeechRequest_voice { + [EnumMember(Value = "alloy")] + Alloy, + [EnumMember(Value = "echo")] + Echo, + [EnumMember(Value = "fable")] + Fable, + [EnumMember(Value = "onyx")] + Onyx, + [EnumMember(Value = "nova")] + Nova, + [EnumMember(Value = "shimmer")] + Shimmer, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest.cs new file mode 100644 index 0000000..57c2a6d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest.cs @@ -0,0 +1,172 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateThreadAndRunRequest : IParsable { + /// The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateThreadAndRunRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public CreateThreadAndRunRequest_metadata Metadata { get; set; } +#endif + /// The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The thread property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateThreadRequest? Thread { get; set; } +#nullable restore +#else + public CreateThreadRequest Thread { get; set; } +#endif + /// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateThreadAndRunRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateThreadAndRunRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(CreateThreadAndRunRequest_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"thread", n => { Thread = n.GetObjectValue(CreateThreadRequest.CreateFromDiscriminatorValue); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(CreateThreadAndRunRequest_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteObjectValue("thread", Thread); + writer.WriteCollectionOfObjectValues("tools", Tools); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class CreateThreadAndRunRequest_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateThreadAndRunRequest_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new CreateThreadAndRunRequest_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest_metadata.cs new file mode 100644 index 0000000..3ab9528 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadAndRunRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class CreateThreadAndRunRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateThreadAndRunRequest_metadata and sets the default values. + /// + public CreateThreadAndRunRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateThreadAndRunRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateThreadAndRunRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest.cs new file mode 100644 index 0000000..553e562 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateThreadRequest : IParsable { + /// A list of [messages](/docs/api-reference/messages) to start the thread with. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Messages { get; set; } +#nullable restore +#else + public List Messages { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public CreateThreadRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public CreateThreadRequest_metadata Metadata { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateThreadRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateThreadRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"messages", n => { Messages = n.GetCollectionOfObjectValues(CreateMessageRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(CreateThreadRequest_metadata.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("messages", Messages); + writer.WriteObjectValue("metadata", Metadata); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest_metadata.cs new file mode 100644 index 0000000..998a6bc --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateThreadRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class CreateThreadRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new CreateThreadRequest_metadata and sets the default values. + /// + public CreateThreadRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateThreadRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateThreadRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranscriptionResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranscriptionResponse.cs new file mode 100644 index 0000000..3f0884c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranscriptionResponse.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateTranscriptionResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new CreateTranscriptionResponse and sets the default values. + /// + public CreateTranscriptionResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateTranscriptionResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateTranscriptionResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranslationResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranslationResponse.cs new file mode 100644 index 0000000..71169c3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/CreateTranslationResponse.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class CreateTranslationResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// + /// Instantiates a new CreateTranslationResponse and sets the default values. + /// + public CreateTranslationResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateTranslationResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateTranslationResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse.cs new file mode 100644 index 0000000..2f55941 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse.cs @@ -0,0 +1,63 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Deletes the association between the assistant and the file, but does not delete the [File](/docs/api-reference/files) object itself. + /// + internal class DeleteAssistantFileResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deleted property + public bool? Deleted { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object property + public DeleteAssistantFileResponse_object? Object { get; set; } + /// + /// Instantiates a new DeleteAssistantFileResponse and sets the default values. + /// + public DeleteAssistantFileResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeleteAssistantFileResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeleteAssistantFileResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"deleted", n => { Deleted = n.GetBoolValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("deleted", Deleted); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse_object.cs new file mode 100644 index 0000000..f10e7a3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantFileResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum DeleteAssistantFileResponse_object { + [EnumMember(Value = "assistant.file.deleted")] + AssistantFileDeleted, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse.cs new file mode 100644 index 0000000..939f9b1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class DeleteAssistantResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deleted property + public bool? Deleted { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object property + public DeleteAssistantResponse_object? Object { get; set; } + /// + /// Instantiates a new DeleteAssistantResponse and sets the default values. + /// + public DeleteAssistantResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeleteAssistantResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeleteAssistantResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"deleted", n => { Deleted = n.GetBoolValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("deleted", Deleted); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse_object.cs new file mode 100644 index 0000000..56cebb5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteAssistantResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum DeleteAssistantResponse_object { + [EnumMember(Value = "assistant.deleted")] + AssistantDeleted, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse.cs new file mode 100644 index 0000000..8c90eb7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class DeleteFileResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deleted property + public bool? Deleted { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object property + public DeleteFileResponse_object? Object { get; set; } + /// + /// Instantiates a new DeleteFileResponse and sets the default values. + /// + public DeleteFileResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeleteFileResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeleteFileResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"deleted", n => { Deleted = n.GetBoolValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("deleted", Deleted); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse_object.cs new file mode 100644 index 0000000..00d5958 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteFileResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum DeleteFileResponse_object { + [EnumMember(Value = "file")] + File, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteModelResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteModelResponse.cs new file mode 100644 index 0000000..18333d7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteModelResponse.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class DeleteModelResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deleted property + public bool? Deleted { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new DeleteModelResponse and sets the default values. + /// + public DeleteModelResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeleteModelResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeleteModelResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"deleted", n => { Deleted = n.GetBoolValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("deleted", Deleted); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse.cs new file mode 100644 index 0000000..c37f3b7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class DeleteThreadResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The deleted property + public bool? Deleted { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object property + public DeleteThreadResponse_object? Object { get; set; } + /// + /// Instantiates a new DeleteThreadResponse and sets the default values. + /// + public DeleteThreadResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeleteThreadResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeleteThreadResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"deleted", n => { Deleted = n.GetBoolValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("deleted", Deleted); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse_object.cs new file mode 100644 index 0000000..6804095 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/DeleteThreadResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum DeleteThreadResponse_object { + [EnumMember(Value = "thread.deleted")] + ThreadDeleted, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding.cs new file mode 100644 index 0000000..98dd412 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding.cs @@ -0,0 +1,63 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents an embedding vector returned by embedding endpoint. + /// + internal class Embedding : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EmbeddingProp { get; set; } +#nullable restore +#else + public List EmbeddingProp { get; set; } +#endif + /// The index of the embedding in the list of embeddings. + public int? Index { get; set; } + /// The object type, which is always "embedding". + public Embedding_object? Object { get; set; } + /// + /// Instantiates a new Embedding and sets the default values. + /// + public Embedding() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static Embedding CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Embedding(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"embedding", n => { EmbeddingProp = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"index", n => { Index = n.GetIntValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("embedding", EmbeddingProp); + writer.WriteIntValue("index", Index); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding_object.cs new file mode 100644 index 0000000..6181300 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Embedding_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "embedding". + internal enum Embedding_object { + [EnumMember(Value = "embedding")] + Embedding, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune.cs new file mode 100644 index 0000000..8da6d57 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune.cs @@ -0,0 +1,158 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The `FineTune` object represents a legacy fine-tune job that has been created through the API. + /// + [Obsolete("")] + internal class FineTune : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) for when the fine-tuning job was created. + public int? CreatedAt { get; set; } + /// The list of events that have been observed in the lifecycle of the FineTune job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Events { get; set; } +#nullable restore +#else + public List Events { get; set; } +#endif + /// The name of the fine-tuned model that is being created. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FineTunedModel { get; set; } +#nullable restore +#else + public string FineTunedModel { get; set; } +#endif + /// The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FineTune_hyperparams? Hyperparams { get; set; } +#nullable restore +#else + public FineTune_hyperparams Hyperparams { get; set; } +#endif + /// The object identifier, which can be referenced in the API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The base model that is being fine-tuned. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always "fine-tune". + public FineTune_object? Object { get; set; } + /// The organization that owns the fine-tuning job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OrganizationId { get; set; } +#nullable restore +#else + public string OrganizationId { get; set; } +#endif + /// The compiled results files for the fine-tuning job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ResultFiles { get; set; } +#nullable restore +#else + public List ResultFiles { get; set; } +#endif + /// The current status of the fine-tuning job, which can be either `created`, `running`, `succeeded`, `failed`, or `cancelled`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status { get; set; } +#nullable restore +#else + public string Status { get; set; } +#endif + /// The list of files used for training. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TrainingFiles { get; set; } +#nullable restore +#else + public List TrainingFiles { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the fine-tuning job was last updated. + public int? UpdatedAt { get; set; } + /// The list of files used for validation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ValidationFiles { get; set; } +#nullable restore +#else + public List ValidationFiles { get; set; } +#endif + /// + /// Instantiates a new FineTune and sets the default values. + /// + public FineTune() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTune CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTune(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"events", n => { Events = n.GetCollectionOfObjectValues(FineTuneEvent.CreateFromDiscriminatorValue)?.ToList(); } }, + {"fine_tuned_model", n => { FineTunedModel = n.GetStringValue(); } }, + {"hyperparams", n => { Hyperparams = n.GetObjectValue(FineTune_hyperparams.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"organization_id", n => { OrganizationId = n.GetStringValue(); } }, + {"result_files", n => { ResultFiles = n.GetCollectionOfObjectValues(OpenAIFile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"status", n => { Status = n.GetStringValue(); } }, + {"training_files", n => { TrainingFiles = n.GetCollectionOfObjectValues(OpenAIFile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"updated_at", n => { UpdatedAt = n.GetIntValue(); } }, + {"validation_files", n => { ValidationFiles = n.GetCollectionOfObjectValues(OpenAIFile.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteCollectionOfObjectValues("events", Events); + writer.WriteStringValue("fine_tuned_model", FineTunedModel); + writer.WriteObjectValue("hyperparams", Hyperparams); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("organization_id", OrganizationId); + writer.WriteCollectionOfObjectValues("result_files", ResultFiles); + writer.WriteStringValue("status", Status); + writer.WriteCollectionOfObjectValues("training_files", TrainingFiles); + writer.WriteIntValue("updated_at", UpdatedAt); + writer.WriteCollectionOfObjectValues("validation_files", ValidationFiles); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent.cs new file mode 100644 index 0000000..75489ec --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Fine-tune event object + /// + [Obsolete("")] + internal class FineTuneEvent : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The created_at property + public int? CreatedAt { get; set; } + /// The level property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Level { get; set; } +#nullable restore +#else + public string Level { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The object property + public FineTuneEvent_object? Object { get; set; } + /// + /// Instantiates a new FineTuneEvent and sets the default values. + /// + public FineTuneEvent() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuneEvent CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTuneEvent(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"level", n => { Level = n.GetStringValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("level", Level); + writer.WriteStringValue("message", Message); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent_object.cs new file mode 100644 index 0000000..4fe536c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuneEvent_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum FineTuneEvent_object { + [EnumMember(Value = "fine-tune-event")] + FineTuneEvent, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_hyperparams.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_hyperparams.cs new file mode 100644 index 0000000..0618720 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_hyperparams.cs @@ -0,0 +1,79 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters) for more details. + /// + internal class FineTune_hyperparams : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The batch size to use for training. The batch size is the number oftraining examples used to train a single forward and backward pass. + public int? BatchSize { get; set; } + /// The number of classes to use for computing classification metrics. + public int? ClassificationNClasses { get; set; } + /// The positive class to use for computing classification metrics. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ClassificationPositiveClass { get; set; } +#nullable restore +#else + public string ClassificationPositiveClass { get; set; } +#endif + /// The classification metrics to compute using the validation dataset at the end of every epoch. + public bool? ComputeClassificationMetrics { get; set; } + /// The learning rate multiplier to use for training. + public double? LearningRateMultiplier { get; set; } + /// The number of epochs to train the model for. An epoch refers to onefull cycle through the training dataset. + public int? NEpochs { get; set; } + /// The weight to use for loss on the prompt tokens. + public double? PromptLossWeight { get; set; } + /// + /// Instantiates a new FineTune_hyperparams and sets the default values. + /// + public FineTune_hyperparams() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTune_hyperparams CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTune_hyperparams(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"batch_size", n => { BatchSize = n.GetIntValue(); } }, + {"classification_n_classes", n => { ClassificationNClasses = n.GetIntValue(); } }, + {"classification_positive_class", n => { ClassificationPositiveClass = n.GetStringValue(); } }, + {"compute_classification_metrics", n => { ComputeClassificationMetrics = n.GetBoolValue(); } }, + {"learning_rate_multiplier", n => { LearningRateMultiplier = n.GetDoubleValue(); } }, + {"n_epochs", n => { NEpochs = n.GetIntValue(); } }, + {"prompt_loss_weight", n => { PromptLossWeight = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("batch_size", BatchSize); + writer.WriteIntValue("classification_n_classes", ClassificationNClasses); + writer.WriteStringValue("classification_positive_class", ClassificationPositiveClass); + writer.WriteBoolValue("compute_classification_metrics", ComputeClassificationMetrics); + writer.WriteDoubleValue("learning_rate_multiplier", LearningRateMultiplier); + writer.WriteIntValue("n_epochs", NEpochs); + writer.WriteDoubleValue("prompt_loss_weight", PromptLossWeight); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_object.cs new file mode 100644 index 0000000..fef3645 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTune_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "fine-tune". + internal enum FineTune_object { + [EnumMember(Value = "fine-tune")] + FineTune, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob.cs new file mode 100644 index 0000000..d5b38cb --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + /// + internal class FineTuningJob : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) for when the fine-tuning job was created. + public int? CreatedAt { get; set; } + /// For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FineTuningJob_error? Error { get; set; } +#nullable restore +#else + public FineTuningJob_error Error { get; set; } +#endif + /// The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FineTunedModel { get; set; } +#nullable restore +#else + public string FineTunedModel { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. + public int? FinishedAt { get; set; } + /// The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FineTuningJob_hyperparameters? Hyperparameters { get; set; } +#nullable restore +#else + public FineTuningJob_hyperparameters Hyperparameters { get; set; } +#endif + /// The object identifier, which can be referenced in the API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The base model that is being fine-tuned. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always "fine_tuning.job". + public FineTuningJob_object? Object { get; set; } + /// The organization that owns the fine-tuning job. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OrganizationId { get; set; } +#nullable restore +#else + public string OrganizationId { get; set; } +#endif + /// The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ResultFiles { get; set; } +#nullable restore +#else + public List ResultFiles { get; set; } +#endif + /// The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + public FineTuningJob_status? Status { get; set; } + /// The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. + public int? TrainedTokens { get; set; } + /// The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TrainingFile { get; set; } +#nullable restore +#else + public string TrainingFile { get; set; } +#endif + /// The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ValidationFile { get; set; } +#nullable restore +#else + public string ValidationFile { get; set; } +#endif + /// + /// Instantiates a new FineTuningJob and sets the default values. + /// + public FineTuningJob() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuningJob CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTuningJob(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"error", n => { Error = n.GetObjectValue(FineTuningJob_error.CreateFromDiscriminatorValue); } }, + {"fine_tuned_model", n => { FineTunedModel = n.GetStringValue(); } }, + {"finished_at", n => { FinishedAt = n.GetIntValue(); } }, + {"hyperparameters", n => { Hyperparameters = n.GetObjectValue(FineTuningJob_hyperparameters.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"organization_id", n => { OrganizationId = n.GetStringValue(); } }, + {"result_files", n => { ResultFiles = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"status", n => { Status = n.GetEnumValue(); } }, + {"trained_tokens", n => { TrainedTokens = n.GetIntValue(); } }, + {"training_file", n => { TrainingFile = n.GetStringValue(); } }, + {"validation_file", n => { ValidationFile = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteObjectValue("error", Error); + writer.WriteStringValue("fine_tuned_model", FineTunedModel); + writer.WriteIntValue("finished_at", FinishedAt); + writer.WriteObjectValue("hyperparameters", Hyperparameters); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("organization_id", OrganizationId); + writer.WriteCollectionOfPrimitiveValues("result_files", ResultFiles); + writer.WriteEnumValue("status", Status); + writer.WriteIntValue("trained_tokens", TrainedTokens); + writer.WriteStringValue("training_file", TrainingFile); + writer.WriteStringValue("validation_file", ValidationFile); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent.cs new file mode 100644 index 0000000..435325a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent.cs @@ -0,0 +1,77 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Fine-tuning job event object + /// + internal class FineTuningJobEvent : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The created_at property + public int? CreatedAt { get; set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The level property + public FineTuningJobEvent_level? Level { get; set; } + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The object property + public FineTuningJobEvent_object? Object { get; set; } + /// + /// Instantiates a new FineTuningJobEvent and sets the default values. + /// + public FineTuningJobEvent() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuningJobEvent CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTuningJobEvent(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"level", n => { Level = n.GetEnumValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("level", Level); + writer.WriteStringValue("message", Message); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_level.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_level.cs new file mode 100644 index 0000000..1c2a8a9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_level.cs @@ -0,0 +1,14 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum FineTuningJobEvent_level { + [EnumMember(Value = "info")] + Info, + [EnumMember(Value = "warn")] + Warn, + [EnumMember(Value = "error")] + Error, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_object.cs new file mode 100644 index 0000000..3fd18ad --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJobEvent_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum FineTuningJobEvent_object { + [EnumMember(Value = "fine_tuning.job.event")] + Fine_tuningJobEvent, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_error.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_error.cs new file mode 100644 index 0000000..8ec5c27 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_error.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. + /// + internal class FineTuningJob_error : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A machine-readable error code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// A human-readable error message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Param { get; set; } +#nullable restore +#else + public string Param { get; set; } +#endif + /// + /// Instantiates a new FineTuningJob_error and sets the default values. + /// + public FineTuningJob_error() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuningJob_error CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTuningJob_error(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code", n => { Code = n.GetStringValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + {"param", n => { Param = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteStringValue("param", Param); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_hyperparameters.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_hyperparameters.cs new file mode 100644 index 0000000..851d715 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_hyperparameters.cs @@ -0,0 +1,105 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + /// + internal class FineTuningJob_hyperparameters : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset."auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FineTuningJob_hyperparameters_n_epochs? NEpochs { get; set; } +#nullable restore +#else + public FineTuningJob_hyperparameters_n_epochs NEpochs { get; set; } +#endif + /// + /// Instantiates a new FineTuningJob_hyperparameters and sets the default values. + /// + public FineTuningJob_hyperparameters() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuningJob_hyperparameters CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FineTuningJob_hyperparameters(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"n_epochs", n => { NEpochs = n.GetObjectValue(FineTuningJob_hyperparameters_n_epochs.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n_epochs", NEpochs); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes integer, string + /// + internal class FineTuningJob_hyperparameters_n_epochs : IComposedTypeWrapper, IParsable { + /// Composed type representation for type integer + public int? Integer { get; set; } + /// Composed type representation for type string +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? String { get; set; } +#nullable restore +#else + public string String { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FineTuningJob_hyperparameters_n_epochs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new FineTuningJob_hyperparameters_n_epochs(); + if(parseNode.GetIntValue() is int integerValue) { + result.Integer = integerValue; + } + else if(parseNode.GetStringValue() is string stringValue) { + result.String = stringValue; + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(Integer != null) { + writer.WriteIntValue(null, Integer); + } + else if(String != null) { + writer.WriteStringValue(null, String); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_object.cs new file mode 100644 index 0000000..6c82236 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "fine_tuning.job". + internal enum FineTuningJob_object { + [EnumMember(Value = "fine_tuning.job")] + Fine_tuningJob, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_status.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_status.cs new file mode 100644 index 0000000..15b09fb --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FineTuningJob_status.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + internal enum FineTuningJob_status { + [EnumMember(Value = "validating_files")] + Validating_files, + [EnumMember(Value = "queued")] + Queued, + [EnumMember(Value = "running")] + Running, + [EnumMember(Value = "succeeded")] + Succeeded, + [EnumMember(Value = "failed")] + Failed, + [EnumMember(Value = "cancelled")] + Cancelled, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionObject.cs new file mode 100644 index 0000000..36bf635 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionObject.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class FunctionObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A description of what the function does, used by the model to choose when and how to call the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.To describe a function that accepts no parameters, provide the value `{"type": "object", "properties": {}}`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FunctionParameters? Parameters { get; set; } +#nullable restore +#else + public FunctionParameters Parameters { get; set; } +#endif + /// + /// Instantiates a new FunctionObject and sets the default values. + /// + public FunctionObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FunctionObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FunctionObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"description", n => { Description = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"parameters", n => { Parameters = n.GetObjectValue(FunctionParameters.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("parameters", Parameters); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionParameters.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionParameters.cs new file mode 100644 index 0000000..54a0345 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/FunctionParameters.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.To describe a function that accepts no parameters, provide the value `{"type": "object", "properties": {}}`. + /// + internal class FunctionParameters : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new FunctionParameters and sets the default values. + /// + public FunctionParameters() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FunctionParameters CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FunctionParameters(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Image.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Image.cs new file mode 100644 index 0000000..c9aa8ca --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Image.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents the url or the content of an image generated by the OpenAI API. + /// + internal class Image : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The base64-encoded JSON of the generated image, if `response_format` is `b64_json`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? B64Json { get; set; } +#nullable restore +#else + public string B64Json { get; set; } +#endif + /// The prompt that was used to generate the image, if there was any revision to the prompt. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RevisedPrompt { get; set; } +#nullable restore +#else + public string RevisedPrompt { get; set; } +#endif + /// The URL of the generated image, if `response_format` is `url` (default). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new Image and sets the default values. + /// + public Image() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static Image CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Image(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"b64_json", n => { B64Json = n.GetStringValue(); } }, + {"revised_prompt", n => { RevisedPrompt = n.GetStringValue(); } }, + {"url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("b64_json", B64Json); + writer.WriteStringValue("revised_prompt", RevisedPrompt); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ImagesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ImagesResponse.cs new file mode 100644 index 0000000..8cdfa1c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ImagesResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ImagesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The created property + public int? Created { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// + /// Instantiates a new ImagesResponse and sets the default values. + /// + public ImagesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImagesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created", n => { Created = n.GetIntValue(); } }, + {"data", n => { Data = n.GetCollectionOfObjectValues(Image.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created", Created); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantFilesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantFilesResponse.cs new file mode 100644 index 0000000..85ed210 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantFilesResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListAssistantFilesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListAssistantFilesResponse and sets the default values. + /// + public ListAssistantFilesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListAssistantFilesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListAssistantFilesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(AssistantFileObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantsResponse.cs new file mode 100644 index 0000000..4f51419 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListAssistantsResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListAssistantsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListAssistantsResponse and sets the default values. + /// + public ListAssistantsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListAssistantsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListAssistantsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(AssistantObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse.cs new file mode 100644 index 0000000..41a53b7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListFilesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The object property + public ListFilesResponse_object? Object { get; set; } + /// + /// Instantiates a new ListFilesResponse and sets the default values. + /// + public ListFilesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListFilesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListFilesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(OpenAIFile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse_object.cs new file mode 100644 index 0000000..44ab962 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFilesResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListFilesResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse.cs new file mode 100644 index 0000000..088f089 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListFineTuneEventsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The object property + public ListFineTuneEventsResponse_object? Object { get; set; } + /// + /// Instantiates a new ListFineTuneEventsResponse and sets the default values. + /// + public ListFineTuneEventsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListFineTuneEventsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListFineTuneEventsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(FineTuneEvent.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse_object.cs new file mode 100644 index 0000000..be58b0a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuneEventsResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListFineTuneEventsResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse.cs new file mode 100644 index 0000000..cf892f3 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListFineTunesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The object property + public ListFineTunesResponse_object? Object { get; set; } + /// + /// Instantiates a new ListFineTunesResponse and sets the default values. + /// + public ListFineTunesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListFineTunesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListFineTunesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(FineTune.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse_object.cs new file mode 100644 index 0000000..4e217ab --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTunesResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListFineTunesResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse.cs new file mode 100644 index 0000000..a2c5123 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListFineTuningJobEventsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The object property + public ListFineTuningJobEventsResponse_object? Object { get; set; } + /// + /// Instantiates a new ListFineTuningJobEventsResponse and sets the default values. + /// + public ListFineTuningJobEventsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListFineTuningJobEventsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListFineTuningJobEventsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(FineTuningJobEvent.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse_object.cs new file mode 100644 index 0000000..590d449 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListFineTuningJobEventsResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListFineTuningJobEventsResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessageFilesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessageFilesResponse.cs new file mode 100644 index 0000000..61fc938 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessageFilesResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListMessageFilesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListMessageFilesResponse and sets the default values. + /// + public ListMessageFilesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListMessageFilesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListMessageFilesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(MessageFileObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessagesResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessagesResponse.cs new file mode 100644 index 0000000..cf9965f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListMessagesResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListMessagesResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListMessagesResponse and sets the default values. + /// + public ListMessagesResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListMessagesResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListMessagesResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(MessageObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse.cs new file mode 100644 index 0000000..ff23ae1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListModelsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The object property + public ListModelsResponse_object? Object { get; set; } + /// + /// Instantiates a new ListModelsResponse and sets the default values. + /// + public ListModelsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListModelsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListModelsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(Model.CreateFromDiscriminatorValue)?.ToList(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse_object.cs new file mode 100644 index 0000000..b2eb9a1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListModelsResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListModelsResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse.cs new file mode 100644 index 0000000..897e980 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListPaginatedFineTuningJobsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The object property + public ListPaginatedFineTuningJobsResponse_object? Object { get; set; } + /// + /// Instantiates a new ListPaginatedFineTuningJobsResponse and sets the default values. + /// + public ListPaginatedFineTuningJobsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListPaginatedFineTuningJobsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListPaginatedFineTuningJobsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(FineTuningJob.CreateFromDiscriminatorValue)?.ToList(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse_object.cs new file mode 100644 index 0000000..9fddaff --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListPaginatedFineTuningJobsResponse_object.cs @@ -0,0 +1,10 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal enum ListPaginatedFineTuningJobsResponse_object { + [EnumMember(Value = "list")] + List, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunStepsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunStepsResponse.cs new file mode 100644 index 0000000..08cc149 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunStepsResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListRunStepsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListRunStepsResponse and sets the default values. + /// + public ListRunStepsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListRunStepsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListRunStepsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(RunStepObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunsResponse.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunsResponse.cs new file mode 100644 index 0000000..6058d47 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ListRunsResponse.cs @@ -0,0 +1,86 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ListRunsResponse : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data { get; set; } +#nullable restore +#else + public List Data { get; set; } +#endif + /// The first_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FirstId { get; set; } +#nullable restore +#else + public string FirstId { get; set; } +#endif + /// The has_more property + public bool? HasMore { get; set; } + /// The last_id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastId { get; set; } +#nullable restore +#else + public string LastId { get; set; } +#endif + /// The object property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Object { get; set; } +#nullable restore +#else + public string Object { get; set; } +#endif + /// + /// Instantiates a new ListRunsResponse and sets the default values. + /// + public ListRunsResponse() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListRunsResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListRunsResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"data", n => { Data = n.GetCollectionOfObjectValues(RunObject.CreateFromDiscriminatorValue)?.ToList(); } }, + {"first_id", n => { FirstId = n.GetStringValue(); } }, + {"has_more", n => { HasMore = n.GetBoolValue(); } }, + {"last_id", n => { LastId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteStringValue("first_id", FirstId); + writer.WriteBoolValue("has_more", HasMore); + writer.WriteStringValue("last_id", LastId); + writer.WriteStringValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject.cs new file mode 100644 index 0000000..82a8dee --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// References an image [File](/docs/api-reference/files) in the content of a message. + /// + internal class MessageContentImageFileObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The image_file property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MessageContentImageFileObject_image_file? ImageFile { get; set; } +#nullable restore +#else + public MessageContentImageFileObject_image_file ImageFile { get; set; } +#endif + /// Always `image_file`. + public MessageContentImageFileObject_type? Type { get; set; } + /// + /// Instantiates a new MessageContentImageFileObject and sets the default values. + /// + public MessageContentImageFileObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentImageFileObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentImageFileObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"image_file", n => { ImageFile = n.GetObjectValue(MessageContentImageFileObject_image_file.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("image_file", ImageFile); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_image_file.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_image_file.cs new file mode 100644 index 0000000..8a98552 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_image_file.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class MessageContentImageFileObject_image_file : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The [File](/docs/api-reference/files) ID of the image in the message content. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileId { get; set; } +#nullable restore +#else + public string FileId { get; set; } +#endif + /// + /// Instantiates a new MessageContentImageFileObject_image_file and sets the default values. + /// + public MessageContentImageFileObject_image_file() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentImageFileObject_image_file CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentImageFileObject_image_file(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"file_id", n => { FileId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("file_id", FileId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_type.cs new file mode 100644 index 0000000..10ba813 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentImageFileObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `image_file`. + internal enum MessageContentImageFileObject_type { + [EnumMember(Value = "image_file")] + Image_file, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject.cs new file mode 100644 index 0000000..19c8e28 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject.cs @@ -0,0 +1,77 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files. + /// + internal class MessageContentTextAnnotationsFileCitationObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The end_index property + public int? EndIndex { get; set; } + /// The file_citation property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MessageContentTextAnnotationsFileCitationObject_file_citation? FileCitation { get; set; } +#nullable restore +#else + public MessageContentTextAnnotationsFileCitationObject_file_citation FileCitation { get; set; } +#endif + /// The start_index property + public int? StartIndex { get; set; } + /// The text in the message content that needs to be replaced. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// Always `file_citation`. + public MessageContentTextAnnotationsFileCitationObject_type? Type { get; set; } + /// + /// Instantiates a new MessageContentTextAnnotationsFileCitationObject and sets the default values. + /// + public MessageContentTextAnnotationsFileCitationObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextAnnotationsFileCitationObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextAnnotationsFileCitationObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"end_index", n => { EndIndex = n.GetIntValue(); } }, + {"file_citation", n => { FileCitation = n.GetObjectValue(MessageContentTextAnnotationsFileCitationObject_file_citation.CreateFromDiscriminatorValue); } }, + {"start_index", n => { StartIndex = n.GetIntValue(); } }, + {"text", n => { Text = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("end_index", EndIndex); + writer.WriteObjectValue("file_citation", FileCitation); + writer.WriteIntValue("start_index", StartIndex); + writer.WriteStringValue("text", Text); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_file_citation.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_file_citation.cs new file mode 100644 index 0000000..963bed8 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_file_citation.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class MessageContentTextAnnotationsFileCitationObject_file_citation : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the specific File the citation is from. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileId { get; set; } +#nullable restore +#else + public string FileId { get; set; } +#endif + /// The specific quote in the file. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Quote { get; set; } +#nullable restore +#else + public string Quote { get; set; } +#endif + /// + /// Instantiates a new MessageContentTextAnnotationsFileCitationObject_file_citation and sets the default values. + /// + public MessageContentTextAnnotationsFileCitationObject_file_citation() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextAnnotationsFileCitationObject_file_citation CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextAnnotationsFileCitationObject_file_citation(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"file_id", n => { FileId = n.GetStringValue(); } }, + {"quote", n => { Quote = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("file_id", FileId); + writer.WriteStringValue("quote", Quote); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_type.cs new file mode 100644 index 0000000..edfcd8d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFileCitationObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `file_citation`. + internal enum MessageContentTextAnnotationsFileCitationObject_type { + [EnumMember(Value = "file_citation")] + File_citation, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject.cs new file mode 100644 index 0000000..4778658 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject.cs @@ -0,0 +1,77 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + /// + internal class MessageContentTextAnnotationsFilePathObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The end_index property + public int? EndIndex { get; set; } + /// The file_path property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MessageContentTextAnnotationsFilePathObject_file_path? FilePath { get; set; } +#nullable restore +#else + public MessageContentTextAnnotationsFilePathObject_file_path FilePath { get; set; } +#endif + /// The start_index property + public int? StartIndex { get; set; } + /// The text in the message content that needs to be replaced. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// Always `file_path`. + public MessageContentTextAnnotationsFilePathObject_type? Type { get; set; } + /// + /// Instantiates a new MessageContentTextAnnotationsFilePathObject and sets the default values. + /// + public MessageContentTextAnnotationsFilePathObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextAnnotationsFilePathObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextAnnotationsFilePathObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"end_index", n => { EndIndex = n.GetIntValue(); } }, + {"file_path", n => { FilePath = n.GetObjectValue(MessageContentTextAnnotationsFilePathObject_file_path.CreateFromDiscriminatorValue); } }, + {"start_index", n => { StartIndex = n.GetIntValue(); } }, + {"text", n => { Text = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("end_index", EndIndex); + writer.WriteObjectValue("file_path", FilePath); + writer.WriteIntValue("start_index", StartIndex); + writer.WriteStringValue("text", Text); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_file_path.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_file_path.cs new file mode 100644 index 0000000..7bb8604 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_file_path.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class MessageContentTextAnnotationsFilePathObject_file_path : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the file that was generated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileId { get; set; } +#nullable restore +#else + public string FileId { get; set; } +#endif + /// + /// Instantiates a new MessageContentTextAnnotationsFilePathObject_file_path and sets the default values. + /// + public MessageContentTextAnnotationsFilePathObject_file_path() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextAnnotationsFilePathObject_file_path CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextAnnotationsFilePathObject_file_path(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"file_id", n => { FileId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("file_id", FileId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_type.cs new file mode 100644 index 0000000..6c8eb26 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextAnnotationsFilePathObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `file_path`. + internal enum MessageContentTextAnnotationsFilePathObject_type { + [EnumMember(Value = "file_path")] + File_path, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject.cs new file mode 100644 index 0000000..da76947 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The text content that is part of a message. + /// + internal class MessageContentTextObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MessageContentTextObject_text? Text { get; set; } +#nullable restore +#else + public MessageContentTextObject_text Text { get; set; } +#endif + /// Always `text`. + public MessageContentTextObject_type? Type { get; set; } + /// + /// Instantiates a new MessageContentTextObject and sets the default values. + /// + public MessageContentTextObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"text", n => { Text = n.GetObjectValue(MessageContentTextObject_text.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_text.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_text.cs new file mode 100644 index 0000000..99df16a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_text.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class MessageContentTextObject_text : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The annotations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Annotations { get; set; } +#nullable restore +#else + public List Annotations { get; set; } +#endif + /// The data that makes up the text. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new MessageContentTextObject_text and sets the default values. + /// + public MessageContentTextObject_text() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextObject_text CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageContentTextObject_text(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"annotations", n => { Annotations = n.GetCollectionOfObjectValues(MessageContentTextObject_text_annotations.CreateFromDiscriminatorValue)?.ToList(); } }, + {"value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("annotations", Annotations); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes MessageContentTextAnnotationsFileCitationObject, MessageContentTextAnnotationsFilePathObject + /// + internal class MessageContentTextObject_text_annotations : IComposedTypeWrapper, IParsable { + /// Composed type representation for type MessageContentTextAnnotationsFileCitationObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFileCitationObject? MessageContentTextAnnotationsFileCitationObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFileCitationObject MessageContentTextAnnotationsFileCitationObject { get; set; } +#endif + /// Composed type representation for type MessageContentTextAnnotationsFilePathObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFilePathObject? MessageContentTextAnnotationsFilePathObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFilePathObject MessageContentTextAnnotationsFilePathObject { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageContentTextObject_text_annotations CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new MessageContentTextObject_text_annotations(); + if("MessageContentTextAnnotationsFileCitationObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.MessageContentTextAnnotationsFileCitationObject = new OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFileCitationObject(); + } + else if("MessageContentTextAnnotationsFilePathObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.MessageContentTextAnnotationsFilePathObject = new OpenAI.GeneratedKiotaClient.Models.MessageContentTextAnnotationsFilePathObject(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(MessageContentTextAnnotationsFileCitationObject != null) { + return MessageContentTextAnnotationsFileCitationObject.GetFieldDeserializers(); + } + else if(MessageContentTextAnnotationsFilePathObject != null) { + return MessageContentTextAnnotationsFilePathObject.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(MessageContentTextAnnotationsFileCitationObject != null) { + writer.WriteObjectValue(null, MessageContentTextAnnotationsFileCitationObject); + } + else if(MessageContentTextAnnotationsFilePathObject != null) { + writer.WriteObjectValue(null, MessageContentTextAnnotationsFilePathObject); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_type.cs new file mode 100644 index 0000000..f9d4952 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageContentTextObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `text`. + internal enum MessageContentTextObject_type { + [EnumMember(Value = "text")] + Text, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject.cs new file mode 100644 index 0000000..a2e54cd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// A list of files attached to a `message`. + /// + internal class MessageFileObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) for when the message file was created. + public int? CreatedAt { get; set; } + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The ID of the [message](/docs/api-reference/messages) that the [File](/docs/api-reference/files) is attached to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageId { get; set; } +#nullable restore +#else + public string MessageId { get; set; } +#endif + /// The object type, which is always `thread.message.file`. + public MessageFileObject_object? Object { get; set; } + /// + /// Instantiates a new MessageFileObject and sets the default values. + /// + public MessageFileObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageFileObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageFileObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"message_id", n => { MessageId = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("message_id", MessageId); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject_object.cs new file mode 100644 index 0000000..8e3e580 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageFileObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `thread.message.file`. + internal enum MessageFileObject_object { + [EnumMember(Value = "thread.message.file")] + ThreadMessageFile, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject.cs new file mode 100644 index 0000000..ce1c065 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject.cs @@ -0,0 +1,189 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents a message within a [thread](/docs/api-reference/threads). + /// + internal class MessageObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// The content of the message in array of text and/or images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Content { get; set; } +#nullable restore +#else + public List Content { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the message was created. + public int? CreatedAt { get; set; } + /// A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MessageObject_metadata? Metadata { get; set; } +#nullable restore +#else + public MessageObject_metadata Metadata { get; set; } +#endif + /// The object type, which is always `thread.message`. + public MessageObject_object? Object { get; set; } + /// The entity that produced the message. One of `user` or `assistant`. + public MessageObject_role? Role { get; set; } + /// If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunId { get; set; } +#nullable restore +#else + public string RunId { get; set; } +#endif + /// The [thread](/docs/api-reference/threads) ID that this message belongs to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreadId { get; set; } +#nullable restore +#else + public string ThreadId { get; set; } +#endif + /// + /// Instantiates a new MessageObject and sets the default values. + /// + public MessageObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"content", n => { Content = n.GetCollectionOfObjectValues(MessageObject_content.CreateFromDiscriminatorValue)?.ToList(); } }, + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(MessageObject_metadata.CreateFromDiscriminatorValue); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"role", n => { Role = n.GetEnumValue(); } }, + {"run_id", n => { RunId = n.GetStringValue(); } }, + {"thread_id", n => { ThreadId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteCollectionOfObjectValues("content", Content); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteEnumValue("object", Object); + writer.WriteEnumValue("role", Role); + writer.WriteStringValue("run_id", RunId); + writer.WriteStringValue("thread_id", ThreadId); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes MessageContentImageFileObject, MessageContentTextObject + /// + internal class MessageObject_content : IComposedTypeWrapper, IParsable { + /// Composed type representation for type MessageContentImageFileObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.MessageContentImageFileObject? MessageContentImageFileObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.MessageContentImageFileObject MessageContentImageFileObject { get; set; } +#endif + /// Composed type representation for type MessageContentTextObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextObject? MessageContentTextObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.MessageContentTextObject MessageContentTextObject { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageObject_content CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new MessageObject_content(); + if("MessageContentImageFileObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.MessageContentImageFileObject = new OpenAI.GeneratedKiotaClient.Models.MessageContentImageFileObject(); + } + else if("MessageContentTextObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.MessageContentTextObject = new OpenAI.GeneratedKiotaClient.Models.MessageContentTextObject(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(MessageContentImageFileObject != null) { + return MessageContentImageFileObject.GetFieldDeserializers(); + } + else if(MessageContentTextObject != null) { + return MessageContentTextObject.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(MessageContentImageFileObject != null) { + writer.WriteObjectValue(null, MessageContentImageFileObject); + } + else if(MessageContentTextObject != null) { + writer.WriteObjectValue(null, MessageContentTextObject); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_metadata.cs new file mode 100644 index 0000000..87f5543 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class MessageObject_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new MessageObject_metadata and sets the default values. + /// + public MessageObject_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageObject_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageObject_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_object.cs new file mode 100644 index 0000000..0674c80 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `thread.message`. + internal enum MessageObject_object { + [EnumMember(Value = "thread.message")] + ThreadMessage, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_role.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_role.cs new file mode 100644 index 0000000..12632f5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/MessageObject_role.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The entity that produced the message. One of `user` or `assistant`. + internal enum MessageObject_role { + [EnumMember(Value = "user")] + User, + [EnumMember(Value = "assistant")] + Assistant, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model.cs new file mode 100644 index 0000000..460c415 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Describes an OpenAI model offering that can be used with the API. + /// + internal class Model : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) when the model was created. + public int? Created { get; set; } + /// The model identifier, which can be referenced in the API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object type, which is always "model". + public Model_object? Object { get; set; } + /// The organization that owns the model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OwnedBy { get; set; } +#nullable restore +#else + public string OwnedBy { get; set; } +#endif + /// + /// Instantiates a new Model and sets the default values. + /// + public Model() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static Model CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Model(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created", n => { Created = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"owned_by", n => { OwnedBy = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created", Created); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("owned_by", OwnedBy); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model_object.cs new file mode 100644 index 0000000..7bd6eab --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/Model_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always "model". + internal enum Model_object { + [EnumMember(Value = "model")] + Model, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest.cs new file mode 100644 index 0000000..af7c226 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest.cs @@ -0,0 +1,182 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ModifyAssistantRequest : IParsable { + /// The description of the assistant. The maximum length is 512 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// A list of [File](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. If a file was previosuly attached to the list but does not show up in the list, it will be deleted from the assistant. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// The system instructions that the assistant uses. The maximum length is 32768 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ModifyAssistantRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public ModifyAssistantRequest_metadata Metadata { get; set; } +#endif + /// ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The name of the assistant. The maximum length is 256 characters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyAssistantRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyAssistantRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"description", n => { Description = n.GetStringValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(ModifyAssistantRequest_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(ModifyAssistantRequest_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteStringValue("name", Name); + writer.WriteCollectionOfObjectValues("tools", Tools); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class ModifyAssistantRequest_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyAssistantRequest_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new ModifyAssistantRequest_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest_metadata.cs new file mode 100644 index 0000000..3225102 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyAssistantRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class ModifyAssistantRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ModifyAssistantRequest_metadata and sets the default values. + /// + public ModifyAssistantRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyAssistantRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyAssistantRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest.cs new file mode 100644 index 0000000..af92921 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ModifyMessageRequest : IParsable { + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ModifyMessageRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public ModifyMessageRequest_metadata Metadata { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyMessageRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyMessageRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"metadata", n => { Metadata = n.GetObjectValue(ModifyMessageRequest_metadata.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("metadata", Metadata); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest_metadata.cs new file mode 100644 index 0000000..594e7f4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyMessageRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class ModifyMessageRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ModifyMessageRequest_metadata and sets the default values. + /// + public ModifyMessageRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyMessageRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyMessageRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest.cs new file mode 100644 index 0000000..f6fc7a6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ModifyRunRequest : IParsable { + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ModifyRunRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public ModifyRunRequest_metadata Metadata { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyRunRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyRunRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"metadata", n => { Metadata = n.GetObjectValue(ModifyRunRequest_metadata.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("metadata", Metadata); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest_metadata.cs new file mode 100644 index 0000000..e34a8b2 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyRunRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class ModifyRunRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ModifyRunRequest_metadata and sets the default values. + /// + public ModifyRunRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyRunRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyRunRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest.cs new file mode 100644 index 0000000..0aaaa2b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class ModifyThreadRequest : IParsable { + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ModifyThreadRequest_metadata? Metadata { get; set; } +#nullable restore +#else + public ModifyThreadRequest_metadata Metadata { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyThreadRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyThreadRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"metadata", n => { Metadata = n.GetObjectValue(ModifyThreadRequest_metadata.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("metadata", Metadata); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest_metadata.cs new file mode 100644 index 0000000..bdf4d96 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ModifyThreadRequest_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class ModifyThreadRequest_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ModifyThreadRequest_metadata and sets the default values. + /// + public ModifyThreadRequest_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ModifyThreadRequest_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModifyThreadRequest_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile.cs new file mode 100644 index 0000000..4142a0c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile.cs @@ -0,0 +1,97 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The `File` object represents a document that has been uploaded to OpenAI. + /// + internal class OpenAIFile : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The size of the file, in bytes. + public int? Bytes { get; set; } + /// The Unix timestamp (in seconds) for when the file was created. + public int? CreatedAt { get; set; } + /// The name of the file. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Filename { get; set; } +#nullable restore +#else + public string Filename { get; set; } +#endif + /// The file identifier, which can be referenced in the API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The object type, which is always `file`. + public OpenAIFile_object? Object { get; set; } + /// The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`. + public OpenAIFile_purpose? Purpose { get; set; } + /// Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. + [Obsolete("")] + public OpenAIFile_status? Status { get; set; } + /// Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StatusDetails { get; set; } +#nullable restore +#else + public string StatusDetails { get; set; } +#endif + /// + /// Instantiates a new OpenAIFile and sets the default values. + /// + public OpenAIFile() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static OpenAIFile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenAIFile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"bytes", n => { Bytes = n.GetIntValue(); } }, + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"filename", n => { Filename = n.GetStringValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"purpose", n => { Purpose = n.GetEnumValue(); } }, + {"status", n => { Status = n.GetEnumValue(); } }, + {"status_details", n => { StatusDetails = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("bytes", Bytes); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("filename", Filename); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("object", Object); + writer.WriteEnumValue("purpose", Purpose); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("status_details", StatusDetails); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_object.cs new file mode 100644 index 0000000..90d5853 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `file`. + internal enum OpenAIFile_object { + [EnumMember(Value = "file")] + File, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_purpose.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_purpose.cs new file mode 100644 index 0000000..92efcfb --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_purpose.cs @@ -0,0 +1,17 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`. + internal enum OpenAIFile_purpose { + [EnumMember(Value = "fine-tune")] + FineTune, + [EnumMember(Value = "fine-tune-results")] + FineTuneResults, + [EnumMember(Value = "assistants")] + Assistants, + [EnumMember(Value = "assistants_output")] + Assistants_output, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_status.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_status.cs new file mode 100644 index 0000000..0aaf4f7 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/OpenAIFile_status.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. + [Obsolete("")] + internal enum OpenAIFile_status { + [EnumMember(Value = "uploaded")] + Uploaded, + [EnumMember(Value = "processed")] + Processed, + [EnumMember(Value = "error")] + Error, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject.cs new file mode 100644 index 0000000..fefdd72 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject.cs @@ -0,0 +1,256 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents an execution run on a [thread](/docs/api-reference/threads). + /// + internal class RunObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the run was cancelled. + public int? CancelledAt { get; set; } + /// The Unix timestamp (in seconds) for when the run was completed. + public int? CompletedAt { get; set; } + /// The Unix timestamp (in seconds) for when the run was created. + public int? CreatedAt { get; set; } + /// The Unix timestamp (in seconds) for when the run will expire. + public int? ExpiresAt { get; set; } + /// The Unix timestamp (in seconds) for when the run failed. + public int? FailedAt { get; set; } + /// The list of [File](/docs/api-reference/files) IDs the [assistant](/docs/api-reference/assistants) used for this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? FileIds { get; set; } +#nullable restore +#else + public List FileIds { get; set; } +#endif + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The instructions that the [assistant](/docs/api-reference/assistants) used for this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instructions { get; set; } +#nullable restore +#else + public string Instructions { get; set; } +#endif + /// The last error associated with this run. Will be `null` if there are no errors. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunObject_last_error? LastError { get; set; } +#nullable restore +#else + public RunObject_last_error LastError { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunObject_metadata? Metadata { get; set; } +#nullable restore +#else + public RunObject_metadata Metadata { get; set; } +#endif + /// The model that the [assistant](/docs/api-reference/assistants) used for this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Model { get; set; } +#nullable restore +#else + public string Model { get; set; } +#endif + /// The object type, which is always `thread.run`. + public RunObject_object? Object { get; set; } + /// Details on the action required to continue the run. Will be `null` if no action is required. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunObject_required_action? RequiredAction { get; set; } +#nullable restore +#else + public RunObject_required_action RequiredAction { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the run was started. + public int? StartedAt { get; set; } + /// The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`. + public RunObject_status? Status { get; set; } + /// The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreadId { get; set; } +#nullable restore +#else + public string ThreadId { get; set; } +#endif + /// The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tools { get; set; } +#nullable restore +#else + public List Tools { get; set; } +#endif + /// + /// Instantiates a new RunObject and sets the default values. + /// + public RunObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"cancelled_at", n => { CancelledAt = n.GetIntValue(); } }, + {"completed_at", n => { CompletedAt = n.GetIntValue(); } }, + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"expires_at", n => { ExpiresAt = n.GetIntValue(); } }, + {"failed_at", n => { FailedAt = n.GetIntValue(); } }, + {"file_ids", n => { FileIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"instructions", n => { Instructions = n.GetStringValue(); } }, + {"last_error", n => { LastError = n.GetObjectValue(RunObject_last_error.CreateFromDiscriminatorValue); } }, + {"metadata", n => { Metadata = n.GetObjectValue(RunObject_metadata.CreateFromDiscriminatorValue); } }, + {"model", n => { Model = n.GetStringValue(); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"required_action", n => { RequiredAction = n.GetObjectValue(RunObject_required_action.CreateFromDiscriminatorValue); } }, + {"started_at", n => { StartedAt = n.GetIntValue(); } }, + {"status", n => { Status = n.GetEnumValue(); } }, + {"thread_id", n => { ThreadId = n.GetStringValue(); } }, + {"tools", n => { Tools = n.GetCollectionOfObjectValues(RunObject_tools.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteIntValue("cancelled_at", CancelledAt); + writer.WriteIntValue("completed_at", CompletedAt); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteIntValue("expires_at", ExpiresAt); + writer.WriteIntValue("failed_at", FailedAt); + writer.WriteCollectionOfPrimitiveValues("file_ids", FileIds); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("instructions", Instructions); + writer.WriteObjectValue("last_error", LastError); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteStringValue("model", Model); + writer.WriteEnumValue("object", Object); + writer.WriteObjectValue("required_action", RequiredAction); + writer.WriteIntValue("started_at", StartedAt); + writer.WriteEnumValue("status", Status); + writer.WriteStringValue("thread_id", ThreadId); + writer.WriteCollectionOfObjectValues("tools", Tools); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes AssistantToolsCode, AssistantToolsFunction, AssistantToolsRetrieval + /// + internal class RunObject_tools : IComposedTypeWrapper, IParsable { + /// Composed type representation for type AssistantToolsCode +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode? AssistantToolsCode { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode AssistantToolsCode { get; set; } +#endif + /// Composed type representation for type AssistantToolsFunction +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction? AssistantToolsFunction { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction AssistantToolsFunction { get; set; } +#endif + /// Composed type representation for type AssistantToolsRetrieval +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval? AssistantToolsRetrieval { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval AssistantToolsRetrieval { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject_tools CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new RunObject_tools(); + if("AssistantToolsCode".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsCode = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsCode(); + } + else if("AssistantToolsFunction".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsFunction = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsFunction(); + } + else if("AssistantToolsRetrieval".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.AssistantToolsRetrieval = new OpenAI.GeneratedKiotaClient.Models.AssistantToolsRetrieval(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(AssistantToolsCode != null) { + return AssistantToolsCode.GetFieldDeserializers(); + } + else if(AssistantToolsFunction != null) { + return AssistantToolsFunction.GetFieldDeserializers(); + } + else if(AssistantToolsRetrieval != null) { + return AssistantToolsRetrieval.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(AssistantToolsCode != null) { + writer.WriteObjectValue(null, AssistantToolsCode); + } + else if(AssistantToolsFunction != null) { + writer.WriteObjectValue(null, AssistantToolsFunction); + } + else if(AssistantToolsRetrieval != null) { + writer.WriteObjectValue(null, AssistantToolsRetrieval); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error.cs new file mode 100644 index 0000000..41a941f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The last error associated with this run. Will be `null` if there are no errors. + /// + internal class RunObject_last_error : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// One of `server_error` or `rate_limit_exceeded`. + public RunObject_last_error_code? Code { get; set; } + /// A human-readable description of the error. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new RunObject_last_error and sets the default values. + /// + public RunObject_last_error() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject_last_error CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunObject_last_error(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code", n => { Code = n.GetEnumValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error_code.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error_code.cs new file mode 100644 index 0000000..4df763c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_last_error_code.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// One of `server_error` or `rate_limit_exceeded`. + internal enum RunObject_last_error_code { + [EnumMember(Value = "server_error")] + Server_error, + [EnumMember(Value = "rate_limit_exceeded")] + Rate_limit_exceeded, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_metadata.cs new file mode 100644 index 0000000..86c2d95 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class RunObject_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new RunObject_metadata and sets the default values. + /// + public RunObject_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunObject_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_object.cs new file mode 100644 index 0000000..8c1a4a6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `thread.run`. + internal enum RunObject_object { + [EnumMember(Value = "thread.run")] + ThreadRun, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action.cs new file mode 100644 index 0000000..b0ed13a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Details on the action required to continue the run. Will be `null` if no action is required. + /// + internal class RunObject_required_action : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Details on the tool outputs needed for this run to continue. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunObject_required_action_submit_tool_outputs? SubmitToolOutputs { get; set; } +#nullable restore +#else + public RunObject_required_action_submit_tool_outputs SubmitToolOutputs { get; set; } +#endif + /// For now, this is always `submit_tool_outputs`. + public RunObject_required_action_type? Type { get; set; } + /// + /// Instantiates a new RunObject_required_action and sets the default values. + /// + public RunObject_required_action() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject_required_action CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunObject_required_action(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"submit_tool_outputs", n => { SubmitToolOutputs = n.GetObjectValue(RunObject_required_action_submit_tool_outputs.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("submit_tool_outputs", SubmitToolOutputs); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_submit_tool_outputs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_submit_tool_outputs.cs new file mode 100644 index 0000000..c38f3b1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_submit_tool_outputs.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Details on the tool outputs needed for this run to continue. + /// + internal class RunObject_required_action_submit_tool_outputs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// A list of the relevant tool calls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ToolCalls { get; set; } +#nullable restore +#else + public List ToolCalls { get; set; } +#endif + /// + /// Instantiates a new RunObject_required_action_submit_tool_outputs and sets the default values. + /// + public RunObject_required_action_submit_tool_outputs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunObject_required_action_submit_tool_outputs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunObject_required_action_submit_tool_outputs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"tool_calls", n => { ToolCalls = n.GetCollectionOfObjectValues(RunToolCallObject.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("tool_calls", ToolCalls); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_type.cs new file mode 100644 index 0000000..a4e7160 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_required_action_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// For now, this is always `submit_tool_outputs`. + internal enum RunObject_required_action_type { + [EnumMember(Value = "submit_tool_outputs")] + Submit_tool_outputs, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_status.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_status.cs new file mode 100644 index 0000000..85ab43a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunObject_status.cs @@ -0,0 +1,25 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`. + internal enum RunObject_status { + [EnumMember(Value = "queued")] + Queued, + [EnumMember(Value = "in_progress")] + In_progress, + [EnumMember(Value = "requires_action")] + Requires_action, + [EnumMember(Value = "cancelling")] + Cancelling, + [EnumMember(Value = "cancelled")] + Cancelled, + [EnumMember(Value = "failed")] + Failed, + [EnumMember(Value = "completed")] + Completed, + [EnumMember(Value = "expired")] + Expired, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject.cs new file mode 100644 index 0000000..021a667 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Details of the message creation by the run step. + /// + internal class RunStepDetailsMessageCreationObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The message_creation property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepDetailsMessageCreationObject_message_creation? MessageCreation { get; set; } +#nullable restore +#else + public RunStepDetailsMessageCreationObject_message_creation MessageCreation { get; set; } +#endif + /// Always `message_creation``. + public RunStepDetailsMessageCreationObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsMessageCreationObject and sets the default values. + /// + public RunStepDetailsMessageCreationObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsMessageCreationObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsMessageCreationObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"message_creation", n => { MessageCreation = n.GetObjectValue(RunStepDetailsMessageCreationObject_message_creation.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("message_creation", MessageCreation); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_message_creation.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_message_creation.cs new file mode 100644 index 0000000..242370c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_message_creation.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class RunStepDetailsMessageCreationObject_message_creation : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the message that was created by this run step. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageId { get; set; } +#nullable restore +#else + public string MessageId { get; set; } +#endif + /// + /// Instantiates a new RunStepDetailsMessageCreationObject_message_creation and sets the default values. + /// + public RunStepDetailsMessageCreationObject_message_creation() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsMessageCreationObject_message_creation CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsMessageCreationObject_message_creation(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"message_id", n => { MessageId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("message_id", MessageId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_type.cs new file mode 100644 index 0000000..7bdabfe --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsMessageCreationObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `message_creation``. + internal enum RunStepDetailsMessageCreationObject_type { + [EnumMember(Value = "message_creation")] + Message_creation, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject.cs new file mode 100644 index 0000000..bee880c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Details of the Code Interpreter tool call the run step was involved in. + /// + internal class RunStepDetailsToolCallsCodeObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Code Interpreter tool call definition. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepDetailsToolCallsCodeObject_code_interpreter? CodeInterpreter { get; set; } +#nullable restore +#else + public RunStepDetailsToolCallsCodeObject_code_interpreter CodeInterpreter { get; set; } +#endif + /// The ID of the tool call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + public RunStepDetailsToolCallsCodeObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsCodeObject and sets the default values. + /// + public RunStepDetailsToolCallsCodeObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsCodeObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code_interpreter", n => { CodeInterpreter = n.GetObjectValue(RunStepDetailsToolCallsCodeObject_code_interpreter.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("code_interpreter", CodeInterpreter); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_code_interpreter.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_code_interpreter.cs new file mode 100644 index 0000000..47a189d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_code_interpreter.cs @@ -0,0 +1,127 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The Code Interpreter tool call definition. + /// + internal class RunStepDetailsToolCallsCodeObject_code_interpreter : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The input to the Code Interpreter tool call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Input { get; set; } +#nullable restore +#else + public string Input { get; set; } +#endif + /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Outputs { get; set; } +#nullable restore +#else + public List Outputs { get; set; } +#endif + /// + /// Instantiates a new RunStepDetailsToolCallsCodeObject_code_interpreter and sets the default values. + /// + public RunStepDetailsToolCallsCodeObject_code_interpreter() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeObject_code_interpreter CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsCodeObject_code_interpreter(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"input", n => { Input = n.GetStringValue(); } }, + {"outputs", n => { Outputs = n.GetCollectionOfObjectValues(RunStepDetailsToolCallsCodeObject_code_interpreter_outputs.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("input", Input); + writer.WriteCollectionOfObjectValues("outputs", Outputs); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes RunStepDetailsToolCallsCodeOutputImageObject, RunStepDetailsToolCallsCodeOutputLogsObject + /// + internal class RunStepDetailsToolCallsCodeObject_code_interpreter_outputs : IComposedTypeWrapper, IParsable { + /// Composed type representation for type RunStepDetailsToolCallsCodeOutputImageObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputImageObject? RunStepDetailsToolCallsCodeOutputImageObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputImageObject RunStepDetailsToolCallsCodeOutputImageObject { get; set; } +#endif + /// Composed type representation for type RunStepDetailsToolCallsCodeOutputLogsObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputLogsObject? RunStepDetailsToolCallsCodeOutputLogsObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputLogsObject RunStepDetailsToolCallsCodeOutputLogsObject { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeObject_code_interpreter_outputs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new RunStepDetailsToolCallsCodeObject_code_interpreter_outputs(); + if("RunStepDetailsToolCallsCodeOutputImageObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsCodeOutputImageObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputImageObject(); + } + else if("RunStepDetailsToolCallsCodeOutputLogsObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsCodeOutputLogsObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeOutputLogsObject(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(RunStepDetailsToolCallsCodeOutputImageObject != null) { + return RunStepDetailsToolCallsCodeOutputImageObject.GetFieldDeserializers(); + } + else if(RunStepDetailsToolCallsCodeOutputLogsObject != null) { + return RunStepDetailsToolCallsCodeOutputLogsObject.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(RunStepDetailsToolCallsCodeOutputImageObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsCodeOutputImageObject); + } + else if(RunStepDetailsToolCallsCodeOutputLogsObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsCodeOutputLogsObject); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_type.cs new file mode 100644 index 0000000..f69dbc6 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + internal enum RunStepDetailsToolCallsCodeObject_type { + [EnumMember(Value = "code_interpreter")] + Code_interpreter, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject.cs new file mode 100644 index 0000000..5e10314 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class RunStepDetailsToolCallsCodeOutputImageObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The image property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepDetailsToolCallsCodeOutputImageObject_image? Image { get; set; } +#nullable restore +#else + public RunStepDetailsToolCallsCodeOutputImageObject_image Image { get; set; } +#endif + /// Always `image`. + public RunStepDetailsToolCallsCodeOutputImageObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsCodeOutputImageObject and sets the default values. + /// + public RunStepDetailsToolCallsCodeOutputImageObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeOutputImageObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsCodeOutputImageObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"image", n => { Image = n.GetObjectValue(RunStepDetailsToolCallsCodeOutputImageObject_image.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("image", Image); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_image.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_image.cs new file mode 100644 index 0000000..9b7537c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_image.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class RunStepDetailsToolCallsCodeOutputImageObject_image : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The [file](/docs/api-reference/files) ID of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileId { get; set; } +#nullable restore +#else + public string FileId { get; set; } +#endif + /// + /// Instantiates a new RunStepDetailsToolCallsCodeOutputImageObject_image and sets the default values. + /// + public RunStepDetailsToolCallsCodeOutputImageObject_image() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeOutputImageObject_image CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsCodeOutputImageObject_image(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"file_id", n => { FileId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("file_id", FileId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_type.cs new file mode 100644 index 0000000..0e6ea88 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputImageObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `image`. + internal enum RunStepDetailsToolCallsCodeOutputImageObject_type { + [EnumMember(Value = "image")] + Image, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject.cs new file mode 100644 index 0000000..6e0d42a --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Text output from the Code Interpreter tool call as part of a run step. + /// + internal class RunStepDetailsToolCallsCodeOutputLogsObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text output from the Code Interpreter tool call. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Logs { get; set; } +#nullable restore +#else + public string Logs { get; set; } +#endif + /// Always `logs`. + public RunStepDetailsToolCallsCodeOutputLogsObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsCodeOutputLogsObject and sets the default values. + /// + public RunStepDetailsToolCallsCodeOutputLogsObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsCodeOutputLogsObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsCodeOutputLogsObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"logs", n => { Logs = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("logs", Logs); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject_type.cs new file mode 100644 index 0000000..9560c4c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsCodeOutputLogsObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `logs`. + internal enum RunStepDetailsToolCallsCodeOutputLogsObject_type { + [EnumMember(Value = "logs")] + Logs, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject.cs new file mode 100644 index 0000000..1d7bfb0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class RunStepDetailsToolCallsFunctionObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The definition of the function that was called. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepDetailsToolCallsFunctionObject_function? Function { get; set; } +#nullable restore +#else + public RunStepDetailsToolCallsFunctionObject_function Function { get; set; } +#endif + /// The ID of the tool call object. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The type of tool call. This is always going to be `function` for this type of tool call. + public RunStepDetailsToolCallsFunctionObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsFunctionObject and sets the default values. + /// + public RunStepDetailsToolCallsFunctionObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsFunctionObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsFunctionObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(RunStepDetailsToolCallsFunctionObject_function.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_function.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_function.cs new file mode 100644 index 0000000..d02c698 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_function.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The definition of the function that was called. + /// + internal class RunStepDetailsToolCallsFunctionObject_function : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The arguments passed to the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Arguments { get; set; } +#nullable restore +#else + public string Arguments { get; set; } +#endif + /// The name of the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Output { get; set; } +#nullable restore +#else + public string Output { get; set; } +#endif + /// + /// Instantiates a new RunStepDetailsToolCallsFunctionObject_function and sets the default values. + /// + public RunStepDetailsToolCallsFunctionObject_function() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsFunctionObject_function CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsFunctionObject_function(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"arguments", n => { Arguments = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"output", n => { Output = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("arguments", Arguments); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("output", Output); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_type.cs new file mode 100644 index 0000000..2cb9eae --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsFunctionObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool call. This is always going to be `function` for this type of tool call. + internal enum RunStepDetailsToolCallsFunctionObject_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject.cs new file mode 100644 index 0000000..1549f94 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject.cs @@ -0,0 +1,138 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Details of the tool call. + /// + internal class RunStepDetailsToolCallsObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ToolCalls { get; set; } +#nullable restore +#else + public List ToolCalls { get; set; } +#endif + /// Always `tool_calls`. + public RunStepDetailsToolCallsObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsObject and sets the default values. + /// + public RunStepDetailsToolCallsObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"tool_calls", n => { ToolCalls = n.GetCollectionOfObjectValues(RunStepDetailsToolCallsObject_tool_calls.CreateFromDiscriminatorValue)?.ToList(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("tool_calls", ToolCalls); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes RunStepDetailsToolCallsCodeObject, RunStepDetailsToolCallsFunctionObject, RunStepDetailsToolCallsRetrievalObject + /// + internal class RunStepDetailsToolCallsObject_tool_calls : IComposedTypeWrapper, IParsable { + /// Composed type representation for type RunStepDetailsToolCallsCodeObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeObject? RunStepDetailsToolCallsCodeObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeObject RunStepDetailsToolCallsCodeObject { get; set; } +#endif + /// Composed type representation for type RunStepDetailsToolCallsFunctionObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsFunctionObject? RunStepDetailsToolCallsFunctionObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsFunctionObject RunStepDetailsToolCallsFunctionObject { get; set; } +#endif + /// Composed type representation for type RunStepDetailsToolCallsRetrievalObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsRetrievalObject? RunStepDetailsToolCallsRetrievalObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsRetrievalObject RunStepDetailsToolCallsRetrievalObject { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsObject_tool_calls CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new RunStepDetailsToolCallsObject_tool_calls(); + if("RunStepDetailsToolCallsCodeObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsCodeObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsCodeObject(); + } + else if("RunStepDetailsToolCallsFunctionObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsFunctionObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsFunctionObject(); + } + else if("RunStepDetailsToolCallsRetrievalObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsRetrievalObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsRetrievalObject(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(RunStepDetailsToolCallsCodeObject != null) { + return RunStepDetailsToolCallsCodeObject.GetFieldDeserializers(); + } + else if(RunStepDetailsToolCallsFunctionObject != null) { + return RunStepDetailsToolCallsFunctionObject.GetFieldDeserializers(); + } + else if(RunStepDetailsToolCallsRetrievalObject != null) { + return RunStepDetailsToolCallsRetrievalObject.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(RunStepDetailsToolCallsCodeObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsCodeObject); + } + else if(RunStepDetailsToolCallsFunctionObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsFunctionObject); + } + else if(RunStepDetailsToolCallsRetrievalObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsRetrievalObject); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject_type.cs new file mode 100644 index 0000000..96f9df8 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// Always `tool_calls`. + internal enum RunStepDetailsToolCallsObject_type { + [EnumMember(Value = "tool_calls")] + Tool_calls, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject.cs new file mode 100644 index 0000000..cb051e1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class RunStepDetailsToolCallsRetrievalObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the tool call object. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// For now, this is always going to be an empty object. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepDetailsToolCallsRetrievalObject_retrieval? Retrieval { get; set; } +#nullable restore +#else + public RunStepDetailsToolCallsRetrievalObject_retrieval Retrieval { get; set; } +#endif + /// The type of tool call. This is always going to be `retrieval` for this type of tool call. + public RunStepDetailsToolCallsRetrievalObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsRetrievalObject and sets the default values. + /// + public RunStepDetailsToolCallsRetrievalObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsRetrievalObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsRetrievalObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"id", n => { Id = n.GetStringValue(); } }, + {"retrieval", n => { Retrieval = n.GetObjectValue(RunStepDetailsToolCallsRetrievalObject_retrieval.CreateFromDiscriminatorValue); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("retrieval", Retrieval); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_retrieval.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_retrieval.cs new file mode 100644 index 0000000..ed7533e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_retrieval.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// For now, this is always going to be an empty object. + /// + internal class RunStepDetailsToolCallsRetrievalObject_retrieval : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new RunStepDetailsToolCallsRetrievalObject_retrieval and sets the default values. + /// + public RunStepDetailsToolCallsRetrievalObject_retrieval() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepDetailsToolCallsRetrievalObject_retrieval CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepDetailsToolCallsRetrievalObject_retrieval(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_type.cs new file mode 100644 index 0000000..56c041f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepDetailsToolCallsRetrievalObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool call. This is always going to be `retrieval` for this type of tool call. + internal enum RunStepDetailsToolCallsRetrievalObject_type { + [EnumMember(Value = "retrieval")] + Retrieval, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject.cs new file mode 100644 index 0000000..c1f83a1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject.cs @@ -0,0 +1,209 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents a step in execution of a run. + /// + internal class RunStepObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AssistantId { get; set; } +#nullable restore +#else + public string AssistantId { get; set; } +#endif + /// The Unix timestamp (in seconds) for when the run step was cancelled. + public int? CancelledAt { get; set; } + /// The Unix timestamp (in seconds) for when the run step completed. + public int? CompletedAt { get; set; } + /// The Unix timestamp (in seconds) for when the run step was created. + public int? CreatedAt { get; set; } + /// The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + public int? ExpiredAt { get; set; } + /// The Unix timestamp (in seconds) for when the run step failed. + public int? FailedAt { get; set; } + /// The identifier of the run step, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The last error associated with this run step. Will be `null` if there are no errors. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepObject_last_error? LastError { get; set; } +#nullable restore +#else + public RunStepObject_last_error LastError { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepObject_metadata? Metadata { get; set; } +#nullable restore +#else + public RunStepObject_metadata Metadata { get; set; } +#endif + /// The object type, which is always `thread.run.step``. + public RunStepObject_object? Object { get; set; } + /// The ID of the [run](/docs/api-reference/runs) that this run step is a part of. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RunId { get; set; } +#nullable restore +#else + public string RunId { get; set; } +#endif + /// The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + public RunStepObject_status? Status { get; set; } + /// The details of the run step. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunStepObject_step_details? StepDetails { get; set; } +#nullable restore +#else + public RunStepObject_step_details StepDetails { get; set; } +#endif + /// The ID of the [thread](/docs/api-reference/threads) that was run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreadId { get; set; } +#nullable restore +#else + public string ThreadId { get; set; } +#endif + /// The type of run step, which can be either `message_creation` or `tool_calls`. + public RunStepObject_type? Type { get; set; } + /// + /// Instantiates a new RunStepObject and sets the default values. + /// + public RunStepObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"assistant_id", n => { AssistantId = n.GetStringValue(); } }, + {"cancelled_at", n => { CancelledAt = n.GetIntValue(); } }, + {"completed_at", n => { CompletedAt = n.GetIntValue(); } }, + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"expired_at", n => { ExpiredAt = n.GetIntValue(); } }, + {"failed_at", n => { FailedAt = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"last_error", n => { LastError = n.GetObjectValue(RunStepObject_last_error.CreateFromDiscriminatorValue); } }, + {"metadata", n => { Metadata = n.GetObjectValue(RunStepObject_metadata.CreateFromDiscriminatorValue); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + {"run_id", n => { RunId = n.GetStringValue(); } }, + {"status", n => { Status = n.GetEnumValue(); } }, + {"step_details", n => { StepDetails = n.GetObjectValue(RunStepObject_step_details.CreateFromDiscriminatorValue); } }, + {"thread_id", n => { ThreadId = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("assistant_id", AssistantId); + writer.WriteIntValue("cancelled_at", CancelledAt); + writer.WriteIntValue("completed_at", CompletedAt); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteIntValue("expired_at", ExpiredAt); + writer.WriteIntValue("failed_at", FailedAt); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("last_error", LastError); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteEnumValue("object", Object); + writer.WriteStringValue("run_id", RunId); + writer.WriteEnumValue("status", Status); + writer.WriteObjectValue("step_details", StepDetails); + writer.WriteStringValue("thread_id", ThreadId); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + /// + /// Composed type wrapper for classes RunStepDetailsMessageCreationObject, RunStepDetailsToolCallsObject + /// + internal class RunStepObject_step_details : IComposedTypeWrapper, IParsable { + /// Composed type representation for type RunStepDetailsMessageCreationObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsMessageCreationObject? RunStepDetailsMessageCreationObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsMessageCreationObject RunStepDetailsMessageCreationObject { get; set; } +#endif + /// Composed type representation for type RunStepDetailsToolCallsObject +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsObject? RunStepDetailsToolCallsObject { get; set; } +#nullable restore +#else + public OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsObject RunStepDetailsToolCallsObject { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepObject_step_details CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("")?.GetStringValue(); + var result = new RunStepObject_step_details(); + if("RunStepDetailsMessageCreationObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsMessageCreationObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsMessageCreationObject(); + } + else if("RunStepDetailsToolCallsObject".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) { + result.RunStepDetailsToolCallsObject = new OpenAI.GeneratedKiotaClient.Models.RunStepDetailsToolCallsObject(); + } + return result; + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + if(RunStepDetailsMessageCreationObject != null) { + return RunStepDetailsMessageCreationObject.GetFieldDeserializers(); + } + else if(RunStepDetailsToolCallsObject != null) { + return RunStepDetailsToolCallsObject.GetFieldDeserializers(); + } + return new Dictionary>(); + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + if(RunStepDetailsMessageCreationObject != null) { + writer.WriteObjectValue(null, RunStepDetailsMessageCreationObject); + } + else if(RunStepDetailsToolCallsObject != null) { + writer.WriteObjectValue(null, RunStepDetailsToolCallsObject); + } + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error.cs new file mode 100644 index 0000000..fce4ca9 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The last error associated with this run step. Will be `null` if there are no errors. + /// + internal class RunStepObject_last_error : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// One of `server_error` or `rate_limit_exceeded`. + public RunStepObject_last_error_code? Code { get; set; } + /// A human-readable description of the error. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// + /// Instantiates a new RunStepObject_last_error and sets the default values. + /// + public RunStepObject_last_error() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepObject_last_error CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepObject_last_error(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"code", n => { Code = n.GetEnumValue(); } }, + {"message", n => { Message = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("code", Code); + writer.WriteStringValue("message", Message); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error_code.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error_code.cs new file mode 100644 index 0000000..28a4e44 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_last_error_code.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// One of `server_error` or `rate_limit_exceeded`. + internal enum RunStepObject_last_error_code { + [EnumMember(Value = "server_error")] + Server_error, + [EnumMember(Value = "rate_limit_exceeded")] + Rate_limit_exceeded, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_metadata.cs new file mode 100644 index 0000000..5cc2db4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class RunStepObject_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new RunStepObject_metadata and sets the default values. + /// + public RunStepObject_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunStepObject_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunStepObject_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_object.cs new file mode 100644 index 0000000..303ac09 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `thread.run.step``. + internal enum RunStepObject_object { + [EnumMember(Value = "thread.run.step")] + ThreadRunStep, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_status.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_status.cs new file mode 100644 index 0000000..dfa9a0b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_status.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + internal enum RunStepObject_status { + [EnumMember(Value = "in_progress")] + In_progress, + [EnumMember(Value = "cancelled")] + Cancelled, + [EnumMember(Value = "failed")] + Failed, + [EnumMember(Value = "completed")] + Completed, + [EnumMember(Value = "expired")] + Expired, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_type.cs new file mode 100644 index 0000000..f91282c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunStepObject_type.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of run step, which can be either `message_creation` or `tool_calls`. + internal enum RunStepObject_type { + [EnumMember(Value = "message_creation")] + Message_creation, + [EnumMember(Value = "tool_calls")] + Tool_calls, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject.cs new file mode 100644 index 0000000..6cf0877 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Tool call objects + /// + internal class RunToolCallObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The function definition. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RunToolCallObject_function? Function { get; set; } +#nullable restore +#else + public RunToolCallObject_function Function { get; set; } +#endif + /// The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The type of tool call the output is required for. For now, this is always `function`. + public RunToolCallObject_type? Type { get; set; } + /// + /// Instantiates a new RunToolCallObject and sets the default values. + /// + public RunToolCallObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunToolCallObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunToolCallObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"function", n => { Function = n.GetObjectValue(RunToolCallObject_function.CreateFromDiscriminatorValue); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("function", Function); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_function.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_function.cs new file mode 100644 index 0000000..4353450 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_function.cs @@ -0,0 +1,65 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The function definition. + /// + internal class RunToolCallObject_function : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The arguments that the model expects you to pass to the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Arguments { get; set; } +#nullable restore +#else + public string Arguments { get; set; } +#endif + /// The name of the function. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new RunToolCallObject_function and sets the default values. + /// + public RunToolCallObject_function() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RunToolCallObject_function CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RunToolCallObject_function(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"arguments", n => { Arguments = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("arguments", Arguments); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_type.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_type.cs new file mode 100644 index 0000000..66379fd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/RunToolCallObject_type.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The type of tool call the output is required for. For now, this is always `function`. + internal enum RunToolCallObject_type { + [EnumMember(Value = "function")] + Function, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest.cs new file mode 100644 index 0000000..92aac79 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class SubmitToolOutputsRunRequest : IParsable { + /// A list of tools for which the outputs are being submitted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ToolOutputs { get; set; } +#nullable restore +#else + public List ToolOutputs { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SubmitToolOutputsRunRequest CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SubmitToolOutputsRunRequest(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"tool_outputs", n => { ToolOutputs = n.GetCollectionOfObjectValues(SubmitToolOutputsRunRequest_tool_outputs.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("tool_outputs", ToolOutputs); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest_tool_outputs.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest_tool_outputs.cs new file mode 100644 index 0000000..08a0fae --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/SubmitToolOutputsRunRequest_tool_outputs.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + internal class SubmitToolOutputsRunRequest_tool_outputs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The output of the tool call to be submitted to continue the run. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Output { get; set; } +#nullable restore +#else + public string Output { get; set; } +#endif + /// The ID of the tool call in the `required_action` object within the run object the output is being submitted for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ToolCallId { get; set; } +#nullable restore +#else + public string ToolCallId { get; set; } +#endif + /// + /// Instantiates a new SubmitToolOutputsRunRequest_tool_outputs and sets the default values. + /// + public SubmitToolOutputsRunRequest_tool_outputs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SubmitToolOutputsRunRequest_tool_outputs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SubmitToolOutputsRunRequest_tool_outputs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"output", n => { Output = n.GetStringValue(); } }, + {"tool_call_id", n => { ToolCallId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("output", Output); + writer.WriteStringValue("tool_call_id", ToolCallId); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/TextContent.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/TextContent.cs new file mode 100644 index 0000000..c71444b --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/TextContent.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// The text contents of the message. + /// + internal class TextContent : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new TextContent and sets the default values. + /// + public TextContent() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TextContent CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TextContent(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject.cs new file mode 100644 index 0000000..ed4bfee --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Represents a thread that contains [messages](/docs/api-reference/messages). + /// + internal class ThreadObject : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Unix timestamp (in seconds) for when the thread was created. + public int? CreatedAt { get; set; } + /// The identifier, which can be referenced in API endpoints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ThreadObject_metadata? Metadata { get; set; } +#nullable restore +#else + public ThreadObject_metadata Metadata { get; set; } +#endif + /// The object type, which is always `thread`. + public ThreadObject_object? Object { get; set; } + /// + /// Instantiates a new ThreadObject and sets the default values. + /// + public ThreadObject() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ThreadObject CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ThreadObject(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"created_at", n => { CreatedAt = n.GetIntValue(); } }, + {"id", n => { Id = n.GetStringValue(); } }, + {"metadata", n => { Metadata = n.GetObjectValue(ThreadObject_metadata.CreateFromDiscriminatorValue); } }, + {"object", n => { Object = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("created_at", CreatedAt); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("metadata", Metadata); + writer.WriteEnumValue("object", Object); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_metadata.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_metadata.cs new file mode 100644 index 0000000..b4599c5 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_metadata.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// + /// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + /// + internal class ThreadObject_metadata : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ThreadObject_metadata and sets the default values. + /// + public ThreadObject_metadata() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ThreadObject_metadata CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ThreadObject_metadata(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_object.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_object.cs new file mode 100644 index 0000000..5547dbe --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Models/ThreadObject_object.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Models { + /// The object type, which is always `thread`. + internal enum ThreadObject_object { + [EnumMember(Value = "thread")] + Thread, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/Item/WithModelItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/Item/WithModelItemRequestBuilder.cs new file mode 100644 index 0000000..bb6a1b8 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/Item/WithModelItemRequestBuilder.cs @@ -0,0 +1,151 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.ModelsRequests.Item { + /// + /// Builds and executes requests for operations under \models\{model} + /// + internal class WithModelItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithModelItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithModelItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/models/{model}", pathParameters) { + } + /// + /// Instantiates a new WithModelItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithModelItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/models/{model}", rawUrl) { + } + /// + /// Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeleteModelResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a model instance, providing basic information about the model such as the owner and permissioning. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, Model.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithModelItemRequestBuilderDeleteRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieves a model instance, providing basic information about the model such as the owner and permissioning. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithModelItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithModelItemRequestBuilder WithUrl(string rawUrl) { + return new WithModelItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithModelItemRequestBuilderDeleteRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithModelItemRequestBuilderDeleteRequestConfiguration and sets the default values. + /// + public WithModelItemRequestBuilderDeleteRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithModelItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithModelItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithModelItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/ModelsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/ModelsRequestBuilder.cs new file mode 100644 index 0000000..793160f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/ModelsRequests/ModelsRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.ModelsRequests.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.ModelsRequests { + /// + /// Builds and executes requests for operations under \models + /// + internal class ModelsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.modelsRequests.item collection + /// The ID of the model to use for this request + public WithModelItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("model", position); + return new WithModelItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ModelsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ModelsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/models", pathParameters) { + } + /// + /// Instantiates a new ModelsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ModelsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/models", rawUrl) { + } + /// + /// Lists the currently available models, and provides basic information about each one such as the owner and availability. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListModelsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Lists the currently available models, and provides basic information about each one such as the owner and availability. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new ModelsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ModelsRequestBuilder WithUrl(string rawUrl) { + return new ModelsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class ModelsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new modelsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public ModelsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Moderations/ModerationsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Moderations/ModerationsRequestBuilder.cs new file mode 100644 index 0000000..c8ef7d0 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Moderations/ModerationsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Moderations { + /// + /// Builds and executes requests for operations under \moderations + /// + internal class ModerationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ModerationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ModerationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/moderations", pathParameters) { + } + /// + /// Instantiates a new ModerationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ModerationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/moderations", rawUrl) { + } + /// + /// Classifies if text violates OpenAI's Content Policy + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateModerationRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateModerationRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CreateModerationResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Classifies if text violates OpenAI's Content Policy + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateModerationRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateModerationRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new ModerationsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ModerationsRequestBuilder WithUrl(string rawUrl) { + return new ModerationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class ModerationsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new moderationsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public ModerationsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..ef0c857 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/FilesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/FilesRequestBuilder.cs new file mode 100644 index 0000000..e9b644e --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/FilesRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item.Files.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item.Files { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\messages\{message_id}\files + /// + internal class FilesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.threads.item.messages.item.files.item collection + /// The ID of the file being retrieved. + public WithFile_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("file_id", position); + return new WithFile_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}/files{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new FilesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FilesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}/files{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of message files. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListMessageFilesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of message files. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new FilesRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FilesRequestBuilder WithUrl(string rawUrl) { + return new FilesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of message files. + /// + internal class FilesRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class FilesRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public FilesRequestBuilderGetQueryParameters QueryParameters { get; set; } = new FilesRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new filesRequestBuilderGetRequestConfiguration and sets the default values. + /// + public FilesRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..2639b48 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item.Files { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/Item/WithFile_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/Item/WithFile_ItemRequestBuilder.cs new file mode 100644 index 0000000..fe77b30 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/Files/Item/WithFile_ItemRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item.Files.Item { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\messages\{message_id}\files\{file_id} + /// + internal class WithFile_ItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}/files/{file_id}", pathParameters) { + } + /// + /// Instantiates a new WithFile_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFile_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}/files/{file_id}", rawUrl) { + } + /// + /// Retrieves a message file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, MessageFileObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a message file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithFile_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFile_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithFile_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithFile_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithFile_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithFile_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/WithMessage_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/WithMessage_ItemRequestBuilder.cs new file mode 100644 index 0000000..5f8dabf --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/Item/WithMessage_ItemRequestBuilder.cs @@ -0,0 +1,161 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item.Files; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\messages\{message_id} + /// + internal class WithMessage_ItemRequestBuilder : BaseRequestBuilder { + /// The files property + public FilesRequestBuilder Files { get => + new FilesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithMessage_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithMessage_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}", pathParameters) { + } + /// + /// Instantiates a new WithMessage_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithMessage_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages/{message_id}", rawUrl) { + } + /// + /// Retrieve a message. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, MessageObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Modifies a message. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ModifyMessageRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ModifyMessageRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, MessageObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieve a message. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithMessage_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Modifies a message. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ModifyMessageRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ModifyMessageRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithMessage_ItemRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithMessage_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithMessage_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithMessage_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithMessage_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithMessage_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithMessage_ItemRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithMessage_ItemRequestBuilderPostRequestConfiguration and sets the default values. + /// + public WithMessage_ItemRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/MessagesRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/MessagesRequestBuilder.cs new file mode 100644 index 0000000..017526f --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Messages/MessagesRequestBuilder.cs @@ -0,0 +1,209 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Messages.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Messages { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\messages + /// + internal class MessagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.threads.item.messages.item collection + /// The ID of the message to retrieve. + public WithMessage_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("message_id", position); + return new WithMessage_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new MessagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MessagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new MessagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MessagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/messages{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of messages for a given thread. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListMessagesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a message. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateMessageRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateMessageRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, MessageObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of messages for a given thread. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new MessagesRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create a message. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateMessageRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateMessageRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new MessagesRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MessagesRequestBuilder WithUrl(string rawUrl) { + return new MessagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of messages for a given thread. + /// + internal class MessagesRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class MessagesRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public MessagesRequestBuilderGetQueryParameters QueryParameters { get; set; } = new MessagesRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new messagesRequestBuilderGetRequestConfiguration and sets the default values. + /// + public MessagesRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class MessagesRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new messagesRequestBuilderPostRequestConfiguration and sets the default values. + /// + public MessagesRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..ae225b1 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Cancel/CancelRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Cancel/CancelRequestBuilder.cs new file mode 100644 index 0000000..3396886 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Cancel/CancelRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Cancel { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs\{run_id}\cancel + /// + internal class CancelRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/cancel", pathParameters) { + } + /// + /// Instantiates a new CancelRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CancelRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/cancel", rawUrl) { + } + /// + /// Cancels a run that is `in_progress`. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Cancels a run that is `in_progress`. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new CancelRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CancelRequestBuilder WithUrl(string rawUrl) { + return new CancelRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class CancelRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new cancelRequestBuilderPostRequestConfiguration and sets the default values. + /// + public CancelRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/GetOrderQueryParameterType.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/GetOrderQueryParameterType.cs new file mode 100644 index 0000000..0ff5a59 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/GetOrderQueryParameterType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Steps { + internal enum GetOrderQueryParameterType { + [EnumMember(Value = "asc")] + Asc, + [EnumMember(Value = "desc")] + Desc, + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/Item/WithStep_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/Item/WithStep_ItemRequestBuilder.cs new file mode 100644 index 0000000..6da3d86 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/Item/WithStep_ItemRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Steps.Item { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs\{run_id}\steps\{step_id} + /// + internal class WithStep_ItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithStep_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithStep_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/steps/{step_id}", pathParameters) { + } + /// + /// Instantiates a new WithStep_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithStep_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/steps/{step_id}", rawUrl) { + } + /// + /// Retrieves a run step. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunStepObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a run step. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithStep_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithStep_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithStep_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithStep_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithStep_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithStep_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/StepsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/StepsRequestBuilder.cs new file mode 100644 index 0000000..9d0ad58 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Steps/StepsRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Steps.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Steps { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs\{run_id}\steps + /// + internal class StepsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.threads.item.runs.item.steps.item collection + /// The ID of the run step to retrieve. + public WithStep_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("step_id", position); + return new WithStep_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new StepsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StepsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/steps{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new StepsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StepsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/steps{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of run steps belonging to a run. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListRunStepsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of run steps belonging to a run. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new StepsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StepsRequestBuilder WithUrl(string rawUrl) { + return new StepsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of run steps belonging to a run. + /// + internal class StepsRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class StepsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public StepsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new StepsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new stepsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public StepsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Submit_tool_outputs/Submit_tool_outputsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Submit_tool_outputs/Submit_tool_outputsRequestBuilder.cs new file mode 100644 index 0000000..bf6ee96 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/Submit_tool_outputs/Submit_tool_outputsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Submit_tool_outputs { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs\{run_id}\submit_tool_outputs + /// + internal class Submit_tool_outputsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new Submit_tool_outputsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Submit_tool_outputsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/submit_tool_outputs", pathParameters) { + } + /// + /// Instantiates a new Submit_tool_outputsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Submit_tool_outputsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}/submit_tool_outputs", rawUrl) { + } + /// + /// When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SubmitToolOutputsRunRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SubmitToolOutputsRunRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SubmitToolOutputsRunRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SubmitToolOutputsRunRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new Submit_tool_outputsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public Submit_tool_outputsRequestBuilder WithUrl(string rawUrl) { + return new Submit_tool_outputsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class Submit_tool_outputsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new submit_tool_outputsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public Submit_tool_outputsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/WithRun_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/WithRun_ItemRequestBuilder.cs new file mode 100644 index 0000000..1c27538 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/Item/WithRun_ItemRequestBuilder.cs @@ -0,0 +1,171 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Cancel; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Steps; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item.Submit_tool_outputs; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs\{run_id} + /// + internal class WithRun_ItemRequestBuilder : BaseRequestBuilder { + /// The cancel property + public CancelRequestBuilder Cancel { get => + new CancelRequestBuilder(PathParameters, RequestAdapter); + } + /// The steps property + public StepsRequestBuilder Steps { get => + new StepsRequestBuilder(PathParameters, RequestAdapter); + } + /// The submit_tool_outputs property + public Submit_tool_outputsRequestBuilder Submit_tool_outputs { get => + new Submit_tool_outputsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithRun_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRun_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}", pathParameters) { + } + /// + /// Instantiates a new WithRun_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRun_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs/{run_id}", rawUrl) { + } + /// + /// Retrieves a run. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Modifies a run. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ModifyRunRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ModifyRunRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a run. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithRun_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Modifies a run. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ModifyRunRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ModifyRunRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithRun_ItemRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithRun_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithRun_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithRun_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithRun_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithRun_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithRun_ItemRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithRun_ItemRequestBuilderPostRequestConfiguration and sets the default values. + /// + public WithRun_ItemRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/RunsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/RunsRequestBuilder.cs new file mode 100644 index 0000000..3728861 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/Runs/RunsRequestBuilder.cs @@ -0,0 +1,209 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item.Runs { + /// + /// Builds and executes requests for operations under \threads\{thread_id}\runs + /// + internal class RunsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the OpenAI.GeneratedKiotaClient.threads.item.runs.item collection + /// The ID of the run to retrieve. + public WithRun_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("run_id", position); + return new WithRun_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new RunsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RunsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs{?limit*,order*,after*,before*}", pathParameters) { + } + /// + /// Instantiates a new RunsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RunsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}/runs{?limit*,order*,after*,before*}", rawUrl) { + } + /// + /// Returns a list of runs belonging to a thread. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListRunsResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a run. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateRunRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateRunRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Returns a list of runs belonging to a thread. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new RunsRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddQueryParameters(requestConfig.QueryParameters); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create a run. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateRunRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateRunRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new RunsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RunsRequestBuilder WithUrl(string rawUrl) { + return new RunsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Returns a list of runs belonging to a thread. + /// + internal class RunsRequestBuilderGetQueryParameters { + /// A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("after")] + public string? After { get; set; } +#nullable restore +#else + [QueryParameter("after")] + public string After { get; set; } +#endif + /// A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("before")] + public string? Before { get; set; } +#nullable restore +#else + [QueryParameter("before")] + public string Before { get; set; } +#endif + /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [Obsolete("This property is deprecated, use orderAsGetOrderQueryParameterType instead")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("order")] + public string? Order { get; set; } +#nullable restore +#else + [QueryParameter("order")] + public string Order { get; set; } +#endif + /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + [QueryParameter("order")] + public GetOrderQueryParameterType? OrderAsGetOrderQueryParameterType { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class RunsRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// Request query parameters + public RunsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new RunsRequestBuilderGetQueryParameters(); + /// + /// Instantiates a new runsRequestBuilderGetRequestConfiguration and sets the default values. + /// + public RunsRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class RunsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new runsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public RunsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/WithThread_ItemRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/WithThread_ItemRequestBuilder.cs new file mode 100644 index 0000000..4abbd6c --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Item/WithThread_ItemRequestBuilder.cs @@ -0,0 +1,222 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item.Messages; +using OpenAI.GeneratedKiotaClient.Threads.Item.Runs; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Item { + /// + /// Builds and executes requests for operations under \threads\{thread_id} + /// + internal class WithThread_ItemRequestBuilder : BaseRequestBuilder { + /// The messages property + public MessagesRequestBuilder Messages { get => + new MessagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The runs property + public RunsRequestBuilder Runs { get => + new RunsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithThread_ItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithThread_ItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}", pathParameters) { + } + /// + /// Instantiates a new WithThread_ItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithThread_ItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/{thread_id}", rawUrl) { + } + /// + /// Delete a thread. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeleteThreadResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a thread. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ThreadObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Modifies a thread. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ModifyThreadRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ModifyThreadRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ThreadObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete a thread. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.DELETE, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithThread_ItemRequestBuilderDeleteRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieves a thread. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation { + HttpMethod = Method.GET, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithThread_ItemRequestBuilderGetRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Modifies a thread. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ModifyThreadRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ModifyThreadRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new WithThread_ItemRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithThread_ItemRequestBuilder WithUrl(string rawUrl) { + return new WithThread_ItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithThread_ItemRequestBuilderDeleteRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithThread_ItemRequestBuilderDeleteRequestConfiguration and sets the default values. + /// + public WithThread_ItemRequestBuilderDeleteRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithThread_ItemRequestBuilderGetRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithThread_ItemRequestBuilderGetRequestConfiguration and sets the default values. + /// + public WithThread_ItemRequestBuilderGetRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class WithThread_ItemRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithThread_ItemRequestBuilderPostRequestConfiguration and sets the default values. + /// + public WithThread_ItemRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Runs/RunsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Runs/RunsRequestBuilder.cs new file mode 100644 index 0000000..b424e06 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/Runs/RunsRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads.Runs { + /// + /// Builds and executes requests for operations under \threads\runs + /// + internal class RunsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RunsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RunsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/runs", pathParameters) { + } + /// + /// Instantiates a new RunsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RunsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads/runs", rawUrl) { + } + /// + /// Create a thread and run it in one request. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateThreadAndRunRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateThreadAndRunRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, RunObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a thread and run it in one request. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateThreadAndRunRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateThreadAndRunRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new RunsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RunsRequestBuilder WithUrl(string rawUrl) { + return new RunsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class RunsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new runsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public RunsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/ThreadsRequestBuilder.cs b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/ThreadsRequestBuilder.cs new file mode 100644 index 0000000..05af3bd --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/Threads/ThreadsRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenAI.GeneratedKiotaClient.Models; +using OpenAI.GeneratedKiotaClient.Threads.Item; +using OpenAI.GeneratedKiotaClient.Threads.Runs; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenAI.GeneratedKiotaClient.Threads { + /// + /// Builds and executes requests for operations under \threads + /// + internal class ThreadsRequestBuilder : BaseRequestBuilder { + /// The runs property + public RunsRequestBuilder Runs { get => + new RunsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the OpenAI.GeneratedKiotaClient.threads.item collection + /// The ID of the thread to retrieve. + public WithThread_ItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("thread_id", position); + return new WithThread_ItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ThreadsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ThreadsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads", pathParameters) { + } + /// + /// Instantiates a new ThreadsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ThreadsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/threads", rawUrl) { + } + /// + /// Create a thread. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateThreadRequest body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateThreadRequest body, Action requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ThreadObject.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a thread. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateThreadRequest body, Action? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateThreadRequest body, Action requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation { + HttpMethod = Method.POST, + UrlTemplate = UrlTemplate, + PathParameters = PathParameters, + }; + if (requestConfiguration != null) { + var requestConfig = new ThreadsRequestBuilderPostRequestConfiguration(); + requestConfiguration.Invoke(requestConfig); + requestInfo.AddRequestOptions(requestConfig.Options); + requestInfo.AddHeaders(requestConfig.Headers); + } + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ThreadsRequestBuilder WithUrl(string rawUrl) { + return new ThreadsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + internal class ThreadsRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new threadsRequestBuilderPostRequestConfiguration and sets the default values. + /// + public ThreadsRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} + diff --git a/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/kiota-lock.json b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/kiota-lock.json new file mode 100644 index 0000000..1bc65aa --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/generated/openai/kiota-lock.json @@ -0,0 +1,27 @@ +{ + "descriptionHash": "81E236DB997E3B1D2CC6ACAEE41A5BFDEFFCDE9F33EF242024EC0F783D618CA3686EF43E9F3E52854AFC0A1991D2F08330858BF2AE37BC05B28D93227B26E398", + "descriptionLocation": "https://github.com/openai/openai-openapi/raw/master/openapi.yaml", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.8.2", + "clientClassName": "GeneratedOpenAiClient", + "clientNamespaceName": "OpenAI.GeneratedKiotaClient", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/src/internal/OpenAI.GeneratedKiotaClient/readme.md b/src/internal/OpenAI.GeneratedKiotaClient/readme.md new file mode 100644 index 0000000..ff8f15d --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/readme.md @@ -0,0 +1,36 @@ +# Install Kiota +```shell +dotnet tool install --global Microsoft.OpenApi.Kiota +``` + +```shell +dotnet tool update --global Microsoft.OpenApi.Kiota +``` + +# OpenAI OpenAPI specification + +```shell +kiota generate -d https://github.com/openai/openai-openapi/raw/master/openapi.yaml -o generated/openai -l CSharp -c GeneratedOpenAiClient --namespace-name OpenAI.GeneratedKiotaClient --serializer Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory --deserializer Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory +``` + +## Update the generated code +```shell +kiota update -o generated/openai +``` + +# Azure OpenAI specification + +```shell +kiota generate -d https://github.com/Azure/azure-rest-api-specs/raw/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.yaml -o generated/azure_openai -l CSharp -c GeneratedAzureOpenAiClient --namespace-name OpenAI.Azure.GeneratedKiotaClient --serializer Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory --deserializer Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory +``` + +## Update the generated code +```shell +kiota update -o azure_openai +``` + +# Replace public with internal + +```shell +powershell -ExecutionPolicy Bypass -File scripts\public_to_internal.ps1 +``` \ No newline at end of file diff --git a/src/internal/OpenAI.GeneratedKiotaClient/scripts/public_to_internal.ps1 b/src/internal/OpenAI.GeneratedKiotaClient/scripts/public_to_internal.ps1 new file mode 100644 index 0000000..b3393e4 --- /dev/null +++ b/src/internal/OpenAI.GeneratedKiotaClient/scripts/public_to_internal.ps1 @@ -0,0 +1,41 @@ +# Define the path to the script's directory +$scriptPath = $PSScriptRoot + +# Define the relative path from the script to the 'generated' directory +$relativePath = "..\generated" + +# Combine paths to get the full path to your source code +$sourcePath = Join-Path -Path $scriptPath -ChildPath $relativePath + +# Define the file extension to search for +$fileExtension = "*.cs" + +# Regex pattern to match public classes, structs, enums, and interfaces +$pattern = '\bpublic\s+(class|struct|enum|interface|record)\s+(\w+)' + +# Initialize the counter +$changedFilesCount = 0 + +# Recursively find all matching files +$files = Get-ChildItem -Path $sourcePath -Filter $fileExtension -Recurse + +Write-Host "Found $($files.Count) files to process." +foreach ($file in $files) { + # Read the contents of the file + $content = Get-Content $file.FullName -Raw + + # Check if the file contains the pattern + if ($content -match $pattern) { + # Replace public with internal + $updatedContent = [Regex]::Replace($content, $pattern, 'internal $1 $2') + + # Write the updated content back to the file + Set-Content -Path $file.FullName -Value $updatedContent + + # Increment the counter + $changedFilesCount++ + } +} + +# Print the number of files changed +Write-Host "$changedFilesCount files have been changed."