From b295b9eafe022de5e702f6e981da9e1c91f5ef28 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:49:27 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-csharp-sdk: 2.59.6 --- .fern/metadata.json | 9 +- reference.md | 279 --------- .../EmpathicVoice/ChatGroups/GetAudioTest.cs | 2 +- .../ChatGroups/GetChatGroupTest.cs | 2 +- .../ChatGroups/ListChatGroupEventsTest.cs | 2 +- .../ChatGroups/ListChatGroupsTest.cs | 2 +- .../EmpathicVoice/Chats/GetAudioTest.cs | 2 +- .../EmpathicVoice/Chats/ListChatEventsTest.cs | 2 +- .../EmpathicVoice/Chats/ListChatsTest.cs | 2 +- .../EmpathicVoice/Configs/CreateConfigTest.cs | 2 +- .../Configs/CreateConfigVersionTest.cs | 2 +- .../Configs/GetConfigVersionTest.cs | 2 +- .../Configs/ListConfigVersionsTest.cs | 2 +- .../EmpathicVoice/Configs/ListConfigsTest.cs | 2 +- .../Configs/UpdateConfigDescriptionTest.cs | 2 +- .../EmpathicVoice/Prompts/CreatePromptTest.cs | 2 +- .../Prompts/CreatePromptVersionTest.cs | 2 +- .../Prompts/GetPromptVersionTest.cs | 2 +- .../Prompts/ListPromptVersionsTest.cs | 2 +- .../EmpathicVoice/Prompts/ListPromptsTest.cs | 2 +- .../Prompts/UpdatePromptDescriptionTest.cs | 2 +- .../EmpathicVoice/Tools/CreateToolTest.cs | 2 +- .../Tools/CreateToolVersionTest.cs | 2 +- .../EmpathicVoice/Tools/GetToolVersionTest.cs | 2 +- .../Tools/ListToolVersionsTest.cs | 2 +- .../EmpathicVoice/Tools/ListToolsTest.cs | 2 +- .../Tools/UpdateToolDescriptionTest.cs | 2 +- .../Batch/GetJobDetailsTest.cs | 76 --- .../Batch/GetJobPredictionsTest.cs | 266 --------- .../Batch/ListJobsTest.cs | 82 --- .../Unit/MockServer/Tts/SynthesizeJsonTest.cs | 2 +- .../Unit/MockServer/Tts/Voices/CreateTest.cs | 2 +- .../Unit/MockServer/Tts/Voices/ListTest.cs | 2 +- src/Hume/Core/Public/Version.cs | 2 +- src/Hume/EmpathicVoice/Chat/ChatApi.cs | 19 +- src/Hume/EmpathicVoice/Chat/IChatApi.cs | 6 +- .../ChatGroups/ChatGroupsClient.cs | 20 +- .../ChatGroups/IChatGroupsClient.cs | 4 +- src/Hume/EmpathicVoice/Chats/ChatsClient.cs | 16 +- src/Hume/EmpathicVoice/Chats/IChatsClient.cs | 4 +- .../EmpathicVoice/Configs/ConfigsClient.cs | 36 +- .../EmpathicVoice/Configs/IConfigsClient.cs | 8 +- .../ControlPlane/ControlPlaneApi.cs | 19 +- .../ControlPlane/ControlPlaneClient.cs | 2 +- .../ControlPlane/IControlPlaneApi.cs | 6 +- .../ControlPlane/IControlPlaneClient.cs | 2 +- .../EmpathicVoice/Prompts/IPromptsClient.cs | 6 +- .../EmpathicVoice/Prompts/PromptsClient.cs | 34 +- src/Hume/EmpathicVoice/Tools/IToolsClient.cs | 8 +- src/Hume/EmpathicVoice/Tools/ToolsClient.cs | 36 +- src/Hume/EmpathicVoice/Types/BuiltInTool.cs | 4 +- src/Hume/EmpathicVoice/Types/ContextType.cs | 4 +- .../EmpathicVoice/Types/LanguageModelType.cs | 4 +- .../EmpathicVoice/Types/ModelProviderEnum.cs | 4 +- .../Types/PostedBuiltinToolName.cs | 4 +- .../Types/PostedWebhookEventType.cs | 4 +- .../EmpathicVoice/Types/ProsodyInference.cs | 2 +- .../Types/ReturnBuiltinToolToolType.cs | 4 +- .../ReturnChatAudioReconstructionStatus.cs | 4 +- .../Types/ReturnChatEventRole.cs | 4 +- .../Types/ReturnChatEventType.cs | 4 +- ...AudioReconstructionsPaginationDirection.cs | 4 +- ...nChatGroupPagedChatsPaginationDirection.cs | 4 +- ...ChatGroupPagedEventsPaginationDirection.cs | 4 +- ...eturnChatPagedEventsPaginationDirection.cs | 4 +- .../Types/ReturnChatPagedEventsStatus.cs | 4 +- .../EmpathicVoice/Types/ReturnChatStatus.cs | 4 +- ...eturnPagedChatGroupsPaginationDirection.cs | 4 +- .../ReturnPagedChatsPaginationDirection.cs | 4 +- .../Types/ReturnPromptVersionType.cs | 4 +- .../Types/ReturnUserDefinedToolToolType.cs | 4 +- .../Types/ReturnUserDefinedToolVersionType.cs | 4 +- .../Types/ReturnWebhookEventType.cs | 4 +- src/Hume/EmpathicVoice/Types/Role.cs | 4 +- src/Hume/EmpathicVoice/Types/ToolType.cs | 4 +- src/Hume/EmpathicVoice/Types/VoiceProvider.cs | 4 +- .../Types/WebhookEventChatStartType.cs | 4 +- .../Types/WebhookEventChatStatus.cs | 4 +- .../Batch/BatchClient.cs | 538 ------------------ .../Batch/IBatchClient.cs | 60 -- .../Batch/Requests/BatchListJobsRequest.cs | 70 --- ...chStartInferenceJobFromLocalFileRequest.cs | 21 - .../Batch/Types/Alternative.cs | 77 --- .../Batch/Types/Bcp47Tag.cs | 221 ------- .../Batch/Types/BoundingBox.cs | 53 -- .../Batch/Types/BurstPrediction.cs | 42 -- .../Types/CompletedEmbeddingGeneration.cs | 44 -- .../Batch/Types/CompletedInference.cs | 56 -- .../Batch/Types/CompletedState.cs | 56 -- .../Batch/Types/CompletedTlInference.cs | 56 -- .../Batch/Types/CompletedTraining.cs | 50 -- .../Batch/Types/CustomModelId.cs | 29 - .../Batch/Types/CustomModelPrediction.cs | 35 -- .../Batch/Types/CustomModelRequest.cs | 35 -- .../Batch/Types/CustomModelVersionId.cs | 29 - .../Batch/Types/CustomModelsInferenceJob.cs | 44 -- .../Batch/Types/CustomModelsTrainingJob.cs | 44 -- .../Batch/Types/DatasetId.cs | 29 - .../Batch/Types/DatasetVersionId.cs | 29 - .../Batch/Types/DescriptionsScore.cs | 38 -- .../Batch/Types/Direction.cs | 113 ---- .../Types/EmbeddingGenerationBaseRequest.cs | 32 -- .../Batch/Types/EmbeddingGenerationJob.cs | 44 -- .../Batch/Types/EmotionScore.cs | 38 -- .../Batch/Types/Error.cs | 38 -- .../Batch/Types/EvaluationArgs.cs | 29 - .../ExpressionMeasurement/Batch/Types/Face.cs | 67 --- .../Batch/Types/FacePrediction.cs | 65 --- .../Batch/Types/FacemeshPrediction.cs | 32 -- .../Batch/Types/FacsScore.cs | 38 -- .../Batch/Types/Failed.cs | 50 -- .../Batch/Types/FailedState.cs | 50 -- .../ExpressionMeasurement/Batch/Types/File.cs | 47 -- .../Batch/Types/Granularity.cs | 123 ---- .../GroupedPredictionsBurstPrediction.cs | 35 -- .../Types/GroupedPredictionsFacePrediction.cs | 35 -- .../GroupedPredictionsFacemeshPrediction.cs | 36 -- .../GroupedPredictionsLanguagePrediction.cs | 36 -- .../Types/GroupedPredictionsNerPrediction.cs | 35 -- .../GroupedPredictionsProsodyPrediction.cs | 35 -- .../Batch/Types/InProgress.cs | 38 -- .../Batch/Types/InProgressState.cs | 38 -- .../Batch/Types/InferenceBaseRequest.cs | 63 -- .../Batch/Types/InferenceJob.cs | 52 -- .../Batch/Types/InferencePrediction.cs | 35 -- .../Batch/Types/InferenceRequest.cs | 61 -- .../Batch/Types/InferenceResults.cs | 33 -- .../Types/InferenceSourcePredictResult.cs | 38 -- .../Batch/Types/JobEmbeddingGeneration.cs | 41 -- .../Batch/Types/JobId.cs | 32 -- .../Batch/Types/JobInference.cs | 44 -- .../Batch/Types/JobTlInference.cs | 41 -- .../Batch/Types/JobTraining.cs | 41 -- .../Batch/Types/Language.cs | 46 -- .../Batch/Types/LanguagePrediction.cs | 70 --- .../Batch/Types/Models.cs | 47 -- .../Batch/Types/ModelsPredictions.cs | 44 -- .../ExpressionMeasurement/Batch/Types/Ner.cs | 37 -- .../Batch/Types/NerPrediction.cs | 80 --- .../Batch/Types/PositionInterval.cs | 41 -- .../PredictionsOptionalNullBurstPrediction.cs | 33 -- .../PredictionsOptionalNullFacePrediction.cs | 33 -- ...edictionsOptionalNullFacemeshPrediction.cs | 33 -- ...TranscriptionMetadataLanguagePrediction.cs | 33 -- ...ionalTranscriptionMetadataNerPrediction.cs | 33 -- ...lTranscriptionMetadataProsodyPrediction.cs | 33 -- .../Batch/Types/Prosody.cs | 43 -- .../Batch/Types/ProsodyPrediction.cs | 53 -- .../Batch/Types/Queued.cs | 32 -- .../Batch/Types/QueuedState.cs | 32 -- .../Batch/Types/RegistryFileDetail.cs | 38 -- .../Batch/Types/SentimentScore.cs | 38 -- .../Batch/Types/SortBy.cs | 117 ---- .../Batch/Types/Source.cs | 357 ------------ .../Batch/Types/SourceFile.cs | 44 -- .../Batch/Types/SourceTextSource.cs | 26 - .../Batch/Types/SourceUrl.cs | 32 -- .../Batch/Types/StateEmbeddingGeneration.cs | 458 --------------- ...gGenerationCompletedEmbeddingGeneration.cs | 44 -- .../Types/StateEmbeddingGenerationFailed.cs | 50 -- .../StateEmbeddingGenerationInProgress.cs | 38 -- .../Types/StateEmbeddingGenerationQueued.cs | 32 -- .../Batch/Types/StateInference.cs | 430 -------------- .../Batch/Types/StateTlInference.cs | 438 -------------- .../StateTlInferenceCompletedTlInference.cs | 56 -- .../Batch/Types/StateTlInferenceFailed.cs | 50 -- .../Batch/Types/StateTlInferenceInProgress.cs | 38 -- .../Batch/Types/StateTlInferenceQueued.cs | 32 -- .../Batch/Types/StateTraining.cs | 432 -------------- .../Types/StateTrainingCompletedTraining.cs | 50 -- .../Batch/Types/StateTrainingFailed.cs | 50 -- .../Batch/Types/StateTrainingInProgress.cs | 38 -- .../Batch/Types/StateTrainingQueued.cs | 32 -- .../Batch/Types/Status.cs | 121 ---- .../ExpressionMeasurement/Batch/Types/Tag.cs | 32 -- .../ExpressionMeasurement/Batch/Types/Task.cs | 280 --------- .../Batch/Types/TaskClassification.cs | 26 - .../Batch/Types/TaskRegression.cs | 26 - .../Batch/Types/TimeInterval.cs | 41 -- .../Batch/Types/TlInferenceBaseRequest.cs | 50 -- .../Batch/Types/TlInferencePrediction.cs | 39 -- .../Batch/Types/TlInferenceResults.cs | 33 -- .../Types/TlInferenceSourcePredictResult.cs | 38 -- .../Batch/Types/ToxicityScore.cs | 38 -- .../Batch/Types/TrainingBaseRequest.cs | 51 -- .../Batch/Types/TrainingCustomModel.cs | 32 -- .../Batch/Types/Transcription.cs | 80 --- .../Batch/Types/TranscriptionMetadata.cs | 38 -- .../ExpressionMeasurement/Batch/Types/Type.cs | 117 ---- .../ExpressionMeasurement/Batch/Types/Url.cs | 32 -- .../Batch/Types/ValidationArgs.cs | 30 - .../ExpressionMeasurement/Batch/Types/When.cs | 109 ---- .../Batch/Types/Window.cs | 43 -- .../ExpressionMeasurementClient.cs | 21 - .../IExpressionMeasurementClient.cs | 10 - .../Stream/IStreamClient.cs | 8 - .../Stream/Stream/IStreamApi.cs | 25 - .../Stream/Stream/StreamApi.cs | 271 --------- .../Stream/Stream/Types/Config.cs | 73 --- .../Stream/Stream/Types/JobDetails.cs | 35 -- .../Stream/Stream/Types/StreamErrorMessage.cs | 53 -- .../Stream/Stream/Types/StreamFace.cs | 67 --- .../Stream/Stream/Types/StreamLanguage.cs | 47 -- .../Stream/Types/StreamModelPredictions.cs | 71 --- .../Types/StreamModelPredictionsBurst.cs | 32 -- ...eamModelPredictionsBurstPredictionsItem.cs | 32 -- .../Types/StreamModelPredictionsFace.cs | 32 -- ...reamModelPredictionsFacePredictionsItem.cs | 62 -- .../Types/StreamModelPredictionsFacemesh.cs | 32 -- ...ModelPredictionsFacemeshPredictionsItem.cs | 29 - .../Types/StreamModelPredictionsJobDetails.cs | 35 -- .../Types/StreamModelPredictionsLanguage.cs | 32 -- ...ModelPredictionsLanguagePredictionsItem.cs | 44 -- .../Types/StreamModelPredictionsProsody.cs | 32 -- ...mModelPredictionsProsodyPredictionsItem.cs | 32 -- .../Types/StreamModelsEndpointPayload.cs | 87 --- .../Stream/Types/StreamWarningMessage.cs | 53 -- .../Types/StreamWarningMessageJobDetails.cs | 35 -- .../Stream/StreamClient.cs | 25 - .../Stream/Types/EmotionEmbeddingItem.cs | 38 -- .../Stream/Types/SentimentItem.cs | 38 -- .../Stream/Types/StreamBoundingBox.cs | 53 -- .../Stream/Types/TextPosition.cs | 41 -- .../Stream/Types/TimeRange.cs | 41 -- .../Stream/Types/ToxicityItem.cs | 38 -- src/Hume/Hume.csproj | 2 +- src/Hume/HumeClient.cs | 6 +- src/Hume/IHumeClient.cs | 2 - src/Hume/Tts/StreamInput/IStreamInputApi.cs | 9 +- src/Hume/Tts/StreamInput/StreamInputApi.cs | 22 +- src/Hume/Tts/TtsClient.cs | 16 +- src/Hume/Tts/Types/AudioFormatType.cs | 4 +- src/Hume/Tts/Types/OctaveVersion.cs | 4 +- src/Hume/Tts/Types/TimestampType.cs | 4 +- src/Hume/Tts/Types/VoiceProvider.cs | 4 +- src/Hume/Tts/Voices/IVoicesClient.cs | 4 +- src/Hume/Tts/Voices/VoicesClient.cs | 10 +- 237 files changed, 193 insertions(+), 10614 deletions(-) delete mode 100644 src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobDetailsTest.cs delete mode 100644 src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobPredictionsTest.cs delete mode 100644 src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/ListJobsTest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/BatchClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/IBatchClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Requests/BatchListJobsRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Requests/BatchStartInferenceJobFromLocalFileRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Alternative.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Bcp47Tag.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/BoundingBox.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/BurstPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CompletedEmbeddingGeneration.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CompletedInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CompletedState.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CompletedTlInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CompletedTraining.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelId.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelVersionId.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsInferenceJob.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsTrainingJob.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/DatasetId.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/DatasetVersionId.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/DescriptionsScore.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Direction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationBaseRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationJob.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/EmotionScore.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Error.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/EvaluationArgs.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Face.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/FacePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/FacemeshPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/FacsScore.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Failed.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/FailedState.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/File.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Granularity.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsBurstPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacemeshPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsLanguagePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsNerPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsProsodyPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InProgress.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InProgressState.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferenceBaseRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferenceJob.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferencePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferenceRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferenceResults.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/InferenceSourcePredictResult.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/JobEmbeddingGeneration.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/JobId.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/JobInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/JobTlInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/JobTraining.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Language.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/LanguagePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Models.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/ModelsPredictions.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Ner.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/NerPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PositionInterval.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullBurstPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacemeshPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataLanguagePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataNerPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataProsodyPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Prosody.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/ProsodyPrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Queued.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/QueuedState.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/RegistryFileDetail.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/SentimentScore.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/SortBy.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Source.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/SourceFile.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/SourceTextSource.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/SourceUrl.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGeneration.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationCompletedEmbeddingGeneration.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationFailed.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationInProgress.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationQueued.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTlInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceCompletedTlInference.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceFailed.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceInProgress.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceQueued.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTraining.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingCompletedTraining.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingFailed.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingInProgress.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingQueued.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Status.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Tag.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Task.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TaskClassification.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TaskRegression.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TimeInterval.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceBaseRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TlInferencePrediction.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceResults.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceSourcePredictResult.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/ToxicityScore.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TrainingBaseRequest.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TrainingCustomModel.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Transcription.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/TranscriptionMetadata.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Type.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Url.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/ValidationArgs.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/When.cs delete mode 100644 src/Hume/ExpressionMeasurement/Batch/Types/Window.cs delete mode 100644 src/Hume/ExpressionMeasurement/ExpressionMeasurementClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/IExpressionMeasurementClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/IStreamClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/IStreamApi.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/StreamApi.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/Config.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/JobDetails.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamErrorMessage.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamFace.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamLanguage.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictions.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurst.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurstPredictionsItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFace.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacePredictionsItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemesh.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemeshPredictionsItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsJobDetails.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguage.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguagePredictionsItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsody.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsodyPredictionsItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelsEndpointPayload.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessage.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessageJobDetails.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/StreamClient.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/EmotionEmbeddingItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/SentimentItem.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/StreamBoundingBox.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/TextPosition.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/TimeRange.cs delete mode 100644 src/Hume/ExpressionMeasurement/Stream/Types/ToxicityItem.cs diff --git a/.fern/metadata.json b/.fern/metadata.json index d7c02b9..0917a17 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -17,14 +17,9 @@ "environments": { "prod": "wss://api.hume.ai/v0/evi" } - }, - "/models": { - "environments": { - "prod": "wss://api.hume.ai/v0/stream" - } } } }, - "originGitCommit": "274a9e627c776728cbf8da2fc71627448d122f99", - "sdkVersion": "0.2.8" + "originGitCommit": "2968d0bfb0c9e8d381a274972edb6f7948cf77c6", + "sdkVersion": "0.2.9" } \ No newline at end of file diff --git a/reference.md b/reference.md index ee939f7..9f17d86 100644 --- a/reference.md +++ b/reference.md @@ -2900,282 +2900,3 @@ client.Tts.ConvertVoiceJsonAsync(new ConvertVoiceJsonRequest()); -## ExpressionMeasurement Batch -
client.ExpressionMeasurement.Batch.ListJobsAsync(BatchListJobsRequest { ... }) -> WithRawResponseTask<IEnumerable<InferenceJob>> -
-
- -#### šŸ“ Description - -
-
- -
-
- -Sort and filter jobs. -
-
-
-
- -#### šŸ”Œ Usage - -
-
- -
-
- -```csharp -await client.ExpressionMeasurement.Batch.ListJobsAsync(new BatchListJobsRequest()); -``` -
-
-
-
- -#### āš™ļø Parameters - -
-
- -
-
- -**request:** `BatchListJobsRequest` - -
-
-
-
- - -
-
-
- -
client.ExpressionMeasurement.Batch.StartInferenceJobAsync(InferenceBaseRequest { ... }) -> WithRawResponseTask<JobId> -
-
- -#### šŸ“ Description - -
-
- -
-
- -Start a new measurement inference job. -
-
-
-
- -#### šŸ”Œ Usage - -
-
- -
-
- -```csharp -await client.ExpressionMeasurement.Batch.StartInferenceJobAsync( - new InferenceBaseRequest - { - Urls = new List() { "https://hume-tutorials.s3.amazonaws.com/faces.zip" }, - Notify = true, - } -); -``` -
-
-
-
- -#### āš™ļø Parameters - -
-
- -
-
- -**request:** `InferenceBaseRequest` - -
-
-
-
- - -
-
-
- -
client.ExpressionMeasurement.Batch.GetJobDetailsAsync(id) -> WithRawResponseTask<InferenceJob> -
-
- -#### šŸ“ Description - -
-
- -
-
- -Get the request details and state of a given job. -
-
-
-
- -#### šŸ”Œ Usage - -
-
- -
-
- -```csharp -await client.ExpressionMeasurement.Batch.GetJobDetailsAsync("job_id"); -``` -
-
-
-
- -#### āš™ļø Parameters - -
-
- -
-
- -**id:** `string` — The unique identifier for the job. - -
-
-
-
- - -
-
-
- -
client.ExpressionMeasurement.Batch.GetJobPredictionsAsync(id) -> WithRawResponseTask<IEnumerable<InferenceSourcePredictResult>> -
-
- -#### šŸ“ Description - -
-
- -
-
- -Get the JSON predictions of a completed inference job. -
-
-
-
- -#### šŸ”Œ Usage - -
-
- -
-
- -```csharp -await client.ExpressionMeasurement.Batch.GetJobPredictionsAsync("job_id"); -``` -
-
-
-
- -#### āš™ļø Parameters - -
-
- -
-
- -**id:** `string` — The unique identifier for the job. - -
-
-
-
- - -
-
-
- -
client.ExpressionMeasurement.Batch.StartInferenceJobFromLocalFileAsync(BatchStartInferenceJobFromLocalFileRequest { ... }) -> WithRawResponseTask<JobId> -
-
- -#### šŸ“ Description - -
-
- -
-
- -Start a new batch inference job. -
-
-
-
- -#### šŸ”Œ Usage - -
-
- -
-
- -```csharp -await client.ExpressionMeasurement.Batch.StartInferenceJobFromLocalFileAsync( - new BatchStartInferenceJobFromLocalFileRequest() -); -``` -
-
-
-
- -#### āš™ļø Parameters - -
-
- -
-
- -**request:** `BatchStartInferenceJobFromLocalFileRequest` - -
-
-
-
- - -
-
-
- diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetAudioTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetAudioTest.cs index 23ea88b..d480ae5 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetAudioTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetAudioTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.ChatGroups; public class GetAudioTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetChatGroupTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetChatGroupTest.cs index 2d12709..74985fc 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetChatGroupTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/GetChatGroupTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.ChatGroups; public class GetChatGroupTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupEventsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupEventsTest.cs index 4fb8f14..b15bd14 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupEventsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupEventsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.ChatGroups; public class ListChatGroupEventsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupsTest.cs index 9514dc7..8736a64 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/ChatGroups/ListChatGroupsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.ChatGroups; public class ListChatGroupsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/GetAudioTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/GetAudioTest.cs index 8379546..03a7abe 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/GetAudioTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/GetAudioTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Chats; public class GetAudioTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatEventsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatEventsTest.cs index 0ddb004..3a94ebb 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatEventsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatEventsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Chats; public class ListChatEventsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatsTest.cs index 69aca0f..2d3dbe5 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Chats/ListChatsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Chats; public class ListChatsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigTest.cs index 7e0436c..2509209 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class CreateConfigTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigVersionTest.cs index 4f72ce1..9a21f90 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/CreateConfigVersionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class CreateConfigVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/GetConfigVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/GetConfigVersionTest.cs index 7758d2d..f0f9af1 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/GetConfigVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/GetConfigVersionTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class GetConfigVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigVersionsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigVersionsTest.cs index a35134b..c9882d7 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigVersionsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigVersionsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class ListConfigVersionsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigsTest.cs index 6e5ca13..91f5240 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/ListConfigsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class ListConfigsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/UpdateConfigDescriptionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/UpdateConfigDescriptionTest.cs index 421e7e5..8f962e6 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/UpdateConfigDescriptionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Configs/UpdateConfigDescriptionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Configs; public class UpdateConfigDescriptionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptTest.cs index 26e07a6..ee3705e 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class CreatePromptTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptVersionTest.cs index 88c6b9b..392a9f8 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/CreatePromptVersionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class CreatePromptVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/GetPromptVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/GetPromptVersionTest.cs index b866425..974771d 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/GetPromptVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/GetPromptVersionTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class GetPromptVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptVersionsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptVersionsTest.cs index b207be9..4508263 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptVersionsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptVersionsTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class ListPromptVersionsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptsTest.cs index b3d0b46..34b684a 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/ListPromptsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class ListPromptsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/UpdatePromptDescriptionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/UpdatePromptDescriptionTest.cs index 6c5997b..3740357 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/UpdatePromptDescriptionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Prompts/UpdatePromptDescriptionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Prompts; public class UpdatePromptDescriptionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolTest.cs index a4c7e5e..33d4d94 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class CreateToolTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolVersionTest.cs index fd087ba..2b5d867 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/CreateToolVersionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class CreateToolVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/GetToolVersionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/GetToolVersionTest.cs index bdb4663..4ceb2b6 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/GetToolVersionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/GetToolVersionTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class GetToolVersionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolVersionsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolVersionsTest.cs index d6107f7..dbbedb7 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolVersionsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolVersionsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class ListToolVersionsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolsTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolsTest.cs index daf9e74..bca29ea 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolsTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/ListToolsTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class ListToolsTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/UpdateToolDescriptionTest.cs b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/UpdateToolDescriptionTest.cs index b872f5c..dcf35bc 100644 --- a/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/UpdateToolDescriptionTest.cs +++ b/src/Hume.Test/Unit/MockServer/EmpathicVoice/Tools/UpdateToolDescriptionTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.EmpathicVoice.Tools; public class UpdateToolDescriptionTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobDetailsTest.cs b/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobDetailsTest.cs deleted file mode 100644 index d63fdc0..0000000 --- a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobDetailsTest.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Hume.Test.Unit.MockServer; -using Hume.Test.Utils; -using NUnit.Framework; - -namespace Hume.Test.Unit.MockServer.ExpressionMeasurement.Batch; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class GetJobDetailsTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() - { - const string mockResponse = """ - { - "type": "INFERENCE", - "job_id": "job_id", - "request": { - "files": [], - "models": { - "burst": {}, - "face": { - "fps_pred": 3, - "identify_faces": false, - "min_face_size": 60, - "prob_threshold": 0.99, - "save_faces": false - }, - "facemesh": {}, - "language": { - "granularity": "word", - "identify_speakers": false - }, - "ner": { - "identify_speakers": false - }, - "prosody": { - "granularity": "utterance", - "identify_speakers": false - } - }, - "notify": true, - "text": [], - "urls": [ - "https://hume-tutorials.s3.amazonaws.com/faces.zip" - ] - }, - "state": { - "status": "COMPLETED", - "created_timestamp_ms": 1712590457884, - "ended_timestamp_ms": 1712590462252, - "num_errors": 0, - "num_predictions": 10, - "started_timestamp_ms": 1712590457995 - } - } - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/v0/batch/jobs/job_id") - .UsingGet() - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.ExpressionMeasurement.Batch.GetJobDetailsAsync("job_id"); - JsonAssert.AreEqual(response, mockResponse); - } -} diff --git a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobPredictionsTest.cs b/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobPredictionsTest.cs deleted file mode 100644 index a011a8f..0000000 --- a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/GetJobPredictionsTest.cs +++ /dev/null @@ -1,266 +0,0 @@ -using Hume.Test.Unit.MockServer; -using Hume.Test.Utils; -using NUnit.Framework; - -namespace Hume.Test.Unit.MockServer.ExpressionMeasurement.Batch; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class GetJobPredictionsTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() - { - const string mockResponse = """ - [ - { - "source": { - "type": "url", - "url": "https://hume-tutorials.s3.amazonaws.com/faces.zip" - }, - "results": { - "predictions": [ - { - "file": "faces/100.jpg", - "models": { - "face": { - "grouped_predictions": [ - { - "id": "unknown", - "predictions": [ - { - "frame": 0, - "time": 0, - "prob": 0.9994111061096191, - "box": { - "x": 1187.885986328125, - "y": 1397.697509765625, - "w": 1401.668701171875, - "h": 1961.424560546875 - }, - "emotions": [ - { - "name": "Admiration", - "score": 0.10722749680280685 - }, - { - "name": "Adoration", - "score": 0.06395940482616425 - }, - { - "name": "Aesthetic Appreciation", - "score": 0.05811462551355362 - }, - { - "name": "Amusement", - "score": 0.14187128841876984 - }, - { - "name": "Anger", - "score": 0.02804684266448021 - }, - { - "name": "Anxiety", - "score": 0.2713485360145569 - }, - { - "name": "Awe", - "score": 0.33812594413757324 - }, - { - "name": "Awkwardness", - "score": 0.1745193600654602 - }, - { - "name": "Boredom", - "score": 0.23600080609321594 - }, - { - "name": "Calmness", - "score": 0.18988418579101562 - }, - { - "name": "Concentration", - "score": 0.44288986921310425 - }, - { - "name": "Confusion", - "score": 0.39346569776535034 - }, - { - "name": "Contemplation", - "score": 0.31002455949783325 - }, - { - "name": "Contempt", - "score": 0.048870109021663666 - }, - { - "name": "Contentment", - "score": 0.0579497292637825 - }, - { - "name": "Craving", - "score": 0.06544201076030731 - }, - { - "name": "Desire", - "score": 0.05526508390903473 - }, - { - "name": "Determination", - "score": 0.08590991795063019 - }, - { - "name": "Disappointment", - "score": 0.19508258998394012 - }, - { - "name": "Disgust", - "score": 0.031529419124126434 - }, - { - "name": "Distress", - "score": 0.23210826516151428 - }, - { - "name": "Doubt", - "score": 0.3284550905227661 - }, - { - "name": "Ecstasy", - "score": 0.040716782212257385 - }, - { - "name": "Embarrassment", - "score": 0.1467227339744568 - }, - { - "name": "Empathic Pain", - "score": 0.07633581757545471 - }, - { - "name": "Entrancement", - "score": 0.16245244443416595 - }, - { - "name": "Envy", - "score": 0.03267110139131546 - }, - { - "name": "Excitement", - "score": 0.10656816512346268 - }, - { - "name": "Fear", - "score": 0.3115977346897125 - }, - { - "name": "Guilt", - "score": 0.11615975946187973 - }, - { - "name": "Horror", - "score": 0.19795553386211395 - }, - { - "name": "Interest", - "score": 0.3136432468891144 - }, - { - "name": "Joy", - "score": 0.06285581737756729 - }, - { - "name": "Love", - "score": 0.06339752674102783 - }, - { - "name": "Nostalgia", - "score": 0.05866732448339462 - }, - { - "name": "Pain", - "score": 0.07684041559696198 - }, - { - "name": "Pride", - "score": 0.026822954416275024 - }, - { - "name": "Realization", - "score": 0.30000734329223633 - }, - { - "name": "Relief", - "score": 0.04414166510105133 - }, - { - "name": "Romance", - "score": 0.042728863656520844 - }, - { - "name": "Sadness", - "score": 0.14773206412792206 - }, - { - "name": "Satisfaction", - "score": 0.05902980640530586 - }, - { - "name": "Shame", - "score": 0.08103451132774353 - }, - { - "name": "Surprise (negative)", - "score": 0.25518184900283813 - }, - { - "name": "Surprise (positive)", - "score": 0.28845661878585815 - }, - { - "name": "Sympathy", - "score": 0.062488824129104614 - }, - { - "name": "Tiredness", - "score": 0.1559651643037796 - }, - { - "name": "Triumph", - "score": 0.01955239288508892 - } - ] - } - ] - } - ] - } - } - } - ], - "errors": [] - } - } - ] - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/v0/batch/jobs/job_id/predictions") - .UsingGet() - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.ExpressionMeasurement.Batch.GetJobPredictionsAsync("job_id"); - JsonAssert.AreEqual(response, mockResponse); - } -} diff --git a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/ListJobsTest.cs b/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/ListJobsTest.cs deleted file mode 100644 index f98f1a1..0000000 --- a/src/Hume.Test/Unit/MockServer/ExpressionMeasurement/Batch/ListJobsTest.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Hume.ExpressionMeasurement.Batch; -using Hume.Test.Unit.MockServer; -using Hume.Test.Utils; -using NUnit.Framework; - -namespace Hume.Test.Unit.MockServer.ExpressionMeasurement.Batch; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class ListJobsTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() - { - const string mockResponse = """ - [ - { - "job_id": "job_id", - "request": { - "files": [ - { - "filename": "filename", - "md5sum": "md5sum", - "content_type": "content_type" - } - ], - "models": { - "burst": {}, - "face": { - "fps_pred": 3, - "identify_faces": false, - "min_face_size": 60, - "prob_threshold": 0.99, - "save_faces": false - }, - "facemesh": {}, - "language": { - "granularity": "word", - "identify_speakers": false - }, - "ner": { - "identify_speakers": false - }, - "prosody": { - "granularity": "utterance", - "identify_speakers": false - } - }, - "notify": true, - "text": [], - "urls": [ - "https://hume-tutorials.s3.amazonaws.com/faces.zip" - ] - }, - "state": { - "status": "COMPLETED", - "created_timestamp_ms": 1712587158717, - "ended_timestamp_ms": 1712587159274, - "num_errors": 0, - "num_predictions": 10, - "started_timestamp_ms": 1712587158800 - }, - "type": "INFERENCE" - } - ] - """; - - Server - .Given(WireMock.RequestBuilders.Request.Create().WithPath("/v0/batch/jobs").UsingGet()) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.ExpressionMeasurement.Batch.ListJobsAsync( - new BatchListJobsRequest() - ); - JsonAssert.AreEqual(response, mockResponse); - } -} diff --git a/src/Hume.Test/Unit/MockServer/Tts/SynthesizeJsonTest.cs b/src/Hume.Test/Unit/MockServer/Tts/SynthesizeJsonTest.cs index ba68795..417b8ec 100644 --- a/src/Hume.Test/Unit/MockServer/Tts/SynthesizeJsonTest.cs +++ b/src/Hume.Test/Unit/MockServer/Tts/SynthesizeJsonTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.Tts; public class SynthesizeJsonTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/Tts/Voices/CreateTest.cs b/src/Hume.Test/Unit/MockServer/Tts/Voices/CreateTest.cs index 7f57fd1..b5d42b6 100644 --- a/src/Hume.Test/Unit/MockServer/Tts/Voices/CreateTest.cs +++ b/src/Hume.Test/Unit/MockServer/Tts/Voices/CreateTest.cs @@ -10,7 +10,7 @@ namespace Hume.Test.Unit.MockServer.Tts.Voices; public class CreateTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string requestJson = """ { diff --git a/src/Hume.Test/Unit/MockServer/Tts/Voices/ListTest.cs b/src/Hume.Test/Unit/MockServer/Tts/Voices/ListTest.cs index 29a4c45..2083028 100644 --- a/src/Hume.Test/Unit/MockServer/Tts/Voices/ListTest.cs +++ b/src/Hume.Test/Unit/MockServer/Tts/Voices/ListTest.cs @@ -9,7 +9,7 @@ namespace Hume.Test.Unit.MockServer.Tts.Voices; public class ListTest : BaseMockServerTest { [NUnit.Framework.Test] - public async global::System.Threading.Tasks.Task MockServerTest() + public async Task MockServerTest() { const string mockResponse = """ { diff --git a/src/Hume/Core/Public/Version.cs b/src/Hume/Core/Public/Version.cs index 4cc4e59..c6bf6b3 100644 --- a/src/Hume/Core/Public/Version.cs +++ b/src/Hume/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Hume; [Serializable] internal class Version { - public const string Current = "0.2.8"; + public const string Current = "0.2.9"; } diff --git a/src/Hume/EmpathicVoice/Chat/ChatApi.cs b/src/Hume/EmpathicVoice/Chat/ChatApi.cs index 5b5441d..a483956 100644 --- a/src/Hume/EmpathicVoice/Chat/ChatApi.cs +++ b/src/Hume/EmpathicVoice/Chat/ChatApi.cs @@ -185,7 +185,7 @@ private void DisposeEvents() /// /// Dispatches incoming WebSocket messages /// - private async global::System.Threading.Tasks.Task OnTextMessage(Stream stream) + private async Task OnTextMessage(Stream stream) { using var json = await JsonSerializer.DeserializeAsync(stream); if (json == null) @@ -299,10 +299,7 @@ await ExceptionOccurred /// /// Serializes and sends a JSON message to the server /// - private async global::System.Threading.Tasks.Task SendJsonAsync( - object message, - CancellationToken cancellationToken = default - ) + private async Task SendJsonAsync(object message, CancellationToken cancellationToken = default) { await _client .SendInstant(JsonUtils.Serialize(message), cancellationToken) @@ -312,7 +309,7 @@ await _client /// /// Injects a fake text message for testing. Dispatches through the normal message handling pipeline. /// - internal async global::System.Threading.Tasks.Task InjectTestMessage(string rawJson) + internal async Task InjectTestMessage(string rawJson) { using var stream = new MemoryStream(global::System.Text.Encoding.UTF8.GetBytes(rawJson)); await OnTextMessage(stream).ConfigureAwait(false); @@ -321,9 +318,7 @@ await _client /// /// Asynchronously establishes a WebSocket connection. /// - public async global::System.Threading.Tasks.Task ConnectAsync( - CancellationToken cancellationToken = default - ) + public async Task ConnectAsync(CancellationToken cancellationToken = default) { #if NET6_0_OR_GREATER _client.DeflateOptions = _options.EnableCompression @@ -336,9 +331,7 @@ await _client /// /// Asynchronously closes the WebSocket connection. /// - public async global::System.Threading.Tasks.Task CloseAsync( - CancellationToken cancellationToken = default - ) + public async Task CloseAsync(CancellationToken cancellationToken = default) { await _client.CloseAsync(cancellationToken).ConfigureAwait(false); } @@ -366,7 +359,7 @@ public void Dispose() /// /// Sends a PublishEvent message to the server /// - public async global::System.Threading.Tasks.Task Send( + public async Task Send( OneOf< AudioInput, SessionSettings, diff --git a/src/Hume/EmpathicVoice/Chat/IChatApi.cs b/src/Hume/EmpathicVoice/Chat/IChatApi.cs index 36e5317..3c49770 100644 --- a/src/Hume/EmpathicVoice/Chat/IChatApi.cs +++ b/src/Hume/EmpathicVoice/Chat/IChatApi.cs @@ -24,9 +24,9 @@ public partial interface IChatApi : IAsyncDisposable, IDisposable public Event SessionSettings { get; } public Event UnknownMessage { get; } public ConnectionStatus Status { get; } - global::System.Threading.Tasks.Task ConnectAsync(CancellationToken cancellationToken = default); + Task ConnectAsync(CancellationToken cancellationToken = default); - global::System.Threading.Tasks.Task Send( + Task Send( OneOf< AudioInput, SessionSettings, @@ -40,5 +40,5 @@ public partial interface IChatApi : IAsyncDisposable, IDisposable CancellationToken cancellationToken = default ); - global::System.Threading.Tasks.Task CloseAsync(CancellationToken cancellationToken = default); + Task CloseAsync(CancellationToken cancellationToken = default); } diff --git a/src/Hume/EmpathicVoice/ChatGroups/ChatGroupsClient.cs b/src/Hume/EmpathicVoice/ChatGroups/ChatGroupsClient.cs index 21e8f24..5edc41c 100644 --- a/src/Hume/EmpathicVoice/ChatGroups/ChatGroupsClient.cs +++ b/src/Hume/EmpathicVoice/ChatGroups/ChatGroupsClient.cs @@ -27,9 +27,7 @@ private WithRawResponseTask ListChatGroupsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListChatGroupsInternalAsyncCore( + private async Task> ListChatGroupsInternalAsyncCore( ChatGroupsListChatGroupsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -117,9 +115,7 @@ private WithRawResponseTask ListChatGroupsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetChatGroupAsyncCore( + private async Task> GetChatGroupAsyncCore( string id, ChatGroupsGetChatGroupRequest request, RequestOptions? options = null, @@ -211,9 +207,7 @@ private WithRawResponseTask ListChatGroupsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetAudioAsyncCore( + private async Task> GetAudioAsyncCore( string id, ChatGroupsGetAudioRequest request, RequestOptions? options = null, @@ -321,7 +315,7 @@ private WithRawResponseTask ListChatGroupEventsInter ); } - private async global::System.Threading.Tasks.Task< + private async Task< WithRawResponse > ListChatGroupEventsInternalAsyncCore( string id, @@ -428,7 +422,7 @@ private WithRawResponseTask ListChatGroupEventsInter /// } /// ); /// - public async global::System.Threading.Tasks.Task> ListChatGroupsAsync( + public async Task> ListChatGroupsAsync( ChatGroupsListChatGroupsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -529,9 +523,7 @@ public WithRawResponseTask GetAudioAsy /// } /// ); /// - public async global::System.Threading.Tasks.Task< - Pager - > ListChatGroupEventsAsync( + public async Task> ListChatGroupEventsAsync( string id, ChatGroupsListChatGroupEventsRequest request, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/ChatGroups/IChatGroupsClient.cs b/src/Hume/EmpathicVoice/ChatGroups/IChatGroupsClient.cs index 790ba42..36bcf85 100644 --- a/src/Hume/EmpathicVoice/ChatGroups/IChatGroupsClient.cs +++ b/src/Hume/EmpathicVoice/ChatGroups/IChatGroupsClient.cs @@ -8,7 +8,7 @@ public partial interface IChatGroupsClient /// /// Fetches a paginated list of **Chat Groups**. /// - global::System.Threading.Tasks.Task> ListChatGroupsAsync( + Task> ListChatGroupsAsync( ChatGroupsListChatGroupsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,7 +37,7 @@ WithRawResponseTask GetAudioAsync( /// /// Fetches a paginated list of **Chat** events associated with a **Chat Group**. /// - global::System.Threading.Tasks.Task> ListChatGroupEventsAsync( + Task> ListChatGroupEventsAsync( string id, ChatGroupsListChatGroupEventsRequest request, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Chats/ChatsClient.cs b/src/Hume/EmpathicVoice/Chats/ChatsClient.cs index 4ba7ee0..1447c7d 100644 --- a/src/Hume/EmpathicVoice/Chats/ChatsClient.cs +++ b/src/Hume/EmpathicVoice/Chats/ChatsClient.cs @@ -27,9 +27,7 @@ private WithRawResponseTask ListChatsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListChatsInternalAsyncCore( + private async Task> ListChatsInternalAsyncCore( ChatsListChatsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -133,9 +131,7 @@ private WithRawResponseTask ListChatEventsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListChatEventsInternalAsyncCore( + private async Task> ListChatEventsInternalAsyncCore( string id, ChatsListChatEventsRequest request, RequestOptions? options = null, @@ -226,9 +222,7 @@ private WithRawResponseTask ListChatEventsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetAudioAsyncCore( + private async Task> GetAudioAsyncCore( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -326,7 +320,7 @@ private WithRawResponseTask ListChatEventsInternalAsync( /// } /// ); /// - public async global::System.Threading.Tasks.Task> ListChatsAsync( + public async Task> ListChatsAsync( ChatsListChatsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -375,7 +369,7 @@ await ListChatsInternalAsync(request, options, cancellationToken) /// } /// ); /// - public async global::System.Threading.Tasks.Task> ListChatEventsAsync( + public async Task> ListChatEventsAsync( string id, ChatsListChatEventsRequest request, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Chats/IChatsClient.cs b/src/Hume/EmpathicVoice/Chats/IChatsClient.cs index 5832cf4..7efdde2 100644 --- a/src/Hume/EmpathicVoice/Chats/IChatsClient.cs +++ b/src/Hume/EmpathicVoice/Chats/IChatsClient.cs @@ -8,7 +8,7 @@ public partial interface IChatsClient /// /// Fetches a paginated list of **Chats**. /// - global::System.Threading.Tasks.Task> ListChatsAsync( + Task> ListChatsAsync( ChatsListChatsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -17,7 +17,7 @@ public partial interface IChatsClient /// /// Fetches a paginated list of **Chat** events. /// - global::System.Threading.Tasks.Task> ListChatEventsAsync( + Task> ListChatEventsAsync( string id, ChatsListChatEventsRequest request, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Configs/ConfigsClient.cs b/src/Hume/EmpathicVoice/Configs/ConfigsClient.cs index 46ee836..505141d 100644 --- a/src/Hume/EmpathicVoice/Configs/ConfigsClient.cs +++ b/src/Hume/EmpathicVoice/Configs/ConfigsClient.cs @@ -29,9 +29,7 @@ private WithRawResponseTask ListConfigsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListConfigsInternalAsyncCore( + private async Task> ListConfigsInternalAsyncCore( ConfigsListConfigsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -119,9 +117,7 @@ private WithRawResponseTask ListConfigsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreateConfigAsyncCore( + private async Task> CreateConfigAsyncCore( PostedConfig request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -220,9 +216,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListConfigVersionsInternalAsyncCore( + private async Task> ListConfigVersionsInternalAsyncCore( string id, ConfigsListConfigVersionsRequest request, RequestOptions? options = null, @@ -313,9 +307,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreateConfigVersionAsyncCore( + private async Task> CreateConfigVersionAsyncCore( string id, PostedConfigVersion request, RequestOptions? options = null, @@ -401,9 +393,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdateConfigNameAsyncCore( + private async Task> UpdateConfigNameAsyncCore( string id, PostedConfigName request, RequestOptions? options = null, @@ -476,9 +466,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetConfigVersionAsyncCore( + private async Task> GetConfigVersionAsyncCore( string id, int version, RequestOptions? options = null, @@ -563,9 +551,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdateConfigDescriptionAsyncCore( + private async Task> UpdateConfigDescriptionAsyncCore( string id, int version, PostedConfigVersionDescription request, @@ -663,7 +649,7 @@ private WithRawResponseTask ListConfigVersionsInternalAsync( /// new ConfigsListConfigsRequest { PageNumber = 0, PageSize = 1 } /// ); /// - public async global::System.Threading.Tasks.Task> ListConfigsAsync( + public async Task> ListConfigsAsync( ConfigsListConfigsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -752,7 +738,7 @@ public WithRawResponseTask CreateConfigAsync( /// new ConfigsListConfigVersionsRequest() /// ); /// - public async global::System.Threading.Tasks.Task> ListConfigVersionsAsync( + public async Task> ListConfigVersionsAsync( string id, ConfigsListConfigVersionsRequest request, RequestOptions? options = null, @@ -842,7 +828,7 @@ public WithRawResponseTask CreateConfigVersionAsync( /// /// await client.EmpathicVoice.Configs.DeleteConfigAsync("your-config-id"); /// - public async global::System.Threading.Tasks.Task DeleteConfigAsync( + public async Task DeleteConfigAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -951,7 +937,7 @@ public WithRawResponseTask GetConfigVersionAsync( /// /// await client.EmpathicVoice.Configs.DeleteConfigVersionAsync("your-config-id", 1); /// - public async global::System.Threading.Tasks.Task DeleteConfigVersionAsync( + public async Task DeleteConfigVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Configs/IConfigsClient.cs b/src/Hume/EmpathicVoice/Configs/IConfigsClient.cs index d964f25..0dbf829 100644 --- a/src/Hume/EmpathicVoice/Configs/IConfigsClient.cs +++ b/src/Hume/EmpathicVoice/Configs/IConfigsClient.cs @@ -10,7 +10,7 @@ public partial interface IConfigsClient /// /// For more details on configuration options and how to configure EVI, see our [configuration guide](/docs/speech-to-speech-evi/configuration). /// - global::System.Threading.Tasks.Task> ListConfigsAsync( + Task> ListConfigsAsync( ConfigsListConfigsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -32,7 +32,7 @@ WithRawResponseTask CreateConfigAsync( /// /// For more details on configuration options and how to configure EVI, see our [configuration guide](/docs/speech-to-speech-evi/configuration). /// - global::System.Threading.Tasks.Task> ListConfigVersionsAsync( + Task> ListConfigVersionsAsync( string id, ConfigsListConfigVersionsRequest request, RequestOptions? options = null, @@ -56,7 +56,7 @@ WithRawResponseTask CreateConfigVersionAsync( /// /// For more details on configuration options and how to configure EVI, see our [configuration guide](/docs/speech-to-speech-evi/configuration). /// - global::System.Threading.Tasks.Task DeleteConfigAsync( + Task DeleteConfigAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -91,7 +91,7 @@ WithRawResponseTask GetConfigVersionAsync( /// /// For more details on configuration options and how to configure EVI, see our [configuration guide](/docs/speech-to-speech-evi/configuration). /// - global::System.Threading.Tasks.Task DeleteConfigVersionAsync( + Task DeleteConfigVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneApi.cs b/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneApi.cs index cf50661..cf6729e 100644 --- a/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneApi.cs +++ b/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneApi.cs @@ -176,7 +176,7 @@ private void DisposeEvents() /// /// Dispatches incoming WebSocket messages /// - private async global::System.Threading.Tasks.Task OnTextMessage(Stream stream) + private async Task OnTextMessage(Stream stream) { using var json = await JsonSerializer.DeserializeAsync(stream); if (json == null) @@ -290,10 +290,7 @@ await ExceptionOccurred /// /// Serializes and sends a JSON message to the server /// - private async global::System.Threading.Tasks.Task SendJsonAsync( - object message, - CancellationToken cancellationToken = default - ) + private async Task SendJsonAsync(object message, CancellationToken cancellationToken = default) { await _client .SendInstant(JsonUtils.Serialize(message), cancellationToken) @@ -303,7 +300,7 @@ await _client /// /// Injects a fake text message for testing. Dispatches through the normal message handling pipeline. /// - internal async global::System.Threading.Tasks.Task InjectTestMessage(string rawJson) + internal async Task InjectTestMessage(string rawJson) { using var stream = new MemoryStream(global::System.Text.Encoding.UTF8.GetBytes(rawJson)); await OnTextMessage(stream).ConfigureAwait(false); @@ -312,9 +309,7 @@ await _client /// /// Asynchronously establishes a WebSocket connection. /// - public async global::System.Threading.Tasks.Task ConnectAsync( - CancellationToken cancellationToken = default - ) + public async Task ConnectAsync(CancellationToken cancellationToken = default) { #if NET6_0_OR_GREATER _client.DeflateOptions = _options.EnableCompression @@ -327,9 +322,7 @@ await _client /// /// Asynchronously closes the WebSocket connection. /// - public async global::System.Threading.Tasks.Task CloseAsync( - CancellationToken cancellationToken = default - ) + public async Task CloseAsync(CancellationToken cancellationToken = default) { await _client.CloseAsync(cancellationToken).ConfigureAwait(false); } @@ -357,7 +350,7 @@ public void Dispose() /// /// Sends a ControlPlanePublishEvent message to the server /// - public async global::System.Threading.Tasks.Task Send( + public async Task Send( OneOf< SessionSettings, UserInput, diff --git a/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneClient.cs b/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneClient.cs index 581c31b..223f305 100644 --- a/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneClient.cs +++ b/src/Hume/EmpathicVoice/ControlPlane/ControlPlaneClient.cs @@ -20,7 +20,7 @@ internal ControlPlaneClient(RawClient client) /// /// await client.EmpathicVoice.ControlPlane.SendAsync("chat_id", new SessionSettings()); /// - public async global::System.Threading.Tasks.Task SendAsync( + public async Task SendAsync( string chatId, OneOf< SessionSettings, diff --git a/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneApi.cs b/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneApi.cs index bedeeac..2726543 100644 --- a/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneApi.cs +++ b/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneApi.cs @@ -24,9 +24,9 @@ public partial interface IControlPlaneApi : IAsyncDisposable, IDisposable public Event SessionSettings { get; } public Event UnknownMessage { get; } public ConnectionStatus Status { get; } - global::System.Threading.Tasks.Task ConnectAsync(CancellationToken cancellationToken = default); + Task ConnectAsync(CancellationToken cancellationToken = default); - global::System.Threading.Tasks.Task Send( + Task Send( OneOf< SessionSettings, UserInput, @@ -39,5 +39,5 @@ public partial interface IControlPlaneApi : IAsyncDisposable, IDisposable CancellationToken cancellationToken = default ); - global::System.Threading.Tasks.Task CloseAsync(CancellationToken cancellationToken = default); + Task CloseAsync(CancellationToken cancellationToken = default); } diff --git a/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneClient.cs b/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneClient.cs index 43f3ce9..3297e51 100644 --- a/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneClient.cs +++ b/src/Hume/EmpathicVoice/ControlPlane/IControlPlaneClient.cs @@ -8,7 +8,7 @@ public partial interface IControlPlaneClient /// /// Send a message to a specific chat. /// - global::System.Threading.Tasks.Task SendAsync( + Task SendAsync( string chatId, OneOf< SessionSettings, diff --git a/src/Hume/EmpathicVoice/Prompts/IPromptsClient.cs b/src/Hume/EmpathicVoice/Prompts/IPromptsClient.cs index e50ce07..8d9e74b 100644 --- a/src/Hume/EmpathicVoice/Prompts/IPromptsClient.cs +++ b/src/Hume/EmpathicVoice/Prompts/IPromptsClient.cs @@ -10,7 +10,7 @@ public partial interface IPromptsClient /// /// See our [prompting guide](/docs/speech-to-speech-evi/guides/phone-calling) for tips on crafting your system prompt. /// - global::System.Threading.Tasks.Task> ListPromptsAsync( + Task> ListPromptsAsync( PromptsListPromptsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -56,7 +56,7 @@ WithRawResponseTask ListPromptVersionsAsync( /// /// See our [prompting guide](/docs/speech-to-speech-evi/guides/phone-calling) for tips on crafting your system prompt. /// - global::System.Threading.Tasks.Task DeletePromptAsync( + Task DeletePromptAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -91,7 +91,7 @@ WithRawResponseTask UpdatePromptNameAsync( /// /// See our [prompting guide](/docs/speech-to-speech-evi/guides/phone-calling) for tips on crafting your system prompt. /// - global::System.Threading.Tasks.Task DeletePromptVersionAsync( + Task DeletePromptVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Prompts/PromptsClient.cs b/src/Hume/EmpathicVoice/Prompts/PromptsClient.cs index 9a8503e..e964629 100644 --- a/src/Hume/EmpathicVoice/Prompts/PromptsClient.cs +++ b/src/Hume/EmpathicVoice/Prompts/PromptsClient.cs @@ -29,9 +29,7 @@ private WithRawResponseTask ListPromptsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListPromptsInternalAsyncCore( + private async Task> ListPromptsInternalAsyncCore( PromptsListPromptsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -119,9 +117,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreatePromptAsyncCore( + private async Task> CreatePromptAsyncCore( PostedPrompt request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -203,9 +199,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListPromptVersionsAsyncCore( + private async Task> ListPromptVersionsAsyncCore( string id, PromptsListPromptVersionsRequest request, RequestOptions? options = null, @@ -296,9 +290,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreatePromptVersionAsyncCore( + private async Task> CreatePromptVersionAsyncCore( string id, PostedPromptVersion request, RequestOptions? options = null, @@ -384,9 +376,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdatePromptNameAsyncCore( + private async Task> UpdatePromptNameAsyncCore( string id, PostedPromptName request, RequestOptions? options = null, @@ -459,9 +449,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetPromptVersionAsyncCore( + private async Task> GetPromptVersionAsyncCore( string id, int version, RequestOptions? options = null, @@ -546,9 +534,7 @@ private WithRawResponseTask ListPromptsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdatePromptDescriptionAsyncCore( + private async Task> UpdatePromptDescriptionAsyncCore( string id, int version, PostedPromptVersionDescription request, @@ -646,7 +632,7 @@ private WithRawResponseTask ListPromptsInternalAsync( /// new PromptsListPromptsRequest { PageNumber = 0, PageSize = 2 } /// ); /// - public async global::System.Threading.Tasks.Task> ListPromptsAsync( + public async Task> ListPromptsAsync( PromptsListPromptsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -766,7 +752,7 @@ public WithRawResponseTask ListPromptVersionsAsync( /// /// await client.EmpathicVoice.Prompts.DeletePromptAsync("your-prompt-id"); /// - public async global::System.Threading.Tasks.Task DeletePromptAsync( + public async Task DeletePromptAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -875,7 +861,7 @@ public WithRawResponseTask UpdatePromptNameAsync( /// /// await client.EmpathicVoice.Prompts.DeletePromptVersionAsync("your-prompt-id", 1); /// - public async global::System.Threading.Tasks.Task DeletePromptVersionAsync( + public async Task DeletePromptVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Tools/IToolsClient.cs b/src/Hume/EmpathicVoice/Tools/IToolsClient.cs index 91a0c6a..fc987d5 100644 --- a/src/Hume/EmpathicVoice/Tools/IToolsClient.cs +++ b/src/Hume/EmpathicVoice/Tools/IToolsClient.cs @@ -10,7 +10,7 @@ public partial interface IToolsClient /// /// Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI. /// - global::System.Threading.Tasks.Task> ListToolsAsync( + Task> ListToolsAsync( ToolsListToolsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -32,7 +32,7 @@ public partial interface IToolsClient /// /// Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI. /// - global::System.Threading.Tasks.Task> ListToolVersionsAsync( + Task> ListToolVersionsAsync( string id, ToolsListToolVersionsRequest request, RequestOptions? options = null, @@ -56,7 +56,7 @@ public partial interface IToolsClient /// /// Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI. /// - global::System.Threading.Tasks.Task DeleteToolAsync( + Task DeleteToolAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -91,7 +91,7 @@ WithRawResponseTask UpdateToolNameAsync( /// /// Refer to our [tool use](/docs/speech-to-speech-evi/features/tool-use#function-calling) guide for comprehensive instructions on defining and integrating tools into EVI. /// - global::System.Threading.Tasks.Task DeleteToolVersionAsync( + Task DeleteToolVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Tools/ToolsClient.cs b/src/Hume/EmpathicVoice/Tools/ToolsClient.cs index 240b3f4..3db67c5 100644 --- a/src/Hume/EmpathicVoice/Tools/ToolsClient.cs +++ b/src/Hume/EmpathicVoice/Tools/ToolsClient.cs @@ -29,9 +29,7 @@ private WithRawResponseTask ListToolsInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListToolsInternalAsyncCore( + private async Task> ListToolsInternalAsyncCore( ToolsListToolsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -121,9 +119,7 @@ private WithRawResponseTask ListToolsInternalAsync( } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreateToolAsyncCore( + private async Task> CreateToolAsyncCore( PostedUserDefinedTool request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -222,7 +218,7 @@ private WithRawResponseTask ListToolVersionsInterna ); } - private async global::System.Threading.Tasks.Task< + private async Task< WithRawResponse > ListToolVersionsInternalAsyncCore( string id, @@ -317,9 +313,7 @@ private WithRawResponseTask ListToolVersionsInterna } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > CreateToolVersionAsyncCore( + private async Task> CreateToolVersionAsyncCore( string id, PostedUserDefinedToolVersion request, RequestOptions? options = null, @@ -405,9 +399,7 @@ private WithRawResponseTask ListToolVersionsInterna } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdateToolNameAsyncCore( + private async Task> UpdateToolNameAsyncCore( string id, PostedUserDefinedToolName request, RequestOptions? options = null, @@ -480,9 +472,7 @@ private WithRawResponseTask ListToolVersionsInterna } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetToolVersionAsyncCore( + private async Task> GetToolVersionAsyncCore( string id, int version, RequestOptions? options = null, @@ -567,9 +557,7 @@ private WithRawResponseTask ListToolVersionsInterna } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > UpdateToolDescriptionAsyncCore( + private async Task> UpdateToolDescriptionAsyncCore( string id, int version, PostedUserDefinedToolVersionDescription request, @@ -667,7 +655,7 @@ private WithRawResponseTask ListToolVersionsInterna /// new ToolsListToolsRequest { PageNumber = 0, PageSize = 2 } /// ); /// - public async global::System.Threading.Tasks.Task> ListToolsAsync( + public async Task> ListToolsAsync( ToolsListToolsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -743,9 +731,7 @@ await ListToolsInternalAsync(request, options, cancellationToken) /// new ToolsListToolVersionsRequest() /// ); /// - public async global::System.Threading.Tasks.Task< - Pager - > ListToolVersionsAsync( + public async Task> ListToolVersionsAsync( string id, ToolsListToolVersionsRequest request, RequestOptions? options = null, @@ -820,7 +806,7 @@ await ListToolVersionsInternalAsync(id, request, options, cancellationToken) /// /// await client.EmpathicVoice.Tools.DeleteToolAsync("your-tool-id"); /// - public async global::System.Threading.Tasks.Task DeleteToolAsync( + public async Task DeleteToolAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -929,7 +915,7 @@ public WithRawResponseTask UpdateToolNameAsync( /// /// await client.EmpathicVoice.Tools.DeleteToolVersionAsync("your-tool-id", 1); /// - public async global::System.Threading.Tasks.Task DeleteToolVersionAsync( + public async Task DeleteToolVersionAsync( string id, int version, RequestOptions? options = null, diff --git a/src/Hume/EmpathicVoice/Types/BuiltInTool.cs b/src/Hume/EmpathicVoice/Types/BuiltInTool.cs index 581c900..e9601f1 100644 --- a/src/Hume/EmpathicVoice/Types/BuiltInTool.cs +++ b/src/Hume/EmpathicVoice/Types/BuiltInTool.cs @@ -57,7 +57,7 @@ internal class BuiltInToolSerializer : JsonConverter { public override BuiltInTool Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override BuiltInTool ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ContextType.cs b/src/Hume/EmpathicVoice/Types/ContextType.cs index b6d220d..da7a436 100644 --- a/src/Hume/EmpathicVoice/Types/ContextType.cs +++ b/src/Hume/EmpathicVoice/Types/ContextType.cs @@ -57,7 +57,7 @@ internal class ContextTypeSerializer : JsonConverter { public override ContextType Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override ContextType ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/LanguageModelType.cs b/src/Hume/EmpathicVoice/Types/LanguageModelType.cs index 4979155..f60a047 100644 --- a/src/Hume/EmpathicVoice/Types/LanguageModelType.cs +++ b/src/Hume/EmpathicVoice/Types/LanguageModelType.cs @@ -229,7 +229,7 @@ internal class LanguageModelTypeSerializer : JsonConverter { public override LanguageModelType Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -252,7 +252,7 @@ JsonSerializerOptions options public override LanguageModelType ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ModelProviderEnum.cs b/src/Hume/EmpathicVoice/Types/ModelProviderEnum.cs index 345e417..8da9315 100644 --- a/src/Hume/EmpathicVoice/Types/ModelProviderEnum.cs +++ b/src/Hume/EmpathicVoice/Types/ModelProviderEnum.cs @@ -77,7 +77,7 @@ internal class ModelProviderEnumSerializer : JsonConverter { public override ModelProviderEnum Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -100,7 +100,7 @@ JsonSerializerOptions options public override ModelProviderEnum ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/PostedBuiltinToolName.cs b/src/Hume/EmpathicVoice/Types/PostedBuiltinToolName.cs index 239e2fa..836c20c 100644 --- a/src/Hume/EmpathicVoice/Types/PostedBuiltinToolName.cs +++ b/src/Hume/EmpathicVoice/Types/PostedBuiltinToolName.cs @@ -57,7 +57,7 @@ internal class PostedBuiltinToolNameSerializer : JsonConverter [JsonPropertyName("scores")] public required EmotionScores Scores { get; set; } diff --git a/src/Hume/EmpathicVoice/Types/ReturnBuiltinToolToolType.cs b/src/Hume/EmpathicVoice/Types/ReturnBuiltinToolToolType.cs index 3a5d971..7103480 100644 --- a/src/Hume/EmpathicVoice/Types/ReturnBuiltinToolToolType.cs +++ b/src/Hume/EmpathicVoice/Types/ReturnBuiltinToolToolType.cs @@ -57,7 +57,7 @@ internal class ReturnBuiltinToolToolTypeSerializer : JsonConverter { public override ReturnChatStatus Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -88,7 +88,7 @@ JsonSerializerOptions options public override ReturnChatStatus ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ReturnPagedChatGroupsPaginationDirection.cs b/src/Hume/EmpathicVoice/Types/ReturnPagedChatGroupsPaginationDirection.cs index 486ca87..d2114ae 100644 --- a/src/Hume/EmpathicVoice/Types/ReturnPagedChatGroupsPaginationDirection.cs +++ b/src/Hume/EmpathicVoice/Types/ReturnPagedChatGroupsPaginationDirection.cs @@ -66,7 +66,7 @@ internal class ReturnPagedChatGroupsPaginationDirectionSerializer { public override ReturnPagedChatGroupsPaginationDirection Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -89,7 +89,7 @@ JsonSerializerOptions options public override ReturnPagedChatGroupsPaginationDirection ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ReturnPagedChatsPaginationDirection.cs b/src/Hume/EmpathicVoice/Types/ReturnPagedChatsPaginationDirection.cs index 9d9e1cb..988b7d6 100644 --- a/src/Hume/EmpathicVoice/Types/ReturnPagedChatsPaginationDirection.cs +++ b/src/Hume/EmpathicVoice/Types/ReturnPagedChatsPaginationDirection.cs @@ -61,7 +61,7 @@ internal class ReturnPagedChatsPaginationDirectionSerializer { public override ReturnPagedChatsPaginationDirection Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -84,7 +84,7 @@ JsonSerializerOptions options public override ReturnPagedChatsPaginationDirection ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ReturnPromptVersionType.cs b/src/Hume/EmpathicVoice/Types/ReturnPromptVersionType.cs index c165bfe..c610a13 100644 --- a/src/Hume/EmpathicVoice/Types/ReturnPromptVersionType.cs +++ b/src/Hume/EmpathicVoice/Types/ReturnPromptVersionType.cs @@ -57,7 +57,7 @@ internal class ReturnPromptVersionTypeSerializer : JsonConverter { public override Role Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -82,7 +82,7 @@ public override void Write(Utf8JsonWriter writer, Role value, JsonSerializerOpti public override Role ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/ToolType.cs b/src/Hume/EmpathicVoice/Types/ToolType.cs index a43bf8c..921d5c8 100644 --- a/src/Hume/EmpathicVoice/Types/ToolType.cs +++ b/src/Hume/EmpathicVoice/Types/ToolType.cs @@ -55,7 +55,7 @@ internal class ToolTypeSerializer : JsonConverter { public override ToolType Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -78,7 +78,7 @@ JsonSerializerOptions options public override ToolType ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/VoiceProvider.cs b/src/Hume/EmpathicVoice/Types/VoiceProvider.cs index edfbbed..edcd966 100644 --- a/src/Hume/EmpathicVoice/Types/VoiceProvider.cs +++ b/src/Hume/EmpathicVoice/Types/VoiceProvider.cs @@ -57,7 +57,7 @@ internal class VoiceProviderSerializer : JsonConverter { public override VoiceProvider Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override VoiceProvider ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/EmpathicVoice/Types/WebhookEventChatStartType.cs b/src/Hume/EmpathicVoice/Types/WebhookEventChatStartType.cs index 3a9bd8d..28b2f82 100644 --- a/src/Hume/EmpathicVoice/Types/WebhookEventChatStartType.cs +++ b/src/Hume/EmpathicVoice/Types/WebhookEventChatStartType.cs @@ -59,7 +59,7 @@ internal class WebhookEventChatStartTypeSerializer : JsonConverter> - > ListJobsAsyncCore( - BatchListJobsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _queryString = new Hume.Core.QueryStringBuilder.Builder(capacity: 6) - .Add("limit", request.Limit) - .Add("status", request.Status) - .Add("when", request.When) - .Add("timestamp_ms", request.TimestampMs) - .Add("sort_by", request.SortBy) - .Add("direction", request.Direction) - .MergeAdditional(options?.AdditionalQueryParameters) - .Build(); - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Get, - Path = "v0/batch/jobs", - QueryString = _queryString, - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize>(responseBody)!; - return new WithRawResponse>() - { - Data = responseData, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new HumeClientApiException( - "Failed to deserialize response", - response.StatusCode, - responseBody, - e - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - private async global::System.Threading.Tasks.Task< - WithRawResponse - > StartInferenceJobAsyncCore( - InferenceBaseRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Post, - Path = "v0/batch/jobs", - Body = request, - Headers = _headers, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize(responseBody)!; - return new WithRawResponse() - { - Data = responseData, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new HumeClientApiException( - "Failed to deserialize response", - response.StatusCode, - responseBody, - e - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetJobDetailsAsyncCore( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Get, - Path = string.Format( - "v0/batch/jobs/{0}", - ValueConvert.ToPathParameterString(id) - ), - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize(responseBody)!; - return new WithRawResponse() - { - Data = responseData, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new HumeClientApiException( - "Failed to deserialize response", - response.StatusCode, - responseBody, - e - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - private async global::System.Threading.Tasks.Task< - WithRawResponse> - > GetJobPredictionsAsyncCore( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Get, - Path = string.Format( - "v0/batch/jobs/{0}/predictions", - ValueConvert.ToPathParameterString(id) - ), - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize>( - responseBody - )!; - return new WithRawResponse>() - { - Data = responseData, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new HumeClientApiException( - "Failed to deserialize response", - response.StatusCode, - responseBody, - e - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - private async global::System.Threading.Tasks.Task< - WithRawResponse - > GetJobArtifactsAsyncCore( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Get, - Path = string.Format( - "v0/batch/jobs/{0}/artifacts", - ValueConvert.ToPathParameterString(id) - ), - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var stream = await response.Raw.Content.ReadAsStreamAsync(); - return new WithRawResponse() - { - Data = stream, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - private async global::System.Threading.Tasks.Task< - WithRawResponse - > StartInferenceJobFromLocalFileAsyncCore( - BatchStartInferenceJobFromLocalFileRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _headers = await new Hume.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var multipartFormRequest_ = new MultipartFormRequest - { - BaseUrl = _client.Options.Environment.Base, - Method = HttpMethod.Post, - Path = "v0/batch/jobs", - Headers = _headers, - Options = options, - }; - multipartFormRequest_.AddJsonPart("json", request.Json); - multipartFormRequest_.AddFileParameterParts("file", request.File); - var response = await _client - .SendRequestAsync(multipartFormRequest_, cancellationToken) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize(responseBody)!; - return new WithRawResponse() - { - Data = responseData, - RawResponse = new RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new HumeClientApiException( - "Failed to deserialize response", - response.StatusCode, - responseBody, - e - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - throw new HumeClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - /// - /// Sort and filter jobs. - /// - /// - /// await client.ExpressionMeasurement.Batch.ListJobsAsync(new BatchListJobsRequest()); - /// - public WithRawResponseTask> ListJobsAsync( - BatchListJobsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask>( - ListJobsAsyncCore(request, options, cancellationToken) - ); - } - - /// - /// Start a new measurement inference job. - /// - /// - /// await client.ExpressionMeasurement.Batch.StartInferenceJobAsync( - /// new InferenceBaseRequest - /// { - /// Urls = new List<string>() { "https://hume-tutorials.s3.amazonaws.com/faces.zip" }, - /// Notify = true, - /// } - /// ); - /// - public WithRawResponseTask StartInferenceJobAsync( - InferenceBaseRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask( - StartInferenceJobAsyncCore(request, options, cancellationToken) - ); - } - - /// - /// Get the request details and state of a given job. - /// - /// - /// await client.ExpressionMeasurement.Batch.GetJobDetailsAsync("job_id"); - /// - public WithRawResponseTask GetJobDetailsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask( - GetJobDetailsAsyncCore(id, options, cancellationToken) - ); - } - - /// - /// Get the JSON predictions of a completed inference job. - /// - /// - /// await client.ExpressionMeasurement.Batch.GetJobPredictionsAsync("job_id"); - /// - public WithRawResponseTask> GetJobPredictionsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask>( - GetJobPredictionsAsyncCore(id, options, cancellationToken) - ); - } - - /// - /// Get the artifacts ZIP of a completed inference job. - /// - public WithRawResponseTask GetJobArtifactsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask( - GetJobArtifactsAsyncCore(id, options, cancellationToken) - ); - } - - /// - /// Start a new batch inference job. - /// - /// - /// await client.ExpressionMeasurement.Batch.StartInferenceJobFromLocalFileAsync( - /// new BatchStartInferenceJobFromLocalFileRequest() - /// ); - /// - public WithRawResponseTask StartInferenceJobFromLocalFileAsync( - BatchStartInferenceJobFromLocalFileRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask( - StartInferenceJobFromLocalFileAsyncCore(request, options, cancellationToken) - ); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/IBatchClient.cs b/src/Hume/ExpressionMeasurement/Batch/IBatchClient.cs deleted file mode 100644 index 8b2403d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/IBatchClient.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Hume; - -namespace Hume.ExpressionMeasurement.Batch; - -public partial interface IBatchClient -{ - /// - /// Sort and filter jobs. - /// - WithRawResponseTask> ListJobsAsync( - BatchListJobsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Start a new measurement inference job. - /// - WithRawResponseTask StartInferenceJobAsync( - InferenceBaseRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Get the request details and state of a given job. - /// - WithRawResponseTask GetJobDetailsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Get the JSON predictions of a completed inference job. - /// - WithRawResponseTask> GetJobPredictionsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Get the artifacts ZIP of a completed inference job. - /// - WithRawResponseTask GetJobArtifactsAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Start a new batch inference job. - /// - WithRawResponseTask StartInferenceJobFromLocalFileAsync( - BatchStartInferenceJobFromLocalFileRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Requests/BatchListJobsRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Requests/BatchListJobsRequest.cs deleted file mode 100644 index 921a1e0..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Requests/BatchListJobsRequest.cs +++ /dev/null @@ -1,70 +0,0 @@ -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record BatchListJobsRequest -{ - /// - /// The maximum number of jobs to include in the response. - /// - [JsonIgnore] - public int? Limit { get; set; } - - /// - /// Include only jobs of this status in the response. There are four possible statuses: - /// - /// - `QUEUED`: The job has been received and is waiting to be processed. - /// - /// - `IN_PROGRESS`: The job is currently being processed. - /// - /// - `COMPLETED`: The job has finished processing. - /// - /// - `FAILED`: The job encountered an error and could not be completed successfully. - /// - [JsonIgnore] - public IEnumerable Status { get; set; } = new List(); - - /// - /// Specify whether to include jobs created before or after a given `timestamp_ms`. - /// - [JsonIgnore] - public When? When { get; set; } - - /// - /// Provide a timestamp in milliseconds to filter jobs. - /// - /// When combined with the `when` parameter, you can filter jobs before or after the given timestamp. Defaults to the current Unix timestamp if one is not provided. - /// - [JsonIgnore] - public long? TimestampMs { get; set; } - - /// - /// Specify which timestamp to sort the jobs by. - /// - /// - `created`: Sort jobs by the time of creation, indicated by `created_timestamp_ms`. - /// - /// - `started`: Sort jobs by the time processing started, indicated by `started_timestamp_ms`. - /// - /// - `ended`: Sort jobs by the time processing ended, indicated by `ended_timestamp_ms`. - /// - [JsonIgnore] - public SortBy? SortBy { get; set; } - - /// - /// Specify the order in which to sort the jobs. Defaults to descending order. - /// - /// - `asc`: Sort in ascending order (chronological, with the oldest records first). - /// - /// - `desc`: Sort in descending order (reverse-chronological, with the newest records first). - /// - [JsonIgnore] - public Direction? Direction { get; set; } - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Requests/BatchStartInferenceJobFromLocalFileRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Requests/BatchStartInferenceJobFromLocalFileRequest.cs deleted file mode 100644 index ec76c87..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Requests/BatchStartInferenceJobFromLocalFileRequest.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record BatchStartInferenceJobFromLocalFileRequest -{ - /// - /// Stringified JSON object containing the inference job configuration. - /// - public InferenceBaseRequest? Json { get; set; } - - public IEnumerable File { get; set; } = new List(); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Alternative.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Alternative.cs deleted file mode 100644 index b7c0479..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Alternative.cs +++ /dev/null @@ -1,77 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(AlternativeConverter))] -public readonly struct Alternative -{ - public const string Value = "language_only"; - - public static implicit operator string(Alternative _) => Value; - - public override string ToString() => Value; - - public override int GetHashCode() => global::System.StringComparer.Ordinal.GetHashCode(Value); - - public override bool Equals(object? obj) => obj is Alternative; - - public static bool operator ==(Alternative _, Alternative __) => true; - - public static bool operator !=(Alternative _, Alternative __) => false; - - internal sealed class AlternativeConverter : JsonConverter - { - public override Alternative Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var value = reader.GetString(); - if (value != Alternative.Value) - { - throw new JsonException( - "Expected \"" - + Alternative.Value - + "\" for type discriminator but got \"" - + value - + "\"." - ); - } - return new Alternative(); - } - - public override void Write( - Utf8JsonWriter writer, - Alternative value, - JsonSerializerOptions options - ) => writer.WriteStringValue(Alternative.Value); - - public override Alternative ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var value = reader.GetString(); - if (value != Alternative.Value) - { - throw new JsonException( - "Expected \"" - + Alternative.Value - + "\" for type discriminator but got \"" - + value - + "\"." - ); - } - return new Alternative(); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Alternative value, - JsonSerializerOptions options - ) => writer.WritePropertyName(Alternative.Value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Bcp47Tag.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Bcp47Tag.cs deleted file mode 100644 index 765cd36..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Bcp47Tag.cs +++ /dev/null @@ -1,221 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Bcp47Tag.Bcp47TagSerializer))] -[Serializable] -public readonly record struct Bcp47Tag : IStringEnum -{ - public static readonly Bcp47Tag Zh = new(Values.Zh); - - public static readonly Bcp47Tag Da = new(Values.Da); - - public static readonly Bcp47Tag Nl = new(Values.Nl); - - public static readonly Bcp47Tag En = new(Values.En); - - public static readonly Bcp47Tag EnAu = new(Values.EnAu); - - public static readonly Bcp47Tag EnIn = new(Values.EnIn); - - public static readonly Bcp47Tag EnNz = new(Values.EnNz); - - public static readonly Bcp47Tag EnGb = new(Values.EnGb); - - public static readonly Bcp47Tag Fr = new(Values.Fr); - - public static readonly Bcp47Tag FrCa = new(Values.FrCa); - - public static readonly Bcp47Tag De = new(Values.De); - - public static readonly Bcp47Tag Hi = new(Values.Hi); - - public static readonly Bcp47Tag HiLatn = new(Values.HiLatn); - - public static readonly Bcp47Tag Id = new(Values.Id); - - public static readonly Bcp47Tag It = new(Values.It); - - public static readonly Bcp47Tag Ja = new(Values.Ja); - - public static readonly Bcp47Tag Ko = new(Values.Ko); - - public static readonly Bcp47Tag No = new(Values.No); - - public static readonly Bcp47Tag Pl = new(Values.Pl); - - public static readonly Bcp47Tag Pt = new(Values.Pt); - - public static readonly Bcp47Tag PtBr = new(Values.PtBr); - - public static readonly Bcp47Tag PtPt = new(Values.PtPt); - - public static readonly Bcp47Tag Ru = new(Values.Ru); - - public static readonly Bcp47Tag Es = new(Values.Es); - - public static readonly Bcp47Tag Es419 = new(Values.Es419); - - public static readonly Bcp47Tag Sv = new(Values.Sv); - - public static readonly Bcp47Tag Ta = new(Values.Ta); - - public static readonly Bcp47Tag Tr = new(Values.Tr); - - public static readonly Bcp47Tag Uk = new(Values.Uk); - - public Bcp47Tag(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static Bcp47Tag FromCustom(string value) - { - return new Bcp47Tag(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(Bcp47Tag value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(Bcp47Tag value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(Bcp47Tag value) => value.Value; - - public static explicit operator Bcp47Tag(string value) => new(value); - - internal class Bcp47TagSerializer : JsonConverter - { - public override Bcp47Tag Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new Bcp47Tag(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - Bcp47Tag value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override Bcp47Tag ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new Bcp47Tag(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Bcp47Tag value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Zh = "zh"; - - public const string Da = "da"; - - public const string Nl = "nl"; - - public const string En = "en"; - - public const string EnAu = "en-AU"; - - public const string EnIn = "en-IN"; - - public const string EnNz = "en-NZ"; - - public const string EnGb = "en-GB"; - - public const string Fr = "fr"; - - public const string FrCa = "fr-CA"; - - public const string De = "de"; - - public const string Hi = "hi"; - - public const string HiLatn = "hi-Latn"; - - public const string Id = "id"; - - public const string It = "it"; - - public const string Ja = "ja"; - - public const string Ko = "ko"; - - public const string No = "no"; - - public const string Pl = "pl"; - - public const string Pt = "pt"; - - public const string PtBr = "pt-BR"; - - public const string PtPt = "pt-PT"; - - public const string Ru = "ru"; - - public const string Es = "es"; - - public const string Es419 = "es-419"; - - public const string Sv = "sv"; - - public const string Ta = "ta"; - - public const string Tr = "tr"; - - public const string Uk = "uk"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/BoundingBox.cs b/src/Hume/ExpressionMeasurement/Batch/Types/BoundingBox.cs deleted file mode 100644 index 8efc430..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/BoundingBox.cs +++ /dev/null @@ -1,53 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// A bounding box around a face. -/// -[Serializable] -public record BoundingBox : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// x-coordinate of bounding box top left corner. - /// - [JsonPropertyName("x")] - public required double X { get; set; } - - /// - /// y-coordinate of bounding box top left corner. - /// - [JsonPropertyName("y")] - public required double Y { get; set; } - - /// - /// Bounding box width. - /// - [JsonPropertyName("w")] - public required double W { get; set; } - - /// - /// Bounding box height. - /// - [JsonPropertyName("h")] - public required double H { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/BurstPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/BurstPrediction.cs deleted file mode 100644 index 420cf2c..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/BurstPrediction.cs +++ /dev/null @@ -1,42 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record BurstPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("time")] - public required TimeInterval Time { get; set; } - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - /// - /// Modality-specific descriptive features and their scores. - /// - [JsonPropertyName("descriptions")] - public IEnumerable Descriptions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedEmbeddingGeneration.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CompletedEmbeddingGeneration.cs deleted file mode 100644 index ced418a..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedEmbeddingGeneration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CompletedEmbeddingGeneration : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CompletedInference.cs deleted file mode 100644 index 231f93e..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedInference.cs +++ /dev/null @@ -1,56 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CompletedInference : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// The number of predictions that were generated by this job. - /// - [JsonPropertyName("num_predictions")] - public required ulong NumPredictions { get; set; } - - /// - /// The number of errors that occurred while running this job. - /// - [JsonPropertyName("num_errors")] - public required ulong NumErrors { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedState.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CompletedState.cs deleted file mode 100644 index d812bad..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedState.cs +++ /dev/null @@ -1,56 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CompletedState : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// The number of predictions that were generated by this job. - /// - [JsonPropertyName("num_predictions")] - public required ulong NumPredictions { get; set; } - - /// - /// The number of errors that occurred while running this job. - /// - [JsonPropertyName("num_errors")] - public required ulong NumErrors { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTlInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTlInference.cs deleted file mode 100644 index 9757ad6..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTlInference.cs +++ /dev/null @@ -1,56 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CompletedTlInference : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// The number of predictions that were generated by this job. - /// - [JsonPropertyName("num_predictions")] - public required ulong NumPredictions { get; set; } - - /// - /// The number of errors that occurred while running this job. - /// - [JsonPropertyName("num_errors")] - public required ulong NumErrors { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTraining.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTraining.cs deleted file mode 100644 index 90d2eff..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CompletedTraining.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CompletedTraining : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - [JsonPropertyName("custom_model")] - public required TrainingCustomModel CustomModel { get; set; } - - [JsonPropertyName("alternatives")] - public Dictionary? Alternatives { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelId.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelId.cs deleted file mode 100644 index 949bca2..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelId.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelId : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelPrediction.cs deleted file mode 100644 index 306dcc2..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelPrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("output")] - public Dictionary Output { get; set; } = new Dictionary(); - - [JsonPropertyName("error")] - public required string Error { get; set; } - - [JsonPropertyName("task_type")] - public required string TaskType { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelRequest.cs deleted file mode 100644 index 2060de3..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelRequest.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("name")] - public required string Name { get; set; } - - [JsonPropertyName("description")] - public string? Description { get; set; } - - [JsonPropertyName("tags")] - public IEnumerable? Tags { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelVersionId.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelVersionId.cs deleted file mode 100644 index 67a4849..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelVersionId.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelVersionId : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("version_id")] - public required string VersionId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsInferenceJob.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsInferenceJob.cs deleted file mode 100644 index 6afb3df..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsInferenceJob.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelsInferenceJob : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("type")] - public required string Type { get; set; } - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required TlInferenceBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateTlInference State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsTrainingJob.cs b/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsTrainingJob.cs deleted file mode 100644 index 945045f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/CustomModelsTrainingJob.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record CustomModelsTrainingJob : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("type")] - public required string Type { get; set; } - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required TrainingBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateTraining State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/DatasetId.cs b/src/Hume/ExpressionMeasurement/Batch/Types/DatasetId.cs deleted file mode 100644 index 0489461..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/DatasetId.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record DatasetId : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/DatasetVersionId.cs b/src/Hume/ExpressionMeasurement/Batch/Types/DatasetVersionId.cs deleted file mode 100644 index 117fd00..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/DatasetVersionId.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record DatasetVersionId : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("version_id")] - public required string VersionId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/DescriptionsScore.cs b/src/Hume/ExpressionMeasurement/Batch/Types/DescriptionsScore.cs deleted file mode 100644 index 16c8e99..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/DescriptionsScore.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record DescriptionsScore : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Name of the descriptive feature being expressed. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// Embedding value for the descriptive feature being expressed. - /// - [JsonPropertyName("score")] - public required float Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Direction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Direction.cs deleted file mode 100644 index cd8d741..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Direction.cs +++ /dev/null @@ -1,113 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Direction.DirectionSerializer))] -[Serializable] -public readonly record struct Direction : IStringEnum -{ - public static readonly Direction Asc = new(Values.Asc); - - public static readonly Direction Desc = new(Values.Desc); - - public Direction(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static Direction FromCustom(string value) - { - return new Direction(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(Direction value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(Direction value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(Direction value) => value.Value; - - public static explicit operator Direction(string value) => new(value); - - internal class DirectionSerializer : JsonConverter - { - public override Direction Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new Direction(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - Direction value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override Direction ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new Direction(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Direction value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Asc = "asc"; - - public const string Desc = "desc"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationBaseRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationBaseRequest.cs deleted file mode 100644 index 95c3c35..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationBaseRequest.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record EmbeddingGenerationBaseRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// File ID and File URL pairs for an asset registry file - /// - [JsonPropertyName("registry_file_details")] - public IEnumerable? RegistryFileDetails { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationJob.cs b/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationJob.cs deleted file mode 100644 index 7cff9ef..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/EmbeddingGenerationJob.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record EmbeddingGenerationJob : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("type")] - public required string Type { get; set; } - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required EmbeddingGenerationBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateEmbeddingGeneration State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/EmotionScore.cs b/src/Hume/ExpressionMeasurement/Batch/Types/EmotionScore.cs deleted file mode 100644 index d29dc63..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/EmotionScore.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record EmotionScore : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Name of the emotion being expressed. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// Embedding value for the emotion being expressed. - /// - [JsonPropertyName("score")] - public required float Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Error.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Error.cs deleted file mode 100644 index 06d736c..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Error.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record Error : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - /// - /// A file path relative to the top level source URL or file. - /// - [JsonPropertyName("file")] - public required string File { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/EvaluationArgs.cs b/src/Hume/ExpressionMeasurement/Batch/Types/EvaluationArgs.cs deleted file mode 100644 index 7df941d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/EvaluationArgs.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record EvaluationArgs : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("validation")] - public ValidationArgs? Validation { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Face.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Face.cs deleted file mode 100644 index ba29bf8..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Face.cs +++ /dev/null @@ -1,67 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The Facial Emotional Expression model analyzes human facial expressions in images and videos. Results will be provided per frame for video files. -/// -/// Recommended input file types: `.png`, `.jpeg`, `.mp4` -/// -[Serializable] -public record Face : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Number of frames per second to process. Other frames will be omitted from the response. Set to `0` to process every frame. - /// - [JsonPropertyName("fps_pred")] - public double? FpsPred { get; set; } - - /// - /// Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response. - /// - [JsonPropertyName("prob_threshold")] - public double? ProbThreshold { get; set; } - - /// - /// Whether to return identifiers for faces across frames. If `true`, unique identifiers will be assigned to face bounding boxes to differentiate different faces. If `false`, all faces will be tagged with an `unknown` ID. - /// - [JsonPropertyName("identify_faces")] - public bool? IdentifyFaces { get; set; } - - /// - /// Minimum bounding box side length in pixels to treat as a face. Faces detected with a bounding box side length in pixels less than this threshold will be omitted from the response. - /// - [JsonPropertyName("min_face_size")] - public ulong? MinFaceSize { get; set; } - - [JsonPropertyName("facs")] - public Dictionary? Facs { get; set; } - - [JsonPropertyName("descriptions")] - public Dictionary? Descriptions { get; set; } - - /// - /// Whether to extract and save the detected faces in the artifacts zip created by each job. - /// - [JsonPropertyName("save_faces")] - public bool? SaveFaces { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/FacePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/FacePrediction.cs deleted file mode 100644 index ded76a6..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/FacePrediction.cs +++ /dev/null @@ -1,65 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record FacePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Frame number - /// - [JsonPropertyName("frame")] - public required ulong Frame { get; set; } - - /// - /// Time in seconds when face detection occurred. - /// - [JsonPropertyName("time")] - public required double Time { get; set; } - - /// - /// The predicted probability that a detected face was actually a face. - /// - [JsonPropertyName("prob")] - public required double Prob { get; set; } - - [JsonPropertyName("box")] - public required BoundingBox Box { get; set; } - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - /// - /// FACS 2.0 features and their scores. - /// - [JsonPropertyName("facs")] - public IEnumerable? Facs { get; set; } - - /// - /// Modality-specific descriptive features and their scores. - /// - [JsonPropertyName("descriptions")] - public IEnumerable? Descriptions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/FacemeshPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/FacemeshPrediction.cs deleted file mode 100644 index a0df956..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/FacemeshPrediction.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record FacemeshPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/FacsScore.cs b/src/Hume/ExpressionMeasurement/Batch/Types/FacsScore.cs deleted file mode 100644 index 1ce04d3..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/FacsScore.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record FacsScore : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Name of the FACS 2.0 feature being expressed. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// Embedding value for the FACS 2.0 feature being expressed. - /// - [JsonPropertyName("score")] - public required float Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Failed.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Failed.cs deleted file mode 100644 index 0792ff0..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Failed.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record Failed : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/FailedState.cs b/src/Hume/ExpressionMeasurement/Batch/Types/FailedState.cs deleted file mode 100644 index 7fe6f1e..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/FailedState.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record FailedState : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/File.cs b/src/Hume/ExpressionMeasurement/Batch/Types/File.cs deleted file mode 100644 index 2dd1671..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/File.cs +++ /dev/null @@ -1,47 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The list of files submitted for analysis. -/// -[Serializable] -public record File : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The name of the file. - /// - [JsonPropertyName("filename")] - public string? Filename { get; set; } - - /// - /// The content type of the file. - /// - [JsonPropertyName("content_type")] - public string? ContentType { get; set; } - - /// - /// The MD5 checksum of the file. - /// - [JsonPropertyName("md5sum")] - public required string Md5Sum { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Granularity.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Granularity.cs deleted file mode 100644 index 4d63898..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Granularity.cs +++ /dev/null @@ -1,123 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Granularity.GranularitySerializer))] -[Serializable] -public readonly record struct Granularity : IStringEnum -{ - public static readonly Granularity Word = new(Values.Word); - - public static readonly Granularity Sentence = new(Values.Sentence); - - public static readonly Granularity Utterance = new(Values.Utterance); - - public static readonly Granularity ConversationalTurn = new(Values.ConversationalTurn); - - public Granularity(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static Granularity FromCustom(string value) - { - return new Granularity(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(Granularity value1, string value2) => - value1.Value.Equals(value2); - - public static bool operator !=(Granularity value1, string value2) => - !value1.Value.Equals(value2); - - public static explicit operator string(Granularity value) => value.Value; - - public static explicit operator Granularity(string value) => new(value); - - internal class GranularitySerializer : JsonConverter - { - public override Granularity Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new Granularity(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - Granularity value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override Granularity ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new Granularity(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Granularity value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Word = "word"; - - public const string Sentence = "sentence"; - - public const string Utterance = "utterance"; - - public const string ConversationalTurn = "conversational_turn"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsBurstPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsBurstPrediction.cs deleted file mode 100644 index 1f83d7d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsBurstPrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsBurstPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacePrediction.cs deleted file mode 100644 index aafad17..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacePrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsFacePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacemeshPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacemeshPrediction.cs deleted file mode 100644 index 0574242..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsFacemeshPrediction.cs +++ /dev/null @@ -1,36 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsFacemeshPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsLanguagePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsLanguagePrediction.cs deleted file mode 100644 index cd8e266..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsLanguagePrediction.cs +++ /dev/null @@ -1,36 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsLanguagePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsNerPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsNerPrediction.cs deleted file mode 100644 index 7cd2885..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsNerPrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsNerPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsProsodyPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsProsodyPrediction.cs deleted file mode 100644 index 9b7ed1d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/GroupedPredictionsProsodyPrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record GroupedPredictionsProsodyPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// An automatically generated label to identify individuals in your media file. Will be `unknown` if you have chosen to disable identification, or if the model is unable to distinguish between individuals. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InProgress.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InProgress.cs deleted file mode 100644 index 7fa6dec..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InProgress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InProgress : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InProgressState.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InProgressState.cs deleted file mode 100644 index f978cf0..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InProgressState.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InProgressState : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceBaseRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferenceBaseRequest.cs deleted file mode 100644 index eac9c42..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceBaseRequest.cs +++ /dev/null @@ -1,63 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferenceBaseRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Specify the models to use for inference. - /// - /// If this field is not explicitly set, then all models will run by default. - /// - [JsonPropertyName("models")] - public Models? Models { get; set; } - - [JsonPropertyName("transcription")] - public Transcription? Transcription { get; set; } - - /// - /// URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`) of media files. - /// - /// If you wish to supply more than 100 URLs, consider providing them as an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`). - /// - [JsonPropertyName("urls")] - public IEnumerable? Urls { get; set; } - - /// - /// Text supplied directly to our Emotional Language and NER models for analysis. - /// - [JsonPropertyName("text")] - public IEnumerable? Text { get; set; } - - /// - /// If provided, a `POST` request will be made to the URL with the generated predictions on completion or the error message on failure. - /// - [JsonPropertyName("callback_url")] - public string? CallbackUrl { get; set; } - - /// - /// Whether to send an email notification to the user upon job completion/failure. - /// - [JsonPropertyName("notify")] - public bool? Notify { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceJob.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferenceJob.cs deleted file mode 100644 index 02e7c20..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceJob.cs +++ /dev/null @@ -1,52 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferenceJob : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Denotes the job type. - /// - /// Jobs created with the Expression Measurement API will have this field set to `INFERENCE`. - /// - [JsonPropertyName("type")] - public required string Type { get; set; } - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - /// - /// The request that initiated the job. - /// - [JsonPropertyName("request")] - public required InferenceRequest Request { get; set; } - - /// - /// The current state of the job. - /// - [JsonPropertyName("state")] - public required StateInference State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferencePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferencePrediction.cs deleted file mode 100644 index 426c05e..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferencePrediction.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferencePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A file path relative to the top level source URL or file. - /// - [JsonPropertyName("file")] - public required string File { get; set; } - - [JsonPropertyName("models")] - public required ModelsPredictions Models { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferenceRequest.cs deleted file mode 100644 index 7c8c6b5..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceRequest.cs +++ /dev/null @@ -1,61 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferenceRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("models")] - public Models? Models { get; set; } - - [JsonPropertyName("transcription")] - public Transcription? Transcription { get; set; } - - /// - /// URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`) of media files. - /// - /// If you wish to supply more than 100 URLs, consider providing them as an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`). - /// - [JsonPropertyName("urls")] - public IEnumerable? Urls { get; set; } - - /// - /// Text to supply directly to our language and NER models. - /// - [JsonPropertyName("text")] - public IEnumerable? Text { get; set; } - - /// - /// If provided, a `POST` request will be made to the URL with the generated predictions on completion or the error message on failure. - /// - [JsonPropertyName("callback_url")] - public string? CallbackUrl { get; set; } - - /// - /// Whether to send an email notification to the user upon job completion/failure. - /// - [JsonPropertyName("notify")] - public bool? Notify { get; set; } - - [JsonPropertyName("files")] - public IEnumerable Files { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceResults.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferenceResults.cs deleted file mode 100644 index 8cf87c8..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceResults.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferenceResults : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = - new List(); - - [JsonPropertyName("errors")] - public IEnumerable Errors { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceSourcePredictResult.cs b/src/Hume/ExpressionMeasurement/Batch/Types/InferenceSourcePredictResult.cs deleted file mode 100644 index e0272ba..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/InferenceSourcePredictResult.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record InferenceSourcePredictResult : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("source")] - public required Source Source { get; set; } - - [JsonPropertyName("results")] - public InferenceResults? Results { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("error")] - public string? Error { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/JobEmbeddingGeneration.cs b/src/Hume/ExpressionMeasurement/Batch/Types/JobEmbeddingGeneration.cs deleted file mode 100644 index f02b2a2..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/JobEmbeddingGeneration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record JobEmbeddingGeneration : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required EmbeddingGenerationBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateEmbeddingGeneration State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/JobId.cs b/src/Hume/ExpressionMeasurement/Batch/Types/JobId.cs deleted file mode 100644 index d5357e3..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/JobId.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record JobId : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The ID of the started job. - /// - [JsonPropertyName("job_id")] - public required string JobId_ { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/JobInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/JobInference.cs deleted file mode 100644 index f955602..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/JobInference.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record JobInference : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - /// - /// The request that initiated the job. - /// - [JsonPropertyName("request")] - public required InferenceRequest Request { get; set; } - - /// - /// The current state of the job. - /// - [JsonPropertyName("state")] - public required StateInference State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/JobTlInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/JobTlInference.cs deleted file mode 100644 index 5d850bb..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/JobTlInference.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record JobTlInference : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required TlInferenceBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateTlInference State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/JobTraining.cs b/src/Hume/ExpressionMeasurement/Batch/Types/JobTraining.cs deleted file mode 100644 index 3677721..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/JobTraining.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record JobTraining : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The ID associated with this job. - /// - [JsonPropertyName("job_id")] - public required string JobId { get; set; } - - [JsonPropertyName("user_id")] - public required string UserId { get; set; } - - [JsonPropertyName("request")] - public required TrainingBaseRequest Request { get; set; } - - [JsonPropertyName("state")] - public required StateTraining State { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Language.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Language.cs deleted file mode 100644 index 05df791..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Language.cs +++ /dev/null @@ -1,46 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The Emotional Language model analyzes passages of text. This also supports audio and video files by transcribing and then directly analyzing the transcribed text. -/// -/// Recommended input filetypes: `.txt`, `.mp3`, `.wav`, `.mp4` -/// -[Serializable] -public record Language : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("granularity")] - public Granularity? Granularity { get; set; } - - [JsonPropertyName("sentiment")] - public Dictionary? Sentiment { get; set; } - - [JsonPropertyName("toxicity")] - public Dictionary? Toxicity { get; set; } - - /// - /// Whether to return identifiers for speakers over time. If `true`, unique identifiers will be assigned to spoken words to differentiate different speakers. If `false`, all speakers will be tagged with an `unknown` ID. - /// - [JsonPropertyName("identify_speakers")] - public bool? IdentifySpeakers { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/LanguagePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/LanguagePrediction.cs deleted file mode 100644 index 3e13e31..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/LanguagePrediction.cs +++ /dev/null @@ -1,70 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record LanguagePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A segment of text (like a word or a sentence). - /// - [JsonPropertyName("text")] - public required string Text { get; set; } - - [JsonPropertyName("position")] - public required PositionInterval Position { get; set; } - - [JsonPropertyName("time")] - public TimeInterval? Time { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence in this text. - /// - [JsonPropertyName("confidence")] - public double? Confidence { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence that this text was spoken by this speaker. - /// - [JsonPropertyName("speaker_confidence")] - public double? SpeakerConfidence { get; set; } - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - /// - /// Sentiment predictions returned as a distribution. This model predicts the probability that a given text could be interpreted as having each sentiment level from `1` (negative) to `9` (positive). - /// - /// Compared to returning one estimate of sentiment, this enables a more nuanced analysis of a text's meaning. For example, a text with very neutral sentiment would have an average rating of `5`. But also a text that could be interpreted as having very positive sentiment or very negative sentiment would also have an average rating of `5`. The average sentiment is less informative than the distribution over sentiment, so this API returns a value for each sentiment level. - /// - [JsonPropertyName("sentiment")] - public IEnumerable? Sentiment { get; set; } - - /// - /// Toxicity predictions returned as probabilities that the text can be classified into the following categories: `toxic`, `severe_toxic`, `obscene`, `threat`, `insult`, and `identity_hate`. - /// - [JsonPropertyName("toxicity")] - public IEnumerable? Toxicity { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Models.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Models.cs deleted file mode 100644 index 09d721f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Models.cs +++ /dev/null @@ -1,47 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The models used for inference. -/// -[Serializable] -public record Models : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("face")] - public Face? Face { get; set; } - - [JsonPropertyName("burst")] - public Dictionary? Burst { get; set; } - - [JsonPropertyName("prosody")] - public Prosody? Prosody { get; set; } - - [JsonPropertyName("language")] - public Language? Language { get; set; } - - [JsonPropertyName("ner")] - public Ner? Ner { get; set; } - - [JsonPropertyName("facemesh")] - public Dictionary? Facemesh { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/ModelsPredictions.cs b/src/Hume/ExpressionMeasurement/Batch/Types/ModelsPredictions.cs deleted file mode 100644 index 5c7d315..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/ModelsPredictions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record ModelsPredictions : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("face")] - public PredictionsOptionalNullFacePrediction? Face { get; set; } - - [JsonPropertyName("burst")] - public PredictionsOptionalNullBurstPrediction? Burst { get; set; } - - [JsonPropertyName("prosody")] - public PredictionsOptionalTranscriptionMetadataProsodyPrediction? Prosody { get; set; } - - [JsonPropertyName("language")] - public PredictionsOptionalTranscriptionMetadataLanguagePrediction? Language { get; set; } - - [JsonPropertyName("ner")] - public PredictionsOptionalTranscriptionMetadataNerPrediction? Ner { get; set; } - - [JsonPropertyName("facemesh")] - public PredictionsOptionalNullFacemeshPrediction? Facemesh { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Ner.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Ner.cs deleted file mode 100644 index 8277561..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Ner.cs +++ /dev/null @@ -1,37 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The NER (Named-entity Recognition) model identifies real-world objects and concepts in passages of text. This also supports audio and video files by transcribing and then directly analyzing the transcribed text. -/// -/// Recommended input filetypes: `.txt`, `.mp3`, `.wav`, `.mp4` -/// -[Serializable] -public record Ner : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Whether to return identifiers for speakers over time. If `true`, unique identifiers will be assigned to spoken words to differentiate different speakers. If `false`, all speakers will be tagged with an `unknown` ID. - /// - [JsonPropertyName("identify_speakers")] - public bool? IdentifySpeakers { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/NerPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/NerPrediction.cs deleted file mode 100644 index 3ceffc5..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/NerPrediction.cs +++ /dev/null @@ -1,80 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record NerPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The recognized topic or entity. - /// - [JsonPropertyName("entity")] - public required string Entity { get; set; } - - [JsonPropertyName("position")] - public required PositionInterval Position { get; set; } - - /// - /// Our NER model's relative confidence in the recognized topic or entity. - /// - [JsonPropertyName("entity_confidence")] - public required double EntityConfidence { get; set; } - - /// - /// A measure of how often the entity is linked to by other entities. - /// - [JsonPropertyName("support")] - public required double Support { get; set; } - - /// - /// A URL which provides more information about the recognized topic or entity. - /// - [JsonPropertyName("uri")] - public required string Uri { get; set; } - - /// - /// The specific word to which the emotion predictions are linked. - /// - [JsonPropertyName("link_word")] - public required string LinkWord { get; set; } - - [JsonPropertyName("time")] - public TimeInterval? Time { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence in this text. - /// - [JsonPropertyName("confidence")] - public double? Confidence { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence that this text was spoken by this speaker. - /// - [JsonPropertyName("speaker_confidence")] - public double? SpeakerConfidence { get; set; } - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PositionInterval.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PositionInterval.cs deleted file mode 100644 index c5eb0b6..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PositionInterval.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// Position of a segment of text within a larger document, measured in characters. Uses zero-based indexing. The beginning index is inclusive and the end index is exclusive. -/// -[Serializable] -public record PositionInterval : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The index of the first character in the text segment, inclusive. - /// - [JsonPropertyName("begin")] - public required ulong Begin { get; set; } - - /// - /// The index of the last character in the text segment, exclusive. - /// - [JsonPropertyName("end")] - public required ulong End { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullBurstPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullBurstPrediction.cs deleted file mode 100644 index a4c90b8..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullBurstPrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalNullBurstPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public Dictionary? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacePrediction.cs deleted file mode 100644 index 254f3a5..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacePrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalNullFacePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public Dictionary? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacemeshPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacemeshPrediction.cs deleted file mode 100644 index d04a66b..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalNullFacemeshPrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalNullFacemeshPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public Dictionary? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataLanguagePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataLanguagePrediction.cs deleted file mode 100644 index 9d02ea1..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataLanguagePrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalTranscriptionMetadataLanguagePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public TranscriptionMetadata? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataNerPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataNerPrediction.cs deleted file mode 100644 index 7d10d87..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataNerPrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalTranscriptionMetadataNerPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public TranscriptionMetadata? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataProsodyPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataProsodyPrediction.cs deleted file mode 100644 index 507b073..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/PredictionsOptionalTranscriptionMetadataProsodyPrediction.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record PredictionsOptionalTranscriptionMetadataProsodyPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("metadata")] - public TranscriptionMetadata? Metadata { get; set; } - - [JsonPropertyName("grouped_predictions")] - public IEnumerable GroupedPredictions { get; set; } = - new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Prosody.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Prosody.cs deleted file mode 100644 index 39d0757..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Prosody.cs +++ /dev/null @@ -1,43 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// The Speech Prosody model analyzes the intonation, stress, and rhythm of spoken word. -/// -/// Recommended input file types: `.wav`, `.mp3`, `.mp4` -/// -[Serializable] -public record Prosody : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("granularity")] - public Granularity? Granularity { get; set; } - - [JsonPropertyName("window")] - public Window? Window { get; set; } - - /// - /// Whether to return identifiers for speakers over time. If `true`, unique identifiers will be assigned to spoken words to differentiate different speakers. If `false`, all speakers will be tagged with an `unknown` ID. - /// - [JsonPropertyName("identify_speakers")] - public bool? IdentifySpeakers { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/ProsodyPrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/ProsodyPrediction.cs deleted file mode 100644 index e2ea50c..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/ProsodyPrediction.cs +++ /dev/null @@ -1,53 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record ProsodyPrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A segment of text (like a word or a sentence). - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - [JsonPropertyName("time")] - public required TimeInterval Time { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence in this text. - /// - [JsonPropertyName("confidence")] - public double? Confidence { get; set; } - - /// - /// Value between `0.0` and `1.0` that indicates our transcription model's relative confidence that this text was spoken by this speaker. - /// - [JsonPropertyName("speaker_confidence")] - public double? SpeakerConfidence { get; set; } - - /// - /// A high-dimensional embedding in emotion space. - /// - [JsonPropertyName("emotions")] - public IEnumerable Emotions { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Queued.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Queued.cs deleted file mode 100644 index cef7a6e..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Queued.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record Queued : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/QueuedState.cs b/src/Hume/ExpressionMeasurement/Batch/Types/QueuedState.cs deleted file mode 100644 index 3cb3508..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/QueuedState.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record QueuedState : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/RegistryFileDetail.cs b/src/Hume/ExpressionMeasurement/Batch/Types/RegistryFileDetail.cs deleted file mode 100644 index 8173868..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/RegistryFileDetail.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record RegistryFileDetail : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// File ID in the Asset Registry - /// - [JsonPropertyName("file_id")] - public required string FileId { get; set; } - - /// - /// URL to the file in the Asset Registry - /// - [JsonPropertyName("file_url")] - public required string FileUrl { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/SentimentScore.cs b/src/Hume/ExpressionMeasurement/Batch/Types/SentimentScore.cs deleted file mode 100644 index 5fe7825..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/SentimentScore.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record SentimentScore : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Level of sentiment, ranging from `1` (negative) to `9` (positive) - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// Prediction for this level of sentiment - /// - [JsonPropertyName("score")] - public required float Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/SortBy.cs b/src/Hume/ExpressionMeasurement/Batch/Types/SortBy.cs deleted file mode 100644 index 33cd2a0..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/SortBy.cs +++ /dev/null @@ -1,117 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(SortBy.SortBySerializer))] -[Serializable] -public readonly record struct SortBy : IStringEnum -{ - public static readonly SortBy Created = new(Values.Created); - - public static readonly SortBy Started = new(Values.Started); - - public static readonly SortBy Ended = new(Values.Ended); - - public SortBy(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static SortBy FromCustom(string value) - { - return new SortBy(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(SortBy value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(SortBy value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(SortBy value) => value.Value; - - public static explicit operator SortBy(string value) => new(value); - - internal class SortBySerializer : JsonConverter - { - public override SortBy Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new SortBy(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - SortBy value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override SortBy ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new SortBy(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - SortBy value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Created = "created"; - - public const string Started = "started"; - - public const string Ended = "ended"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Source.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Source.cs deleted file mode 100644 index e4907de..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Source.cs +++ /dev/null @@ -1,357 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Source.JsonConverter))] -[Serializable] -public record Source -{ - internal Source(string type, object? value) - { - Type = type; - Value = value; - } - - /// - /// Create an instance of Source with . - /// - public Source(Source.Url value) - { - Type = "url"; - Value = value.Value; - } - - /// - /// Create an instance of Source with . - /// - public Source(Source.File value) - { - Type = "file"; - Value = value.Value; - } - - /// - /// Create an instance of Source with . - /// - public Source(Source.Text value) - { - Type = "text"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("type")] - public string Type { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "url" - /// - public bool IsUrl => Type == "url"; - - /// - /// Returns true if is "file" - /// - public bool IsFile => Type == "file"; - - /// - /// Returns true if is "text" - /// - public bool IsText => Type == "text"; - - /// - /// Returns the value as a if is 'url', otherwise throws an exception. - /// - /// Thrown when is not 'url'. - public Hume.ExpressionMeasurement.Batch.SourceUrl AsUrl() => - IsUrl - ? (Hume.ExpressionMeasurement.Batch.SourceUrl)Value! - : throw new global::System.Exception("Source.Type is not 'url'"); - - /// - /// Returns the value as a if is 'file', otherwise throws an exception. - /// - /// Thrown when is not 'file'. - public Hume.ExpressionMeasurement.Batch.SourceFile AsFile() => - IsFile - ? (Hume.ExpressionMeasurement.Batch.SourceFile)Value! - : throw new global::System.Exception("Source.Type is not 'file'"); - - /// - /// Returns the value as a if is 'text', otherwise throws an exception. - /// - /// Thrown when is not 'text'. - public Hume.ExpressionMeasurement.Batch.SourceTextSource AsText() => - IsText - ? (Hume.ExpressionMeasurement.Batch.SourceTextSource)Value! - : throw new global::System.Exception("Source.Type is not 'text'"); - - public T Match( - Func onUrl, - Func onFile, - Func onText, - Func onUnknown_ - ) - { - return Type switch - { - "url" => onUrl(AsUrl()), - "file" => onFile(AsFile()), - "text" => onText(AsText()), - _ => onUnknown_(Type, Value), - }; - } - - public void Visit( - Action onUrl, - Action onFile, - Action onText, - Action onUnknown_ - ) - { - switch (Type) - { - case "url": - onUrl(AsUrl()); - break; - case "file": - onFile(AsFile()); - break; - case "text": - onText(AsText()); - break; - default: - onUnknown_(Type, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsUrl(out Hume.ExpressionMeasurement.Batch.SourceUrl? value) - { - if (Type == "url") - { - value = (Hume.ExpressionMeasurement.Batch.SourceUrl)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsFile(out Hume.ExpressionMeasurement.Batch.SourceFile? value) - { - if (Type == "file") - { - value = (Hume.ExpressionMeasurement.Batch.SourceFile)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsText(out Hume.ExpressionMeasurement.Batch.SourceTextSource? value) - { - if (Type == "text") - { - value = (Hume.ExpressionMeasurement.Batch.SourceTextSource)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator Source(Source.Url value) => new(value); - - public static implicit operator Source(Source.File value) => new(value); - - public static implicit operator Source(Source.Text value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(Source).IsAssignableFrom(typeToConvert); - - public override Source Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("type", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'type'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'type' is null"); - } - - throw new JsonException( - $"Discriminator property 'type' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'type' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("type"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "url" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.SourceUrl" - ), - "file" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.SourceFile" - ), - "text" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.SourceTextSource" - ), - _ => json.Deserialize(options), - }; - return new Source(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - Source value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Type switch - { - "url" => JsonSerializer.SerializeToNode(value.Value, options), - "file" => JsonSerializer.SerializeToNode(value.Value, options), - "text" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["type"] = value.Type; - json.WriteTo(writer, options); - } - - public override Source ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new Source(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Source value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Type); - } - } - - /// - /// Discriminated union type for url - /// - [Serializable] - public struct Url - { - public Url(Hume.ExpressionMeasurement.Batch.SourceUrl value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.SourceUrl Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator Source.Url( - Hume.ExpressionMeasurement.Batch.SourceUrl value - ) => new(value); - } - - /// - /// Discriminated union type for file - /// - [Serializable] - public struct File - { - public File(Hume.ExpressionMeasurement.Batch.SourceFile value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.SourceFile Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator Source.File( - Hume.ExpressionMeasurement.Batch.SourceFile value - ) => new(value); - } - - /// - /// Discriminated union type for text - /// - [Serializable] - public struct Text - { - public Text(Hume.ExpressionMeasurement.Batch.SourceTextSource value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.SourceTextSource Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator Source.Text( - Hume.ExpressionMeasurement.Batch.SourceTextSource value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/SourceFile.cs b/src/Hume/ExpressionMeasurement/Batch/Types/SourceFile.cs deleted file mode 100644 index d4101a4..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/SourceFile.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record SourceFile : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The name of the file. - /// - [JsonPropertyName("filename")] - public string? Filename { get; set; } - - /// - /// The content type of the file. - /// - [JsonPropertyName("content_type")] - public string? ContentType { get; set; } - - /// - /// The MD5 checksum of the file. - /// - [JsonPropertyName("md5sum")] - public required string Md5Sum { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/SourceTextSource.cs b/src/Hume/ExpressionMeasurement/Batch/Types/SourceTextSource.cs deleted file mode 100644 index 81d11ae..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/SourceTextSource.cs +++ /dev/null @@ -1,26 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record SourceTextSource : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/SourceUrl.cs b/src/Hume/ExpressionMeasurement/Batch/Types/SourceUrl.cs deleted file mode 100644 index 402a52f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/SourceUrl.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record SourceUrl : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The URL of the source media file. - /// - [JsonPropertyName("url")] - public required string Url { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGeneration.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGeneration.cs deleted file mode 100644 index 80cda6d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGeneration.cs +++ /dev/null @@ -1,458 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(StateEmbeddingGeneration.JsonConverter))] -[Serializable] -public record StateEmbeddingGeneration -{ - internal StateEmbeddingGeneration(string type, object? value) - { - Status = type; - Value = value; - } - - /// - /// Create an instance of StateEmbeddingGeneration with . - /// - public StateEmbeddingGeneration(StateEmbeddingGeneration.Queued value) - { - Status = "QUEUED"; - Value = value.Value; - } - - /// - /// Create an instance of StateEmbeddingGeneration with . - /// - public StateEmbeddingGeneration(StateEmbeddingGeneration.InProgress value) - { - Status = "IN_PROGRESS"; - Value = value.Value; - } - - /// - /// Create an instance of StateEmbeddingGeneration with . - /// - public StateEmbeddingGeneration(StateEmbeddingGeneration.Completed value) - { - Status = "COMPLETED"; - Value = value.Value; - } - - /// - /// Create an instance of StateEmbeddingGeneration with . - /// - public StateEmbeddingGeneration(StateEmbeddingGeneration.Failed value) - { - Status = "FAILED"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("status")] - public string Status { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "QUEUED" - /// - public bool IsQueued => Status == "QUEUED"; - - /// - /// Returns true if is "IN_PROGRESS" - /// - public bool IsInProgress => Status == "IN_PROGRESS"; - - /// - /// Returns true if is "COMPLETED" - /// - public bool IsCompleted => Status == "COMPLETED"; - - /// - /// Returns true if is "FAILED" - /// - public bool IsFailed => Status == "FAILED"; - - /// - /// Returns the value as a if is 'QUEUED', otherwise throws an exception. - /// - /// Thrown when is not 'QUEUED'. - public Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued AsQueued() => - IsQueued - ? (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued)Value! - : throw new global::System.Exception("StateEmbeddingGeneration.Status is not 'QUEUED'"); - - /// - /// Returns the value as a if is 'IN_PROGRESS', otherwise throws an exception. - /// - /// Thrown when is not 'IN_PROGRESS'. - public Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress AsInProgress() => - IsInProgress - ? (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress)Value! - : throw new global::System.Exception( - "StateEmbeddingGeneration.Status is not 'IN_PROGRESS'" - ); - - /// - /// Returns the value as a if is 'COMPLETED', otherwise throws an exception. - /// - /// Thrown when is not 'COMPLETED'. - public Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration AsCompleted() => - IsCompleted - ? (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration) - Value! - : throw new global::System.Exception( - "StateEmbeddingGeneration.Status is not 'COMPLETED'" - ); - - /// - /// Returns the value as a if is 'FAILED', otherwise throws an exception. - /// - /// Thrown when is not 'FAILED'. - public Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed AsFailed() => - IsFailed - ? (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed)Value! - : throw new global::System.Exception("StateEmbeddingGeneration.Status is not 'FAILED'"); - - public T Match( - Func onQueued, - Func onInProgress, - Func< - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration, - T - > onCompleted, - Func onFailed, - Func onUnknown_ - ) - { - return Status switch - { - "QUEUED" => onQueued(AsQueued()), - "IN_PROGRESS" => onInProgress(AsInProgress()), - "COMPLETED" => onCompleted(AsCompleted()), - "FAILED" => onFailed(AsFailed()), - _ => onUnknown_(Status, Value), - }; - } - - public void Visit( - Action onQueued, - Action onInProgress, - Action onCompleted, - Action onFailed, - Action onUnknown_ - ) - { - switch (Status) - { - case "QUEUED": - onQueued(AsQueued()); - break; - case "IN_PROGRESS": - onInProgress(AsInProgress()); - break; - case "COMPLETED": - onCompleted(AsCompleted()); - break; - case "FAILED": - onFailed(AsFailed()); - break; - default: - onUnknown_(Status, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsQueued( - out Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued? value - ) - { - if (Status == "QUEUED") - { - value = (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsInProgress( - out Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress? value - ) - { - if (Status == "IN_PROGRESS") - { - value = (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsCompleted( - out Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration? value - ) - { - if (Status == "COMPLETED") - { - value = - (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration) - Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsFailed( - out Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed? value - ) - { - if (Status == "FAILED") - { - value = (Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator StateEmbeddingGeneration( - StateEmbeddingGeneration.Queued value - ) => new(value); - - public static implicit operator StateEmbeddingGeneration( - StateEmbeddingGeneration.InProgress value - ) => new(value); - - public static implicit operator StateEmbeddingGeneration( - StateEmbeddingGeneration.Completed value - ) => new(value); - - public static implicit operator StateEmbeddingGeneration( - StateEmbeddingGeneration.Failed value - ) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(StateEmbeddingGeneration).IsAssignableFrom(typeToConvert); - - public override StateEmbeddingGeneration Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("status", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'status'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'status' is null"); - } - - throw new JsonException( - $"Discriminator property 'status' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'status' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("status"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "QUEUED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued" - ), - "IN_PROGRESS" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress" - ), - "COMPLETED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration" - ), - "FAILED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed" - ), - _ => json.Deserialize(options), - }; - return new StateEmbeddingGeneration(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - StateEmbeddingGeneration value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Status switch - { - "QUEUED" => JsonSerializer.SerializeToNode(value.Value, options), - "IN_PROGRESS" => JsonSerializer.SerializeToNode(value.Value, options), - "COMPLETED" => JsonSerializer.SerializeToNode(value.Value, options), - "FAILED" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["status"] = value.Status; - json.WriteTo(writer, options); - } - - public override StateEmbeddingGeneration ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new StateEmbeddingGeneration(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - StateEmbeddingGeneration value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Status); - } - } - - /// - /// Discriminated union type for QUEUED - /// - [Serializable] - public struct Queued - { - public Queued(Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateEmbeddingGeneration.Queued( - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationQueued value - ) => new(value); - } - - /// - /// Discriminated union type for IN_PROGRESS - /// - [Serializable] - public struct InProgress - { - public InProgress(Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateEmbeddingGeneration.InProgress( - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationInProgress value - ) => new(value); - } - - /// - /// Discriminated union type for COMPLETED - /// - [Serializable] - public struct Completed - { - public Completed( - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration value - ) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateEmbeddingGeneration.Completed( - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationCompletedEmbeddingGeneration value - ) => new(value); - } - - /// - /// Discriminated union type for FAILED - /// - [Serializable] - public struct Failed - { - public Failed(Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateEmbeddingGeneration.Failed( - Hume.ExpressionMeasurement.Batch.StateEmbeddingGenerationFailed value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationCompletedEmbeddingGeneration.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationCompletedEmbeddingGeneration.cs deleted file mode 100644 index b3b4cc4..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationCompletedEmbeddingGeneration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateEmbeddingGenerationCompletedEmbeddingGeneration : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationFailed.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationFailed.cs deleted file mode 100644 index ecc0658..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationFailed.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateEmbeddingGenerationFailed : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationInProgress.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationInProgress.cs deleted file mode 100644 index 90e9d5f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationInProgress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateEmbeddingGenerationInProgress : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationQueued.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationQueued.cs deleted file mode 100644 index bcd2cb9..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateEmbeddingGenerationQueued.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateEmbeddingGenerationQueued : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateInference.cs deleted file mode 100644 index bc84ce3..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateInference.cs +++ /dev/null @@ -1,430 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(StateInference.JsonConverter))] -[Serializable] -public record StateInference -{ - internal StateInference(string type, object? value) - { - Status = type; - Value = value; - } - - /// - /// Create an instance of StateInference with . - /// - public StateInference(StateInference.Queued value) - { - Status = "QUEUED"; - Value = value.Value; - } - - /// - /// Create an instance of StateInference with . - /// - public StateInference(StateInference.InProgress value) - { - Status = "IN_PROGRESS"; - Value = value.Value; - } - - /// - /// Create an instance of StateInference with . - /// - public StateInference(StateInference.Completed value) - { - Status = "COMPLETED"; - Value = value.Value; - } - - /// - /// Create an instance of StateInference with . - /// - public StateInference(StateInference.Failed value) - { - Status = "FAILED"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("status")] - public string Status { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "QUEUED" - /// - public bool IsQueued => Status == "QUEUED"; - - /// - /// Returns true if is "IN_PROGRESS" - /// - public bool IsInProgress => Status == "IN_PROGRESS"; - - /// - /// Returns true if is "COMPLETED" - /// - public bool IsCompleted => Status == "COMPLETED"; - - /// - /// Returns true if is "FAILED" - /// - public bool IsFailed => Status == "FAILED"; - - /// - /// Returns the value as a if is 'QUEUED', otherwise throws an exception. - /// - /// Thrown when is not 'QUEUED'. - public Hume.ExpressionMeasurement.Batch.QueuedState AsQueued() => - IsQueued - ? (Hume.ExpressionMeasurement.Batch.QueuedState)Value! - : throw new global::System.Exception("StateInference.Status is not 'QUEUED'"); - - /// - /// Returns the value as a if is 'IN_PROGRESS', otherwise throws an exception. - /// - /// Thrown when is not 'IN_PROGRESS'. - public Hume.ExpressionMeasurement.Batch.InProgressState AsInProgress() => - IsInProgress - ? (Hume.ExpressionMeasurement.Batch.InProgressState)Value! - : throw new global::System.Exception("StateInference.Status is not 'IN_PROGRESS'"); - - /// - /// Returns the value as a if is 'COMPLETED', otherwise throws an exception. - /// - /// Thrown when is not 'COMPLETED'. - public Hume.ExpressionMeasurement.Batch.CompletedState AsCompleted() => - IsCompleted - ? (Hume.ExpressionMeasurement.Batch.CompletedState)Value! - : throw new global::System.Exception("StateInference.Status is not 'COMPLETED'"); - - /// - /// Returns the value as a if is 'FAILED', otherwise throws an exception. - /// - /// Thrown when is not 'FAILED'. - public Hume.ExpressionMeasurement.Batch.FailedState AsFailed() => - IsFailed - ? (Hume.ExpressionMeasurement.Batch.FailedState)Value! - : throw new global::System.Exception("StateInference.Status is not 'FAILED'"); - - public T Match( - Func onQueued, - Func onInProgress, - Func onCompleted, - Func onFailed, - Func onUnknown_ - ) - { - return Status switch - { - "QUEUED" => onQueued(AsQueued()), - "IN_PROGRESS" => onInProgress(AsInProgress()), - "COMPLETED" => onCompleted(AsCompleted()), - "FAILED" => onFailed(AsFailed()), - _ => onUnknown_(Status, Value), - }; - } - - public void Visit( - Action onQueued, - Action onInProgress, - Action onCompleted, - Action onFailed, - Action onUnknown_ - ) - { - switch (Status) - { - case "QUEUED": - onQueued(AsQueued()); - break; - case "IN_PROGRESS": - onInProgress(AsInProgress()); - break; - case "COMPLETED": - onCompleted(AsCompleted()); - break; - case "FAILED": - onFailed(AsFailed()); - break; - default: - onUnknown_(Status, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsQueued(out Hume.ExpressionMeasurement.Batch.QueuedState? value) - { - if (Status == "QUEUED") - { - value = (Hume.ExpressionMeasurement.Batch.QueuedState)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsInProgress(out Hume.ExpressionMeasurement.Batch.InProgressState? value) - { - if (Status == "IN_PROGRESS") - { - value = (Hume.ExpressionMeasurement.Batch.InProgressState)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsCompleted(out Hume.ExpressionMeasurement.Batch.CompletedState? value) - { - if (Status == "COMPLETED") - { - value = (Hume.ExpressionMeasurement.Batch.CompletedState)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsFailed(out Hume.ExpressionMeasurement.Batch.FailedState? value) - { - if (Status == "FAILED") - { - value = (Hume.ExpressionMeasurement.Batch.FailedState)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator StateInference(StateInference.Queued value) => new(value); - - public static implicit operator StateInference(StateInference.InProgress value) => new(value); - - public static implicit operator StateInference(StateInference.Completed value) => new(value); - - public static implicit operator StateInference(StateInference.Failed value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(StateInference).IsAssignableFrom(typeToConvert); - - public override StateInference Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("status", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'status'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'status' is null"); - } - - throw new JsonException( - $"Discriminator property 'status' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'status' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("status"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "QUEUED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.QueuedState" - ), - "IN_PROGRESS" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.InProgressState" - ), - "COMPLETED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.CompletedState" - ), - "FAILED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.FailedState" - ), - _ => json.Deserialize(options), - }; - return new StateInference(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - StateInference value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Status switch - { - "QUEUED" => JsonSerializer.SerializeToNode(value.Value, options), - "IN_PROGRESS" => JsonSerializer.SerializeToNode(value.Value, options), - "COMPLETED" => JsonSerializer.SerializeToNode(value.Value, options), - "FAILED" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["status"] = value.Status; - json.WriteTo(writer, options); - } - - public override StateInference ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new StateInference(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - StateInference value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Status); - } - } - - /// - /// Discriminated union type for QUEUED - /// - [Serializable] - public struct Queued - { - public Queued(Hume.ExpressionMeasurement.Batch.QueuedState value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.QueuedState Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateInference.Queued( - Hume.ExpressionMeasurement.Batch.QueuedState value - ) => new(value); - } - - /// - /// Discriminated union type for IN_PROGRESS - /// - [Serializable] - public struct InProgress - { - public InProgress(Hume.ExpressionMeasurement.Batch.InProgressState value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.InProgressState Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateInference.InProgress( - Hume.ExpressionMeasurement.Batch.InProgressState value - ) => new(value); - } - - /// - /// Discriminated union type for COMPLETED - /// - [Serializable] - public struct Completed - { - public Completed(Hume.ExpressionMeasurement.Batch.CompletedState value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.CompletedState Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateInference.Completed( - Hume.ExpressionMeasurement.Batch.CompletedState value - ) => new(value); - } - - /// - /// Discriminated union type for FAILED - /// - [Serializable] - public struct Failed - { - public Failed(Hume.ExpressionMeasurement.Batch.FailedState value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.FailedState Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateInference.Failed( - Hume.ExpressionMeasurement.Batch.FailedState value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInference.cs deleted file mode 100644 index 0015bca..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInference.cs +++ /dev/null @@ -1,438 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(StateTlInference.JsonConverter))] -[Serializable] -public record StateTlInference -{ - internal StateTlInference(string type, object? value) - { - Status = type; - Value = value; - } - - /// - /// Create an instance of StateTlInference with . - /// - public StateTlInference(StateTlInference.Queued value) - { - Status = "QUEUED"; - Value = value.Value; - } - - /// - /// Create an instance of StateTlInference with . - /// - public StateTlInference(StateTlInference.InProgress value) - { - Status = "IN_PROGRESS"; - Value = value.Value; - } - - /// - /// Create an instance of StateTlInference with . - /// - public StateTlInference(StateTlInference.Completed value) - { - Status = "COMPLETED"; - Value = value.Value; - } - - /// - /// Create an instance of StateTlInference with . - /// - public StateTlInference(StateTlInference.Failed value) - { - Status = "FAILED"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("status")] - public string Status { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "QUEUED" - /// - public bool IsQueued => Status == "QUEUED"; - - /// - /// Returns true if is "IN_PROGRESS" - /// - public bool IsInProgress => Status == "IN_PROGRESS"; - - /// - /// Returns true if is "COMPLETED" - /// - public bool IsCompleted => Status == "COMPLETED"; - - /// - /// Returns true if is "FAILED" - /// - public bool IsFailed => Status == "FAILED"; - - /// - /// Returns the value as a if is 'QUEUED', otherwise throws an exception. - /// - /// Thrown when is not 'QUEUED'. - public Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued AsQueued() => - IsQueued - ? (Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued)Value! - : throw new global::System.Exception("StateTlInference.Status is not 'QUEUED'"); - - /// - /// Returns the value as a if is 'IN_PROGRESS', otherwise throws an exception. - /// - /// Thrown when is not 'IN_PROGRESS'. - public Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress AsInProgress() => - IsInProgress - ? (Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress)Value! - : throw new global::System.Exception("StateTlInference.Status is not 'IN_PROGRESS'"); - - /// - /// Returns the value as a if is 'COMPLETED', otherwise throws an exception. - /// - /// Thrown when is not 'COMPLETED'. - public Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference AsCompleted() => - IsCompleted - ? (Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference)Value! - : throw new global::System.Exception("StateTlInference.Status is not 'COMPLETED'"); - - /// - /// Returns the value as a if is 'FAILED', otherwise throws an exception. - /// - /// Thrown when is not 'FAILED'. - public Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed AsFailed() => - IsFailed - ? (Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed)Value! - : throw new global::System.Exception("StateTlInference.Status is not 'FAILED'"); - - public T Match( - Func onQueued, - Func onInProgress, - Func onCompleted, - Func onFailed, - Func onUnknown_ - ) - { - return Status switch - { - "QUEUED" => onQueued(AsQueued()), - "IN_PROGRESS" => onInProgress(AsInProgress()), - "COMPLETED" => onCompleted(AsCompleted()), - "FAILED" => onFailed(AsFailed()), - _ => onUnknown_(Status, Value), - }; - } - - public void Visit( - Action onQueued, - Action onInProgress, - Action onCompleted, - Action onFailed, - Action onUnknown_ - ) - { - switch (Status) - { - case "QUEUED": - onQueued(AsQueued()); - break; - case "IN_PROGRESS": - onInProgress(AsInProgress()); - break; - case "COMPLETED": - onCompleted(AsCompleted()); - break; - case "FAILED": - onFailed(AsFailed()); - break; - default: - onUnknown_(Status, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsQueued(out Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued? value) - { - if (Status == "QUEUED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsInProgress( - out Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress? value - ) - { - if (Status == "IN_PROGRESS") - { - value = (Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsCompleted( - out Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference? value - ) - { - if (Status == "COMPLETED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsFailed(out Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed? value) - { - if (Status == "FAILED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator StateTlInference(StateTlInference.Queued value) => new(value); - - public static implicit operator StateTlInference(StateTlInference.InProgress value) => - new(value); - - public static implicit operator StateTlInference(StateTlInference.Completed value) => - new(value); - - public static implicit operator StateTlInference(StateTlInference.Failed value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(StateTlInference).IsAssignableFrom(typeToConvert); - - public override StateTlInference Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("status", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'status'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'status' is null"); - } - - throw new JsonException( - $"Discriminator property 'status' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'status' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("status"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "QUEUED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued" - ), - "IN_PROGRESS" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress" - ), - "COMPLETED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference" - ), - "FAILED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed" - ), - _ => json.Deserialize(options), - }; - return new StateTlInference(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - StateTlInference value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Status switch - { - "QUEUED" => JsonSerializer.SerializeToNode(value.Value, options), - "IN_PROGRESS" => JsonSerializer.SerializeToNode(value.Value, options), - "COMPLETED" => JsonSerializer.SerializeToNode(value.Value, options), - "FAILED" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["status"] = value.Status; - json.WriteTo(writer, options); - } - - public override StateTlInference ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new StateTlInference(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - StateTlInference value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Status); - } - } - - /// - /// Discriminated union type for QUEUED - /// - [Serializable] - public struct Queued - { - public Queued(Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTlInference.Queued( - Hume.ExpressionMeasurement.Batch.StateTlInferenceQueued value - ) => new(value); - } - - /// - /// Discriminated union type for IN_PROGRESS - /// - [Serializable] - public struct InProgress - { - public InProgress(Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTlInference.InProgress( - Hume.ExpressionMeasurement.Batch.StateTlInferenceInProgress value - ) => new(value); - } - - /// - /// Discriminated union type for COMPLETED - /// - [Serializable] - public struct Completed - { - public Completed( - Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference value - ) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTlInference.Completed( - Hume.ExpressionMeasurement.Batch.StateTlInferenceCompletedTlInference value - ) => new(value); - } - - /// - /// Discriminated union type for FAILED - /// - [Serializable] - public struct Failed - { - public Failed(Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTlInference.Failed( - Hume.ExpressionMeasurement.Batch.StateTlInferenceFailed value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceCompletedTlInference.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceCompletedTlInference.cs deleted file mode 100644 index 74ecb10..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceCompletedTlInference.cs +++ /dev/null @@ -1,56 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTlInferenceCompletedTlInference : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// The number of predictions that were generated by this job. - /// - [JsonPropertyName("num_predictions")] - public required ulong NumPredictions { get; set; } - - /// - /// The number of errors that occurred while running this job. - /// - [JsonPropertyName("num_errors")] - public required ulong NumErrors { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceFailed.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceFailed.cs deleted file mode 100644 index 689a2fd..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceFailed.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTlInferenceFailed : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceInProgress.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceInProgress.cs deleted file mode 100644 index 67a0e0c..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceInProgress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTlInferenceInProgress : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceQueued.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceQueued.cs deleted file mode 100644 index 66975ee..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTlInferenceQueued.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTlInferenceQueued : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTraining.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTraining.cs deleted file mode 100644 index 6590792..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTraining.cs +++ /dev/null @@ -1,432 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(StateTraining.JsonConverter))] -[Serializable] -public record StateTraining -{ - internal StateTraining(string type, object? value) - { - Status = type; - Value = value; - } - - /// - /// Create an instance of StateTraining with . - /// - public StateTraining(StateTraining.Queued value) - { - Status = "QUEUED"; - Value = value.Value; - } - - /// - /// Create an instance of StateTraining with . - /// - public StateTraining(StateTraining.InProgress value) - { - Status = "IN_PROGRESS"; - Value = value.Value; - } - - /// - /// Create an instance of StateTraining with . - /// - public StateTraining(StateTraining.Completed value) - { - Status = "COMPLETED"; - Value = value.Value; - } - - /// - /// Create an instance of StateTraining with . - /// - public StateTraining(StateTraining.Failed value) - { - Status = "FAILED"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("status")] - public string Status { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "QUEUED" - /// - public bool IsQueued => Status == "QUEUED"; - - /// - /// Returns true if is "IN_PROGRESS" - /// - public bool IsInProgress => Status == "IN_PROGRESS"; - - /// - /// Returns true if is "COMPLETED" - /// - public bool IsCompleted => Status == "COMPLETED"; - - /// - /// Returns true if is "FAILED" - /// - public bool IsFailed => Status == "FAILED"; - - /// - /// Returns the value as a if is 'QUEUED', otherwise throws an exception. - /// - /// Thrown when is not 'QUEUED'. - public Hume.ExpressionMeasurement.Batch.StateTrainingQueued AsQueued() => - IsQueued - ? (Hume.ExpressionMeasurement.Batch.StateTrainingQueued)Value! - : throw new global::System.Exception("StateTraining.Status is not 'QUEUED'"); - - /// - /// Returns the value as a if is 'IN_PROGRESS', otherwise throws an exception. - /// - /// Thrown when is not 'IN_PROGRESS'. - public Hume.ExpressionMeasurement.Batch.StateTrainingInProgress AsInProgress() => - IsInProgress - ? (Hume.ExpressionMeasurement.Batch.StateTrainingInProgress)Value! - : throw new global::System.Exception("StateTraining.Status is not 'IN_PROGRESS'"); - - /// - /// Returns the value as a if is 'COMPLETED', otherwise throws an exception. - /// - /// Thrown when is not 'COMPLETED'. - public Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining AsCompleted() => - IsCompleted - ? (Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining)Value! - : throw new global::System.Exception("StateTraining.Status is not 'COMPLETED'"); - - /// - /// Returns the value as a if is 'FAILED', otherwise throws an exception. - /// - /// Thrown when is not 'FAILED'. - public Hume.ExpressionMeasurement.Batch.StateTrainingFailed AsFailed() => - IsFailed - ? (Hume.ExpressionMeasurement.Batch.StateTrainingFailed)Value! - : throw new global::System.Exception("StateTraining.Status is not 'FAILED'"); - - public T Match( - Func onQueued, - Func onInProgress, - Func onCompleted, - Func onFailed, - Func onUnknown_ - ) - { - return Status switch - { - "QUEUED" => onQueued(AsQueued()), - "IN_PROGRESS" => onInProgress(AsInProgress()), - "COMPLETED" => onCompleted(AsCompleted()), - "FAILED" => onFailed(AsFailed()), - _ => onUnknown_(Status, Value), - }; - } - - public void Visit( - Action onQueued, - Action onInProgress, - Action onCompleted, - Action onFailed, - Action onUnknown_ - ) - { - switch (Status) - { - case "QUEUED": - onQueued(AsQueued()); - break; - case "IN_PROGRESS": - onInProgress(AsInProgress()); - break; - case "COMPLETED": - onCompleted(AsCompleted()); - break; - case "FAILED": - onFailed(AsFailed()); - break; - default: - onUnknown_(Status, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsQueued(out Hume.ExpressionMeasurement.Batch.StateTrainingQueued? value) - { - if (Status == "QUEUED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTrainingQueued)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsInProgress(out Hume.ExpressionMeasurement.Batch.StateTrainingInProgress? value) - { - if (Status == "IN_PROGRESS") - { - value = (Hume.ExpressionMeasurement.Batch.StateTrainingInProgress)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsCompleted( - out Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining? value - ) - { - if (Status == "COMPLETED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsFailed(out Hume.ExpressionMeasurement.Batch.StateTrainingFailed? value) - { - if (Status == "FAILED") - { - value = (Hume.ExpressionMeasurement.Batch.StateTrainingFailed)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator StateTraining(StateTraining.Queued value) => new(value); - - public static implicit operator StateTraining(StateTraining.InProgress value) => new(value); - - public static implicit operator StateTraining(StateTraining.Completed value) => new(value); - - public static implicit operator StateTraining(StateTraining.Failed value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(StateTraining).IsAssignableFrom(typeToConvert); - - public override StateTraining Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("status", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'status'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'status' is null"); - } - - throw new JsonException( - $"Discriminator property 'status' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'status' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("status"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "QUEUED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTrainingQueued" - ), - "IN_PROGRESS" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTrainingInProgress" - ), - "COMPLETED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining" - ), - "FAILED" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.StateTrainingFailed" - ), - _ => json.Deserialize(options), - }; - return new StateTraining(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - StateTraining value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Status switch - { - "QUEUED" => JsonSerializer.SerializeToNode(value.Value, options), - "IN_PROGRESS" => JsonSerializer.SerializeToNode(value.Value, options), - "COMPLETED" => JsonSerializer.SerializeToNode(value.Value, options), - "FAILED" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["status"] = value.Status; - json.WriteTo(writer, options); - } - - public override StateTraining ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new StateTraining(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - StateTraining value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Status); - } - } - - /// - /// Discriminated union type for QUEUED - /// - [Serializable] - public struct Queued - { - public Queued(Hume.ExpressionMeasurement.Batch.StateTrainingQueued value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTrainingQueued Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTraining.Queued( - Hume.ExpressionMeasurement.Batch.StateTrainingQueued value - ) => new(value); - } - - /// - /// Discriminated union type for IN_PROGRESS - /// - [Serializable] - public struct InProgress - { - public InProgress(Hume.ExpressionMeasurement.Batch.StateTrainingInProgress value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTrainingInProgress Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTraining.InProgress( - Hume.ExpressionMeasurement.Batch.StateTrainingInProgress value - ) => new(value); - } - - /// - /// Discriminated union type for COMPLETED - /// - [Serializable] - public struct Completed - { - public Completed(Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTraining.Completed( - Hume.ExpressionMeasurement.Batch.StateTrainingCompletedTraining value - ) => new(value); - } - - /// - /// Discriminated union type for FAILED - /// - [Serializable] - public struct Failed - { - public Failed(Hume.ExpressionMeasurement.Batch.StateTrainingFailed value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.StateTrainingFailed Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator StateTraining.Failed( - Hume.ExpressionMeasurement.Batch.StateTrainingFailed value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingCompletedTraining.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingCompletedTraining.cs deleted file mode 100644 index cbd9ca9..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingCompletedTraining.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTrainingCompletedTraining : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - [JsonPropertyName("custom_model")] - public required TrainingCustomModel CustomModel { get; set; } - - [JsonPropertyName("alternatives")] - public Dictionary? Alternatives { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingFailed.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingFailed.cs deleted file mode 100644 index 7d96430..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingFailed.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTrainingFailed : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - /// - /// When this job ended (Unix timestamp in milliseconds). - /// - [JsonPropertyName("ended_timestamp_ms")] - public required long EndedTimestampMs { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("message")] - public required string Message { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingInProgress.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingInProgress.cs deleted file mode 100644 index 3735946..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingInProgress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTrainingInProgress : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - /// - /// When this job started (Unix timestamp in milliseconds). - /// - [JsonPropertyName("started_timestamp_ms")] - public required long StartedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingQueued.cs b/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingQueued.cs deleted file mode 100644 index 1d97d6e..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/StateTrainingQueued.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record StateTrainingQueued : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// When this job was created (Unix timestamp in milliseconds). - /// - [JsonPropertyName("created_timestamp_ms")] - public required long CreatedTimestampMs { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Status.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Status.cs deleted file mode 100644 index 3cf24ca..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Status.cs +++ /dev/null @@ -1,121 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Status.StatusSerializer))] -[Serializable] -public readonly record struct Status : IStringEnum -{ - public static readonly Status Queued = new(Values.Queued); - - public static readonly Status InProgress = new(Values.InProgress); - - public static readonly Status Completed = new(Values.Completed); - - public static readonly Status Failed = new(Values.Failed); - - public Status(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static Status FromCustom(string value) - { - return new Status(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(Status value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(Status value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(Status value) => value.Value; - - public static explicit operator Status(string value) => new(value); - - internal class StatusSerializer : JsonConverter - { - public override Status Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new Status(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - Status value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override Status ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new Status(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Status value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Queued = "QUEUED"; - - public const string InProgress = "IN_PROGRESS"; - - public const string Completed = "COMPLETED"; - - public const string Failed = "FAILED"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Tag.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Tag.cs deleted file mode 100644 index 3d8d9d1..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Tag.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record Tag : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("key")] - public required string Key { get; set; } - - [JsonPropertyName("value")] - public required string Value { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Task.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Task.cs deleted file mode 100644 index 4d6434f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Task.cs +++ /dev/null @@ -1,280 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Task.JsonConverter))] -[Serializable] -public record Task -{ - internal Task(string type, object? value) - { - Type = type; - Value = value; - } - - /// - /// Create an instance of Task with . - /// - public Task(Task.Classification value) - { - Type = "classification"; - Value = value.Value; - } - - /// - /// Create an instance of Task with . - /// - public Task(Task.Regression value) - { - Type = "regression"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("type")] - public string Type { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "classification" - /// - public bool IsClassification => Type == "classification"; - - /// - /// Returns true if is "regression" - /// - public bool IsRegression => Type == "regression"; - - /// - /// Returns the value as a if is 'classification', otherwise throws an exception. - /// - /// Thrown when is not 'classification'. - public Hume.ExpressionMeasurement.Batch.TaskClassification AsClassification() => - IsClassification - ? (Hume.ExpressionMeasurement.Batch.TaskClassification)Value! - : throw new global::System.Exception("Task.Type is not 'classification'"); - - /// - /// Returns the value as a if is 'regression', otherwise throws an exception. - /// - /// Thrown when is not 'regression'. - public Hume.ExpressionMeasurement.Batch.TaskRegression AsRegression() => - IsRegression - ? (Hume.ExpressionMeasurement.Batch.TaskRegression)Value! - : throw new global::System.Exception("Task.Type is not 'regression'"); - - public T Match( - Func onClassification, - Func onRegression, - Func onUnknown_ - ) - { - return Type switch - { - "classification" => onClassification(AsClassification()), - "regression" => onRegression(AsRegression()), - _ => onUnknown_(Type, Value), - }; - } - - public void Visit( - Action onClassification, - Action onRegression, - Action onUnknown_ - ) - { - switch (Type) - { - case "classification": - onClassification(AsClassification()); - break; - case "regression": - onRegression(AsRegression()); - break; - default: - onUnknown_(Type, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsClassification(out Hume.ExpressionMeasurement.Batch.TaskClassification? value) - { - if (Type == "classification") - { - value = (Hume.ExpressionMeasurement.Batch.TaskClassification)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsRegression(out Hume.ExpressionMeasurement.Batch.TaskRegression? value) - { - if (Type == "regression") - { - value = (Hume.ExpressionMeasurement.Batch.TaskRegression)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator Task(Task.Classification value) => new(value); - - public static implicit operator Task(Task.Regression value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(Task).IsAssignableFrom(typeToConvert); - - public override Task Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("type", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'type'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'type' is null"); - } - - throw new JsonException( - $"Discriminator property 'type' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'type' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("type"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "classification" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.TaskClassification" - ), - "regression" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Hume.ExpressionMeasurement.Batch.TaskRegression" - ), - _ => json.Deserialize(options), - }; - return new Task(discriminator, value); - } - - public override void Write(Utf8JsonWriter writer, Task value, JsonSerializerOptions options) - { - JsonNode json = - value.Type switch - { - "classification" => JsonSerializer.SerializeToNode(value.Value, options), - "regression" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["type"] = value.Type; - json.WriteTo(writer, options); - } - - public override Task ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new Task(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Task value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Type); - } - } - - /// - /// Discriminated union type for classification - /// - [Serializable] - public struct Classification - { - public Classification(Hume.ExpressionMeasurement.Batch.TaskClassification value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.TaskClassification Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator Task.Classification( - Hume.ExpressionMeasurement.Batch.TaskClassification value - ) => new(value); - } - - /// - /// Discriminated union type for regression - /// - [Serializable] - public struct Regression - { - public Regression(Hume.ExpressionMeasurement.Batch.TaskRegression value) - { - Value = value; - } - - internal Hume.ExpressionMeasurement.Batch.TaskRegression Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator Task.Regression( - Hume.ExpressionMeasurement.Batch.TaskRegression value - ) => new(value); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TaskClassification.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TaskClassification.cs deleted file mode 100644 index 2171466..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TaskClassification.cs +++ /dev/null @@ -1,26 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TaskClassification : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TaskRegression.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TaskRegression.cs deleted file mode 100644 index ba28356..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TaskRegression.cs +++ /dev/null @@ -1,26 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TaskRegression : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TimeInterval.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TimeInterval.cs deleted file mode 100644 index 9a36df9..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TimeInterval.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// A time range with a beginning and end, measured in seconds. -/// -[Serializable] -public record TimeInterval : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Beginning of time range in seconds. - /// - [JsonPropertyName("begin")] - public required double Begin { get; set; } - - /// - /// End of time range in seconds. - /// - [JsonPropertyName("end")] - public required double End { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceBaseRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceBaseRequest.cs deleted file mode 100644 index a036e4d..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceBaseRequest.cs +++ /dev/null @@ -1,50 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; -using OneOf; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TlInferenceBaseRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("custom_model")] - public required OneOf CustomModel { get; set; } - - /// - /// URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`) of media files. - /// - /// If you wish to supply more than 100 URLs, consider providing them as an archive (`.zip`, `.tar.gz`, `.tar.bz2`, `.tar.xz`). - /// - [JsonPropertyName("urls")] - public IEnumerable? Urls { get; set; } - - /// - /// If provided, a `POST` request will be made to the URL with the generated predictions on completion or the error message on failure. - /// - [JsonPropertyName("callback_url")] - public string? CallbackUrl { get; set; } - - /// - /// Whether to send an email notification to the user upon job completion/failure. - /// - [JsonPropertyName("notify")] - public bool? Notify { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferencePrediction.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TlInferencePrediction.cs deleted file mode 100644 index 2faa9eb..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferencePrediction.cs +++ /dev/null @@ -1,39 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TlInferencePrediction : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A file path relative to the top level source URL or file. - /// - [JsonPropertyName("file")] - public required string File { get; set; } - - [JsonPropertyName("file_type")] - public required string FileType { get; set; } - - [JsonPropertyName("custom_models")] - public Dictionary CustomModels { get; set; } = - new Dictionary(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceResults.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceResults.cs deleted file mode 100644 index 10b2248..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceResults.cs +++ /dev/null @@ -1,33 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TlInferenceResults : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable Predictions { get; set; } = - new List(); - - [JsonPropertyName("errors")] - public IEnumerable Errors { get; set; } = new List(); - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceSourcePredictResult.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceSourcePredictResult.cs deleted file mode 100644 index 6ad270f..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TlInferenceSourcePredictResult.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TlInferenceSourcePredictResult : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("source")] - public required Source Source { get; set; } - - [JsonPropertyName("results")] - public TlInferenceResults? Results { get; set; } - - /// - /// An error message. - /// - [JsonPropertyName("error")] - public string? Error { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/ToxicityScore.cs b/src/Hume/ExpressionMeasurement/Batch/Types/ToxicityScore.cs deleted file mode 100644 index 88a5400..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/ToxicityScore.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record ToxicityScore : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Category of toxicity. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// Prediction for this category of toxicity - /// - [JsonPropertyName("score")] - public required float Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TrainingBaseRequest.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TrainingBaseRequest.cs deleted file mode 100644 index 481f903..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TrainingBaseRequest.cs +++ /dev/null @@ -1,51 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; -using OneOf; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TrainingBaseRequest : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("custom_model")] - public required CustomModelRequest CustomModel { get; set; } - - [JsonPropertyName("dataset")] - public required OneOf Dataset { get; set; } - - [JsonPropertyName("target_feature")] - public string? TargetFeature { get; set; } - - [JsonPropertyName("task")] - public Task? Task { get; set; } - - [JsonPropertyName("evaluation")] - public EvaluationArgs? Evaluation { get; set; } - - [JsonPropertyName("alternatives")] - public IEnumerable? Alternatives { get; set; } - - [JsonPropertyName("callback_url")] - public string? CallbackUrl { get; set; } - - [JsonPropertyName("notify")] - public bool? Notify { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TrainingCustomModel.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TrainingCustomModel.cs deleted file mode 100644 index 1de7aad..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TrainingCustomModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record TrainingCustomModel : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("id")] - public required string Id { get; set; } - - [JsonPropertyName("version_id")] - public string? VersionId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Transcription.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Transcription.cs deleted file mode 100644 index 0f3b613..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Transcription.cs +++ /dev/null @@ -1,80 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// Transcription-related configuration options. -/// -/// To disable transcription, explicitly set this field to `null`. -/// -[Serializable] -public record Transcription : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// By default, we use an automated language detection method for our Speech Prosody, Language, and NER models. However, if you know what language is being spoken in your media samples, you can specify it via its BCP-47 tag and potentially obtain more accurate results. - /// - /// You can specify any of the following languages: - /// - Chinese: `zh` - /// - Danish: `da` - /// - Dutch: `nl` - /// - English: `en` - /// - English (Australia): `en-AU` - /// - English (India): `en-IN` - /// - English (New Zealand): `en-NZ` - /// - English (United Kingdom): `en-GB` - /// - French: `fr` - /// - French (Canada): `fr-CA` - /// - German: `de` - /// - Hindi: `hi` - /// - Hindi (Roman Script): `hi-Latn` - /// - Indonesian: `id` - /// - Italian: `it` - /// - Japanese: `ja` - /// - Korean: `ko` - /// - Norwegian: `no` - /// - Polish: `pl` - /// - Portuguese: `pt` - /// - Portuguese (Brazil): `pt-BR` - /// - Portuguese (Portugal): `pt-PT` - /// - Russian: `ru` - /// - Spanish: `es` - /// - Spanish (Latin America): `es-419` - /// - Swedish: `sv` - /// - Tamil: `ta` - /// - Turkish: `tr` - /// - Ukrainian: `uk` - /// - [JsonPropertyName("language")] - public Bcp47Tag? Language { get; set; } - - /// - /// Whether to return identifiers for speakers over time. If `true`, unique identifiers will be assigned to spoken words to differentiate different speakers. If `false`, all speakers will be tagged with an `unknown` ID. - /// - [JsonPropertyName("identify_speakers")] - public bool? IdentifySpeakers { get; set; } - - /// - /// Transcript confidence threshold. Transcripts generated with a confidence less than this threshold will be considered invalid and not used as an input for model inference. - /// - [JsonPropertyName("confidence_threshold")] - public double? ConfidenceThreshold { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/TranscriptionMetadata.cs b/src/Hume/ExpressionMeasurement/Batch/Types/TranscriptionMetadata.cs deleted file mode 100644 index dc8a436..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/TranscriptionMetadata.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// Transcription metadata for your media file. -/// -[Serializable] -public record TranscriptionMetadata : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Value between `0.0` and `1.0` indicating our transcription model's relative confidence in the transcription of your media file. - /// - [JsonPropertyName("confidence")] - public required double Confidence { get; set; } - - [JsonPropertyName("detected_language")] - public Bcp47Tag? DetectedLanguage { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Type.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Type.cs deleted file mode 100644 index 01afded..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Type.cs +++ /dev/null @@ -1,117 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(Type.TypeSerializer))] -[Serializable] -public readonly record struct Type : IStringEnum -{ - public static readonly Type EmbeddingGeneration = new(Values.EmbeddingGeneration); - - public static readonly Type Inference = new(Values.Inference); - - public static readonly Type TlInference = new(Values.TlInference); - - public static readonly Type Training = new(Values.Training); - - public Type(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static Type FromCustom(string value) - { - return new Type(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(Type value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(Type value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(Type value) => value.Value; - - public static explicit operator Type(string value) => new(value); - - internal class TypeSerializer : JsonConverter - { - public override Type Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new Type(stringValue); - } - - public override void Write(Utf8JsonWriter writer, Type value, JsonSerializerOptions options) - { - writer.WriteStringValue(value.Value); - } - - public override Type ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new Type(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - Type value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string EmbeddingGeneration = "EMBEDDING_GENERATION"; - - public const string Inference = "INFERENCE"; - - public const string TlInference = "TL_INFERENCE"; - - public const string Training = "TRAINING"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Url.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Url.cs deleted file mode 100644 index ffe4afe..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Url.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record Url : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The URL of the source media file. - /// - [JsonPropertyName("url")] - public required string Url_ { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/ValidationArgs.cs b/src/Hume/ExpressionMeasurement/Batch/Types/ValidationArgs.cs deleted file mode 100644 index de67754..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/ValidationArgs.cs +++ /dev/null @@ -1,30 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; -using OneOf; - -namespace Hume.ExpressionMeasurement.Batch; - -[Serializable] -public record ValidationArgs : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("positive_label")] - public OneOf? PositiveLabel { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/When.cs b/src/Hume/ExpressionMeasurement/Batch/Types/When.cs deleted file mode 100644 index 84226b3..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/When.cs +++ /dev/null @@ -1,109 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -[JsonConverter(typeof(When.WhenSerializer))] -[Serializable] -public readonly record struct When : IStringEnum -{ - public static readonly When CreatedBefore = new(Values.CreatedBefore); - - public static readonly When CreatedAfter = new(Values.CreatedAfter); - - public When(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static When FromCustom(string value) - { - return new When(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==(When value1, string value2) => value1.Value.Equals(value2); - - public static bool operator !=(When value1, string value2) => !value1.Value.Equals(value2); - - public static explicit operator string(When value) => value.Value; - - public static explicit operator When(string value) => new(value); - - internal class WhenSerializer : JsonConverter - { - public override When Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new When(stringValue); - } - - public override void Write(Utf8JsonWriter writer, When value, JsonSerializerOptions options) - { - writer.WriteStringValue(value.Value); - } - - public override When ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new When(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - When value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string CreatedBefore = "created_before"; - - public const string CreatedAfter = "created_after"; - } -} diff --git a/src/Hume/ExpressionMeasurement/Batch/Types/Window.cs b/src/Hume/ExpressionMeasurement/Batch/Types/Window.cs deleted file mode 100644 index 065a167..0000000 --- a/src/Hume/ExpressionMeasurement/Batch/Types/Window.cs +++ /dev/null @@ -1,43 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Batch; - -/// -/// Generate predictions based on time. -/// -/// Setting the `window` field allows for a 'sliding window' approach, where a fixed-size window moves across the audio or video file in defined steps. This enables continuous analysis of prosody within subsets of the file, providing dynamic and localized insights into emotional expression. -/// -[Serializable] -public record Window : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The length of the sliding window. - /// - [JsonPropertyName("length")] - public double? Length { get; set; } - - /// - /// The step size of the sliding window. - /// - [JsonPropertyName("step")] - public double? Step { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/ExpressionMeasurementClient.cs b/src/Hume/ExpressionMeasurement/ExpressionMeasurementClient.cs deleted file mode 100644 index 333af40..0000000 --- a/src/Hume/ExpressionMeasurement/ExpressionMeasurementClient.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Hume.Core; -using Hume.ExpressionMeasurement.Batch; -using Hume.ExpressionMeasurement.Stream; - -namespace Hume.ExpressionMeasurement; - -public partial class ExpressionMeasurementClient : IExpressionMeasurementClient -{ - private readonly RawClient _client; - - internal ExpressionMeasurementClient(RawClient client) - { - _client = client; - Batch = new BatchClient(_client); - Stream = new StreamClient(_client); - } - - public IBatchClient Batch { get; } - - public IStreamClient Stream { get; } -} diff --git a/src/Hume/ExpressionMeasurement/IExpressionMeasurementClient.cs b/src/Hume/ExpressionMeasurement/IExpressionMeasurementClient.cs deleted file mode 100644 index 46605f8..0000000 --- a/src/Hume/ExpressionMeasurement/IExpressionMeasurementClient.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Hume.ExpressionMeasurement.Batch; -using Hume.ExpressionMeasurement.Stream; - -namespace Hume.ExpressionMeasurement; - -public partial interface IExpressionMeasurementClient -{ - public IBatchClient Batch { get; } - public IStreamClient Stream { get; } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/IStreamClient.cs b/src/Hume/ExpressionMeasurement/Stream/IStreamClient.cs deleted file mode 100644 index 33b36c9..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/IStreamClient.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Hume.ExpressionMeasurement.Stream; - -public partial interface IStreamClient -{ - IStreamApi CreateStreamApi(); - - IStreamApi CreateStreamApi(StreamApi.Options options); -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/IStreamApi.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/IStreamApi.cs deleted file mode 100644 index 88019b4..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/IStreamApi.cs +++ /dev/null @@ -1,25 +0,0 @@ -using global::System.Text.Json; -using Hume.Core.WebSockets; - -namespace Hume.ExpressionMeasurement.Stream; - -public partial interface IStreamApi : IAsyncDisposable, IDisposable -{ - public Event Connected { get; } - public Event Closed { get; } - public Event ExceptionOccurred { get; } - public Event Reconnecting { get; } - public Event StreamModelPredictions { get; } - public Event StreamErrorMessage { get; } - public Event StreamWarningMessage { get; } - public Event UnknownMessage { get; } - public ConnectionStatus Status { get; } - global::System.Threading.Tasks.Task ConnectAsync(CancellationToken cancellationToken = default); - - global::System.Threading.Tasks.Task Send( - StreamModelsEndpointPayload message, - CancellationToken cancellationToken = default - ); - - global::System.Threading.Tasks.Task CloseAsync(CancellationToken cancellationToken = default); -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/StreamApi.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/StreamApi.cs deleted file mode 100644 index 23f5fe5..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/StreamApi.cs +++ /dev/null @@ -1,271 +0,0 @@ -using global::System.ComponentModel; -using global::System.Text.Json; -using Hume.Core; -using Hume.Core.WebSockets; - -namespace Hume.ExpressionMeasurement.Stream; - -public partial class StreamApi : IStreamApi, IAsyncDisposable, IDisposable, INotifyPropertyChanged -{ - private readonly StreamApi.Options _options; - - private readonly WebSocketClient _client; - - /// - /// Event that is raised when a property value changes. - /// - public event PropertyChangedEventHandler PropertyChanged - { - add => _client.PropertyChanged += value; - remove => _client.PropertyChanged -= value; - } - - /// - /// Default constructor - /// - public StreamApi() { } - - /// - /// Constructor with options - /// - public StreamApi(StreamApi.Options options) - { - _options = options; - var uri = new UriBuilder(_options.BaseUrl); - uri.Path = $"{uri.Path.TrimEnd('/')}/models"; - _client = new WebSocketClient(uri.Uri, OnTextMessage); - _client.HttpInvoker = _options.HttpInvoker; - _client.IsReconnectionEnabled = _options.IsReconnectionEnabled; - _client.ReconnectTimeout = _options.ReconnectTimeout; - _client.ErrorReconnectTimeout = _options.ErrorReconnectTimeout; - _client.LostReconnectTimeout = _options.LostReconnectTimeout; - _client.Backoff = _options.ReconnectBackoff; - } - - /// - /// Gets the current connection status of the WebSocket. - /// - public ConnectionStatus Status => _client.Status; - - /// - /// Event that is raised when the WebSocket connection is established. - /// - public Event Connected => _client.Connected; - - /// - /// Event that is raised when the WebSocket connection is closed. - /// - public Event Closed => _client.Closed; - - /// - /// Event that is raised when an exception occurs during WebSocket operations. - /// - public Event ExceptionOccurred => _client.ExceptionOccurred; - - /// - /// Event raised when the WebSocket connection is re-established after a disconnect. - /// - public Event Reconnecting => _client.Reconnecting; - - /// - /// Event handler for StreamModelPredictions. - /// Use StreamModelPredictions.Subscribe(...) to receive messages. - /// - public Event StreamModelPredictions { get; } = new(); - - /// - /// Event handler for StreamErrorMessage. - /// Use StreamErrorMessage.Subscribe(...) to receive messages. - /// - public Event StreamErrorMessage { get; } = new(); - - /// - /// Event handler for StreamWarningMessage. - /// Use StreamWarningMessage.Subscribe(...) to receive messages. - /// - public Event StreamWarningMessage { get; } = new(); - - /// - /// Event handler for unknown/unrecognized message types. - /// Use UnknownMessage.Subscribe(...) to handle messages from newer server versions. - /// - public Event UnknownMessage { get; } = new(); - - /// - /// Disposes of event subscriptions - /// - private void DisposeEvents() - { - StreamModelPredictions.Dispose(); - StreamErrorMessage.Dispose(); - StreamWarningMessage.Dispose(); - UnknownMessage.Dispose(); - } - - /// - /// Dispatches incoming WebSocket messages - /// - private async global::System.Threading.Tasks.Task OnTextMessage(global::System.IO.Stream stream) - { - using var json = await JsonSerializer.DeserializeAsync(stream); - if (json == null) - { - await ExceptionOccurred - .RaiseEvent(new Exception("Invalid message - Not valid JSON")) - .ConfigureAwait(false); - return; - } - - // deserialize the message to find the correct event - { - if (JsonUtils.TryDeserialize(json, out StreamModelPredictions? message)) - { - await StreamModelPredictions.RaiseEvent(message!).ConfigureAwait(false); - return; - } - } - - { - if (JsonUtils.TryDeserialize(json, out StreamErrorMessage? message)) - { - await StreamErrorMessage.RaiseEvent(message!).ConfigureAwait(false); - return; - } - } - - { - if (JsonUtils.TryDeserialize(json, out StreamWarningMessage? message)) - { - await StreamWarningMessage.RaiseEvent(message!).ConfigureAwait(false); - return; - } - } - - await UnknownMessage.RaiseEvent(json.RootElement.Clone()).ConfigureAwait(false); - } - - /// - /// Serializes and sends a JSON message to the server - /// - private async global::System.Threading.Tasks.Task SendJsonAsync( - object message, - CancellationToken cancellationToken = default - ) - { - await _client - .SendInstant(JsonUtils.Serialize(message), cancellationToken) - .ConfigureAwait(false); - } - - /// - /// Injects a fake text message for testing. Dispatches through the normal message handling pipeline. - /// - internal async global::System.Threading.Tasks.Task InjectTestMessage(string rawJson) - { - using var stream = new MemoryStream(global::System.Text.Encoding.UTF8.GetBytes(rawJson)); - await OnTextMessage(stream).ConfigureAwait(false); - } - - /// - /// Asynchronously establishes a WebSocket connection. - /// - public async global::System.Threading.Tasks.Task ConnectAsync( - CancellationToken cancellationToken = default - ) - { -#if NET6_0_OR_GREATER - _client.DeflateOptions = _options.EnableCompression - ? new System.Net.WebSockets.WebSocketDeflateOptions() - : null; -#endif - await _client.ConnectAsync(cancellationToken).ConfigureAwait(false); - } - - /// - /// Asynchronously closes the WebSocket connection. - /// - public async global::System.Threading.Tasks.Task CloseAsync( - CancellationToken cancellationToken = default - ) - { - await _client.CloseAsync(cancellationToken).ConfigureAwait(false); - } - - /// - /// Asynchronously disposes the WebSocket client, closing any active connections and cleaning up resources. - /// - public async ValueTask DisposeAsync() - { - await _client.DisposeAsync(); - DisposeEvents(); - GC.SuppressFinalize(this); - } - - /// - /// Synchronously disposes the WebSocket client, closing any active connections and cleaning up resources. - /// - public void Dispose() - { - _client.Dispose(); - DisposeEvents(); - GC.SuppressFinalize(this); - } - - /// - /// Sends a StreamModelsEndpointPayload message to the server - /// - public async global::System.Threading.Tasks.Task Send( - StreamModelsEndpointPayload message, - CancellationToken cancellationToken = default - ) - { - await SendJsonAsync(message, cancellationToken).ConfigureAwait(false); - } - - /// - /// Options for the API client - /// - public class Options - { - /// - /// The Websocket URL for the API connection. - /// - public string BaseUrl { get; set; } = "wss://api.hume.ai/v0/stream"; - - /// - /// Enable per-message deflate compression (RFC 7692). When true, the client sets ClientWebSocketOptions.DangerousDeflateOptions before connecting. Compression is negotiated during the handshake; if the server does not support it, the connection proceeds uncompressed. Default: false. - /// Security warning: do not enable compression when transmitting data containing secrets — compressed encrypted payloads are vulnerable to CRIME/BREACH side-channel attacks. See ClientWebSocketOptions.DangerousDeflateOptions for details. - /// - public bool EnableCompression { get; set; } = false; - - /// - /// Optional HTTP/2 handler for multiplexed WebSocket connections (.NET 7+). - /// - public System.Net.Http.HttpMessageInvoker? HttpInvoker { get; set; } - - /// - /// Enable or disable automatic reconnection. Default: false. - /// - public bool IsReconnectionEnabled { get; set; } = false; - - /// - /// Time to wait before reconnecting if no message comes from the server. Set null to disable. Default: 1 minute. - /// - public TimeSpan? ReconnectTimeout { get; set; } = TimeSpan.FromMinutes(1); - - /// - /// Time to wait before reconnecting if the last reconnection attempt failed. Set null to disable. Default: 1 minute. - /// - public TimeSpan? ErrorReconnectTimeout { get; set; } = TimeSpan.FromMinutes(1); - - /// - /// Time to wait before reconnecting if the connection is lost with a transient error. Set null to disable (reconnect immediately). Default: null. - /// - public TimeSpan? LostReconnectTimeout { get; set; } - - /// - /// Backoff strategy for reconnection delays. Controls interval growth, jitter, and max attempts. Set to null to use fixed-interval reconnection (legacy behavior). Default: exponential backoff, 1s→60s, unlimited attempts, with jitter. - /// - public ReconnectStrategy? ReconnectBackoff { get; set; } = new ReconnectStrategy(); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/Config.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/Config.cs deleted file mode 100644 index 8b697c0..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/Config.cs +++ /dev/null @@ -1,73 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Configuration used to specify which models should be used and with what settings. -/// -[Serializable] -public record Config : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Configuration for the vocal burst emotion model. - /// - /// Note: Model configuration is not currently available in streaming. - /// - /// Please use the default configuration by passing an empty object `{}`. - /// - [JsonPropertyName("burst")] - public Dictionary? Burst { get; set; } - - /// - /// Configuration for the facial expression emotion model. - /// - /// Note: Using the `reset_stream` parameter does not have any effect on face identification. A single face identifier cache is maintained over a full session whether `reset_stream` is used or not. - /// - [JsonPropertyName("face")] - public StreamFace? Face { get; set; } - - /// - /// Configuration for the facemesh emotion model. - /// - /// Note: Model configuration is not currently available in streaming. - /// - /// Please use the default configuration by passing an empty object `{}`. - /// - [JsonPropertyName("facemesh")] - public Dictionary? Facemesh { get; set; } - - /// - /// Configuration for the language emotion model. - /// - [JsonPropertyName("language")] - public StreamLanguage? Language { get; set; } - - /// - /// Configuration for the speech prosody emotion model. - /// - /// Note: Model configuration is not currently available in streaming. - /// - /// Please use the default configuration by passing an empty object `{}`. - /// - [JsonPropertyName("prosody")] - public Dictionary? Prosody { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/JobDetails.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/JobDetails.cs deleted file mode 100644 index 2a0324e..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/JobDetails.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. -/// -[Serializable] -public record JobDetails : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// ID of the current streaming job. - /// - [JsonPropertyName("job_id")] - public string? JobId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamErrorMessage.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamErrorMessage.cs deleted file mode 100644 index aee4f0a..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamErrorMessage.cs +++ /dev/null @@ -1,53 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Error message -/// -[Serializable] -public record StreamErrorMessage : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Error message text. - /// - [JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Unique identifier for the error. - /// - [JsonPropertyName("code")] - public string? Code { get; set; } - - /// - /// If a payload ID was passed in the request, the same payload ID will be sent back in the response body. - /// - [JsonPropertyName("payload_id")] - public string? PayloadId { get; set; } - - /// - /// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. - /// - [JsonPropertyName("job_details")] - public JobDetails? JobDetails { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamFace.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamFace.cs deleted file mode 100644 index 044099d..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamFace.cs +++ /dev/null @@ -1,67 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Configuration for the facial expression emotion model. -/// -/// Note: Using the `reset_stream` parameter does not have any effect on face identification. A single face identifier cache is maintained over a full session whether `reset_stream` is used or not. -/// -[Serializable] -public record StreamFace : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Configuration for FACS predictions. If missing or null, no FACS predictions will be generated. - /// - [JsonPropertyName("facs")] - public Dictionary? Facs { get; set; } - - /// - /// Configuration for Descriptions predictions. If missing or null, no Descriptions predictions will be generated. - /// - [JsonPropertyName("descriptions")] - public Dictionary? Descriptions { get; set; } - - /// - /// Whether to return identifiers for faces across frames. If true, unique identifiers will be assigned to face bounding boxes to differentiate different faces. If false, all faces will be tagged with an "unknown" ID. - /// - [JsonPropertyName("identify_faces")] - public bool? IdentifyFaces { get; set; } - - /// - /// Number of frames per second to process. Other frames will be omitted from the response. - /// - [JsonPropertyName("fps_pred")] - public double? FpsPred { get; set; } - - /// - /// Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response. - /// - [JsonPropertyName("prob_threshold")] - public double? ProbThreshold { get; set; } - - /// - /// Minimum bounding box side length in pixels to treat as a face. Faces detected with a bounding box side length in pixels less than this threshold will be omitted from the response. - /// - [JsonPropertyName("min_face_size")] - public double? MinFaceSize { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamLanguage.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamLanguage.cs deleted file mode 100644 index 8464bb5..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamLanguage.cs +++ /dev/null @@ -1,47 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Configuration for the language emotion model. -/// -[Serializable] -public record StreamLanguage : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Configuration for sentiment predictions. If missing or null, no sentiment predictions will be generated. - /// - [JsonPropertyName("sentiment")] - public Dictionary? Sentiment { get; set; } - - /// - /// Configuration for toxicity predictions. If missing or null, no toxicity predictions will be generated. - /// - [JsonPropertyName("toxicity")] - public Dictionary? Toxicity { get; set; } - - /// - /// The granularity at which to generate predictions. Values are `word`, `sentence`, `utterance`, or `passage`. To get a single prediction for the entire text of your streaming payload use `passage`. Default value is `word`. - /// - [JsonPropertyName("granularity")] - public string? Granularity { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictions.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictions.cs deleted file mode 100644 index 93eae9a..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictions.cs +++ /dev/null @@ -1,71 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Model predictions -/// -[Serializable] -public record StreamModelPredictions : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// If a payload ID was passed in the request, the same payload ID will be sent back in the response body. - /// - [JsonPropertyName("payload_id")] - public string? PayloadId { get; set; } - - /// - /// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. - /// - [JsonPropertyName("job_details")] - public StreamModelPredictionsJobDetails? JobDetails { get; set; } - - /// - /// Response for the vocal burst emotion model. - /// - [JsonPropertyName("burst")] - public StreamModelPredictionsBurst? Burst { get; set; } - - /// - /// Response for the facial expression emotion model. - /// - [JsonPropertyName("face")] - public StreamModelPredictionsFace? Face { get; set; } - - /// - /// Response for the facemesh emotion model. - /// - [JsonPropertyName("facemesh")] - public StreamModelPredictionsFacemesh? Facemesh { get; set; } - - /// - /// Response for the language emotion model. - /// - [JsonPropertyName("language")] - public StreamModelPredictionsLanguage? Language { get; set; } - - /// - /// Response for the speech prosody emotion model. - /// - [JsonPropertyName("prosody")] - public StreamModelPredictionsProsody? Prosody { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurst.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurst.cs deleted file mode 100644 index 6d56567..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurst.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Response for the vocal burst emotion model. -/// -[Serializable] -public record StreamModelPredictionsBurst : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable? Predictions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurstPredictionsItem.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurstPredictionsItem.cs deleted file mode 100644 index 587942b..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsBurstPredictionsItem.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record StreamModelPredictionsBurstPredictionsItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("time")] - public TimeRange? Time { get; set; } - - [JsonPropertyName("emotions")] - public IEnumerable? Emotions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFace.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFace.cs deleted file mode 100644 index 92f184e..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFace.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Response for the facial expression emotion model. -/// -[Serializable] -public record StreamModelPredictionsFace : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable? Predictions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacePredictionsItem.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacePredictionsItem.cs deleted file mode 100644 index 3ab0cdd..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacePredictionsItem.cs +++ /dev/null @@ -1,62 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record StreamModelPredictionsFacePredictionsItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Frame number - /// - [JsonPropertyName("frame")] - public double? Frame { get; set; } - - /// - /// Time in seconds when face detection occurred. - /// - [JsonPropertyName("time")] - public double? Time { get; set; } - - [JsonPropertyName("bbox")] - public StreamBoundingBox? Bbox { get; set; } - - /// - /// The predicted probability that a detected face was actually a face. - /// - [JsonPropertyName("prob")] - public double? Prob { get; set; } - - /// - /// Identifier for a face. Not that this defaults to `unknown` unless face identification is enabled in the face model configuration. - /// - [JsonPropertyName("face_id")] - public string? FaceId { get; set; } - - [JsonPropertyName("emotions")] - public IEnumerable? Emotions { get; set; } - - [JsonPropertyName("facs")] - public IEnumerable? Facs { get; set; } - - [JsonPropertyName("descriptions")] - public IEnumerable? Descriptions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemesh.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemesh.cs deleted file mode 100644 index cd8b023..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemesh.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Response for the facemesh emotion model. -/// -[Serializable] -public record StreamModelPredictionsFacemesh : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable? Predictions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemeshPredictionsItem.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemeshPredictionsItem.cs deleted file mode 100644 index fcbbae2..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsFacemeshPredictionsItem.cs +++ /dev/null @@ -1,29 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record StreamModelPredictionsFacemeshPredictionsItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("emotions")] - public IEnumerable? Emotions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsJobDetails.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsJobDetails.cs deleted file mode 100644 index c5d1b24..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsJobDetails.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. -/// -[Serializable] -public record StreamModelPredictionsJobDetails : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// ID of the current streaming job. - /// - [JsonPropertyName("job_id")] - public string? JobId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguage.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguage.cs deleted file mode 100644 index 8a94a72..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Response for the language emotion model. -/// -[Serializable] -public record StreamModelPredictionsLanguage : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable? Predictions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguagePredictionsItem.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguagePredictionsItem.cs deleted file mode 100644 index d3061f9..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsLanguagePredictionsItem.cs +++ /dev/null @@ -1,44 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record StreamModelPredictionsLanguagePredictionsItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// A segment of text (like a word or a sentence). - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - - [JsonPropertyName("position")] - public TextPosition? Position { get; set; } - - [JsonPropertyName("emotions")] - public IEnumerable? Emotions { get; set; } - - [JsonPropertyName("sentiment")] - public IEnumerable? Sentiment { get; set; } - - [JsonPropertyName("toxicity")] - public IEnumerable? Toxicity { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsody.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsody.cs deleted file mode 100644 index 8ea64f3..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsody.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Response for the speech prosody emotion model. -/// -[Serializable] -public record StreamModelPredictionsProsody : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("predictions")] - public IEnumerable? Predictions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsodyPredictionsItem.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsodyPredictionsItem.cs deleted file mode 100644 index 84b71ea..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelPredictionsProsodyPredictionsItem.cs +++ /dev/null @@ -1,32 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record StreamModelPredictionsProsodyPredictionsItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("time")] - public TimeRange? Time { get; set; } - - [JsonPropertyName("emotions")] - public IEnumerable? Emotions { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelsEndpointPayload.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelsEndpointPayload.cs deleted file mode 100644 index 6cb3d32..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamModelsEndpointPayload.cs +++ /dev/null @@ -1,87 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Models endpoint payload -/// -[Serializable] -public record StreamModelsEndpointPayload : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [JsonPropertyName("data")] - public string? Data { get; set; } - - /// - /// Configuration used to specify which models should be used and with what settings. - /// - [JsonPropertyName("models")] - public Config? Models { get; set; } - - /// - /// Length in milliseconds of streaming sliding window. - /// - /// Extending the length of this window will prepend media context from past payloads into the current payload. - /// - /// For example, if on the first payload you send 500ms of data and on the second payload you send an additional 500ms of data, a window of at least 1000ms will allow the model to process all 1000ms of stream data. - /// - /// A window of 600ms would append the full 500ms of the second payload to the last 100ms of the first payload. - /// - /// Note: This feature is currently only supported for audio data and audio models. For other file types and models this parameter will be ignored. - /// - [JsonPropertyName("stream_window_ms")] - public double? StreamWindowMs { get; set; } - - /// - /// Whether to reset the streaming sliding window before processing the current payload. - /// - /// If this parameter is set to `true` then past context will be deleted before processing the current payload. - /// - /// Use reset_stream when one audio file is done being processed and you do not want context to leak across files. - /// - [JsonPropertyName("reset_stream")] - public bool? ResetStream { get; set; } - - /// - /// Set to `true` to enable the data parameter to be parsed as raw text rather than base64 encoded bytes. - /// This parameter is useful if you want to send text to be processed by the language model, but it cannot be used with other file types like audio, image, or video. - /// - [JsonPropertyName("raw_text")] - public bool? RawText { get; set; } - - /// - /// Set to `true` to get details about the job. - /// - /// This parameter can be set in the same payload as data or it can be set without data and models configuration to get the job details between payloads. - /// - /// This parameter is useful to get the unique job ID. - /// - [JsonPropertyName("job_details")] - public bool? JobDetails { get; set; } - - /// - /// Pass an arbitrary string as the payload ID and get it back at the top level of the socket response. - /// - /// This can be useful if you have multiple requests running asynchronously and want to disambiguate responses as they are received. - /// - [JsonPropertyName("payload_id")] - public string? PayloadId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessage.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessage.cs deleted file mode 100644 index 1f58864..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessage.cs +++ /dev/null @@ -1,53 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Warning message -/// -[Serializable] -public record StreamWarningMessage : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Warning message text. - /// - [JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Unique identifier for the error. - /// - [JsonPropertyName("code")] - public string? Code { get; set; } - - /// - /// If a payload ID was passed in the request, the same payload ID will be sent back in the response body. - /// - [JsonPropertyName("payload_id")] - public string? PayloadId { get; set; } - - /// - /// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. - /// - [JsonPropertyName("job_details")] - public StreamWarningMessageJobDetails? JobDetails { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessageJobDetails.cs b/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessageJobDetails.cs deleted file mode 100644 index b9acd94..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Stream/Types/StreamWarningMessageJobDetails.cs +++ /dev/null @@ -1,35 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// If the job_details flag was set in the request, details about the current streaming job will be returned in the response body. -/// -[Serializable] -public record StreamWarningMessageJobDetails : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// ID of the current streaming job. - /// - [JsonPropertyName("job_id")] - public string? JobId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/StreamClient.cs b/src/Hume/ExpressionMeasurement/Stream/StreamClient.cs deleted file mode 100644 index 62e3281..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/StreamClient.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -public partial class StreamClient : IStreamClient -{ - private readonly RawClient _client; - - internal StreamClient(RawClient client) - { - _client = client; - } - - public IStreamApi CreateStreamApi() - { - return new StreamApi( - new StreamApi.Options { BaseUrl = _client.Options.Environment.Stream } - ); - } - - public IStreamApi CreateStreamApi(StreamApi.Options options) - { - return new StreamApi(options); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/EmotionEmbeddingItem.cs b/src/Hume/ExpressionMeasurement/Stream/Types/EmotionEmbeddingItem.cs deleted file mode 100644 index 49f0c7b..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/EmotionEmbeddingItem.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record EmotionEmbeddingItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Name of the emotion being expressed. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// Embedding value for the emotion being expressed. - /// - [JsonPropertyName("score")] - public double? Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/SentimentItem.cs b/src/Hume/ExpressionMeasurement/Stream/Types/SentimentItem.cs deleted file mode 100644 index fb3fc6a..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/SentimentItem.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record SentimentItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Level of sentiment, ranging from 1 (negative) to 9 (positive) - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// Prediction for this level of sentiment - /// - [JsonPropertyName("score")] - public double? Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/StreamBoundingBox.cs b/src/Hume/ExpressionMeasurement/Stream/Types/StreamBoundingBox.cs deleted file mode 100644 index 586b5a3..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/StreamBoundingBox.cs +++ /dev/null @@ -1,53 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// A bounding box around a face. -/// -[Serializable] -public record StreamBoundingBox : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// x-coordinate of bounding box top left corner. - /// - [JsonPropertyName("x")] - public double? X { get; set; } - - /// - /// y-coordinate of bounding box top left corner. - /// - [JsonPropertyName("y")] - public double? Y { get; set; } - - /// - /// Bounding box width. - /// - [JsonPropertyName("w")] - public double? W { get; set; } - - /// - /// Bounding box height. - /// - [JsonPropertyName("h")] - public double? H { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/TextPosition.cs b/src/Hume/ExpressionMeasurement/Stream/Types/TextPosition.cs deleted file mode 100644 index 63bc178..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/TextPosition.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// Position of a segment of text within a larger document, measured in characters. Uses zero-based indexing. The beginning index is inclusive and the end index is exclusive. -/// -[Serializable] -public record TextPosition : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The index of the first character in the text segment, inclusive. - /// - [JsonPropertyName("begin")] - public double? Begin { get; set; } - - /// - /// The index of the last character in the text segment, exclusive. - /// - [JsonPropertyName("end")] - public double? End { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/TimeRange.cs b/src/Hume/ExpressionMeasurement/Stream/Types/TimeRange.cs deleted file mode 100644 index c7a8d92..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/TimeRange.cs +++ /dev/null @@ -1,41 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -/// -/// A time range with a beginning and end, measured in seconds. -/// -[Serializable] -public record TimeRange : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Beginning of time range in seconds. - /// - [JsonPropertyName("begin")] - public double? Begin { get; set; } - - /// - /// End of time range in seconds. - /// - [JsonPropertyName("end")] - public double? End { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/ExpressionMeasurement/Stream/Types/ToxicityItem.cs b/src/Hume/ExpressionMeasurement/Stream/Types/ToxicityItem.cs deleted file mode 100644 index 1a3315e..0000000 --- a/src/Hume/ExpressionMeasurement/Stream/Types/ToxicityItem.cs +++ /dev/null @@ -1,38 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Hume; -using Hume.Core; - -namespace Hume.ExpressionMeasurement.Stream; - -[Serializable] -public record ToxicityItem : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Category of toxicity. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// Prediction for this category of toxicity - /// - [JsonPropertyName("score")] - public double? Score { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Hume/Hume.csproj b/src/Hume/Hume.csproj index 9dc5b00..6bd4400 100644 --- a/src/Hume/Hume.csproj +++ b/src/Hume/Hume.csproj @@ -4,7 +4,7 @@ enable 12 enable - 0.2.8 + 0.2.9 $(Version) $(Version) README.md diff --git a/src/Hume/HumeClient.cs b/src/Hume/HumeClient.cs index bc484eb..1b565d7 100644 --- a/src/Hume/HumeClient.cs +++ b/src/Hume/HumeClient.cs @@ -1,6 +1,5 @@ using Hume.Core; using Hume.EmpathicVoice; -using Hume.ExpressionMeasurement; using Hume.Tts; namespace Hume; @@ -18,7 +17,7 @@ public HumeClient(string? apiKey = null, ClientOptions? clientOptions = null) { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Hume" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Hume/0.2.8" }, + { "User-Agent", "Hume/0.2.9" }, } ); foreach (var header in platformHeaders) @@ -39,12 +38,9 @@ public HumeClient(string? apiKey = null, ClientOptions? clientOptions = null) _client = new RawClient(clientOptionsWithAuth); EmpathicVoice = new EmpathicVoiceClient(_client); Tts = new TtsClient(_client); - ExpressionMeasurement = new ExpressionMeasurementClient(_client); } public IEmpathicVoiceClient EmpathicVoice { get; } public ITtsClient Tts { get; } - - public IExpressionMeasurementClient ExpressionMeasurement { get; } } diff --git a/src/Hume/IHumeClient.cs b/src/Hume/IHumeClient.cs index 40e0dbb..5da8a56 100644 --- a/src/Hume/IHumeClient.cs +++ b/src/Hume/IHumeClient.cs @@ -1,5 +1,4 @@ using Hume.EmpathicVoice; -using Hume.ExpressionMeasurement; using Hume.Tts; namespace Hume; @@ -8,5 +7,4 @@ public partial interface IHumeClient { public IEmpathicVoiceClient EmpathicVoice { get; } public ITtsClient Tts { get; } - public IExpressionMeasurementClient ExpressionMeasurement { get; } } diff --git a/src/Hume/Tts/StreamInput/IStreamInputApi.cs b/src/Hume/Tts/StreamInput/IStreamInputApi.cs index 76d5d9d..59d1489 100644 --- a/src/Hume/Tts/StreamInput/IStreamInputApi.cs +++ b/src/Hume/Tts/StreamInput/IStreamInputApi.cs @@ -13,12 +13,9 @@ public partial interface IStreamInputApi : IAsyncDisposable, IDisposable public Event TimestampMessage { get; } public Event UnknownMessage { get; } public ConnectionStatus Status { get; } - global::System.Threading.Tasks.Task ConnectAsync(CancellationToken cancellationToken = default); + Task ConnectAsync(CancellationToken cancellationToken = default); - global::System.Threading.Tasks.Task Send( - PublishTts message, - CancellationToken cancellationToken = default - ); + Task Send(PublishTts message, CancellationToken cancellationToken = default); - global::System.Threading.Tasks.Task CloseAsync(CancellationToken cancellationToken = default); + Task CloseAsync(CancellationToken cancellationToken = default); } diff --git a/src/Hume/Tts/StreamInput/StreamInputApi.cs b/src/Hume/Tts/StreamInput/StreamInputApi.cs index 1506669..e5b1378 100644 --- a/src/Hume/Tts/StreamInput/StreamInputApi.cs +++ b/src/Hume/Tts/StreamInput/StreamInputApi.cs @@ -119,7 +119,7 @@ private void DisposeEvents() /// /// Dispatches incoming WebSocket messages /// - private async global::System.Threading.Tasks.Task OnTextMessage(Stream stream) + private async Task OnTextMessage(Stream stream) { using var json = await JsonSerializer.DeserializeAsync(stream); if (json == null) @@ -153,10 +153,7 @@ await ExceptionOccurred /// /// Serializes and sends a JSON message to the server /// - private async global::System.Threading.Tasks.Task SendJsonAsync( - object message, - CancellationToken cancellationToken = default - ) + private async Task SendJsonAsync(object message, CancellationToken cancellationToken = default) { await _client .SendInstant(JsonUtils.Serialize(message), cancellationToken) @@ -166,7 +163,7 @@ await _client /// /// Injects a fake text message for testing. Dispatches through the normal message handling pipeline. /// - internal async global::System.Threading.Tasks.Task InjectTestMessage(string rawJson) + internal async Task InjectTestMessage(string rawJson) { using var stream = new MemoryStream(global::System.Text.Encoding.UTF8.GetBytes(rawJson)); await OnTextMessage(stream).ConfigureAwait(false); @@ -175,9 +172,7 @@ await _client /// /// Asynchronously establishes a WebSocket connection. /// - public async global::System.Threading.Tasks.Task ConnectAsync( - CancellationToken cancellationToken = default - ) + public async Task ConnectAsync(CancellationToken cancellationToken = default) { #if NET6_0_OR_GREATER _client.DeflateOptions = _options.EnableCompression @@ -190,9 +185,7 @@ await _client /// /// Asynchronously closes the WebSocket connection. /// - public async global::System.Threading.Tasks.Task CloseAsync( - CancellationToken cancellationToken = default - ) + public async Task CloseAsync(CancellationToken cancellationToken = default) { await _client.CloseAsync(cancellationToken).ConfigureAwait(false); } @@ -220,10 +213,7 @@ public void Dispose() /// /// Sends a PublishTts message to the server /// - public async global::System.Threading.Tasks.Task Send( - PublishTts message, - CancellationToken cancellationToken = default - ) + public async Task Send(PublishTts message, CancellationToken cancellationToken = default) { await SendJsonAsync(message, cancellationToken).ConfigureAwait(false); } diff --git a/src/Hume/Tts/TtsClient.cs b/src/Hume/Tts/TtsClient.cs index c91b1e1..f60d245 100644 --- a/src/Hume/Tts/TtsClient.cs +++ b/src/Hume/Tts/TtsClient.cs @@ -17,9 +17,7 @@ internal TtsClient(RawClient client) public IVoicesClient Voices { get; } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > SynthesizeJsonAsyncCore( + private async Task> SynthesizeJsonAsyncCore( PostedTts request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -101,9 +99,7 @@ internal TtsClient(RawClient client) } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > SynthesizeFileAsyncCore( + private async Task> SynthesizeFileAsyncCore( PostedTts request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -170,9 +166,7 @@ internal TtsClient(RawClient client) } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > SynthesizeFileStreamingAsyncCore( + private async Task> SynthesizeFileStreamingAsyncCore( PostedTts request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -239,9 +233,7 @@ internal TtsClient(RawClient client) } } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ConvertVoiceFileAsyncCore( + private async Task> ConvertVoiceFileAsyncCore( ConvertVoiceFileRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default diff --git a/src/Hume/Tts/Types/AudioFormatType.cs b/src/Hume/Tts/Types/AudioFormatType.cs index 6f711fc..fe7512f 100644 --- a/src/Hume/Tts/Types/AudioFormatType.cs +++ b/src/Hume/Tts/Types/AudioFormatType.cs @@ -59,7 +59,7 @@ internal class AudioFormatTypeSerializer : JsonConverter { public override AudioFormatType Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -82,7 +82,7 @@ JsonSerializerOptions options public override AudioFormatType ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/Tts/Types/OctaveVersion.cs b/src/Hume/Tts/Types/OctaveVersion.cs index 80d76d6..c5b1e1b 100644 --- a/src/Hume/Tts/Types/OctaveVersion.cs +++ b/src/Hume/Tts/Types/OctaveVersion.cs @@ -57,7 +57,7 @@ internal class OctaveVersionSerializer : JsonConverter { public override OctaveVersion Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override OctaveVersion ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/Tts/Types/TimestampType.cs b/src/Hume/Tts/Types/TimestampType.cs index a453f83..679cac5 100644 --- a/src/Hume/Tts/Types/TimestampType.cs +++ b/src/Hume/Tts/Types/TimestampType.cs @@ -57,7 +57,7 @@ internal class TimestampTypeSerializer : JsonConverter { public override TimestampType Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override TimestampType ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/Tts/Types/VoiceProvider.cs b/src/Hume/Tts/Types/VoiceProvider.cs index 9db80f8..173d5b4 100644 --- a/src/Hume/Tts/Types/VoiceProvider.cs +++ b/src/Hume/Tts/Types/VoiceProvider.cs @@ -57,7 +57,7 @@ internal class VoiceProviderSerializer : JsonConverter { public override VoiceProvider Read( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { @@ -80,7 +80,7 @@ JsonSerializerOptions options public override VoiceProvider ReadAsPropertyName( ref Utf8JsonReader reader, - global::System.Type typeToConvert, + Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Hume/Tts/Voices/IVoicesClient.cs b/src/Hume/Tts/Voices/IVoicesClient.cs index 2f70558..00fff94 100644 --- a/src/Hume/Tts/Voices/IVoicesClient.cs +++ b/src/Hume/Tts/Voices/IVoicesClient.cs @@ -8,7 +8,7 @@ public partial interface IVoicesClient /// /// Lists voices you have saved in your account, or voices from the [Voice Library](https://app.hume.ai/tts/voice-library). /// - global::System.Threading.Tasks.Task> ListAsync( + Task> ListAsync( VoicesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -28,7 +28,7 @@ WithRawResponseTask CreateAsync( /// /// Deletes a previously generated custom voice. /// - global::System.Threading.Tasks.Task DeleteAsync( + Task DeleteAsync( VoicesDeleteRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default diff --git a/src/Hume/Tts/Voices/VoicesClient.cs b/src/Hume/Tts/Voices/VoicesClient.cs index 36cea39..17a8163 100644 --- a/src/Hume/Tts/Voices/VoicesClient.cs +++ b/src/Hume/Tts/Voices/VoicesClient.cs @@ -27,9 +27,7 @@ private WithRawResponseTask ListInternalAsync( ); } - private async global::System.Threading.Tasks.Task< - WithRawResponse - > ListInternalAsyncCore( + private async Task> ListInternalAsyncCore( VoicesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -118,7 +116,7 @@ private WithRawResponseTask ListInternalAsync( } } - private async global::System.Threading.Tasks.Task> CreateAsyncCore( + private async Task> CreateAsyncCore( PostedVoice request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -208,7 +206,7 @@ private WithRawResponseTask ListInternalAsync( /// new VoicesListRequest { Provider = Hume.Tts.VoiceProvider.CustomVoice } /// ); /// - public async global::System.Threading.Tasks.Task> ListAsync( + public async Task> ListAsync( VoicesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -267,7 +265,7 @@ public WithRawResponseTask CreateAsync( /// /// await client.Tts.Voices.DeleteAsync(new VoicesDeleteRequest { Name = "David Hume" }); /// - public async global::System.Threading.Tasks.Task DeleteAsync( + public async Task DeleteAsync( VoicesDeleteRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default From b65f3115533cb8ecc1e38202ec926882413a64ce Mon Sep 17 00:00:00 2001 From: zach Date: Wed, 17 Jun 2026 10:37:27 -0700 Subject: [PATCH 2/2] bump version to 0.3.0 for Expression Measurement removal --- .fern/metadata.json | 2 +- src/Hume/Core/Public/Version.cs | 2 +- src/Hume/Hume.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 0917a17..db0228e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -21,5 +21,5 @@ } }, "originGitCommit": "2968d0bfb0c9e8d381a274972edb6f7948cf77c6", - "sdkVersion": "0.2.9" + "sdkVersion": "0.3.0" } \ No newline at end of file diff --git a/src/Hume/Core/Public/Version.cs b/src/Hume/Core/Public/Version.cs index c6bf6b3..f20ee15 100644 --- a/src/Hume/Core/Public/Version.cs +++ b/src/Hume/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Hume; [Serializable] internal class Version { - public const string Current = "0.2.9"; + public const string Current = "0.3.0"; } diff --git a/src/Hume/Hume.csproj b/src/Hume/Hume.csproj index 6bd4400..3d1938a 100644 --- a/src/Hume/Hume.csproj +++ b/src/Hume/Hume.csproj @@ -4,7 +4,7 @@ enable 12 enable - 0.2.9 + 0.3.0 $(Version) $(Version) README.md