From 7bd430b168ee87c3cfe485dc0ee1030a76f64ce7 Mon Sep 17 00:00:00 2001 From: HavenDV Date: Sun, 22 Sep 2024 11:01:59 +0400 Subject: [PATCH] fix: Fixed issue with enum header parameters. --- specs/cohere.yaml | 847 +++++++---- src/libs/AutoSDK/Sources/Sources.Methods.cs | 4 +- .../NewtonsoftJson/_#G.Api.Chat.g.verified.cs | 39 +- .../_#G.Api.Chatv2.g.verified.cs | 35 +- .../_#G.Api.Embed.g.verified.cs | 3 +- .../_#G.Api.Embedv2.g.verified.cs | 190 +++ .../_#G.Api.Rerankv2.g.verified.cs | 176 +++ ...bedJobsClient.CreateEmbedJob.g.verified.cs | 3 +- .../_#G.IApi.Chat.g.verified.cs | 24 +- .../_#G.IApi.Chatv2.g.verified.cs | 29 +- .../_#G.IApi.Embed.g.verified.cs | 3 +- .../_#G.IApi.Embedv2.g.verified.cs | 82 ++ .../_#G.IApi.Rerankv2.g.verified.cs | 66 + ...bedJobsClient.CreateEmbedJob.g.verified.cs | 3 +- .../_#G.Models.AssistantMessage.g.verified.cs | 2 +- ...els.AssistantMessageResponse.g.verified.cs | 2 +- .../_#G.Models.BaseModel.g.verified.cs | 4 +- .../_#G.Models.BaseType.g.verified.cs | 4 +- ...s => _#G.Models.ChatAccepts.g.verified.cs} | 18 +- ...=> _#G.Models.ChatMessageV2.g.verified.cs} | 112 +- .../_#G.Models.ChatRequest.g.verified.cs | 18 +- ....ChatRequestPromptTruncation.g.verified.cs | 8 +- ...Models.ChatRequestSafetyMode.g.verified.cs | 66 + ... => _#G.Models.ChatResponse.g.verified.cs} | 4 +- ...> _#G.Models.ChatResponse14.g.verified.cs} | 4 +- .../_#G.Models.Chatv2Request.g.verified.cs | 31 +- ...dels.Chatv2RequestSafetyMode.g.verified.cs | 66 + .../_#G.Models.CitationOptions.g.verified.cs | 25 + ....Models.CitationOptionsMode.g.verified.cs} | 22 +- ...Models.CreateEmbedJobRequest.g.verified.cs | 3 +- .../_#G.Models.Document.g.verified.cs | 32 + .../_#G.Models.DocumentContent.g.verified.cs | 32 + ...G.Models.DocumentContentType.g.verified.cs | 48 + ... => _#G.Models.DocumentData.g.verified.cs} | 6 +- .../_#G.Models.EmbedInputType.g.verified.cs | 10 +- .../_#G.Models.EmbedRequest.g.verified.cs | 3 +- .../_#G.Models.Embedv2Request.g.verified.cs | 74 + ...odels.Embedv2RequestTruncate.g.verified.cs | 66 + .../_#G.Models.Embedv2Response.g.verified.cs | 24 + ..._#G.Models.Embedv2Response10.g.verified.cs | 24 + ..._#G.Models.Embedv2Response11.g.verified.cs | 24 + ..._#G.Models.Embedv2Response12.g.verified.cs | 24 + .../_#G.Models.Embedv2Response2.g.verified.cs | 24 + .../_#G.Models.Embedv2Response3.g.verified.cs | 24 + .../_#G.Models.Embedv2Response4.g.verified.cs | 24 + .../_#G.Models.Embedv2Response5.g.verified.cs | 24 + .../_#G.Models.Embedv2Response6.g.verified.cs | 24 + .../_#G.Models.Embedv2Response7.g.verified.cs | 24 + .../_#G.Models.Embedv2Response8.g.verified.cs | 24 + .../_#G.Models.Embedv2Response9.g.verified.cs | 24 + .../_#G.Models.Hyperparameters.g.verified.cs | 25 + ...Models.JsonResponseFormatV2.g.verified.cs} | 8 +- ...nResponseFormatV2JsonSchema.g.verified.cs} | 4 +- ..._#G.Models.LoraTargetModules.g.verified.cs | 74 + .../_#G.Models.Rerankv2Request.g.verified.cs | 68 + .../_#G.Models.Rerankv2Response.g.verified.cs | 36 + ...#G.Models.Rerankv2Response10.g.verified.cs | 24 + ...#G.Models.Rerankv2Response11.g.verified.cs | 24 + ...#G.Models.Rerankv2Response12.g.verified.cs | 24 + ...#G.Models.Rerankv2Response13.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response2.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response3.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response4.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response5.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response6.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response7.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response8.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response9.g.verified.cs | 24 + ...odels.Rerankv2ResponseResult.g.verified.cs | 37 + ...rankv2ResponseResultDocument.g.verified.cs | 24 + .../_#G.Models.ResponseFormat.g.verified.cs | 2 +- ....Models.ResponseFormatTypeV2.g.verified.cs | 56 + ..._#G.Models.ResponseFormatV2.g.verified.cs} | 74 +- .../_#G.Models.Strategy.g.verified.cs | 4 +- ...dels.StreamedChatResponseV2.g.verified.cs} | 70 +- ....Models.TextResponseFormatV2.g.verified.cs | 25 + ...cs => _#G.Models.ToolCallV2.g.verified.cs} | 8 +- ...G.Models.ToolCallV2Function.g.verified.cs} | 4 +- ...> _#G.Models.ToolCallV2Type.g.verified.cs} | 14 +- .../_#G.Models.ToolContent.g.verified.cs | 157 +- ...=> _#G.Models.ToolMessageV2.g.verified.cs} | 12 +- ...#G.Models.ToolMessageV2Role.g.verified.cs} | 14 +- ...ied.cs => _#G.Models.ToolV2.g.verified.cs} | 8 +- ...> _#G.Models.ToolV2Function.g.verified.cs} | 6 +- ...ls.ToolV2FunctionParameters.g.verified.cs} | 4 +- ...cs => _#G.Models.ToolV2Type.g.verified.cs} | 14 +- .../_#G.Models.UserMessage.g.verified.cs | 6 - .../SystemTextJson/_#G.Api.Chat.g.verified.cs | 34 +- .../_#G.Api.Chatv2.g.verified.cs | 35 +- .../_#G.Api.Embed.g.verified.cs | 3 +- .../_#G.Api.Embedv2.g.verified.cs | 190 +++ .../_#G.Api.Rerankv2.g.verified.cs | 176 +++ .../SystemTextJson/_#G.Api.g.verified.cs | 39 +- ...bedJobsClient.CreateEmbedJob.g.verified.cs | 3 +- .../_#G.IApi.Chat.g.verified.cs | 24 +- .../_#G.IApi.Chatv2.g.verified.cs | 29 +- .../_#G.IApi.Embed.g.verified.cs | 3 +- .../_#G.IApi.Embedv2.g.verified.cs | 82 ++ .../_#G.IApi.Rerankv2.g.verified.cs | 66 + ...bedJobsClient.CreateEmbedJob.g.verified.cs | 3 +- .../_#G.Models.AssistantMessage.g.verified.cs | 2 +- ...els.AssistantMessageResponse.g.verified.cs | 2 +- .../_#G.Models.BaseModel.g.verified.cs | 4 +- .../_#G.Models.BaseType.g.verified.cs | 4 +- ...s => _#G.Models.ChatAccepts.g.verified.cs} | 16 +- ...=> _#G.Models.ChatMessageV2.g.verified.cs} | 112 +- .../_#G.Models.ChatRequest.g.verified.cs | 19 +- ....ChatRequestPromptTruncation.g.verified.cs | 8 +- ...Models.ChatRequestSafetyMode.g.verified.cs | 62 + ... => _#G.Models.ChatResponse.g.verified.cs} | 4 +- ...> _#G.Models.ChatResponse14.g.verified.cs} | 4 +- .../_#G.Models.Chatv2Request.g.verified.cs | 35 +- ...dels.Chatv2RequestSafetyMode.g.verified.cs | 62 + .../_#G.Models.CitationOptions.g.verified.cs | 26 + ....Models.CitationOptionsMode.g.verified.cs} | 22 +- ...Models.CreateEmbedJobRequest.g.verified.cs | 3 +- .../_#G.Models.Document.g.verified.cs | 33 + .../_#G.Models.DocumentContent.g.verified.cs | 34 + ...G.Models.DocumentContentType.g.verified.cs | 46 + ... => _#G.Models.DocumentData.g.verified.cs} | 6 +- .../_#G.Models.EmbedInputType.g.verified.cs | 9 +- .../_#G.Models.EmbedRequest.g.verified.cs | 3 +- .../_#G.Models.Embedv2Request.g.verified.cs | 76 + ...odels.Embedv2RequestTruncate.g.verified.cs | 62 + .../_#G.Models.Embedv2Response.g.verified.cs | 24 + ..._#G.Models.Embedv2Response10.g.verified.cs | 24 + ..._#G.Models.Embedv2Response11.g.verified.cs | 24 + ..._#G.Models.Embedv2Response12.g.verified.cs | 24 + .../_#G.Models.Embedv2Response2.g.verified.cs | 24 + .../_#G.Models.Embedv2Response3.g.verified.cs | 24 + .../_#G.Models.Embedv2Response4.g.verified.cs | 24 + .../_#G.Models.Embedv2Response5.g.verified.cs | 24 + .../_#G.Models.Embedv2Response6.g.verified.cs | 24 + .../_#G.Models.Embedv2Response7.g.verified.cs | 24 + .../_#G.Models.Embedv2Response8.g.verified.cs | 24 + .../_#G.Models.Embedv2Response9.g.verified.cs | 24 + .../_#G.Models.Hyperparameters.g.verified.cs | 26 + ...Models.JsonResponseFormatV2.g.verified.cs} | 10 +- ...nResponseFormatV2JsonSchema.g.verified.cs} | 4 +- ..._#G.Models.LoraTargetModules.g.verified.cs | 69 + .../_#G.Models.Rerankv2Request.g.verified.cs | 71 + .../_#G.Models.Rerankv2Response.g.verified.cs | 37 + ...#G.Models.Rerankv2Response10.g.verified.cs | 24 + ...#G.Models.Rerankv2Response11.g.verified.cs | 24 + ...#G.Models.Rerankv2Response12.g.verified.cs | 24 + ...#G.Models.Rerankv2Response13.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response2.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response3.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response4.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response5.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response6.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response7.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response8.g.verified.cs | 24 + ..._#G.Models.Rerankv2Response9.g.verified.cs | 24 + ...odels.Rerankv2ResponseResult.g.verified.cs | 38 + ...rankv2ResponseResultDocument.g.verified.cs | 25 + .../_#G.Models.ResponseFormat.g.verified.cs | 2 +- ....Models.ResponseFormatTypeV2.g.verified.cs | 53 + ..._#G.Models.ResponseFormatV2.g.verified.cs} | 74 +- .../_#G.Models.Strategy.g.verified.cs | 4 +- ...dels.StreamedChatResponseV2.g.verified.cs} | 70 +- ....Models.TextResponseFormatV2.g.verified.cs | 27 + ...cs => _#G.Models.ToolCallV2.g.verified.cs} | 10 +- ...G.Models.ToolCallV2Function.g.verified.cs} | 4 +- ...> _#G.Models.ToolCallV2Type.g.verified.cs} | 14 +- .../_#G.Models.ToolContent.g.verified.cs | 159 +- ...=> _#G.Models.ToolMessageV2.g.verified.cs} | 15 +- ...#G.Models.ToolMessageV2Role.g.verified.cs} | 14 +- ...ied.cs => _#G.Models.ToolV2.g.verified.cs} | 10 +- ...> _#G.Models.ToolV2Function.g.verified.cs} | 6 +- ...ls.ToolV2FunctionParameters.g.verified.cs} | 4 +- ...cs => _#G.Models.ToolV2Type.g.verified.cs} | 14 +- .../_#G.Models.UserMessage.g.verified.cs | 6 - ...#JsonConverters.ChatAccepts.g.verified.cs} | 14 +- ...verters.ChatAcceptsNullable.g.verified.cs} | 14 +- ...sonConverters.ChatMessageV2.g.verified.cs} | 60 +- ...erters.ChatRequestSafetyMode.g.verified.cs | 50 + ...hatRequestSafetyModeNullable.g.verified.cs | 57 + ...rs.Chatv2RequestCitationMode.g.verified.cs | 50 - ...2RequestCitationModeNullable.g.verified.cs | 57 - ...ters.Chatv2RequestSafetyMode.g.verified.cs | 50 + ...tv2RequestSafetyModeNullable.g.verified.cs | 57 + ...nverters.CitationOptionsMode.g.verified.cs | 50 + ....CitationOptionsModeNullable.g.verified.cs | 57 + ...nverters.DocumentContentType.g.verified.cs | 50 + ....DocumentContentTypeNullable.g.verified.cs | 57 + ...rters.Embedv2RequestTruncate.g.verified.cs | 50 + ...bedv2RequestTruncateNullable.g.verified.cs | 57 + ...onverters.LoraTargetModules.g.verified.cs} | 14 +- ...s.LoraTargetModulesNullable.g.verified.cs} | 14 +- ...verters.ResponseFormatTypeV2.g.verified.cs | 50 + ...ResponseFormatTypeV2Nullable.g.verified.cs | 57 + ...Converters.ResponseFormatV2.g.verified.cs} | 58 +- ...ters.StreamedChatResponseV2.g.verified.cs} | 10 +- ...onConverters.ToolCallV2Type.g.verified.cs} | 14 +- ...ters.ToolCallV2TypeNullable.g.verified.cs} | 14 +- ..._#JsonConverters.ToolContent.g.verified.cs | 88 ++ ...Converters.ToolMessageV2Role.g.verified.cs | 50 + ...rs.ToolMessageV2RoleNullable.g.verified.cs | 57 + ..._#JsonConverters.ToolV2Type.g.verified.cs} | 14 +- ...nverters.ToolV2TypeNullable.g.verified.cs} | 14 +- ...nSerializerContextConverters.g.verified.cs | 39 +- ..._#JsonSerializerContextTypes.g.verified.cs | 1294 ++++++++++------- .../Cohere/ResolvedSchemas/_.verified.txt | 177 ++- .../Snapshots/Cohere/Schemas/_.verified.txt | 177 ++- 205 files changed, 7335 insertions(+), 1713 deletions(-) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embedv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Rerankv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embedv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Rerankv2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolContentType.g.verified.cs => _#G.Models.ChatAccepts.g.verified.cs} (65%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ChatMessage2.g.verified.cs => _#G.Models.ChatMessageV2.g.verified.cs} (55%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.NonStreamedChatResponse2.g.verified.cs => _#G.Models.ChatResponse.g.verified.cs} (92%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ChatResponse2.g.verified.cs => _#G.Models.ChatResponse14.g.verified.cs} (87%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptions.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.Chatv2RequestCitationMode.g.verified.cs => _#G.Models.CitationOptionsMode.g.verified.cs} (67%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Document.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContent.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContentType.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolContentOutput.g.verified.cs => _#G.Models.DocumentData.g.verified.cs} (66%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Request.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response10.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response11.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response12.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response3.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response4.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response5.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response6.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response7.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response8.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response9.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.JSONResponseFormat2.g.verified.cs => _#G.Models.JsonResponseFormatV2.g.verified.cs} (85%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs => _#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs} (89%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.LoraTargetModules.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Request.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response10.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response11.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response12.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response13.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response3.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response4.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response5.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response6.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response7.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response8.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response9.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ResponseFormat2.g.verified.cs => _#G.Models.ResponseFormatV2.g.verified.cs} (62%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.StreamedChatResponse2.g.verified.cs => _#G.Models.StreamedChatResponseV2.g.verified.cs} (83%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.TextResponseFormatV2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolCall2.g.verified.cs => _#G.Models.ToolCallV2.g.verified.cs} (80%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolCall2Function.g.verified.cs => _#G.Models.ToolCallV2Function.g.verified.cs} (88%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolCall2Type.g.verified.cs => _#G.Models.ToolCallV2Type.g.verified.cs} (70%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolMessage2.g.verified.cs => _#G.Models.ToolMessageV2.g.verified.cs} (66%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.ToolMessage2Role.g.verified.cs => _#G.Models.ToolMessageV2Role.g.verified.cs} (70%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.Tool2.g.verified.cs => _#G.Models.ToolV2.g.verified.cs} (78%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.Tool2Function.g.verified.cs => _#G.Models.ToolV2Function.g.verified.cs} (86%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.Tool2FunctionParameters.g.verified.cs => _#G.Models.ToolV2FunctionParameters.g.verified.cs} (81%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/{_#G.Models.Tool2Type.g.verified.cs => _#G.Models.ToolV2Type.g.verified.cs} (72%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embedv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Rerankv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embedv2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Rerankv2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolContentType.g.verified.cs => _#G.Models.ChatAccepts.g.verified.cs} (63%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ChatMessage2.g.verified.cs => _#G.Models.ChatMessageV2.g.verified.cs} (55%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.NonStreamedChatResponse2.g.verified.cs => _#G.Models.ChatResponse.g.verified.cs} (93%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ChatResponse2.g.verified.cs => _#G.Models.ChatResponse14.g.verified.cs} (87%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptions.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.Chatv2RequestCitationMode.g.verified.cs => _#G.Models.CitationOptionsMode.g.verified.cs} (62%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Document.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContent.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContentType.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolContentOutput.g.verified.cs => _#G.Models.DocumentData.g.verified.cs} (67%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Request.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response10.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response11.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response12.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response3.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response4.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response5.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response6.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response7.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response8.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response9.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.JSONResponseFormat2.g.verified.cs => _#G.Models.JsonResponseFormatV2.g.verified.cs} (83%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs => _#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs} (89%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.LoraTargetModules.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Request.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response10.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response11.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response12.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response13.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response3.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response4.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response5.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response6.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response7.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response8.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response9.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ResponseFormat2.g.verified.cs => _#G.Models.ResponseFormatV2.g.verified.cs} (62%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.StreamedChatResponse2.g.verified.cs => _#G.Models.StreamedChatResponseV2.g.verified.cs} (83%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.TextResponseFormatV2.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolCall2.g.verified.cs => _#G.Models.ToolCallV2.g.verified.cs} (78%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolCall2Function.g.verified.cs => _#G.Models.ToolCallV2Function.g.verified.cs} (89%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolCall2Type.g.verified.cs => _#G.Models.ToolCallV2Type.g.verified.cs} (67%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolMessage2.g.verified.cs => _#G.Models.ToolMessageV2.g.verified.cs} (62%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.ToolMessage2Role.g.verified.cs => _#G.Models.ToolMessageV2Role.g.verified.cs} (67%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.Tool2.g.verified.cs => _#G.Models.ToolV2.g.verified.cs} (76%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.Tool2Function.g.verified.cs => _#G.Models.ToolV2Function.g.verified.cs} (86%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.Tool2FunctionParameters.g.verified.cs => _#G.Models.ToolV2FunctionParameters.g.verified.cs} (82%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#G.Models.Tool2Type.g.verified.cs => _#G.Models.ToolV2Type.g.verified.cs} (69%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolCall2Type.g.verified.cs => _#JsonConverters.ChatAccepts.g.verified.cs} (70%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolCall2TypeNullable.g.verified.cs => _#JsonConverters.ChatAcceptsNullable.g.verified.cs} (72%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ChatMessage2.g.verified.cs => _#JsonConverters.ChatMessageV2.g.verified.cs} (78%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyMode.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyModeNullable.g.verified.cs delete mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationMode.g.verified.cs delete mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationModeNullable.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyMode.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyModeNullable.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsMode.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsModeNullable.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentType.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentTypeNullable.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncate.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncateNullable.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolMessage2Role.g.verified.cs => _#JsonConverters.LoraTargetModules.g.verified.cs} (69%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolMessage2RoleNullable.g.verified.cs => _#JsonConverters.LoraTargetModulesNullable.g.verified.cs} (71%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2Nullable.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ResponseFormat2.g.verified.cs => _#JsonConverters.ResponseFormatV2.g.verified.cs} (61%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.StreamedChatResponse2.g.verified.cs => _#JsonConverters.StreamedChatResponseV2.g.verified.cs} (97%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolContentType.g.verified.cs => _#JsonConverters.ToolCallV2Type.g.verified.cs} (70%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.ToolContentTypeNullable.g.verified.cs => _#JsonConverters.ToolCallV2TypeNullable.g.verified.cs} (71%) create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContent.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2Role.g.verified.cs create mode 100644 src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2RoleNullable.g.verified.cs rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.Tool2Type.g.verified.cs => _#JsonConverters.ToolV2Type.g.verified.cs} (71%) rename src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/{_#JsonConverters.Tool2TypeNullable.g.verified.cs => _#JsonConverters.ToolV2TypeNullable.g.verified.cs} (73%) diff --git a/specs/cohere.yaml b/specs/cohere.yaml index b5f6393533..4d43f00c5d 100644 --- a/specs/cohere.yaml +++ b/specs/cohere.yaml @@ -18,10 +18,20 @@ paths: /v1/chat: post: summary: Chat - description: "Generates a text response to a user message.\nTo learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).\n" + description: "Generates a text response to a user message.\nTo learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).\n" operationId: chat parameters: - $ref: '#/components/parameters/RequestSource' + - name: Accepts + in: header + description: "Pass text/event-stream to receive the streamed response as server-sent events. The default is `\\n` delimited events.\n" + schema: + enum: + - text/event-stream + type: string + example: text/event-stream + x-fern-audiences: + - public requestBody: content: application/json: @@ -32,22 +42,22 @@ paths: properties: message: type: string - description: "Text input for the model to respond to.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Text input for the model to respond to.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public model: type: string - description: "Defaults to `command-r-plus`.\n\nThe name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.\nCompatible Deployments: Cohere Platform, Private Deployments\n" + description: "Defaults to `command-r-plus-08-2024`.\n\nThe name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.\n\nCompatible Deployments: Cohere Platform, Private Deployments\n" x-fern-audiences: - public stream: type: boolean - description: "Defaults to `false`.\n\nWhen `true`, the response will be a JSON stream of events. The final event will contain the complete response, and will have an `event_type` of `\"stream-end\"`.\n\nStreaming is beneficial for user interfaces that render the contents of the response piece by piece, as it gets generated.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `false`.\n\nWhen `true`, the response will be a JSON stream of events. The final event will contain the complete response, and will have an `event_type` of `\"stream-end\"`.\n\nStreaming is beneficial for user interfaces that render the contents of the response piece by piece, as it gets generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public preamble: type: string - description: "When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style, and use the `SYSTEM` role.\n\nThe `SYSTEM` role is also used for the contents of the optional `chat_history=` parameter. When used with the `chat_history=` parameter it adds content throughout a conversation. Conversely, when used with the `preamble=` parameter it adds content at the start of the conversation only.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style, and use the `SYSTEM` role.\n\nThe `SYSTEM` role is also used for the contents of the optional `chat_history=` parameter. When used with the `chat_history=` parameter it adds content throughout a conversation. Conversely, when used with the `preamble=` parameter it adds content at the start of the conversation only.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public chat_history: @@ -55,12 +65,12 @@ paths: type: array items: $ref: '#/components/schemas/Message' - description: "A list of previous messages between the user and the model, giving the model conversational context for responding to the user's `message`.\n\nEach item represents a single message in the chat history, excluding the current user turn. It has two properties: `role` and `message`. The `role` identifies the sender (`CHATBOT`, `SYSTEM`, or `USER`), while the `message` contains the text content.\n\nThe chat_history parameter should not be used for `SYSTEM` messages in most cases. Instead, to add a `SYSTEM` role message at the beginning of a conversation, the `preamble` parameter should be used.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "A list of previous messages between the user and the model, giving the model conversational context for responding to the user's `message`.\n\nEach item represents a single message in the chat history, excluding the current user turn. It has two properties: `role` and `message`. The `role` identifies the sender (`CHATBOT`, `SYSTEM`, or `USER`), while the `message` contains the text content.\n\nThe chat_history parameter should not be used for `SYSTEM` messages in most cases. Instead, to add a `SYSTEM` role message at the beginning of a conversation, the `preamble` parameter should be used.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public conversation_id: type: string - description: "An alternative to `chat_history`.\n\nProviding a `conversation_id` creates or resumes a persisted conversation with the specified ID. The ID can be any non empty string.\nCompatible Deployments: Cohere Platform\n" + description: "An alternative to `chat_history`.\n\nProviding a `conversation_id` creates or resumes a persisted conversation with the specified ID. The ID can be any non empty string.\n\nCompatible Deployments: Cohere Platform\n" x-fern-audiences: - public prompt_truncation: @@ -69,7 +79,7 @@ paths: - AUTO - AUTO_PRESERVE_ORDER type: string - description: "Defaults to `AUTO` when `connectors` are specified and `OFF` in all other cases.\n\nDictates how the prompt will be constructed.\n\nWith `prompt_truncation` set to \"AUTO\", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.\n\nWith `prompt_truncation` set to \"AUTO_PRESERVE_ORDER\", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.\n\nWith `prompt_truncation` set to \"OFF\", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.\nCompatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `AUTO` when `connectors` are specified and `OFF` in all other cases.\n\nDictates how the prompt will be constructed.\n\nWith `prompt_truncation` set to \"AUTO\", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.\n\nWith `prompt_truncation` set to \"AUTO_PRESERVE_ORDER\", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.\n\nWith `prompt_truncation` set to \"OFF\", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.\n\nCompatible Deployments: \n - AUTO: Cohere Platform Only\n - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public connectors: @@ -77,19 +87,19 @@ paths: type: array items: $ref: '#/components/schemas/ChatConnector' - description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\nCompatible Deployments: Cohere Platform\n" + description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n" x-fern-audiences: - public search_queries_only: type: boolean - description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public documents: type: array items: $ref: '#/components/schemas/ChatDocument' - description: "A list of relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.\n\nExample:\n```\n[\n { \"title\": \"Tall penguins\", \"text\": \"Emperor penguins are the tallest.\" },\n { \"title\": \"Penguin habitats\", \"text\": \"Emperor penguins only live in Antarctica.\" },\n]\n```\n\nKeys and values from each document will be serialized to a string and passed to the model. The resulting generation will include citations that reference some of these documents.\n\nSome suggested keys are \"text\", \"author\", and \"date\". For better generation quality, it is recommended to keep the total word count of the strings in the dictionary to under 300 words.\n\nAn `id` field (string) can be optionally supplied to identify the document in the citations. This field will not be passed to the model.\n\nAn `_excludes` field (array of strings) can be optionally supplied to omit some key-value pairs from being shown to the model. The omitted fields will still show up in the citation object. The \"_excludes\" field will not be passed to the model.\n\nSee ['Document Mode'](https://docs.cohere.com/docs/retrieval-augmented-generation-rag#document-mode) in the guide for more information.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "A list of relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.\n\nExample:\n```\n[\n { \"title\": \"Tall penguins\", \"text\": \"Emperor penguins are the tallest.\" },\n { \"title\": \"Penguin habitats\", \"text\": \"Emperor penguins only live in Antarctica.\" },\n]\n```\n\nKeys and values from each document will be serialized to a string and passed to the model. The resulting generation will include citations that reference some of these documents.\n\nSome suggested keys are \"text\", \"author\", and \"date\". For better generation quality, it is recommended to keep the total word count of the strings in the dictionary to under 300 words.\n\nAn `id` field (string) can be optionally supplied to identify the document in the citations. This field will not be passed to the model.\n\nAn `_excludes` field (array of strings) can be optionally supplied to omit some key-value pairs from being shown to the model. The omitted fields will still show up in the citation object. The \"_excludes\" field will not be passed to the model.\n\nSee ['Document Mode'](https://docs.cohere.com/docs/retrieval-augmented-generation-rag#document-mode) in the guide for more information.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public citation_quality: @@ -98,26 +108,26 @@ paths: - accurate - off type: string - description: "Defaults to `\"accurate\"`.\n\nDictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `\"accurate\"` results, `\"fast\"` results or no results.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `\"accurate\"`.\n\nDictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `\"accurate\"` results, `\"fast\"` results or no results.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public temperature: maximum: 1 minimum: 0 type: number - description: "Defaults to `0.3`.\n\nA non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations.\n\nRandomness can be further maximized by increasing the value of the `p` parameter.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `0.3`.\n\nA non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations.\n\nRandomness can be further maximized by increasing the value of the `p` parameter.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" format: float x-fern-audiences: - public max_tokens: type: integer - description: "The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" writeOnly: true x-fern-audiences: - public max_input_tokens: type: integer - description: "The maximum number of input tokens to send to the model. If not specified, `max_input_tokens` is the model's context length limit minus a small buffer.\n\nInput will be truncated according to the `prompt_truncation` parameter.\nCompatible Deployments: Cohere Platform\n" + description: "The maximum number of input tokens to send to the model. If not specified, `max_input_tokens` is the model's context length limit minus a small buffer.\n\nInput will be truncated according to the `prompt_truncation` parameter.\n\nCompatible Deployments: Cohere Platform\n" writeOnly: true x-fern-audiences: - public @@ -125,7 +135,7 @@ paths: maximum: 500 minimum: 0 type: integer - description: "Ensures only the top `k` most likely tokens are considered for generation at each step.\nDefaults to `0`, min value of `0`, max value of `500`.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Ensures only the top `k` most likely tokens are considered for generation at each step.\nDefaults to `0`, min value of `0`, max value of `500`.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" default: 0 writeOnly: true x-fern-audiences: @@ -134,7 +144,7 @@ paths: maximum: 0.99 minimum: 0.01 type: number - description: "Ensures that only the most likely tokens, with total probability mass of `p`, are considered for generation at each step. If both `k` and `p` are enabled, `p` acts after `k`.\nDefaults to `0.75`. min value of `0.01`, max value of `0.99`.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Ensures that only the most likely tokens, with total probability mass of `p`, are considered for generation at each step. If both `k` and `p` are enabled, `p` acts after `k`.\nDefaults to `0.75`. min value of `0.01`, max value of `0.99`.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" default: 0.75 writeOnly: true x-fern-audiences: @@ -143,26 +153,26 @@ paths: maximum: 18446744073709552000 minimum: 0 type: integer - description: "If specified, the backend will make a best effort to sample tokens\ndeterministically, such that repeated requests with the same\nseed and parameters should return the same result. However,\ndeterminism cannot be totally guaranteed.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "If specified, the backend will make a best effort to sample tokens\ndeterministically, such that repeated requests with the same\nseed and parameters should return the same result. However,\ndeterminism cannot be totally guaranteed.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public stop_sequences: type: array items: type: string - description: "A list of up to 5 strings that the model will use to stop generation. If the model generates a string that matches any of the strings in the list, it will stop generating tokens and return the generated text up to that point not including the stop sequence.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "A list of up to 5 strings that the model will use to stop generation. If the model generates a string that matches any of the strings in the list, it will stop generating tokens and return the generated text up to that point not including the stop sequence.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" writeOnly: true x-fern-audiences: - public frequency_penalty: type: number - description: "Defaults to `0.0`, min value of `0.0`, max value of `1.0`.\n\nUsed to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `0.0`, min value of `0.0`, max value of `1.0`.\n\nUsed to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" writeOnly: true x-fern-audiences: - public presence_penalty: type: number - description: "Defaults to `0.0`, min value of `0.0`, max value of `1.0`.\n\nUsed to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "Defaults to `0.0`, min value of `0.0`, max value of `1.0`.\n\nUsed to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" writeOnly: true x-fern-audiences: - public @@ -171,7 +181,7 @@ paths: type: array items: $ref: '#/components/schemas/Tool' - description: "A list of available tools (functions) that the model may suggest invoking before producing a text response.\n\nWhen `tools` is passed (without `tool_results`), the `text` field in the response will be `\"\"` and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "A list of available tools (functions) that the model may suggest invoking before producing a text response.\n\nWhen `tools` is passed (without `tool_results`), the `text` field in the response will be `\"\"` and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public tool_results: @@ -179,7 +189,7 @@ paths: type: array items: $ref: '#/components/schemas/ToolResult' - description: "A list of results from invoking tools recommended by the model in the previous chat turn. Results are used to produce a text response and will be referenced in citations. When using `tool_results`, `tools` must be passed as well.\nEach tool_result contains information about how it was invoked, as well as a list of outputs in the form of dictionaries.\n\n**Note**: `outputs` must be a list of objects. If your tool returns a single object (eg `{\"status\": 200}`), make sure to wrap it in a list.\n```\ntool_results = [\n {\n \"call\": {\n \"name\": ,\n \"parameters\": {\n : \n }\n },\n \"outputs\": [{\n : \n }]\n },\n ...\n]\n```\n**Note**: Chat calls with `tool_results` should not be included in the Chat history to avoid duplication of the message text.\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + description: "A list of results from invoking tools recommended by the model in the previous chat turn. Results are used to produce a text response and will be referenced in citations. When using `tool_results`, `tools` must be passed as well.\nEach tool_result contains information about how it was invoked, as well as a list of outputs in the form of dictionaries.\n\n**Note**: `outputs` must be a list of objects. If your tool returns a single object (eg `{\"status\": 200}`), make sure to wrap it in a list.\n```\ntool_results = [\n {\n \"call\": {\n \"name\": ,\n \"parameters\": {\n : \n }\n },\n \"outputs\": [{\n : \n }]\n },\n ...\n]\n```\n**Note**: Chat calls with `tool_results` should not be included in the Chat history to avoid duplication of the message text.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" x-fern-audiences: - public force_single_step: @@ -189,6 +199,15 @@ paths: - public response_format: $ref: '#/components/schemas/ResponseFormat' + safety_mode: + enum: + - CONTEXTUAL + - STRICT + - NONE + description: "Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `NONE` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" + x-fern-audiences: + - public + x-fern-availability: beta x-fern-audiences: - public x-examples: @@ -399,7 +418,7 @@ paths: citations: - start: 25 end: 41 - text: '1642-12-25T00:00:00.0000000+03:42' + text: '1642-12-25T00:00:00.0000000+00:00' document_ids: - web-search_0 - web-search_1 @@ -417,7 +436,7 @@ paths: - web-search_5 - start: 57 end: 71 - text: '1643-01-04T00:00:00.0000000+03:42' + text: '1643-01-04T00:00:00.0000000+00:00' document_ids: - web-search_0 - web-search_1 @@ -435,32 +454,32 @@ paths: documents: - id: web-search_0 snippet: "New Articles History & Society\n\nLifestyles & Social Issues\n\nPhilosophy & Religion\n\nPolitics, Law & Government\n\nWorld History Science & Tech\n\nTechnology Biographies\n\nBrowse Biographies Animals & Nature\n\nBirds, Reptiles & Other Vertebrates\n\nBugs, Mollusks & Other Invertebrates\n\nFossils & Geologic Time\n\nPlants Geography & Travel\n\nGeography & Travel Arts & Culture\n\nEntertainment & Pop Culture\n\nAsk the Chatbot Games & Quizzes History & Society Science & Tech Biographies Animals & Nature Geography & Travel Arts & Culture Money Videos\n\nIntroduction & Top Questions\n\nFormative influences\n\nInfluence of the Scientific Revolution\n\nWork during the plague years\n\nInaugural lectures at Trinity\n\nInfluence of the Hermetic tradition\n\nUniversal gravitation\n\nInternational prominence\n\nInterest in religion and theology\n\nLeader of English science\n\nFinal years Quotes References & Edit History Quick Facts & Related Topics\n\nIsaac Newton Timeline\n\nIsaac Newton’s Achievements\n\nUnderstanding Newton’s Laws of Motion\n\nNumbers and Mathematics\n\nPhysics and Natural Law\n\nWhat is Isaac Newton most famous for?\n\nHow was Isaac Newton educated?\n\nWhat was Isaac Newton’s childhood like?\n\nWhat is the Scientific Revolution?\n\nHow is the Scientific Revolution connected to the Enlightenment?\n\nGravity: From Apples to the Universe\n\nTelescopes: Seeing Stars\n\nUnusual Counting Systems\n\nWhat's the Difference Between Speed and Velocity?\n\nIs Zero an Even or an Odd Number?\n\nThe 10 Greatest Basketball Players of All Time\n\nWhat Is a Modern Pentathlon?\n\nWhich Religion Is the Oldest?\n\nWhat's the Difference Between a Solstice and an Equinox?\n\nNew Seven Wonders of the World\n\nIs It True That Squirrels Forget Where They Bury About Half of Their Food?\n\nAmerica’s 5 Most Notorious Cold Cases (Including One You May Have Thought Was Already Solved)\n\nIsaac Newton, oil painting by Sir Godfrey Kneller, 1702; in the National Portrait Gallery, London. Newton's discoveries in physics and mathematics revolutionized science.(more)\n\nEnglish physicist and mathematician\n\nWhile every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions.\n\nSelect Citation Style\n\nChicago Manual of Style\n\nShare to social media\n\nURL https://www.britannica.com/biography/Isaac-Newton\n\nThank you for your feedback\n\nOur editors will review what you’ve submitted and determine whether to revise the article.\n\nIsaac Newton Institute of Mathematical Sciences - Who was Isaac Newton?\n\nScience Kids - Fun Science and Technology for Kids - Biography of Isaac Newton\n\nTrinity College Dublin - School of mathematics - Biography of Sir Isaac Newton\n\nWorld History Encyclopedia - Isaac Newton\n\nStanford Encyclopedia of Philosophy - Biography of Isaac Newton\n\nUniversity of British Columbia - Physics and Astronomy Department - The Life and Work of Newton\n\nLiveScience - Biography of Isaac Newton\n\nPhysics LibreTexts - Newton's Laws of Motion\n\nArticles from Britannica Encyclopedias for elementary and high school students.\n\nIsaac Newton - Children's Encyclopedia (Ages 8-11)\n\nIsaac Newton - Student Encyclopedia (Ages 11 and up)\n\nPlease select which sections you would like to print:\n\nWhile every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions.\n\nSelect Citation Style\n\nChicago Manual of Style\n\nShare to social media\n\nURL https://www.britannica.com/biography/Isaac-Newton Feedback\n\nThank you for your feedback\n\nOur editors will review what you’ve submitted and determine whether to revise the article.\n\nIsaac Newton Institute of Mathematical Sciences - Who was Isaac Newton?\n\nScience Kids - Fun Science and Technology for Kids - Biography of Isaac Newton\n\nTrinity College Dublin - School of mathematics - Biography of Sir Isaac Newton\n\nWorld History Encyclopedia - Isaac Newton\n\nStanford Encyclopedia of Philosophy - Biography of Isaac Newton\n\nUniversity of British Columbia - Physics and Astronomy Department - The Life and Work of Newton\n\nLiveScience - Biography of Isaac Newton\n\nPhysics LibreTexts - Newton's Laws of Motion\n\nArticles from Britannica Encyclopedias for elementary and high school students.\n\nIsaac Newton - Children's Encyclopedia (Ages 8-11)\n\nIsaac Newton - Student Encyclopedia (Ages 11 and up)\n\nAlso known as: Sir Isaac Newton\n\nProfessor of History of Science, Indiana University, Bloomington, 1963–89. Author of Never at Rest: A Biography of Isaac Newton and others.\n\nThe Editors of Encyclopaedia Britannica\n\nEncyclopaedia Britannica's editors oversee subject areas in which they have extensive knowledge, whether from years of experience gained by working on that content or via study for an advanced degree. They write new content and verify and edit content received from contributors.\n\nThe Editors of Encyclopaedia Britannica\n\nLast Updated: Jul 23, 2024 • Article History Table of Contents\n\nSir Isaac Newton (Show more)\n\nDecember 25, 1642 [January 4, 1643, New Style], Woolsthorpe, Lincolnshire, England (Show more)\n\nMarch 20 [March 31], 1727, London (aged 84) (Show more)\n\n“The Method of Fluxions and Infinite Series” (Show more)\n\nNewton’s laws of motion\n\nwhite light (Show more)\n\nScientific Revolution (Show more)\n\nIsaac Newton Institute of Mathematical Sciences - Who was Isaac Newton? (July 23, 2024) (Show more)\n\nSee all related content →\n\nWhat is Isaac Newton most famous for?\n\nAlthough Isaac Newton is well known for his discoveries in optics (white light composition) and mathematics (calculus), it is his formulation of the three laws of motion—the basic principles of modern physics—for which he is most famous. His formulation of the laws of motion resulted in the law of universal gravitation.\n\nHow was Isaac Newton educated?\n\nAfter interrupted attendance at the grammar school in Grantham, Lincolnshire, England, Isaac Newton finally settled down to prepare for university, going on to Trinity College, Cambridge, in 1661, somewhat older than his classmates. There he immersed himself in Aristotle’s work and discovered the works of René Descartes before graduating in 1665 with a bachelor’s degree.\n\nWhat was Isaac Newton’s childhood like?\n\nIsaac Newton was born to a widowed mother (his father died three months prior) and was not expected to survive, being tiny and weak. Shortly thereafter Newton was sent by his stepfather, the well-to-do minister Barnabas Smith, to live with his grandmother and was separated from his mother until Smith’s death in 1653.\n\nWhat did Isaac Newton write?\n\nIsaac Newton is widely known for his published work Philosophiae Naturalis Principia Mathematica (1687), commonly known as the Principia. His laws of motion first appeared in this work. It is one of the most important single works in the history of modern science.\n\nConsider how Isaac Newton's discovery of gravity led to a better understanding of planetary motion\n\nIsaac Newton's formulation of the law of universal gravitation.(more)See all videos for this article\n\nIsaac Newton (born December 25, 1642 [January 4, 1643, New Style], Woolsthorpe, Lincolnshire, England—died March 20 [March 31], 1727, London) was an English physicist and mathematician who was the culminating figure of the Scientific Revolution of the 17th century. In optics, his discovery of the composition of white light integrated the phenomena of colours into the science of light and laid the foundation for modern physical optics. In mechanics, his three laws of motion, the basic principles of modern physics, resulted in the formulation of the law of universal gravitation. In mathematics, he was the original discoverer of the infinitesimal calculus. Newton’s Philosophiae Naturalis Principia Mathematica (Mathematical Principles of Natural Philosophy, 1687) was one of the most important single works in the history of modern science.\n\nFormative influences\n\nBorn in the hamlet of Woolsthorpe, Newton was the only son of a local yeoman, also Isaac Newton, who had died three months before, and of Hannah Ayscough. That same year, at Arcetri near Florence, Galileo Galilei had died; Newton would eventually pick up his idea of a mathematical science of motion and bring his work to full fruition. A tiny and weak baby, Newton was not expected to survive his first day of life, much less 84 years. Deprived of a father before birth, he soon lost his mother as well, for within two years she married a second time; her husband, the well-to-do minister Barnabas Smith, left young Isaac with his grandmother and moved to a neighbouring village to raise a son and two daughters. For nine years, until the death of Barnabas Smith in 1653, Isaac was effectively separated from his mother, and his pronounced psychotic tendencies have been ascribed to this traumatic event. That he hated his stepfather we may be sure. When he examined the state of his soul in 1662 and compiled a catalog of sins in shorthand, he remembered “Threatning my father and mother Smith to burne them and the house over them.” The acute sense of insecurity that rendered him obsessively anxious when his work was published and irrationally violent when he defended it accompanied Newton throughout his life and can plausibly be traced to his early years.\n\nAfter his mother was widowed a second time, she determined that her first-born son should manage her now considerable property. It quickly became apparent, however, that this would be a disaster, both for the estate and for Newton. He could not bring himself to concentrate on rural affairs—set to watch the cattle, he would curl up under a tree with a book. Fortunately, the mistake was recognized, and Newton was sent back to the grammar school in Grantham, where he had already studied, to prepare for the university. As with many of the leading scientists of the age, he left behind in Grantham anecdotes about his mechanical ability and his skill in building models of machines, such as clocks and windmills. At the school he apparently gained a firm command of Latin but probably received no more than a smattering of arithmetic. By June 1661 he was ready to matriculate at Trinity College, Cambridge, somewhat older than the other undergraduates because of his interrupted education.\n\nInfluence of the Scientific Revolution\n\nWhen Newton arrived in Cambridge in 1661, the movement now known as the Scientific Revolution was well advanced, and many of the works basic to modern science had appeared. Astronomers from Nicolaus Copernicus to Johannes Kepler had elaborated the heliocentric system of the universe. Galileo had proposed the foundations of a new mechanics built on the principle of inertia. Led by René Descartes, philosophers had begun to formulate a new conception of nature as an intricate, impersonal, and inert machine. Yet as far as the universities of Europe, including Cambridge, were concerned, all this might well have never happened. They continued to be the strongholds of outmoded Aristotelianism, which rested on a geocentric view of the universe and dealt with nature in qualitative rather than quantitative terms.\n\nPhysics and Natural Law\n\nLike thousands of other undergraduates, Newton began his higher education by immersing himself in Aristotle’s work. Even though the new philosophy was not in the curriculum, it was in the air. Some time during his undergraduate career, Newton discovered the works of the French natural philosopher Descartes and the other mechanical philosophers, who, in contrast to Aristotle, viewed physical reality as composed entirely of particles of matter in motion and who held that all the phenomena of nature result from their mechanical interaction. A new set of notes, which he entitled “Quaestiones Quaedam Philosophicae” (“Certain Philosophical Questions”), begun sometime in 1664, usurped the unused pages of a notebook intended for traditional scholastic exercises; under the title he entered the slogan “Amicus Plato amicus Aristoteles magis amica veritas” (“Plato is my friend, Aristotle is my friend, but my best friend is truth”). Newton’s scientific career had begun.\n\nThe “Quaestiones” reveal that Newton had discovered the new conception of nature that provided the framework of the Scientific Revolution. He had thoroughly mastered the works of Descartes and had also discovered that the French philosopher Pierre Gassendi had revived atomism, an alternative mechanical system to explain nature. The “Quaestiones” also reveal that Newton already was inclined to find the latter a more attractive philosophy than Cartesian natural philosophy, which rejected the existence of ultimate indivisible particles. The works of the 17th-century chemist Robert Boyle provided the foundation for Newton’s considerable work in chemistry. Significantly, he had read Henry More, the Cambridge Platonist, and was thereby introduced to another intellectual world, the magical Hermetic tradition, which sought to explain natural phenomena in terms of alchemical and magical concepts. The two traditions of natural philosophy, the mechanical and the Hermetic, antithetical though they appear, continued to influence his thought and in their tension supplied the fundamental theme of his scientific career.\n\nAre you a student? Get a special academic rate on Britannica Premium. Learn More\n\nAlthough he did not record it in the “Quaestiones,” Newton had also begun his mathematical studies. He again started with Descartes, from whose La Géometrie he branched out into the other literature of modern analysis with its application of algebraic techniques to problems of geometry. He then reached back for the support of classical geometry. Within little more than a year, he had mastered the literature; and, pursuing his own line of analysis, he began to move into new territory. He discovered the binomial theorem, and he developed the calculus, a more powerful form of analysis that employs infinitesimal considerations in finding the slopes of curves and areas under curves.\n\nBy 1669 Newton was ready to write a tract summarizing his progress, De Analysi per Aequationes Numeri Terminorum Infinitas (“On Analysis by Infinite Series”), which circulated in manuscript through a limited circle and made his name known. During the next two years he revised it as De methodis serierum et fluxionum (“On the Methods of Series and Fluxions”). The word fluxions, Newton’s private rubric, indicates that the calculus had been born. Despite the fact that only a handful of savants were even aware of Newton’s existence, he had arrived at the point where he had become the leading mathematician in Europe.\n\nWork during the plague years\n\nWho created the color wheel?\n\nFor millennia, many believed Aristotle's theory that all colors were a mixture of black and white. How did we learn otherwise?(more)See all videos for this article\n\nWhen Newton received the bachelor’s degree in April 1665, the most remarkable undergraduate career in the history of university education had passed unrecognized. On his own, without formal guidance, he had sought out the new philosophy and the new mathematics and made them his own, but he had confined the progress of his studies to his notebooks. Then, in 1665, the plague closed the university, and for most of the following two years he was forced to stay at his home, contemplating at leisure what he had learned. During the plague years Newton laid the foundations of the calculus and extended an earlier insight into an essay, “Of Colours,” which contains most of the ideas elaborated in his Opticks. It was during this time that he examined the elements of circular motion and, applying his analysis to the Moon and the planets, derived the inverse square relation that the radially directed force acting on a planet decreases with the square of its distance from the Sun—which was later crucial to the law of universal gravitation. The world heard nothing of these discoveries." - timestamp: '2024-08-15T20:57:35.0000000+04:00' + timestamp: '2024-08-15T20:57:35.0000000+00:00' title: 'Isaac Newton | Biography, Facts, Discoveries, Laws, & Inventions | Britannica' url: https://www.britannica.com/biography/Isaac-Newton - id: web-search_1 snippet: "Sir Isaac Newton FRS (25 December 1642 – 20 March 1726/27) was an English polymath active as a mathematician, physicist, astronomer, alchemist, theologian, and author who was described in his time as a natural philosopher. He was a key figure in the Scientific Revolution and the Enlightenment that followed. His pioneering book Philosophiæ Naturalis Principia Mathematica (Mathematical Principles of Natural Philosophy), first published in 1687, consolidated many previous results and established classical mechanics. Newton also made seminal contributions to optics, and shares credit with German mathematician Gottfried Wilhelm Leibniz for formulating infinitesimal calculus, though he developed calculus years before Leibniz.\n\nIn the Principia, Newton formulated the laws of motion and universal gravitation that formed the dominant scientific viewpoint for centuries until it was superseded by the theory of relativity. He used his mathematical description of gravity to derive Kepler's laws of planetary motion, account for tides, the trajectories of comets, the precession of the equinoxes and other phenomena, eradicating doubt about the Solar System's heliocentricity. He demonstrated that the motion of objects on Earth and celestial bodies could be accounted for by the same principles. Newton's inference that the Earth is an oblate spheroid was later confirmed by the geodetic measurements of Maupertuis, La Condamine, and others, convincing most European scientists of the superiority of Newtonian mechanics over earlier systems.\n\nHe built the first practical reflecting telescope and developed a sophisticated theory of colour based on the observation that a prism separates white light into the colours of the visible spectrum. His work on light was collected in his highly influential book Opticks, published in 1704. He formulated an empirical law of cooling, which was the first heat transfer formulation, made the first theoretical calculation of the speed of sound, and introduced the notion of a Newtonian fluid. Furthermore, he made early investigations into electricity, with an idea from his book Opticks arguably the beginning of the field theory of the electric force. In addition to his work on calculus, as a mathematician, he contributed to the study of power series, generalised the binomial theorem to non-integer exponents, developed a method for approximating the roots of a function, and classified most of the cubic plane curves.\n\nNewton was a fellow of Trinity College and the second Lucasian Professor of Mathematics at the University of Cambridge. He was a devout but unorthodox Christian who privately rejected the doctrine of the Trinity. He refused to take holy orders in the Church of England, unlike most members of the Cambridge faculty of the day. Beyond his work on the mathematical sciences, Newton dedicated much of his time to the study of alchemy and biblical chronology, but most of his work in those areas remained unpublished until long after his death. Politically and personally tied to the Whig party, Newton served two brief terms as Member of Parliament for the University of Cambridge, in 1689–1690 and 1701–1702. He was knighted by Queen Anne in 1705 and spent the last three decades of his life in London, serving as Warden (1696–1699) and Master (1699–1727) of the Royal Mint, as well as president of the Royal Society (1703–1727).\n\nIsaac Newton was born (according to the Julian calendar in use in England at the time) on Christmas Day, 25 December 1642 (NS 4 January 1643) at Woolsthorpe Manor in Woolsthorpe-by-Colsterworth, a hamlet in the county of Lincolnshire. His father, also named Isaac Newton, had died three months before. Born prematurely, Newton was a small child; his mother Hannah Ayscough reportedly said that he could have fit inside a quart mug. When Newton was three, his mother remarried and went to live with her new husband, the Reverend Barnabas Smith, leaving her son in the care of his maternal grandmother, Margery Ayscough (née Blythe). Newton disliked his stepfather and maintained some enmity towards his mother for marrying him, as revealed by this entry in a list of sins committed up to the age of 19: \"Threatening my father and mother Smith to burn them and the house over them.\" Newton's mother had three children (Mary, Benjamin, and Hannah) from her second marriage.\n\nFrom the age of about twelve until he was seventeen, Newton was educated at The King's School in Grantham, which taught Latin and Ancient Greek and probably imparted a significant foundation of mathematics. He was removed from school by his mother and returned to Woolsthorpe-by-Colsterworth by October 1659. His mother, widowed for the second time, attempted to make him a farmer, an occupation he hated. Henry Stokes, master at The King's School, persuaded his mother to send him back to school. Motivated partly by a desire for revenge against a schoolyard bully, he became the top-ranked student, distinguishing himself mainly by building sundials and models of windmills.\n\nUniversity of Cambridge\n\nIn June 1661, Newton was admitted to Trinity College at the University of Cambridge. His uncle the Reverend William Ayscough, who had studied at Cambridge, recommended him to the university. At Cambridge, Newton started as a subsizar, paying his way by performing valet duties until he was awarded a scholarship in 1664, which covered his university costs for four more years until the completion of his MA. At the time, Cambridge's teachings were based on those of Aristotle, whom Newton read along with then more modern philosophers, including Descartes and astronomers such as Galileo Galilei and Thomas Street. He set down in his notebook a series of \"Quaestiones\" about mechanical philosophy as he found it. In 1665, he discovered the generalised binomial theorem and began to develop a mathematical theory that later became calculus. Soon after Newton obtained his BA degree at Cambridge in August 1665, the university temporarily closed as a precaution against the Great Plague.\n\nAlthough he had been undistinguished as a Cambridge student, Newton's private studies at his home in Woolsthorpe over the next two years saw the development of his theories on calculus, optics, and the law of gravitation.\n\nIn April 1667, Newton returned to the University of Cambridge, and in October he was elected as a fellow of Trinity. Fellows were required to take holy orders and be ordained as Anglican priests, although this was not enforced in the Restoration years, and an assertion of conformity to the Church of England was sufficient. He made the commitment that \"I will either set Theology as the object of my studies and will take holy orders when the time prescribed by these statutes [7 years] arrives, or I will resign from the college.\" Up until this point he had not thought much about religion and had twice signed his agreement to the Thirty-nine Articles, the basis of Church of England doctrine. By 1675 the issue could not be avoided, and by then his unconventional views stood in the way.\n\nHis academic work impressed the Lucasian professor Isaac Barrow, who was anxious to develop his own religious and administrative potential (he became master of Trinity College two years later); in 1669, Newton succeeded him, only one year after receiving his MA. The terms of the Lucasian professorship required that the holder not be active in the church – presumably to leave more time for science. Newton argued that this should exempt him from the ordination requirement, and King Charles II, whose permission was needed, accepted this argument; thus, a conflict between Newton's religious views and Anglican orthodoxy was averted.\n\nThe Lucasian Professor of Mathematics at Cambridge position included the responsibility of instructing geography. In 1672, and again in 1681, Newton published a revised, corrected, and amended edition of the Geographia Generalis, a geography textbook first published in 1650 by the then-deceased Bernhardus Varenius. In the Geographia Generalis, Varenius attempted to create a theoretical foundation linking scientific principles to classical concepts in geography, and considered geography to be a mix between science and pure mathematics applied to quantifying features of the Earth. While it is unclear if Newton ever lectured in geography, the 1733 Dugdale and Shaw English translation of the book stated Newton published the book to be read by students while he lectured on the subject. The Geographia Generalis is viewed by some as the dividing line between ancient and modern traditions in the history of geography, and Newton's involvement in the subsequent editions is thought to be a large part of the reason for this enduring legacy.\n\nNewton was elected a Fellow of the Royal Society (FRS) in 1672.\n\nNewton's work has been said \"to distinctly advance every branch of mathematics then studied\". His work on the subject, usually referred to as fluxions or calculus, seen in a manuscript of October 1666, is now published among Newton's mathematical papers. His work De analysi per aequationes numero terminorum infinitas, sent by Isaac Barrow to John Collins in June 1669, was identified by Barrow in a letter sent to Collins that August as the work \"of an extraordinary genius and proficiency in these things\". Newton later became involved in a dispute with Leibniz over priority in the development of calculus. Most modern historians believe that Newton and Leibniz developed calculus independently, although with very different mathematical notations. However, it is established that Newton came to develop calculus much earlier than Leibniz. Leibniz's notation and \"differential Method\", nowadays recognised as much more convenient notations, were adopted by continental European mathematicians, and after 1820 or so, also by British mathematicians.\n\nHis work extensively uses calculus in geometric form based on limiting values of the ratios of vanishingly small quantities: in the Principia itself, Newton gave demonstration of this under the name of \"the method of first and last ratios\" and explained why he put his expositions in this form, remarking also that \"hereby the same thing is performed as by the method of indivisibles.\" Because of this, the Principia has been called \"a book dense with the theory and application of the infinitesimal calculus\" in modern times and in Newton's time \"nearly all of it is of this calculus.\" His use of methods involving \"one or more orders of the infinitesimally small\" is present in his De motu corporum in gyrum of 1684 and in his papers on motion \"during the two decades preceding 1684\".\n\nNewton had been reluctant to publish his calculus because he feared controversy and criticism. He was close to the Swiss mathematician Nicolas Fatio de Duillier. In 1691, Duillier started to write a new version of Newton's Principia, and corresponded with Leibniz. In 1693, the relationship between Duillier and Newton deteriorated and the book was never completed. Starting in 1699, other members of the Royal Society accused Leibniz of plagiarism. The dispute then broke out in full force in 1711 when the Royal Society proclaimed in a study that it was Newton who was the true discoverer and labelled Leibniz a fraud; it was later found that Newton wrote the study's concluding remarks on Leibniz. Thus began the bitter controversy which marred the lives of both Newton and Leibniz until the latter's death in 1716.\n\nNewton is generally credited with the generalised binomial theorem, valid for any exponent. He discovered Newton's identities, Newton's method, classified cubic plane curves (polynomials of degree three in two variables), made substantial contributions to the theory of finite differences, and was the first to use fractional indices and to employ coordinate geometry to derive solutions to Diophantine equations. He approximated partial sums of the harmonic series by logarithms (a precursor to Euler's summation formula) and was the first to use power series with confidence and to revert power series. Newton's work on infinite series was inspired by Simon Stevin's decimals.\n\nIn 1666, Newton observed that the spectrum of colours exiting a prism in the position of minimum deviation is oblong, even when the light ray entering the prism is circular, which is to say, the prism refracts different colours by different angles. This led him to conclude that colour is a property intrinsic to light – a point which had, until then, been a matter of debate.\n\nFrom 1670 to 1672, Newton lectured on optics. During this period he investigated the refraction of light, demonstrating that the multicoloured image produced by a prism, which he named a spectrum, could be recomposed into white light by a lens and a second prism. Modern scholarship has revealed that Newton's analysis and resynthesis of white light owes a debt to corpuscular alchemy.\n\nHe showed that coloured light does not change its properties by separating out a coloured beam and shining it on various objects, and that regardless of whether reflected, scattered, or transmitted, the light remains the same colour. Thus, he observed that colour is the result of objects interacting with already-coloured light rather than objects generating the colour themselves. This is known as Newton's theory of colour.\n\nFrom this work, he concluded that the lens of any refracting telescope would suffer from the dispersion of light into colours (chromatic aberration). As a proof of the concept, he constructed a telescope using reflective mirrors instead of lenses as the objective to bypass that problem. Building the design, the first known functional reflecting telescope, today known as a Newtonian telescope, involved solving the problem of a suitable mirror material and shaping technique. Newton ground his own mirrors out of a custom composition of highly reflective speculum metal, using Newton's rings to judge the quality of the optics for his telescopes. In late 1668, he was able to produce this first reflecting telescope. It was about eight inches long and it gave a clearer and larger image. In 1671, the Royal Society asked for a demonstration of his reflecting telescope. Their interest encouraged him to publish his notes, Of Colours, which he later expanded into the work Opticks. When Robert Hooke criticised some of Newton's ideas, Newton was so offended that he withdrew from public debate. Newton and Hooke had brief exchanges in 1679–80, when Hooke, appointed to manage the Royal Society's correspondence, opened up a correspondence intended to elicit contributions from Newton to Royal Society transactions, which had the effect of stimulating Newton to work out a proof that the elliptical form of planetary orbits would result from a centripetal force inversely proportional to the square of the radius vector. But the two men remained generally on poor terms until Hooke's death.\n\nNewton argued that light is composed of particles or corpuscles, which were refracted by accelerating into a denser medium. He verged on soundlike waves to explain the repeated pattern of reflection and transmission by thin films (Opticks Bk. II, Props. 12), but still retained his theory of 'fits' that disposed corpuscles to be reflected or transmitted (Props.13). However, later physicists favoured a purely wavelike explanation of light to account for the interference patterns and the general phenomenon of diffraction. Today's quantum mechanics, photons, and the idea of wave–particle duality bear only a minor resemblance to Newton's understanding of light.\n\nIn his Hypothesis of Light of 1675, Newton posited the existence of the ether to transmit forces between particles. The contact with the Cambridge Platonist philosopher Henry More revived his interest in alchemy. He replaced the ether with occult forces based on Hermetic ideas of attraction and repulsion between particles. John Maynard Keynes, who acquired many of Newton's writings on alchemy, stated that \"Newton was not the first of the age of reason: He was the last of the magicians.\" Newton's contributions to science cannot be isolated from his interest in alchemy. This was at a time when there was no clear distinction between alchemy and science.\n\nIn 1704, Newton published Opticks, in which he expounded his corpuscular theory of light. He considered light to be made up of extremely subtle corpuscles, that ordinary matter was made of grosser corpuscles and speculated that through a kind of alchemical transmutation \"Are not gross Bodies and Light convertible into one another, ... and may not Bodies receive much of their Activity from the Particles of Light which enter their Composition?\" Newton also constructed a primitive form of a frictional electrostatic generator, using a glass globe.\n\nIn his book Opticks, Newton was the first to show a diagram using a prism as a beam expander, and also the use of multiple-prism arrays. Some 278 years after Newton's discussion, multiple-prism beam expanders became central to the development of narrow-linewidth tunable lasers. Also, the use of these prismatic beam expanders led to the multiple-prism dispersion theory.\n\nSubsequent to Newton, much has been amended. Young and Fresnel discarded Newton's particle theory in favour of Huygens' wave theory to show that colour is the visible manifestation of light's wavelength. Science also slowly came to realise the difference between perception of colour and mathematisable optics. The German poet and scientist, Goethe, could not shake the Newtonian foundation but \"one hole Goethe did find in Newton's armour, ... Newton had committed himself to the doctrine that refraction without colour was impossible. He, therefore, thought that the object-glasses of telescopes must forever remain imperfect, achromatism and refraction being incompatible. This inference was proved by Dollond to be wrong.\"\n\nNewton had been developing his theory of gravitation as far back as 1665. In 1679, Newton returned to his work on celestial mechanics by considering gravitation and its effect on the orbits of planets with reference to Kepler's laws of planetary motion. This followed stimulation by a brief exchange of letters in 1679–80 with Hooke, who had been appointed Secretary of the Royal Society, and who opened a correspondence intended to elicit contributions from Newton to Royal Society transactions. Newton's reawakening interest in astronomical matters received further stimulus by the appearance of a comet in the winter of 1680–1681, on which he corresponded with John Flamsteed. After the exchanges with Hooke, Newton worked out a proof that the elliptical form of planetary orbits would result from a centripetal force inversely proportional to the square of the radius vector. Newton communicated his results to Edmond Halley and to the Royal Society in De motu corporum in gyrum, a tract written on about nine sheets which was copied into the Royal Society's Register Book in December 1684. This tract contained the nucleus that Newton developed and expanded to form the Principia.\n\nThe Principia was published on 5 July 1687 with encouragement and financial help from Halley. In this work, Newton stated the three universal laws of motion. Together, these laws describe the relationship between any object, the forces acting upon it and the resulting motion, laying the foundation for classical mechanics. They contributed to many advances during the Industrial Revolution which soon followed and were not improved upon for more than 200 years. Many of these advances continue to be the underpinnings of non-relativistic technologies in the modern world. He used the Latin word gravitas (weight) for the effect that would become known as gravity, and defined the law of universal gravitation.\n\nIn the same work, Newton presented a calculus-like method of geometrical analysis using 'first and last ratios', gave the first analytical determination (based on Boyle's law) of the speed of sound in air, inferred the oblateness of Earth's spheroidal figure, accounted for the precession of the equinoxes as a result of the Moon's gravitational attraction on the Earth's oblateness, initiated the gravitational study of the irregularities in the motion of the Moon, provided a theory for the determination of the orbits of comets, and much more. Newton's biographer David Brewster reported that the complexity of applying his theory of gravity to the motion of the moon was so great it affected Newton's health: \"[H]e was deprived of his appetite and sleep\" during his work on the problem in 1692–93, and told the astronomer John Machin that \"his head never ached but when he was studying the subject\". According to Brewster, Edmund Halley also told John Conduitt that when pressed to complete his analysis Newton \"always replied that it made his head ache, and kept him awake so often, that he would think of it no more\". [Emphasis in original]\n\nNewton made clear his heliocentric view of the Solar System—developed in a somewhat modern way because already in the mid-1680s he recognised the \"deviation of the Sun\" from the centre of gravity of the Solar System. For Newton, it was not precisely the centre of the Sun or any other body that could be considered at rest, but rather \"the common centre of gravity of the Earth, the Sun and all the Planets is to be esteem'd the Centre of the World\", and this centre of gravity \"either is at rest or moves uniformly forward in a right line\". (Newton adopted the \"at rest\" alternative in view of common consent that the centre, wherever it was, was at rest.)\n\nNewton was criticised for introducing \"occult agencies\" into science because of his postulate of an invisible force able to act over vast distances. Later, in the second edition of the Principia (1713), Newton firmly rejected such criticisms in a concluding General Scholium, writing that it was enough that the phenomena implied a gravitational attraction, as they did; but they did not so far indicate its cause, and it was both unnecessary and improper to frame hypotheses of things that were not implied by the phenomena. (Here Newton used what became his famous expression \"Hypotheses non fingo\".)\n\nWith the Principia, Newton became internationally recognised. He acquired a circle of admirers, including the Swiss-born mathematician Nicolas Fatio de Duillier.\n\nIn 1710, Newton found 72 of the 78 \"species\" of cubic curves and categorised them into four types. In 1717, and probably with Newton's help, James Stirling proved that every cubic was one of these four types. Newton also claimed that the four types could be obtained by plane projection from one of them, and this was proved in 1731, four years after his death.\n\nIn the 1690s, Newton wrote a number of religious tracts dealing with the literal and symbolic interpretation of the Bible. A manuscript Newton sent to John Locke in which he disputed the fidelity of 1 John 5:7—the Johannine Comma—and its fidelity to the original manuscripts of the New Testament, remained unpublished until 1785.\n\nNewton was also a member of the Parliament of England for Cambridge University in 1689 and 1701, but according to some accounts his only comments were to complain about a cold draught in the chamber and request that the window be closed. He was, however, noted by Cambridge diarist Abraham de la Pryme to have rebuked students who were frightening locals by claiming that a house was haunted.\n\nNewton moved to London to take up the post of warden of the Royal Mint during the reign of King William III in 1696, a position that he had obtained through the patronage of Charles Montagu, 1st Earl of Halifax, then Chancellor of the Exchequer. He took charge of England's great recoining, trod on the toes of Lord Lucas, Governor of the Tower, and secured the job of deputy comptroller of the temporary Chester branch for Edmond Halley. Newton became perhaps the best-known Master of the Mint upon the death of Thomas Neale in 1699, a position Newton held for the last 30 years of his life. These appointments were intended as sinecures, but Newton took them seriously. He retired from his Cambridge duties in 1701, and exercised his authority to reform the currency and punish clippers and counterfeiters.\n\nAs Warden, and afterwards as Master, of the Royal Mint, Newton estimated that 20 percent of the coins taken in during the Great Recoinage of 1696 were counterfeit. Counterfeiting was high treason, punishable by the felon being hanged, drawn and quartered. Despite this, convicting even the most flagrant criminals could be extremely difficult, but Newton proved equal to the task.\n\nDisguised as a habitué of bars and taverns, he gathered much of that evidence himself. For all the barriers placed to prosecution, and separating the branches of government, English law still had ancient and formidable customs of authority. Newton had himself made a justice of the peace in all the home counties. A draft letter regarding the matter is included in Newton's personal first edition of Philosophiæ Naturalis Principia Mathematica, which he must have been amending at the time. Then he conducted more than 100 cross-examinations of witnesses, informers, and suspects between June 1698 and Christmas 1699. Newton successfully prosecuted 28 coiners.\n\nNewton was made president of the Royal Society in 1703 and an associate of the French Académie des Sciences. In his position at the Royal Society, Newton made an enemy of John Flamsteed, the Astronomer Royal, by prematurely publishing Flamsteed's Historia Coelestis Britannica, which Newton had used in his studies.\n\nIn April 1705, Queen Anne knighted Newton during a royal visit to Trinity College, Cambridge. The knighthood is likely to have been motivated by political considerations connected with the parliamentary election in May 1705, rather than any recognition of Newton's scientific work or services as Master of the Mint. Newton was the second scientist to be knighted, after Francis Bacon.\n\nAs a result of a report written by Newton on 21 September 1717 to the Lords Commissioners of His Majesty's Treasury, the bimetallic relationship between gold coins and silver coins was changed by royal proclamation on 22 December 1717, forbidding the exchange of gold guineas for more than 21 silver shillings. This inadvertently resulted in a silver shortage as silver coins were used to pay for imports, while exports were paid for in gold, effectively moving Britain from the silver standard to its first gold standard. It is a matter of debate as to whether he intended to do this or not. It has been argued that Newton conceived of his work at the Mint as a continuation of his alchemical work.\n\nNewton was invested in the South Sea Company and lost some £20,000 (£4.4 million in 2020) when it collapsed in around 1720.\n\nToward the end of his life, Newton took up residence at Cranbury Park, near Winchester, with his niece and her husband, until his death. His half-niece, Catherine Barton, served as his hostess in social affairs at his house on Jermyn Street in London; he was her \"very loving Uncle\", according to his letter to her when she was recovering from smallpox.\n\nNewton died in his sleep in London on 20 March 1727 (OS 20 March 1726; NS 31 March 1727). He was given a ceremonial funeral, attended by nobles, scientists, and philosophers, and was buried in Westminster Abbey among kings and queens. He was the first scientist to be buried in the abbey. Voltaire may have been present at his funeral. A bachelor, he had divested much of his estate to relatives during his last years, and died intestate. His papers went to John Conduitt and Catherine Barton.\n\nShortly after his death, a plaster death mask was moulded of Newton. It was used by Flemish sculptor John Michael Rysbrack in making a sculpture of Newton. It is now held by the Royal Society, who created a 3D scan of it in 2012.\n\nNewton's hair was posthumously examined and found to contain mercury, probably resulting from his alchemical pursuits. Mercury poisoning could explain Newton's eccentricity in late life.\n\nAlthough it was claimed that he was once engaged, Newton never married. The French writer and philosopher Voltaire, who was in London at the time of Newton's funeral, said that he \"was never sensible to any passion, was not subject to the common frailties of mankind, nor had any commerce with women—a circumstance which was assured me by the physician and surgeon who attended him in his last moments.” There exists a widespread belief that Newton died a virgin, and writers as diverse as mathematician Charles Hutton, economist John Maynard Keynes, and physicist Carl Sagan have commented on it.\n\nNewton had a close friendship with the Swiss mathematician Nicolas Fatio de Duillier, whom he met in London around 1689—some of their correspondence has survived. Their relationship came to an abrupt and unexplained end in 1693, and at the same time Newton suffered a nervous breakdown, which included sending wild accusatory letters to his friends Samuel Pepys and John Locke. His note to the latter included the charge that Locke had endeavoured to \"embroil\" him with \"woemen & by other means\".\n\nNewton was relatively modest about his achievements, writing in a letter to Robert Hooke in February 1676, \"If I have seen further it is by standing on the shoulders of giants.\" Two writers think that the sentence, written at a time when Newton and Hooke were in dispute over optical discoveries, was an oblique attack on Hooke (said to have been short and hunchbacked), rather than—or in addition to—a statement of modesty. On the other hand, the widely known proverb about standing on the shoulders of giants, published among others by seventeenth-century poet George Herbert (a former orator of the University of Cambridge and fellow of Trinity College) in his Jacula Prudentum (1651), had as its main point that \"a dwarf on a giant's shoulders sees farther of the two\", and so its effect as an analogy would place Newton himself rather than Hooke as the 'dwarf'.\n\nIn a later memoir, Newton wrote, \"I do not know what I may appear to the world, but to myself I seem to have been only like a boy playing on the sea-shore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me.\"\n\nAlthough born into an Anglican family, by his thirties Newton held a Christian faith that, had it been made public, would not have been considered orthodox by mainstream Christianity, with one historian labelling him a heretic.\n\nBy 1672, he had started to record his theological researches in notebooks which he showed to no one and which have only been available for public examination since 1972. Over half of what Newton wrote concerned theology and alchemy, and most has never been printed. His writings demonstrate an extensive knowledge of early Church writings and show that in the conflict between Athanasius and Arius which defined the Creed, he took the side of Arius, the loser, who rejected the conventional view of the Trinity. Newton \"recognized Christ as a divine mediator between God and man, who was subordinate to the Father who created him.\" He was especially interested in prophecy, but for him, \"the great apostasy was trinitarianism.\"\n\nNewton tried unsuccessfully to obtain one of the two fellowships that exempted the holder from the ordination requirement. At the last moment in 1675 he received a dispensation from the government that excused him and all future holders of the Lucasian chair.\n\nIn Newton's eyes, worshipping Christ as God was idolatry, to him the fundamental sin. In 1999, historian Stephen D. Snobelen wrote, \"Isaac Newton was a heretic. But ... he never made a public declaration of his private faith—which the orthodox would have deemed extremely radical. He hid his faith so well that scholars are still unraveling his personal beliefs.\" Snobelen concludes that Newton was at least a Socinian sympathiser (he owned and had thoroughly read at least eight Socinian books), possibly an Arian and almost certainly an anti-trinitarian.\n\nAlthough the laws of motion and universal gravitation became Newton's best-known discoveries, he warned against using them to view the Universe as a mere machine, as if akin to a great clock. He said, \"So then gravity may put the planets into motion, but without the Divine Power it could never put them into such a circulating motion, as they have about the sun\".\n\nAlong with his scientific fame, Newton's studies of the Bible and of the early Church Fathers were also noteworthy. Newton wrote works on textual criticism, most notably An Historical Account of Two Notable Corruptions of Scripture and Observations upon the Prophecies of Daniel, and the Apocalypse of St. John. He placed the crucifixion of Jesus Christ at 3 April, AD 33, which agrees with one traditionally accepted date.\n\nHe believed in a rationally immanent world, but he rejected the hylozoism implicit in Leibniz and Baruch Spinoza. The ordered and dynamically informed Universe could be understood, and must be understood, by an active reason. In his correspondence, Newton claimed that in writing the Principia \"I had an eye upon such Principles as might work with considering men for the belief of a Deity\". He saw evidence of design in the system of the world: \"Such a wonderful uniformity in the planetary system must be allowed the effect of choice\". But Newton insisted that divine intervention would eventually be required to reform the system, due to the slow growth of instabilities. For this, Leibniz lampooned him: \"God Almighty wants to wind up his watch from time to time: otherwise it would cease to move. He had not, it seems, sufficient foresight to make it a perpetual motion.\"\n\nNewton's position was vigorously defended by his follower Samuel Clarke in a famous correspondence. A century later, Pierre-Simon Laplace's work Celestial Mechanics had a natural explanation for why the planet orbits do not require periodic divine intervention. The contrast between Laplace's mechanistic worldview and Newton's one is the most strident considering the famous answer which the French scientist gave Napoleon, who had criticised him for the absence of the Creator in the Mécanique céleste: \"Sire, j'ai pu me passer de cette hypothèse\" (\"Sir, I didn't need this hypothesis\").\n\nScholars long debated whether Newton disputed the doctrine of the Trinity. His first biographer, David Brewster, who compiled his manuscripts, interpreted Newton as questioning the veracity of some passages used to support the Trinity, but never denying the doctrine of the Trinity as such. In the twentieth century, encrypted manuscripts written by Newton and bought by John Maynard Keynes (among others) were deciphered and it became known that Newton did indeed reject Trinitarianism.\n\nNewton and Robert Boyle's approach to the mechanical philosophy was promoted by rationalist pamphleteers as a viable alternative to the pantheists and enthusiasts, and was accepted hesitantly by orthodox preachers as well as dissident preachers like the latitudinarians. The clarity and simplicity of science was seen as a way to combat the emotional and metaphysical superlatives of both superstitious enthusiasm and the threat of atheism, and at the same time, the second wave of English deists used Newton's discoveries to demonstrate the possibility of a \"Natural Religion\".\n\nThe attacks made against pre-Enlightenment \"magical thinking\", and the mystical elements of Christianity, were given their foundation with Boyle's mechanical conception of the universe. Newton gave Boyle's ideas their completion through mathematical proofs and, perhaps more importantly, was very successful in popularising them.\n\nNewton was not the first of the age of reason. He was the last of the magicians, the last of the Babylonians and Sumerians, the last great mind which looked out on the visible and intellectual world with the same eyes as those who began to build our intellectual inheritance rather less than 10,000 years ago. Isaac Newton, a posthumous child born with no father on Christmas Day, 1642, was the last wonderchild to whom the Magi could do sincere and appropriate homage.\n\n–John Maynard Keynes, \"Newton, the Man\"\n\nOf an estimated ten million words of writing in Newton's papers, about one million deal with alchemy. Many of Newton's writings on alchemy are copies of other manuscripts, with his own annotations. Alchemical texts mix artisanal knowledge with philosophical speculation, often hidden behind layers of wordplay, allegory, and imagery to protect craft secrets. Some of the content contained in Newton's papers could have been considered heretical by the church.\n\nIn 1888, after spending sixteen years cataloguing Newton's papers, Cambridge University kept a small number and returned the rest to the Earl of Portsmouth. In 1936, a descendant offered the papers for sale at Sotheby's. The collection was broken up and sold for a total of about £9,000. John Maynard Keynes was one of about three dozen bidders who obtained part of the collection at auction. Keynes went on to reassemble an estimated half of Newton's collection of papers on alchemy before donating his collection to Cambridge University in 1946.\n\nAll of Newton's known writings on alchemy are currently being put online in a project undertaken by Indiana University: \"The Chymistry of Isaac Newton\" and summarised in a book.\n\nNewton's fundamental contributions to science include the quantification of gravitational attraction, the discovery that white light is actually a mixture of immutable spectral colors, and the formulation of the calculus. Yet there is another, more mysterious side to Newton that is imperfectly known, a realm of activity that spanned some thirty years of his life, although he kept it largely hidden from his contemporaries and colleagues. We refer to Newton's involvement in the discipline of alchemy, or as it was often called in seventeenth-century England, \"chymistry.\"\n\nIn June 2020, two unpublished pages of Newton's notes on Jan Baptist van Helmont's book on plague, De Peste, were being auctioned online by Bonhams. Newton's analysis of this book, which he made in Cambridge while protecting himself from London's 1665–1666 infection, is the most substantial written statement he is known to have made about the plague, according to Bonhams. As far as the therapy is concerned, Newton writes that \"the best is a toad suspended by the legs in a chimney for three days, which at last vomited up earth with various insects in it, on to a dish of yellow wax, and shortly after died. Combining powdered toad with the excretions and serum made into lozenges and worn about the affected area drove away the contagion and drew out the poison\".\n\nThe mathematician Joseph-Louis Lagrange said that Newton was the greatest genius who ever lived, and once added that Newton was also \"the most fortunate, for we cannot find more than once a system of the world to establish.\" English poet Alexander Pope wrote the famous epitaph:\n\nNature, and Nature's laws lay hid in night. God said, Let Newton be! and all was light.\n\nBut this was not allowed to be inscribed in Newton's monument at Westminster. The epitaph added is as follows:\n\nH. S. E. ISAACUS NEWTON Eques Auratus, / Qui, animi vi prope divinâ, / Planetarum Motus, Figuras, / Cometarum semitas, Oceanique Aestus. Suâ Mathesi facem praeferente / Primus demonstravit: / Radiorum Lucis dissimilitudines, / Colorumque inde nascentium proprietates, / Quas nemo antea vel suspicatus erat, pervestigavit. / Naturae, Antiquitatis, S. Scripturae, / Sedulus, sagax, fidus Interpres / Dei O. M. Majestatem Philosophiâ asseruit, / Evangelij Simplicitatem Moribus expressit. / Sibi gratulentur Mortales, / Tale tantumque exstitisse / HUMANI GENERIS DECUS. / NAT. XXV DEC. A.D. MDCXLII. OBIIT. XX. MAR. MDCCXXVI,\n\nwhich can be translated as follows:\n\nHere is buried Isaac Newton, Knight, who by a strength of mind almost divine, and mathematical principles peculiarly his own, explored the course and figures of the planets, the paths of comets, the tides of the sea, the dissimilarities in rays of light, and, what no other scholar has previously imagined, the properties of the colours thus produced. Diligent, sagacious and faithful, in his expositions of nature, antiquity and the holy Scriptures, he vindicated by his philosophy the majesty of God mighty and good, and expressed the simplicity of the Gospel in his manners. Mortals rejoice that there has existed such and so great an ornament of the human race! He was born on 25th December 1642, and died on 20th March 1726.\n\nIn a 2005 survey of members of Britain's Royal Society (formerly headed by Newton) asking who had the greater effect on the history of science, Newton or Albert Einstein, the members deemed Newton to have made the greater overall contribution. In 1999, an opinion poll of 100 of the day's leading physicists voted Einstein the \"greatest physicist ever,\" with Newton the runner-up, while a parallel survey of rank-and-file physicists by the site PhysicsWeb gave the top spot to Newton. New Scientist called Newton \"the supreme genius and most enigmatic character in the history of science\". Newton has been called the \"most influential figure in the history of Western science\". Einstein kept a picture of Newton on his study wall alongside ones of Michael Faraday and James Clerk Maxwell.\n\nPhysicist Lev Landau ranked physicists on a logarithmic scale of productivity ranging from 0 to 5. The highest ranking, 0, was assigned to Newton. Albert Einstein was ranked 0.5. A rank of 1 was awarded to the \"founding fathers\" of quantum mechanics, Niels Bohr, Werner Heisenberg, Paul Dirac and Erwin Schrödinger. Landau, a Nobel prize winner and discoverer of superfluidity, ranked himself as 2.\n\nThe SI derived unit of force is named the newton in his honour.\n\nWoolsthorpe Manor is a Grade I listed building by Historic England through being his birthplace and \"where he discovered gravity and developed his theories regarding the refraction of light\".\n\nIn 1816, a tooth said to have belonged to Newton was sold for £730 in London to an aristocrat who had it set in a ring. Guinness World Records 2002 classified it as the most valuable tooth in the world, which would value approximately £25,000 (US$35,700) in late 2001. Who bought it and who currently has it has not been disclosed.\n\nNewton himself often told the story that he was inspired to formulate his theory of gravitation by watching the fall of an apple from a tree. The story is believed to have passed into popular knowledge after being related by Catherine Barton, Newton's niece, to Voltaire. Voltaire then wrote in his Essay on Epic Poetry (1727), \"Sir Isaac Newton walking in his gardens, had the first thought of his system of gravitation, upon seeing an apple falling from a tree.\"\n\nAlthough it has been said that the apple story is a myth and that he did not arrive at his theory of gravity at any single moment, acquaintances of Newton (such as William Stukeley, whose manuscript account of 1752 has been made available by the Royal Society) do in fact confirm the incident, though not the apocryphal version that the apple actually hit Newton's head. Stukeley recorded in his Memoirs of Sir Isaac Newton's Life a conversation with Newton in Kensington on 15 April 1726:\n\nwe went into the garden, & drank thea under the shade of some appletrees, only he, & myself. amidst other discourse, he told me, he was just in the same situation, as when formerly, the notion of gravitation came into his mind. \"why should that apple always descend perpendicularly to the ground,\" thought he to him self: occasion'd by the fall of an apple, as he sat in a comtemplative mood: \"why should it not go sideways, or upwards? but constantly to the earths centre? assuredly, the reason is, that the earth draws it. there must be a drawing power in matter. & the sum of the drawing power in the matter of the earth must be in the earths center, not in any side of the earth. therefore dos this apple fall perpendicularly, or toward the center. if matter thus draws matter; it must be in proportion of its quantity. therefore the apple draws the earth, as well as the earth draws the apple.\"\n\nJohn Conduitt, Newton's assistant at the Royal Mint and husband of Newton's niece, also described the event when he wrote about Newton's life:\n\nIn the year 1666 he retired again from Cambridge to his mother in Lincolnshire. Whilst he was pensively meandering in a garden it came into his thought that the power of gravity (which brought an apple from a tree to the ground) was not limited to a certain distance from earth, but that this power must extend much further than was usually thought. Why not as high as the Moon said he to himself & if so, that must influence her motion & perhaps retain her in her orbit, whereupon he fell a calculating what would be the effect of that supposition.\n\nIt is known from his notebooks that Newton was grappling in the late 1660s with the idea that terrestrial gravity extends, in an inverse-square proportion, to the Moon; however, it took him two decades to develop the full-fledged theory. The question was not whether gravity existed, but whether it extended so far from Earth that it could also be the force holding the Moon to its orbit. Newton showed that if the force decreased as the inverse square of the distance, one could indeed calculate the Moon's orbital period, and get good agreement. He guessed the same force was responsible for other orbital motions, and hence named it \"universal gravitation\".\n\nVarious trees are claimed to be \"the\" apple tree which Newton describes. The King's School, Grantham claims that the tree was purchased by the school, uprooted and transported to the headmaster's garden some years later. The staff of the (now) National Trust-owned Woolsthorpe Manor dispute this, and claim that a tree present in their gardens is the one described by Newton. A descendant of the original tree can be seen growing outside the main gate of Trinity College, Cambridge, below the room Newton lived in when he studied there. The National Fruit Collection at Brogdale in Kent can supply grafts from their tree, which appears identical to Flower of Kent, a coarse-fleshed cooking variety.\n\nNewton's monument (1731) can be seen in Westminster Abbey, at the north of the entrance to the choir against the choir screen, near his tomb. It was executed by the sculptor Michael Rysbrack (1694–1770) in white and grey marble with design by the architect William Kent. The monument features a figure of Newton reclining on top of a sarcophagus, his right elbow resting on several of his great books and his left hand pointing to a scroll with a mathematical design. Above him is a pyramid and a celestial globe showing the signs of the Zodiac and the path of the comet of 1680. A relief panel depicts putti using instruments such as a telescope and prism.\n\nFrom 1978 until 1988, an image of Newton designed by Harry Ecclestone appeared on Series D £1 banknotes issued by the Bank of England (the last £1 notes to be issued by the Bank of England). Newton was shown on the reverse of the notes holding a book and accompanied by a telescope, a prism and a map of the Solar System.\n\nA statue of Isaac Newton, looking at an apple at his feet, can be seen at the Oxford University Museum of Natural History. A large bronze statue, Newton, after William Blake, by Eduardo Paolozzi, dated 1995 and inspired by Blake's etching, dominates the piazza of the British Library in London. A bronze statue of Newton was erected in 1858 in the centre of Grantham where he went to school, prominently standing in front of Grantham Guildhall.\n\nThe still-surviving farmhouse at Woolsthorpe By Colsterworth is a Grade I listed building by Historic England through being his birthplace and \"where he discovered gravity and developed his theories regarding the refraction of light\".\n\nEnlightenment philosophers chose a short history of scientific predecessors—Galileo, Boyle, and Newton principally—as the guides and guarantors of their applications of the singular concept of nature and natural law to every physical and social field of the day. In this respect, the lessons of history and the social structures built upon it could be discarded.\n\nIt is held by European philosophers of the Enlightenment and by historians of the Enlightenment that Newton's publication of the Principia was a turning point in the Scientific Revolution and started the Enlightenment. It was Newton's conception of the universe based upon natural and rationally understandable laws that became one of the seeds for Enlightenment ideology. Locke and Voltaire applied concepts of natural law to political systems advocating intrinsic rights; the physiocrats and Adam Smith applied natural conceptions of psychology and self-interest to economic systems; and sociologists criticised the current social order for trying to fit history into natural models of progress. Monboddo and Samuel Clarke resisted elements of Newton's work, but eventually rationalised it to conform with their strong religious views of nature.\n\nPublished in his lifetime\n\nDe analysi per aequationes numero terminorum infinitas (1669, published 1711)\n\nOf Natures Obvious Laws & Processes in Vegetation (unpublished, c. 1671–75)\n\nDe motu corporum in gyrum (1684)\n\nPhilosophiæ Naturalis Principia Mathematica (1687)\n\nScala graduum Caloris. Calorum Descriptiones & signa (1701)\n\nReports as Master of the Mint (1701–1725)\n\nArithmetica Universalis (1707)\n\nPublished posthumously\n\nDe mundi systemate (The System of the World) (1728)\n\nOptical Lectures (1728)\n\nThe Chronology of Ancient Kingdoms Amended (1728)\n\nObservations on Daniel and The Apocalypse of St. John (1733)\n\nMethod of Fluxions (1671, published 1736)\n\nAn Historical Account of Two Notable Corruptions of Scripture (1754)\n\nElements of the Philosophy of Newton, a book by Voltaire\n\nList of multiple discoveries: seventeenth century\n\nList of things named after Isaac Newton\n\nList of presidents of the Royal Society\n\n^ a b c d e During Newton's lifetime, two calendars were in use in Europe: the Julian (\"Old Style\") calendar in Protestant and Orthodox regions, including Britain; and the Gregorian (\"New Style\") calendar in Roman Catholic Europe. At Newton's birth, Gregorian dates were ten days ahead of Julian dates; thus, his birth is recorded as taking place on 25 December 1642 Old Style, but it can be converted to a New Style (modern) date of 4 January 1643. By the time of his death, the difference between the calendars had increased to eleven days. Moreover, he died in the period after the start of the New Style year on 1 January but before that of the Old Style new year on 25 March. His death occurred on 20 March 1726, according to the Old Style calendar, but the year is usually adjusted to 1727. A full conversion to New Style gives the date 31 March 1727.\n\n^ This claim was made by William Stukeley in 1727, in a letter about Newton written to Richard Mead. Charles Hutton, who in the late eighteenth century collected oral traditions about earlier scientists, declared that there \"do not appear to be any sufficient reason for his never marrying, if he had an inclination so to do. It is much more likely that he had a constitutional indifference to the state, and even to the sex in general.\"" - timestamp: '2024-08-20T11:51:54.0000000+04:00' + timestamp: '2024-08-20T11:51:54.0000000+00:00' title: Isaac Newton - Wikipedia url: https://en.wikipedia.org/wiki/Isaac_Newton - id: web-search_2 snippet: "Stanford Encyclopedia of Philosophy\n\nEditorial Information\n\nPDFs for SEP Friends\n\nAuthor and Citation Info\n\nFirst published Wed Dec 19, 2007\n\nIsaac Newton (1642–1727) is best known for having invented the calculus in the mid to late 1660s (most of a decade before Leibniz did so independently, and ultimately more influentially) and for having formulated the theory of universal gravity — the latter in his Principia, the single most important work in the transformation of early modern natural philosophy into modern physical science. Yet he also made major discoveries in optics beginning in the mid-1660s and reaching across four decades; and during the course of his 60 years of intense intellectual activity he put no less effort into chemical and alchemical research and into theology and biblical studies than he put into mathematics and physics. He became a dominant figure in Britain almost immediately following publication of his Principia in 1687, with the consequence that “Newtonianism” of one form or another had become firmly rooted there within the first decade of the eighteenth century. His influence on the continent, however, was delayed by the strong opposition to his theory of gravity expressed by such leading figures as Christiaan Huygens and Leibniz, both of whom saw the theory as invoking an occult power of action at a distance in the absence of Newton's having proposed a contact mechanism by means of which forces of gravity could act. As the promise of the theory of gravity became increasingly substantiated, starting in the late 1730s but especially during the 1740s and 1750s, Newton became an equally dominant figure on the continent, and “Newtonianism,” though perhaps in more guarded forms, flourished there as well. What physics textbooks now refer to as “Newtonian mechanics” and “Newtonian science” consists mostly of results achieved on the continent between 1740 and 1800.\n\n1.1 Newton's Early Years\n\n1.2 Newton's Years at Cambridge Prior to Principia\n\n1.3 Newton's Final Years at Cambridge\n\n1.4 Newton's Years in London and His Final Years\n\n2. Newton's Work and Influence\n\nOther Internet Resources\n\nNewton's life naturally divides into four parts: the years before he entered Trinity College, Cambridge in 1661; his years in Cambridge before the Principia was published in 1687; a period of almost a decade immediately following this publication, marked by the renown it brought him and his increasing disenchantment with Cambridge; and his final three decades in London, for most of which he was Master of the Mint. While he remained intellectually active during his years in London, his legendary advances date almost entirely from his years in Cambridge. Nevertheless, save for his optical papers of the early 1670s and the first edition of the Principia, all his works published before he died fell within his years in London.[1]\n\n1.1 Newton's Early Years\n\nNewton was born into a Puritan family in Woolsthorpe, a small village in Linconshire near Grantham, on 25 December 1642 (old calendar), a few days short of one year after Galileo died. Isaac's father, a farmer, died two months before Isaac was born. When his mother Hannah married the 63 year old Barnabas Smith three years later and moved to her new husband's residence, Isaac was left behind with his maternal grandparents. (Isaac learned to read and write from his maternal grandmother and mother, both of whom, unlike his father, were literate.) Hannah returned to Woolsthorpe with three new children in 1653, after Smith died. Two years later Isaac went to boarding school in Grantham, returning full time to manage the farm, not very successfully, in 1659. Hannah's brother, who had received an M.A. from Cambridge, and the headmaster of the Grantham school then persuaded his mother that Isaac should prepare for the university. After further schooling at Grantham, he entered Trinity College in 1661, somewhat older than most of his classmates.\n\nThese years of Newton's youth were the most turbulent in the history of England. The English Civil War had begun in 1642, King Charles was beheaded in 1649, Oliver Cromwell ruled as lord protector from 1653 until he died in 1658, followed by his son Richard from 1658 to 1659, leading to the restoration of the monarchy under Charles II in 1660. How much the political turmoil of these years affected Newton and his family is unclear, but the effect on Cambridge and other universities was substantial, if only through unshackling them for a period from the control of the Anglican Catholic Church. The return of this control with the restoration was a key factor inducing such figures as Robert Boyle to turn to Charles II for support for what in 1660 emerged as the Royal Society of London. The intellectual world of England at the time Newton matriculated to Cambridge was thus very different from what it was when he was born.\n\n1.2 Newton's Years at Cambridge Prior to Principia\n\nNewton's initial education at Cambridge was classical, focusing (primarily through secondary sources) on Aristotlean rhetoric, logic, ethics, and physics. By 1664, Newton had begun reaching beyond the standard curriculum, reading, for example, the 1656 Latin edition of Descartes's Opera philosophica, which included the Meditations, Discourse on Method, the Dioptrics, and the Principles of Philosophy. By early 1664 he had also begun teaching himself mathematics, taking notes on works by Oughtred, Viète, Wallis, and Descartes — the latter via van Schooten's Latin translation, with commentary, of the Géométrie. Newton spent all but three months from the summer of 1665 until the spring of 1667 at home in Woolsthorpe when the university was closed because of the plague. This period was his so-called annus mirabilis. During it, he made his initial experimental discoveries in optics and developed (independently of Huygens's treatment of 1659) the mathematical theory of uniform circular motion, in the process noting the relationship between the inverse-square and Kepler's rule relating the square of the planetary periods to the cube of their mean distance from the Sun. Even more impressively, by late 1666 he had become de facto the leading mathematician in the world, having extended his earlier examination of cutting-edge problems into the discovery of the calculus, as presented in his tract of October 1666. He returned to Trinity as a Fellow in 1667, where he continued his research in optics, constructing his first reflecting telescope in 1669, and wrote a more extended tract on the calculus “De Analysi per Æquations Numero Terminorum Infinitas” incorporating new work on infinite series. On the basis of this tract Isaac Barrow recommended Newton as his replacement as Lucasian Professor of Mathematics, a position he assumed in October 1669, four and a half years after he had received his Bachelor of Arts.\n\nOver the course of the next fifteen years as Lucasian Professor Newton presented his lectures and carried on research in a variety of areas. By 1671 he had completed most of a treatise length account of the calculus,[2] which he then found no one would publish. This failure appears to have diverted his interest in mathematics away from the calculus for some time, for the mathematical lectures he registered during this period mostly concern algebra. (During the early 1680s he undertook a critical review of classical texts in geometry, a review that reduced his view of the importance of symbolic mathematics.) His lectures from 1670 to 1672 concerned optics, with a large range of experiments presented in detail. Newton went public with his work in optics in early 1672, submitting material that was read before the Royal Society and then published in the Philosophical Transactions of the Royal Society. This led to four years of exchanges with various figures who challenged his claims, including both Robert Hooke and Christiaan Huygens — exchanges that at times exasperated Newton to the point that he chose to withdraw from further public exchanges in natural philosophy. Before he largely isolated himself in the late 1670s, however, he had also engaged in a series of sometimes long exchanges in the mid 1670s, most notably with John Collins (who had a copy of “De Analysi”) and Leibniz, concerning his work on the calculus. So, though they remained unpublished, Newton's advances in mathematics scarcely remained a secret.\n\nThis period as Lucasian Professor also marked the beginning of his more private researches in alchemy and theology. Newton purchased chemical apparatus and treatises in alchemy in 1669, with experiments in chemistry extending across this entire period. The issue of the vows Newton might have to take in conjunction with the Lucasian Professorship also appears to have precipitated his study of the doctrine of the Trinity, which opened the way to his questioning the validity of a good deal more doctrine central to the Roman and Anglican Churches.\n\nNewton showed little interest in orbital astronomy during this period until Hooke initiated a brief correspondence with him in an effort to solicit material for the Royal Society at the end of November 1679, shortly after Newton had returned to Cambridge following the death of his mother. Among the several problems Hooke proposed to Newton was the question of the trajectory of a body under an inverse-square central force:\n\nIt now remaines to know the proprietys of a curve Line (not circular nor concentricall) made by a centrall attractive power which makes the velocitys of Descent from the tangent Line or equall straight motion at all Distances in a Duplicate proportion to the Distances Reciprocally taken. I doubt not but that by your excellent method you will easily find out what the Curve must be, and it proprietys, and suggest a physicall Reason of this proportion.[3]\n\nNewton apparently discovered the systematic relationship between conic-section trajectories and inverse-square central forces at the time, but did not communicate it to anyone, and for reasons that remain unclear did not follow up this discovery until Halley, during a visit in the summer of 1684, put the same question to him. His immediate answer was, an ellipse; and when he was unable to produce the paper on which he had made this determination, he agreed to forward an account to Halley in London. Newton fulfilled this commitment in November by sending Halley a nine-folio-page manuscript, “De Motu Corporum in Gyrum” (“On the Motion of Bodies in Orbit”), which was entered into the Register of the Royal Society in early December 1684. The body of this tract consists of ten deduced propositions — three theorems and seven problems — all of which, along with their corollaries, recur in important propositions in the Principia.\n\nSave for a few weeks away from Cambridge, from late 1684 until early 1687, Newton concentrated on lines of research that expanded the short ten-proposition tract into the 500 page Principia, with its 192 derived propositions. Initially the work was to have a two book structure, but Newton subsequently shifted to three books, and replaced the original version of the final book with one more mathematically demanding. The manuscript for Book 1 was sent to London in the spring of 1686, and the manuscripts for Books 2 and 3, in March and April 1687, respectively. The roughly three hundred copies of the Principia came off the press in the summer of 1687, thrusting the 44 year old Newton into the forefront of natural philosophy and forever ending his life of comparative isolation.\n\n1.3 Newton's Final Years at Cambridge\n\nThe years between the publication of the Principia and Newton's permanent move to London in 1696 were marked by his increasing disenchantment with his situation in Cambridge. In January 1689, following the Glorious Revolution at the end of 1688, he was elected to represent Cambridge University in the Convention Parliament, which he did until January 1690. During this time he formed friendships with John Locke and Nicolas Fatio de Duillier, and in the summer of 1689 he finally met Christiaan Huygens face to face for two extended discussions. Perhaps because of disappointment with Huygens not being convinced by the argument for universal gravity, in the early 1690s Newton initiated a radical rewriting of the Principia. During these same years he wrote (but withheld) his principal treatise in alchemy, Praxis; he corresponded with Richard Bentley on religion and allowed Locke to read some of his writings on the subject; he once again entered into an effort to put his work on the calculus in a form suitable for publication; and he carried out experiments on diffraction with the intent of completing his Opticks, only to withhold the manuscript from publication because of dissatisfaction with its treatment of diffraction. The radical revision of the Principia became abandoned by 1693, during the middle of which Newton suffered, by his own testimony, what in more recent times would be called a nervous breakdown. In the two years following his recovery that autumn, he continued his experiments in chymistry and he put substantial effort into trying to refine and extend the gravity-based theory of the lunar orbit in the Principia, but with less success than he had hoped.\n\nThroughout these years Newton showed interest in a position of significance in London, but again with less success than he had hoped until he accepted the relatively minor position of Warden of the Mint in early 1696, a position he held until he became Master of the Mint at the end of 1699. He again represented Cambridge University in Parliament for 16 months, beginning in 1701, the year in which he resigned his Fellowship at Trinity College and the Lucasian Professorship. He was elected President of the Royal Society in 1703 and was knighted by Queen Anne in 1705.\n\n1.4 Newton's Years in London and His Final Years\n\nNewton thus became a figure of imminent authority in London over the rest of his life, in face-to-face contact with individuals of power and importance in ways that he had not known in his Cambridge years. His everyday home life changed no less dramatically when his extraordinarily vivacious teenage niece, Catherine Barton, the daughter of his half-sister Hannah, moved in with him shortly after he moved to London, staying until she married John Conduitt in 1717, and after that remaining in close contact. (It was through her and her husband that Newton's papers came down to posterity.) Catherine was socially prominent among the powerful and celebrated among the literati for the years before she married, and her husband was among the wealthiest men of London.\n\nThe London years saw Newton embroiled in some nasty disputes, probably made the worse by the ways in which he took advantage of his position of authority in the Royal Society. In the first years of his Presidency he became involved in a dispute with John Flamsteed in which he and Halley, long ill-disposed toward the Flamsteed, violated the trust of the Royal Astronomer, turning him into a permanent enemy. Ill feelings between Newton and Leibniz had been developing below the surface from even before Huygens had died in 1695, and they finally came to a head in 1710 when John Keill accused Leibniz in the Philosophical Transactions of having plagiarized the calculus from Newton and Leibniz, a Fellow of the Royal Society since 1673, demanded redress from the Society. The Society's 1712 published response was anything but redress. Newton not only was a dominant figure in this response, but then published an outspoken anonymous review of it in 1715 in the Philosophical Transactions. Leibniz and his colleagues on the Continent had never been comfortable with the Principia and its implication of action at a distance. With the priority dispute this attitude turned into one of open hostility toward Newton's theory of gravity — a hostility that was matched in its blindness by the fervor of acceptance of the theory in England. The public elements of the priority dispute had the effect of expanding a schism between Newton and Leibniz into a schism between the English associated with the Royal Society and the group who had been working with Leibniz on the calculus since the 1690s, including most notably Johann Bernoulli, and this schism in turn transformed into one between the conduct of science and mathematics in England versus the Continent that persisted long after Leibniz died in 1716.\n\nAlthough Newton obviously had far less time available to devote to solitary research during his London years than he had had in Cambridge, he did not entirely cease to be productive. The first (English) edition of his Opticks finally appeared in 1704, appended to which were two mathematical treatises, his first work on the calculus to appear in print. This edition was followed by a Latin edition in 1706 and a second English edition in 1717, each containing important Queries on key topics in natural philosophy beyond those in its predecessor. Other earlier work in mathematics began to appear in print, including a work on algebra, Arithmetica Universalis, in 1707 and “De Analysi” and a tract on finite differences, “Methodis differentialis” in 1711. The second edition of the Principia, on which Newton had begun work at the age of 66 in 1709, was published in 1713, with a third edition in 1726. Though the original plan for a radical restructuring had long been abandoned, the fact that virtually every page of the Principia received some modifications in the second edition shows how carefully Newton, often prodded by his editor Roger Cotes, reconsidered everything in it; and important parts were substantially rewritten not only in response to Continental criticisms, but also because of new data, including data from experiments on resistance forces carried out in London. Focused effort on the third edition began in 1723, when Newton was 80 years old, and while the revisions are far less extensive than in the second edition, it does contain substantive additions and modfications, and it surely has claim to being the edition that represents his most considered views.\n\nNewton died on 20 March 1727 at the age of 84. His contemporaries' conception of him nevertheless continued to expand as a consequence of various posthumous publications, including The Chronology of Ancient Kingdoms Amended (1728); the work originally intended to be the last book of the Principia, The System of the World (1728, in both English and Latin); Observations upon the Prophecies of Daniel and the Apocalypse of St. John (1733); A Treatise of the Method of Fluxions and Infinite Series (1737); A Dissertation upon the Sacred Cubit of the Jews (1737), and Four Letters from Sir Isaac Newton to Doctor Bentley concerning Some Arguments in Proof of a Deity (1756). Even then, however, the works that had been published represented only a limited fraction of the total body of papers that had been left in the hands of Catherine and John Conduitt. The five volume collection of Newton's works edited by Samuel Horsley (1779–85) did not alter this situation. Through the marriage of the Conduitts' daughter Catherine and subsequent inheritance, this body of papers came into the possession of Lord Portsmouth, who agreed in 1872 to allow it to be reviewed by scholars at Cambridge University (John Couch Adams, George Stokes, H. R. Luard, and G. D. Liveing). They issued a catalogue in 1888, and the university then retained all the papers of a scientific character. With the notable exception of W. W. Rouse Ball, little work was done on the scientific papers before World War II. The remaining papers were returned to Lord Portsmouth, and then ultimately sold at auction in 1936 to various parties. Serious scholarly work on them did not get underway until the 1970s, and much remains to be done on them.\n\n2. Newton's Work and Influence\n\nThree factors stand in the way of giving an account of Newton's work and influence. First is the contrast between the public Newton, consisting of publications in his lifetime and in the decade or two following his death, and the private Newton, consisting of his unpublished work in math and physics, his efforts in chymistry — that is, the 17th century blend of alchemy and chemistry — and his writings in radical theology — material that has become public mostly since World War II. Only the public Newton influenced the eighteenth and early nineteenth centuries, yet any account of Newton himself confined to this material can at best be only fragmentary. Second is the contrast, often shocking, between the actual content of Newton's public writings and the positions attributed to him by others, including most importantly his popularizers. The term “Newtonian” refers to several different intellectual strands unfolding in the eighteenth century, some of them tied more closely to Voltaire, Pemberton, and Maclaurin — or for that matter to those who saw themselves as extending his work, such as Clairaut, Euler, d'Alembert, Lagrange, and Laplace — than to Newton himself. Third is the contrast between the enormous range of subjects to which Newton devoted his full concentration at one time or another during the 60 years of his intellectual career — mathematics, optics, mechanics, astronomy, experimental chemistry, alchemy, and theology — and the remarkably little information we have about what drove him or his sense of himself. Biographers and analysts who try to piece together a unified picture of Newton and his intellectual endeavors often end up telling us almost as much about themselves as about Newton.\n\nCompounding the diversity of the subjects to which Newton devoted time are sharp contrasts in his work within each subject. Optics and orbital mechanics both fall under what we now call physics, and even then they were seen as tied to one another, as indicated by Descartes' first work on the subject, Le Monde, ou Traité de la lumierè. Nevertheless, two very different “Newtonian” traditions in physics arose from Newton's Opticks and Principia: from his Opticks a tradition centered on meticulous experimentation and from his Principia a tradition centered on mathematical theory. The most important element common to these two was Newton's deep commitment to having the empirical world serve not only as the ultimate arbiter, but also as the sole basis for adopting provisional theory. Throughout all of this work he displayed distrust of what was then known as the method of hypotheses – putting forward hypotheses that reach beyond all known phenomena and then testing them by deducing observable conclusions from them. Newton insisted instead on having specific phenomena decide each element of theory, with the goal of limiting the provisional aspect of theory as much as possible to the step of inductively generalizing from the specific phenomena. This stance is perhaps best summarized in his fourth Rule of Reasoning, added in the third edition of the Principia, but adopted as early as his Optical Lectures of the 1670s:\n\nIn experimental philosophy, propositions gathered from phenomena by induction should be taken to be either exactly or very nearly true notwithstanding any contrary hypotheses, until yet other phenomena make such propositions either more exact or liable to exceptions.\n\nThis rule should be followed so that arguments based on induction may not be nullified by hypotheses.\n\nSuch a commitment to empirically driven science was a hallmark of the Royal Society from its very beginnings, and one can find it in the research of Kepler, Galileo, Huygens, and in the experimental efforts of the Royal Academy of Paris. Newton, however, carried this commitment further first by eschewing the method of hypotheses and second by displaying in his Principia and Opticks how rich a set of theoretical results can be secured through well-designed experiments and mathematical theory designed to allow inferences from phenomena. The success of those after him in building on these theoretical results completed the process of transforming natural philosophy into modern empirical science.\n\nNewton's commitment to having phenomena decide the elements of theory required questions to be left open when no available phenomena could decide them. Newton contrasted himself most strongly with Leibniz in this regard at the end of his anonymous review of the Royal Society's report on the priority dispute over the calculus:\n\nIt must be allowed that these two Gentlemen differ very much in Philosophy. The one proceeds upon the Evidence arising from Experiments and Phenomena, and stops where such Evidence is wanting; the other is taken up with Hypotheses, and propounds them, not to be examined by Experiments, but to be believed without Examination. The one for want of Experiments to decide the Question, doth not affirm whether the Cause of Gravity be Mechanical or not Mechanical; the other that it is a perpetual Miracle if it be not Mechanical.\n\nNewton could have said much the same about the question of what light consists of, waves or particles, for while he felt that the latter was far more probable, he saw it still not decided by any experiment or phenomenon in his lifetime. Leaving questions about the ultimate cause of gravity and the constitution of light open was the other factor in his work driving a wedge between natural philosophy and empirical science.\n\nThe many other areas of Newton's intellectual endeavors made less of a difference to eighteenth century philosophy and science. In mathematics, Newton was the first to develop a full range of algorithms for symbolically determining what we now call integrals and derivatives, but he subsequently became fundamentally opposed to the idea, championed by Leibniz, of transforming mathematics into a discipline grounded in symbol manipulation. Newton thought the only way of rendering limits rigorous lay in extending geometry to incorporate them, a view that went entirely against the tide in the development of mathematics in the eighteenth and nineteenth ceturies. In chemistry Newton conducted a vast array of experiments, but the experimental tradition coming out of his Opticks, and not his experiments in chemistry, lay behind Lavoisier calling himself a Newtonian; indeed, one must wonder whether Lavoisier would even have associated his new form of chemistry with Newton had he been aware of Newton's fascination with writings in the alchemical tradition. And even in theology, there is Newton the anti-Trinitarian mild heretic who was not that much more radical in his departures from Roman and Anglican Christianity than many others at the time, and Newton, the wild religious zealot predicting the end of the Earth, who did not emerge to public view until quite recently.\n\nThere is surprisingly little cross-referencing of themes from one area of Newton's endeavors to another. The common element across almost all of them is that of a problem-solver extraordinaire, taking on one problem at a time and staying with it until he had found, usually rather promptly, a solution. All of his technical writings display this, but so too does his unpublished manuscript reconstructing Solomon's Temple from the biblical account of it and his posthumously published Chronology of the Ancient Kingdoms in which he attempted to infer from astronomical phenomena the dating of major events in the Old Testament. The Newton one encounters in his writings seems to compartmentalize his interests at any given moment. Whether he had a unified conception of what he was up to in all his intellectual efforts, and if so what this conception might be, has been a continuing source of controversy among Newton scholars.\n\nOf course, were it not for the Principia, there would be no entry at all for Newton in an Encyclopedia of Philosophy. In science, he would have been known only for the contributions he made to optics, which, while notable, were no more so than those made by Huygens and Grimaldi, neither of whom had much impact on philosophy; and in mathematics, his failure to publish would have relegated his work to not much more than a footnote to the achievements of Leibniz and his school. Regardless of which aspect of Newton's endeavors “Newtonian” might be applied to, the word gained its aura from the Principia. But this adds still a further complication, for the Principia itself was substantially different things to different people. The press-run of the first edition (estimated to be around 300) was too small for it to have been read by all that many individuals. The second edition also appeared in two pirated Amsterdam editions, and hence was much more widely available, as was the third edition and its English (and later French) translation. The Principia, however, is not an easy book to read, so one must still ask, even of those who had access to it, whether they read all or only portions of the book and to what extent they grasped the full complexity of what they read. The detailed commentary provided in the three volume Jesuit edition (1739–42) made the work less daunting. But even then the vast majority of those invoking the word “Newtonian” were unlikely to have been much more conversant with the Principia itself than those in the first half of the 20th century who invoked ‘relativity’ were likely to have read Einstein's two special relativity papers of 1905 or his general relativity paper of 1916. An important question to ask of any philosophers commenting on Newton is, what primary sources had they read?\n\nThe 1740s witnessed a major transformation in the standing of the science in the Principia. The Principia itself had left a number of loose-ends, most of them detectable by only highly discerning readers. By 1730, however, some of these loose-ends had been cited in Bernard le Bovier de Fontenelle's elogium for Newton[4] and in John Machin's appendix to the 1729 English translation of the Principia, raising questions about just how secure Newton's theory of gravity was, empirically. The shift on the continent began in the 1730s when Maupertuis convinced the Royal Academy to conduct expeditions to Lapland and Peru to determine whether Newton's claims about the non-spherical shape of the Earth and the variation of surface gravity with latitude are correct. Several of the loose-ends were successfully resolved during the 1740's through such notable advances beyond the Principia as Clairaut's Théorie de la Figure de la Terre; the return of the expedition from Peru; d'Alembert's 1749 rigid-body solution for the wobble of the Earth that produces the precession of the equinoxes; Clairaut's 1749 resolution of the factor of 2 discrepancy between theory and observation in the mean motion of the lunar apogee, glossed over by Newton but emphasized by Machin; and the prize-winning first ever successful description of the motion of the Moon by Tobias Mayer in 1753, based on a theory of this motion derived from gravity by Euler in the early 1750s taking advantage of Clairaut's solution for the mean motion of the apogee.\n\nEuler was the central figure in turning the three laws of motion put forward by Newton in the Principia into Newtonian mechanics. These three laws, as Newton formulated them, apply to “point-masses,” a term Euler had put forward in his Mechanica of 1736. Most of the effort of eighteenth century mechanics was devoted to solving problems of the motion of rigid bodies, elastic strings and bodies, and fluids, all of which require principles beyond Newton's three laws. From the 1740s on this led to alternative approaches to formulating a general mechanics, employing such different principles as the conservation of vis viva, the principle of least action, and d'Alembert's principle. The “Newtonian” formulation of a general mechanics sprang from Euler's proposal in 1750 that Newton's second law, in an F=ma formulation that appears nowhere in the Principia, could be applied locally within bodies and fluids to yield differential equations for the motions of bodies, elastic and rigid, and fluids. During the 1750s Euler developed his equations for the motion of fluids, and in the 1760s, his equations of rigid-body motion. What we call Newtonian mechanics was accordingly something for which Euler was more responsible than Newton.\n\nAlthough some loose-ends continued to defy resolution until much later in the eighteenth century, by the early 1750s Newton's theory of gravity had become the accepted basis for ongoing research among almost everyone working in orbital astronomy. Clairaut's successful prediction of the month of return of Halley's comet at the end of this decade made a larger segment of the educated public aware of the extent to which empirical grounds for doubting Newton's theory of gravity had largely disappeared. Even so, one must still ask of anyone outside active research in gravitational astronomy just how aware they were of the developments from ongoing efforts when they made their various pronouncements about the standing of the science of the Principia among the community of researchers. The naivety of these pronouncements cuts both ways: on the one hand, they often reflected a bloated view of how secure Newton's theory was at the time, and, on the other, they often underestimated how strong the evidence favoring it had become. The upshot is a need to be attentive to the question of what anyone, even including Newton himself, had in mind when they spoke of the science of the Principia.\n\nTo view the seventy years of research after Newton died as merely tying up the loose-ends of the Principia or as simply compiling more evidence for his theory of gravity is to miss the whole point. Research predicated on Newton's theory had answered a huge number of questions about the world dating from long before it. The motion of the Moon and the trajectories of comets were two early examples, both of which answered such questions as how one comet differs from another and what details make the Moon's motion so much more complicated than that of the satellites of Jupiter and Saturn. In the 1770s Laplace had developed a proper theory of the tides, reaching far beyond the suggestions Newton had made in the Principia by including the effects of the Earth's rotation and the non-radial components of the gravitational forces of the Sun and Moon, components that dominate the radial component that Newton had singled out. In 1786 Laplace identified a large 900 year fluctuation in the motions of Jupiter and Saturn arising from quite subtle features of their respective orbits. With this discovery, calculation of the motion of the planets from the theory of gravity became the basis for predicting planet positions, with observation serving primarily to identify further forces not yet taken into consideration in the calculation. These advances in our understanding of planetary motion led Laplace to produce the four principal volumes of his Traité de mécanique céleste from 1799 to 1805, a work collecting in one place all the theoretical and empirical results of the research predicated on Newton's Principia. From that time forward, Newtonian science sprang from Laplace's work, not Newton's.\n\nThe success of the research in celestial mechanics predicated on the Principia was unprecedented. Nothing of comparable scope and accuracy had ever occurred before in empirical research of any kind. That led to a new philosophical question: what was it about the science of the Principia that enabled it to achieve what it did? Philosophers like Locke and Berkeley began asking this question while Newton was still alive, but it gained increasing force as successes piled on one another over the decades after he died. This question had a practical side, as those working in other fields like chemistry pursued comparable success, and others like Hume and Adam Smith aimed for a science of human affairs. It had, of course, a philosophical side, giving rise to the subdiscipline of philosophy of science, starting with Kant and continuing throughout the nineteenth century as other areas of physical science began showing similar signs of success. The Einsteinian revolution in the beginning of the twentieth century, in which Newtonian theory was shown to hold only as a limiting case of the special and general theories of relativity, added a further twist to the question, for now all the successes of Newtonian science, which still remain in place, have to be seen as predicated on a theory that holds only to high approximation in parochial circumstances.\n\nThe extraordinary character of the Principia gave rise to a still continuing tendency to place great weight on everything Newton said. This, however, was, and still is, easy to carry to excess. One need look no further than Book 2 of the Principia to see that Newton had no more claim to being somehow in tune with nature and the truth than any number of his contemporaries. Newton's manuscripts do reveal an exceptional level of attention to detail of phrasing, from which we can rightly conclude that his pronouncements, especially in print, were generally backed by careful, self-critical reflection. But this conclusion does not automatically extend to every statement he ever made. We must constantly be mindful of the possibility of too much weight being placed, then or now, on any pronouncement that stands in relative isolation over his 60 year career; and, to counter the tendency to excess, we should be even more vigilant than usual in not losing sight of the context, circumstantial as well as historical and textual, of both Newton's statements and the eighteenth century reaction to them.\n\nPhilosophiae Naturalis Principia Mathematica (“Mathematical Principles of Natural Philosophy”), London, 1687; Cambridge, 1713; London, 1726. Isaac Newton's Philosophiae Naturalis Principia Mathematica, the Third Edition with Variant Readings, ed. A. Koyré and I. B. Cohen, 2 vols., Cambridge: Harvard University Press and Cambridge: Cambridge University Press, 1972. The Principia: Mathematical Principles of Natural Philosophy: A New Translation, tr. I. B. Cohen and Anne Whitman, preceded by “A Guide to Newton'sPrincipia” by I. B. Cohen, Berkeley: University of California Press, 1999.\n\nOpticks or A Treatise of the Reflections, Refractions, Inflections & Colors of Light, London, 1704 (English), 1706 (Latin), 1717/18 (English). Now available under the same title, but based on the fourth posthumous edition of 1730, New York: Dover Publications, 1952.\n\nThe Chronology of Ancient Kingdoms Amended, ed. John Conduit, London,1728.\n\nThe System of the World, London, 1728. The original version of the third book of the Principia, retitled by the translator and reissued in reprint form, London: Dawsons of Pall Mall, 1969.\n\nObservations upon the Prophecies of Daniel and the Apocalypse of St John, ed. Benjamin Smith, London and Dublin,1733.\n\nThe Correspondence of Isaac Newton, ed. H. W. Turnbull, J. F. Scott, A. R. Hall, and L. Tilling, 7 vols., Cambridge: Cambridge University Press, 1959–1984.\n\nThe Mathematical Papers of Isaac Newton, ed. D. T. Whiteside, 8 vols., Cambridge: Cambridge University Press, 1967–81.\n\nThe Mathematical Works of Isaac Newton, ed. D. T. Whiteside, 2 vols., New York: Johnson Reprint Corporation, 1964, 1967. Contains facsimile reprints of the translations into English published during the first half of the 18th century.\n\nUnpublished Scientific Papers of Isaac Newton, ed. A. R. Hall and M. B. Hall, Cambridge: Cambridge University Press, 1962.\n\nIsaac Newton's Papers and Letters on Natural Philosophy, 2nd ed., ed. I. B. Cohen and R. E. Schofield, Cambridge: Harvard University Press, 1978. Contains all the papers on optics published in the early 1670s, the letters to Bentley, and Fontenelle's Elogium, among other things).\n\nThe Optical Papers of Isaac Newton: Volume 1, The Optical Lectures, 1670–72, ed. Alan E. Shapiro, Cambridge University Press, 1984; volume 2 forthcoming.\n\nPhilosophical Writings, ed. A. Janiak, Cambridge: Cambridge University Press, 2004.\n\nWestfall, Richard S., 1980, Never At Rest: A Biography of Isaac Newton, New York: Cambridge University Press.\n\nHall, A. Rupert, 1992, Isaac Newton: Adventurer in Thought, Oxford: Blackwell.\n\nFeingold, Mordechai, 2004, The Newtonian Moment: Isaac Newton and the Making of Modern Culture, Oxford: Oxford University Press.\n\nIliffe, Rob, 2007, Newton: A Very Short Introduction Oxford: Oxford University Press.\n\nCohen, I. B. and Smith, G. E., 2002, The Cambridge Companion to Newton, Cambridge: Cambridge University Press.\n\nCohen, I. B. and Westfall, R. S., 1995, Newton: Texts, Backgrounds, and Commentaries, A Norton Critical Edition, New York: Norton.\n\nHow to cite this entry.\n\nPreview the PDF version of this entry at the Friends of the SEP Society.\n\nLook up topics and thinkers related to this entry at the Internet Philosophy Ontology Project (InPhO).\n\nEnhanced bibliography for this entry at PhilPapers, with links to its database.\n\nOther Internet Resources\n\nMacTutor History of Mathematics Archive\n\nThe Newton Project-Canada\n\nThe Chymistry of Isaac Newton, Digital Library at Indiana\n\nCopernicus, Nicolaus | Descartes, René | Kant, Immanuel | Leibniz, Gottfried Wilhelm | Newton, Isaac: Philosophiae Naturalis Principia Mathematica | scientific revolutions | trinity | Whewell, William\n\nCopyright © 2007 by George Smith \n\nOpen access to the SEP is made possible by a world-wide funding initiative. The Encyclopedia Now Needs Your Support Please Read How You Can Help Keep the Encyclopedia Free\n\nEditorial Information\n\nPDFs for SEP Friends\n\nView this site from another server:\n\nUSA (Main Site) Philosophy, Stanford University\n\nInfo about mirror sites\n\nThe Stanford Encyclopedia of Philosophy is copyright © 2024 by The Metaphysics Research Lab, Department of Philosophy, Stanford University\n\nLibrary of Congress Catalog Data: ISSN 1095-5054" - timestamp: '2024-07-29T20:46:15.0000000+04:00' + timestamp: '2024-07-29T20:46:15.0000000+00:00' title: Isaac Newton (Stanford Encyclopedia of Philosophy) url: https://plato.stanford.edu/Entries/newton/ - id: web-search_3 snippet: "ShowsThis Day In HistoryScheduleTopicsStories\n\nFind History on Facebook (Opens in a new window)\n\nFind History on Twitter (Opens in a new window)\n\nFind History on YouTube (Opens in a new window)\n\nFind History on Instagram (Opens in a new window)\n\nFind History on TikTok (Opens in a new window)\n\nBy: History.com Editors\n\nUpdated: October 16, 2023 | Original: March 10, 2015\n\ncopy page linkPrint Page\n\nIsaac Newton is best know for his theory about the law of gravity, but his “Principia Mathematica” (1686) with its three laws of motion greatly influenced the Enlightenment in Europe. Born in 1643 in Woolsthorpe, England, Sir Isaac Newton began developing his theories on light, calculus and celestial mechanics while on break from Cambridge University. \n\nYears of research culminated with the 1687 publication of “Principia,” a landmark work that established the universal laws of motion and gravity. Newton’s second major book, “Opticks,” detailed his experiments to determine the properties of light. Also a student of Biblical history and alchemy, the famed scientist served as president of the Royal Society of London and master of England’s Royal Mint until his death in 1727.\n\nIsaac Newton: Early Life and Education\n\nIsaac Newton was born on January 4, 1643, in Woolsthorpe, Lincolnshire, England. The son of a farmer who died three months before he was born, Newton spent most of his early years with his maternal grandmother after his mother remarried. His education was interrupted by a failed attempt to turn him into a farmer, and he attended the King’s School in Grantham before enrolling at the University of Cambridge’s Trinity College in 1661.\n\nNewton studied a classical curriculum at Cambridge, but he became fascinated by the works of modern philosophers such as René Descartes, even devoting a set of notes to his outside readings he titled “Quaestiones Quaedam Philosophicae” (“Certain Philosophical Questions”). When the Great Plague shuttered Cambridge in 1665, Newton returned home and began formulating his theories on calculus, light and color, his farm the setting for the supposed falling apple that inspired his work on gravity.\n\nHistory Shorts: Isaac Newton's Genius in Quarantine (Forged in Crisis)\n\nIsaac Newton’s Telescope and Studies on Light\n\nNewton returned to Cambridge in 1667 and was elected a minor fellow. He constructed the first reflecting telescope in 1668, and the following year he received his Master of Arts degree and took over as Cambridge’s Lucasian Professor of Mathematics. Asked to give a demonstration of his telescope to the Royal Society of London in 1671, he was elected to the Royal Society the following year and published his notes on optics for his peers.\n\nThrough his experiments with refraction, Newton determined that white light was a composite of all the colors on the spectrum, and he asserted that light was composed of particles instead of waves. His methods drew sharp rebuke from established Society member Robert Hooke, who was unsparing again with Newton’s follow-up paper in 1675. \n\nKnown for his temperamental defense of his work, Newton engaged in heated correspondence with Hooke before suffering a nervous breakdown and withdrawing from the public eye in 1678. In the following years, he returned to his earlier studies on the forces governing gravity and dabbled in alchemy.\n\nIsaac Newton and the Law of Gravity\n\nIn 1684, English astronomer Edmund Halley paid a visit to the secluded Newton. Upon learning that Newton had mathematically worked out the elliptical paths of celestial bodies, Halley urged him to organize his notes. \n\nThe result was the 1687 publication of “Philosophiae Naturalis Principia Mathematica” (Mathematical Principles of Natural Philosophy), which established the three laws of motion and the law of universal gravity. Newton’s three laws of motion state that (1) Every object in a state of uniform motion will remain in that state of motion unless an external force acts on it; (2) Force equals mass times acceleration: F=MA and (3) For every action there is an equal and opposite reaction.\n\n“Principia” propelled Newton to stardom in intellectual circles, eventually earning universal acclaim as one of the most important works of modern science. His work was a foundational part of the European Enlightenment.\n\nWith his newfound influence, Newton opposed the attempts of King James II to reinstitute Catholic teachings at English Universities. King James II was replaced by his protestant daughter Mary and her husband William of Orange as part of the Glorious Revolution of 1688, and Newton was elected to represent Cambridge in Parliament in 1689. \n\nNewton moved to London permanently after being named warden of the Royal Mint in 1696, earning a promotion to master of the Mint three years later. Determined to prove his position wasn’t merely symbolic, Newton moved the pound sterling from the silver to the gold standard and sought to punish counterfeiters.\n\nThe death of Hooke in 1703 allowed Newton to take over as president of the Royal Society, and the following year he published his second major work, “Opticks.” Composed largely from his earlier notes on the subject, the book detailed Newton’s painstaking experiments with refraction and the color spectrum, closing with his ruminations on such matters as energy and electricity. In 1705, he was knighted by Queen Anne of England.\n\nIsaac Newton: Founder of Calculus?\n\nAround this time, the debate over Newton’s claims to originating the field of calculus exploded into a nasty dispute. Newton had developed his concept of “fluxions” (differentials) in the mid 1660s to account for celestial orbits, though there was no public record of his work. \n\nIn the meantime, German mathematician Gottfried Leibniz formulated his own mathematical theories and published them in 1684. As president of the Royal Society, Newton oversaw an investigation that ruled his work to be the founding basis of the field, but the debate continued even after Leibniz’s death in 1716. Researchers later concluded that both men likely arrived at their conclusions independent of one another.\n\nDeath of Isaac Newton\n\nNewton was also an ardent student of history and religious doctrines, and his writings on those subjects were compiled into multiple books that were published posthumously. Having never married, Newton spent his later years living with his niece at Cranbury Park near Winchester, England. He died in his sleep on March 31, 1727, and was buried in Westminster Abbey.\n\nA giant even among the brilliant minds that drove the Scientific Revolution, Newton is remembered as a transformative scholar, inventor and writer. He eradicated any doubts about the heliocentric model of the universe by establishing celestial mechanics, his precise methodology giving birth to what is known as the scientific method. Although his theories of space-time and gravity eventually gave way to those of Albert Einstein, his work remains the bedrock on which modern physics was built.\n\n“If I have seen further it is by standing on the shoulders of Giants.”\n\n“I can calculate the motion of heavenly bodies but not the madness of people.”\n\n“What we know is a drop, what we don't know is an ocean.”\n\n“Gravity explains the motions of the planets, but it cannot explain who sets the planets in motion.”\n\n“No great discovery was ever made without a bold guess.”\n\nHISTORY Vault: Sir Isaac Newton: Gravity of Genius\n\nExplore the life of Sir Isaac Newton, who laid the foundations for calculus and defined the laws of gravity.\n\nSign up for Inside History\n\nGet HISTORY’s most fascinating stories delivered to your inbox three times a week.\n\nBy submitting your information, you agree to receive emails from HISTORY and A+E Networks. You can opt out at any time. You must be 16 years or older and a resident of the United States.\n\nMore details: Privacy Notice | Terms of Use | Contact Us" - timestamp: '2024-08-13T07:37:00.0000000+04:00' + timestamp: '2024-08-13T07:37:00.0000000+00:00' title: 'Isaac Newton ‑ Facts, Biography & Laws' url: https://www.history.com/topics/inventions/isaac-newton - id: web-search_4 snippet: "Isaac Newton was an English physicist and mathematician famous for his laws of physics. He was a key figure in the Scientific Revolution of the 17th century.\n\nUpdated: Nov 05, 2020 10:32 AM EST\n\nPhoto: Painting by Godfrey Kneller, [Public Domain], via Wikimedia Commons//Getty Images\n\nWho Was Isaac Newton?\n\nIsaac Newton was a physicist and mathematician who developed the principles of modern physics, including the laws of motion and is credited as one of the great minds of the 17th-century Scientific Revolution.\n\nIn 1687, he published his most acclaimed work, Philosophiae Naturalis Principia Mathematica (Mathematical Principles of Natural Philosophy), which has been called the single most influential book on physics. In 1705, he was knighted by Queen Anne of England, making him Sir Isaac Newton.\n\nEarly Life and Family\n\nNewton was born on January 4, 1643, in Woolsthorpe, Lincolnshire, England. Using the \"old\" Julian calendar, Newton's birth date is sometimes displayed as December 25, 1642.\n\nNewton was the only son of a prosperous local farmer, also named Isaac, who died three months before he was born. A premature baby born tiny and weak, Newton was not expected to survive.\n\nWhen he was 3 years old, his mother, Hannah Ayscough Newton, remarried a well-to-do minister, Barnabas Smith, and went to live with him, leaving young Newton with his maternal grandmother.\n\nThe experience left an indelible imprint on Newton, later manifesting itself as an acute sense of insecurity. He anxiously obsessed over his published work, defending its merits with irrational behavior.\n\nAt age 12, Newton was reunited with his mother after her second husband died. She brought along her three small children from her second marriage.\n\nIsaac Newton's Education\n\nNewton was enrolled at the King's School in Grantham, a town in Lincolnshire, where he lodged with a local apothecary and was introduced to the fascinating world of chemistry.\n\nHis mother pulled him out of school at age 12. Her plan was to make him a farmer and have him tend the farm. Newton failed miserably, as he found farming monotonous. Newton was soon sent back to King's School to finish his basic education.\n\nPerhaps sensing the young man's innate intellectual abilities, his uncle, a graduate of the University of Cambridge's Trinity College, persuaded Newton's mother to have him enter the university. Newton enrolled in a program similar to a work-study in 1661, and subsequently waited on tables and took care of wealthier students' rooms.\n\nScientific Revolution\n\nWhen Newton arrived at Cambridge, the Scientific Revolution of the 17th century was already in full force. The heliocentric view of the universe—theorized by astronomers Nicolaus Copernicus and Johannes Kepler, and later refined by Galileo—was well known in most European academic circles.\n\nPhilosopher René Descartes had begun to formulate a new concept of nature as an intricate, impersonal and inert machine. Yet, like most universities in Europe, Cambridge was steeped in Aristotelian philosophy and a view of nature resting on a geocentric view of the universe, dealing with nature in qualitative rather than quantitative terms.\n\nDuring his first three years at Cambridge, Newton was taught the standard curriculum but was fascinated with the more advanced science. All his spare time was spent reading from the modern philosophers. The result was a less-than-stellar performance, but one that is understandable, given his dual course of study.\n\nIt was during this time that Newton kept a second set of notes, entitled \"Quaestiones Quaedam Philosophicae\" (\"Certain Philosophical Questions\"). The \"Quaestiones\" reveal that Newton had discovered the new concept of nature that provided the framework for the Scientific Revolution. Though Newton graduated without honors or distinctions, his efforts won him the title of scholar and four years of financial support for future education.\n\nIn 1665, the bubonic plague that was ravaging Europe had come to Cambridge, forcing the university to close. After a two-year hiatus, Newton returned to Cambridge in 1667 and was elected a minor fellow at Trinity College, as he was still not considered a standout scholar.\n\nIn the ensuing years, his fortune improved. Newton received his Master of Arts degree in 1669, before he was 27. During this time, he came across Nicholas Mercator's published book on methods for dealing with infinite series.\n\nNewton quickly wrote a treatise, De Analysi, expounding his own wider-ranging results. He shared this with friend and mentor Isaac Barrow, but didn't include his name as author.\n\nIn June 1669, Barrow shared the unaccredited manuscript with British mathematician John Collins. In August 1669, Barrow identified its author to Collins as \"Mr. Newton ... very young ... but of an extraordinary genius and proficiency in these things.\"\n\nNewton's work was brought to the attention of the mathematics community for the first time. Shortly afterward, Barrow resigned his Lucasian professorship at Cambridge, and Newton assumed the chair.\n\nIsaac Newton’s Discoveries\n\nNewton made discoveries in optics, motion and mathematics. Newton theorized that white light was a composite of all colors of the spectrum, and that light was composed of particles.\n\nHis momentous book on physics, Principia, contains information on nearly all of the essential concepts of physics except energy, ultimately helping him to explain the laws of motion and the theory of gravity. Along with mathematician Gottfried Wilhelm von Leibniz, Newton is credited for developing essential theories of calculus.\n\nIsaac Newton Inventions\n\nNewton's first major public scientific achievement was designing and constructing a reflecting telescope in 1668. As a professor at Cambridge, Newton was required to deliver an annual course of lectures and chose optics as his initial topic. He used his telescope to study optics and help prove his theory of light and color.\n\nThe Royal Society asked for a demonstration of his reflecting telescope in 1671, and the organization's interest encouraged Newton to publish his notes on light, optics and color in 1672. These notes were later published as part of Newton's Opticks: Or, A treatise of the Reflections, Refractions, Inflections and Colours of Light.\n\nPhoto: Hulton Archive/Getty Images\n\nSir Isaac Newton contemplates the force of gravity, as the famous story goes, on seeing an apple fall in his orchard, circa 1665.\n\nBetween 1665 and 1667, Newton returned home from Trinity College to pursue his private study, as school was closed due to the Great Plague. Legend has it that, at this time, Newton experienced his famous inspiration of gravity with the falling apple. According to this common myth, Newton was sitting under an apple tree when a fruit fell and hit him on the head, inspiring him to suddenly come up with the theory of gravity.\n\nWhile there is no evidence that the apple actually hit Newton on the head, he did see an apple fall from a tree, leading him to wonder why it fell straight down and not at an angle. Consequently, he began exploring the theories of motion and gravity.\n\nIt was during this 18-month hiatus as a student that Newton conceived many of his most important insights—including the method of infinitesimal calculus, the foundations for his theory of light and color, and the laws of planetary motion—that eventually led to the publication of his physics book Principia and his theory of gravity.\n\nIsaac Newton’s Laws of Motion\n\nIn 1687, following 18 months of intense and effectively nonstop work, Newton published Philosophiae Naturalis Principia Mathematica (Mathematical Principles of Natural Philosophy), most often known as Principia.\n\nPrincipia is said to be the single most influential book on physics and possibly all of science. Its publication immediately raised Newton to international prominence.\n\nPrincipia offers an exact quantitative description of bodies in motion, with three basic but important laws of motion:\n\nA stationary body will stay stationary unless an external force is applied to it.\n\nForce is equal to mass times acceleration, and a change in motion (i.e., change in speed) is proportional to the force applied.\n\nFor every action, there is an equal and opposite reaction.\n\nNewton and the Theory of Gravity\n\nNewton’s three basic laws of motion outlined in Principia helped him arrive at his theory of gravity. Newton’s law of universal gravitation states that two objects attract each other with a force of gravitational attraction that’s proportional to their masses and inversely proportional to the square of the distance between their centers.\n\nThese laws helped explain not only elliptical planetary orbits but nearly every other motion in the universe: how the planets are kept in orbit by the pull of the sun’s gravity; how the moon revolves around Earth and the moons of Jupiter revolve around it; and how comets revolve in elliptical orbits around the sun.\n\nThey also allowed him to calculate the mass of each planet, calculate the flattening of the Earth at the poles and the bulge at the equator, and how the gravitational pull of the sun and moon create the Earth’s tides. In Newton's account, gravity kept the universe balanced, made it work, and brought heaven and Earth together in one great equation.\n\nDOWNLOAD BIOGRAPHY'S ISAAC NEWTON FACT CARD\n\nIsaac Newton & Robert Hooke\n\nNot everyone at the Royal Academy was enthusiastic about Newton’s discoveries in optics and 1672 publication of Opticks: Or, A treatise of the Reflections, Refractions, Inflections and Colours of Light. Among the dissenters was Robert Hooke, one of the original members of the Royal Academy and a scientist who was accomplished in a number of areas, including mechanics and optics.\n\nWhile Newton theorized that light was composed of particles, Hooke believed it was composed of waves. Hooke quickly condemned Newton's paper in condescending terms, and attacked Newton's methodology and conclusions.\n\nHooke was not the only one to question Newton's work in optics. Renowned Dutch scientist Christiaan Huygens and a number of French Jesuits also raised objections. But because of Hooke's association with the Royal Society and his own work in optics, his criticism stung Newton the worst.\n\nUnable to handle the critique, he went into a rage—a reaction to criticism that was to continue throughout his life. Newton denied Hooke's charge that his theories had any shortcomings and argued the importance of his discoveries to all of science.\n\nIn the ensuing months, the exchange between the two men grew more acrimonious, and soon Newton threatened to quit the Royal Society altogether. He remained only when several other members assured him that the Fellows held him in high esteem.\n\nThe rivalry between Newton and Hooke would continue for several years thereafter. Then, in 1678, Newton suffered a complete nervous breakdown and the correspondence abruptly ended. The death of his mother the following year caused him to become even more isolated, and for six years he withdrew from intellectual exchange except when others initiated correspondence, which he always kept short.\n\nDuring his hiatus from public life, Newton returned to his study of gravitation and its effects on the orbits of planets. Ironically, the impetus that put Newton on the right direction in this study came from Robert Hooke.\n\nIn a 1679 letter of general correspondence to Royal Society members for contributions, Hooke wrote to Newton and brought up the question of planetary motion, suggesting that a formula involving the inverse squares might explain the attraction between planets and the shape of their orbits.\n\nSubsequent exchanges transpired before Newton quickly broke off the correspondence once again. But Hooke's idea was soon incorporated into Newton's work on planetary motion, and from his notes it appears he had quickly drawn his own conclusions by 1680, though he kept his discoveries to himself.\n\nIn early 1684, in a conversation with fellow Royal Society members Christopher Wren and Edmond Halley, Hooke made his case on the proof for planetary motion. Both Wren and Halley thought he was on to something, but pointed out that a mathematical demonstration was needed.\n\nIn August 1684, Halley traveled to Cambridge to visit with Newton, who was coming out of his seclusion. Halley idly asked him what shape the orbit of a planet would take if its attraction to the sun followed the inverse square of the distance between them (Hooke's theory).\n\nNewton knew the answer, due to his concentrated work for the past six years, and replied, \"An ellipse.\" Newton claimed to have solved the problem some 18 years prior, during his hiatus from Cambridge and the plague, but he was unable to find his notes. Halley persuaded him to work out the problem mathematically and offered to pay all costs so that the ideas might be published, which it was, in Newton’s Principia.\n\nUpon the publication of the first edition of Principia in 1687, Robert Hooke immediately accused Newton of plagiarism, claiming that he had discovered the theory of inverse squares and that Newton had stolen his work. The charge was unfounded, as most scientists knew, for Hooke had only theorized on the idea and had never brought it to any level of proof.\n\nNewton, however, was furious and strongly defended his discoveries. He withdrew all references to Hooke in his notes and threatened to withdraw from publishing the subsequent edition of Principia altogether.\n\nHalley, who had invested much of himself in Newton's work, tried to make peace between the two men. While Newton begrudgingly agreed to insert a joint acknowledgment of Hooke's work (shared with Wren and Halley) in his discussion of the law of inverse squares, it did nothing to placate Hooke.\n\nAs the years went on, Hooke's life began to unravel. His beloved niece and companion died the same year that Principia was published, in 1687. As Newton's reputation and fame grew, Hooke's declined, causing him to become even more bitter and loathsome toward his rival.\n\nTo the very end, Hooke took every opportunity he could to offend Newton. Knowing that his rival would soon be elected president of the Royal Society, Hooke refused to retire until the year of his death, in 1703.\n\nFollowing the publication of Principia, Newton was ready for a new direction in life. He no longer found contentment in his position at Cambridge and was becoming more involved in other issues.\n\nHe helped lead the resistance to King James II's attempts to reinstitute Catholic teaching at Cambridge, and in 1689 he was elected to represent Cambridge in Parliament.\n\nWhile in London, Newton acquainted himself with a broader group of intellectuals and became acquainted with political philosopher John Locke. Though many of the scientists on the continent continued to teach the mechanical world according to Aristotle, a young generation of British scientists became captivated with Newton's new view of the physical world and recognized him as their leader.\n\nOne of these admirers was Nicolas Fatio de Duillier, a Swiss mathematician whom Newton befriended while in London.\n\nHowever, within a few years, Newton fell into another nervous breakdown in 1693. The cause is open to speculation: his disappointment over not being appointed to a higher position by England's new monarchs, William III and Mary II, or the subsequent loss of his friendship with Duillier; exhaustion from being overworked; or perhaps chronic mercury poisoning after decades of alchemical research.\n\nIt's difficult to know the exact cause, but evidence suggests that letters written by Newton to several of his London acquaintances and friends, including Duillier, seemed deranged and paranoiac, and accused them of betrayal and conspiracy.\n\nOddly enough, Newton recovered quickly, wrote letters of apology to friends, and was back to work within a few months. He emerged with all his intellectual facilities intact, but seemed to have lost interest in scientific problems and now favored pursuing prophecy and scripture and the study of alchemy.\n\nWhile some might see this as work beneath the man who had revolutionized science, it might be more properly attributed to Newton responding to the issues of the time in turbulent 17th century Britain.\n\nMany intellectuals were grappling with the meaning of many different subjects, not least of which were religion, politics and the very purpose of life. Modern science was still so new that no one knew for sure how it measured up against older philosophies.\n\nIn 1696, Newton was able to attain the governmental position he had long sought: warden of the Mint; after acquiring this new title, he permanently moved to London and lived with his niece, Catherine Barton.\n\nBarton was the mistress of Lord Halifax, a high-ranking government official who was instrumental in having Newton promoted, in 1699, to master of the Mint—a position that he would hold until his death.\n\nNot wanting it to be considered a mere honorary position, Newton approached the job in earnest, reforming the currency and severely punishing counterfeiters. As master of the Mint, Newton moved the British currency, the pound sterling, from the silver to the gold standard.\n\nIn 1703, Newton was elected president of the Royal Society upon Robert Hooke's death. However, Newton never seemed to understand the notion of science as a cooperative venture, and his ambition and fierce defense of his own discoveries continued to lead him from one conflict to another with other scientists.\n\nBy most accounts, Newton's tenure at the society was tyrannical and autocratic; he was able to control the lives and careers of younger scientists with absolute power.\n\nIn 1705, in a controversy that had been brewing for several years, German mathematician Gottfried Leibniz publicly accused Newton of plagiarizing his research, claiming he had discovered infinitesimal calculus several years before the publication of Principia.\n\nIn 1712, the Royal Society appointed a committee to investigate the matter. Of course, since Newton was president of the society, he was able to appoint the committee's members and oversee its investigation. Not surprisingly, the committee concluded Newton's priority over the discovery.\n\nThat same year, in another of Newton's more flagrant episodes of tyranny, he published without permission the notes of astronomer John Flamsteed. It seems the astronomer had collected a massive body of data from his years at the Royal Observatory at Greenwich, England.\n\nNewton had requested a large volume of Flamsteed's notes for his revisions to Principia. Annoyed when Flamsteed wouldn't provide him with more information as quickly as he wanted it, Newton used his influence as president of the Royal Society to be named the chairman of the body of \"visitors\" responsible for the Royal Observatory.\n\nHe then tried to force the immediate publication of Flamsteed's catalogue of the stars, as well as all of Flamsteed's notes, edited and unedited. To add insult to injury, Newton arranged for Flamsteed's mortal enemy, Edmund Halley, to prepare the notes for press.\n\nFlamsteed was finally able to get a court order forcing Newton to cease his plans for publication and return the notes—one of the few times that Newton was bested by one of his rivals.\n\nToward the end of this life, Newton lived at Cranbury Park, near Winchester, England, with his niece, Catherine (Barton) Conduitt, and her husband, John Conduitt.\n\nBy this time, Newton had become one of the most famous men in Europe. His scientific discoveries were unchallenged. He also had become wealthy, investing his sizable income wisely and bestowing sizable gifts to charity.\n\nDespite his fame, Newton's life was far from perfect: He never married or made many friends, and in his later years, a combination of pride, insecurity and side trips on peculiar scientific inquiries led even some of his few friends to worry about his mental stability.\n\nBy the time he reached 80 years of age, Newton was experiencing digestion problems and had to drastically change his diet and mobility.\n\nIn March 1727, Newton experienced severe pain in his abdomen and blacked out, never to regain consciousness. He died the next day, on March 31, 1727, at the age of 84.\n\nNewton's fame grew even more after his death, as many of his contemporaries proclaimed him the greatest genius who ever lived. Maybe a slight exaggeration, but his discoveries had a large impact on Western thought, leading to comparisons to the likes of Plato, Aristotle and Galileo.\n\nAlthough his discoveries were among many made during the Scientific Revolution, Newton's universal principles of gravity found no parallels in science at the time.\n\nOf course, Newton was proven wrong on some of his key assumptions. In the 20th century, Albert Einstein would overturn Newton's concept of the universe, stating that space, distance and motion were not absolute but relative and that the universe was more fantastic than Newton had ever conceived.\n\nNewton might not have been surprised: In his later life, when asked for an assessment of his achievements, he replied, \"I do not know what I may appear to the world; but to myself I seem to have been only like a boy playing on the seashore, and diverting myself now and then in finding a smoother pebble or prettier shell than ordinary, while the great ocean of truth lay all undiscovered before me.\"\n\nBirth date: January 4, 1643\n\nBirth City: Woolsthorpe, Lincolnshire, England\n\nBirth Country: United Kingdom\n\nBest Known For: Isaac Newton was an English physicist and mathematician famous for his laws of physics. He was a key figure in the Scientific Revolution of the 17th century.\n\nScience and Medicine\n\nTechnology and Engineering\n\nEducation and Academia\n\nAstrological Sign: Capricorn\n\nUniversity of Cambridge, Trinity College\n\nIsaac Newton helped develop the principles of modern physics, including the laws of motion, and is credited as one of the great minds of the 17th-century Scientific Revolution.\n\nIn 1687, Newton published his most acclaimed work, 'Philosophiae Naturalis Principia Mathematica' ('Mathematical Principles of Natural Philosophy'), which has been called the single most influential book on physics.\n\nNewton's theory of gravity states that two objects attract each other with a force of gravitational attraction that’s proportional to their masses and inversely proportional to the square of the distance between their centers.\n\nDeath date: March 31, 1727\n\nDeath City: London, England\n\nDeath Country: United Kingdom\n\nWe strive for accuracy and fairness.If you see something that doesn't look right,contact us!\n\nCITATION INFORMATION\n\nArticle Title: Isaac Newton Biography\n\nAuthor: Biography.com Editors\n\nWebsite Name: The Biography.com website\n\nUrl: https://www.biography.com/scientists/isaac-newton\n\nPublisher: A&E; Television Networks\n\nLast Updated: November 5, 2020\n\nOriginal Published Date: April 3, 2014\n\nI do not know what I may appear to the world; but to myself I seem to have been only like a boy playing on the seashore, and diverting myself now and then in finding a smoother pebble or prettier shell than ordinary, while the great ocean of truth lay all undiscovered before me.\n\nPlato is my friend, Aristotle is my friend, but my greatest friend is truth.\n\nIf I have seen further it is by standing on the shoulders of giants.\n\nIt is the perfection of God's works that they are all done with the greatest simplicity.\n\nEvery body continues in its state of rest, or of uniform motion in a right line, unless it is compelled to change that state by forces impressed upon it.\n\nTo every action there is always opposed an equal reaction: or, the mutual actions of two bodies upon each other are always equal, and directed to contrary parts.\n\nI see I have made myself a slave to philosophy.\n\nThe changing of bodies into light, and light into bodies, is very conformable to the course of nature, which seems delighted with transmutations.\n\nTo explain all nature is too difficult a task for any one man or even for any one age. Tis much better to do a little with certainty and leave the rest for others that come after, then to explain all things by conjecture without making sure of any thing.\n\nTruth is ever to be found in simplicity, and not in the multiplicity and confusion of things.\n\nAtheism is so senseless and odious to mankind that it never had many professors.\n\nNewton was not the first of the age of reason. He was the last of the magicians, the last of the Babylonians and Sumerians, the last great mind that looked out on the visible and intellectual world with the same eyes as those who began to build our intellectual inheritance rather less than 10,000 years ago.\n\nAdvertisement - Continue Reading Below\n\nFamous British People\n\nAdvertisement - Continue Reading Below\n\nThe Real Royal Scheme Depicted in ‘Mary & George’\n\nAdvertisement - Continue Reading Below" - timestamp: '2024-08-13T07:52:50.0000000+04:00' + timestamp: '2024-08-13T07:52:50.0000000+00:00' title: 'Isaac Newton - Quotes, Facts & Laws' url: https://www.biography.com/scientists/isaac-newton - id: web-search_5 snippet: "Join our email list and be the first to learn about new programs, events, and collections updates!Sign Up\n\nWednesday, August 14, 2024\n\nOpen today 4 PM - 11 PM\n\nWednesday, August 14, 2024\n\nOpen today 4 PM - 11 PM\n\nScientist of the Day\n\nIsaac Newton was born Jan. 4, 1643. It used to be that we celebrated Newton’s birthday on Dec. 25, for his own birth records attest that he came into the world on Christmas Day, 1642. But the Julian calendar in use in England at the time of Newton’s...\n\nScientist of the Day - Isaac Newton\n\nIsaac Newton was born Jan. 4, 1643. It used to be that we celebrated Newton’s birthday on Dec. 25, for his own birth records attest that he came into the world on Christmas Day, 1642. But the Julian calendar in use in England at the time of Newton’s birth was 10 days behind the Gregorian calendar that had been adopted by most of the Continent, so if you had asked Christiaan Huygens or Pierre Fermat for Newton’s birthday, they would have said Jan. 4, 1643. The generally accepted practice among historians today is to convert all Julian dates between 1582 (when the Gregorian calendar was first implemented) and 1752 (when England finally adopted the “new style” calendar) to Gregorian dates, and we have done so here.\n\nNearly everyone has heard of Isaac Newton and knows that he “discovered gravity”. What Newton actually proposed is the existence of a universal force of gravitation, so that any two objects in the universe are attracted to one another by a force that increases with the product of the masses of the two objects, and decreases with the square of the distance between them. With this force, Newton was able to explain: the rate at which an apple falls, the orbits of the moon and planets, the swing of a pendulum, the ebb and flow of the tides, and even the shape of the earth. Even though Newton did not know how this force acted at a distance, its explanatory power was so great that universal gravitation was almost universally adopted within twenty-five years of his death in 1727.\n\nNewton’s equation for the force of gravitation, and his famous “laws of motion”, first appeared in his Mathematical Principles of Natural Philosophy (1687), usually referred to as the Principia, after the third word of the Latin title. We have nearly every edition of the Principia ever published, including the first, in our History of Science Collection. The first English translation of 1729 includes a frontispiece that not only deifies Newton, but nicely represents the solar system as bound together by gravitational forces (third image).\n\nThe copy of the 1687 Principia shown above (second image) is not our copy, but rather Newton’s own corrected copy, in the Cambridge University Library.\n\nDr. William B. Ashworth, Jr., Consultant for the History of Science, Linda Hall Library and Associate Professor, Department of History, University of Missouri-Kansas City. Comments or corrections are welcome; please direct to ashworthw@umkc.edu.\n\nMargaret Lindsay Huggins\n\nScientist of the Day\n\nScientist of the Day\n\nScientist of the Day\n\nScientist of the Day\n\nScientist of the Day\n\nMonday - Friday 10 AM - 5 PM\n\nTelephone816.363.4600\n\n5109 Cherry Street Kansas City, Missouri 64110-2498\n\nAcceptable Use Policy\n\nTerms and Conditions\n\nLinda Hall Library on FacebookLinda Hall Library on TwitterLinda Hall Library on TumblrLinda Hall Library on VimeoLinda Hall Library on InstagramLinda Hall Library on Youtube" - timestamp: '2024-08-14T18:39:29.0000000+04:00' + timestamp: '2024-08-14T18:39:29.0000000+00:00' title: Isaac Newton - Linda Hall Library url: https://www.lindahall.org/about/news/scientist-of-the-day/isaac-newton/ search_results: @@ -694,7 +713,7 @@ paths: tool_calls: - name: query_daily_sales_report parameters: - day: '2023-09-29T00:00:00.0000000+04:00' + day: '2023-09-29T00:00:00.0000000+00:00' - name: query_product_catalog parameters: category: Electronics @@ -711,7 +730,7 @@ paths: tool_calls: - name: query_daily_sales_report parameters: - day: '2023-09-29T00:00:00.0000000+04:00' + day: '2023-09-29T00:00:00.0000000+00:00' - name: query_product_catalog parameters: category: Electronics @@ -737,17 +756,25 @@ paths: tools: type: array items: - $ref: '#/components/schemas/Tool-2' + $ref: '#/components/schemas/ToolV2' description: "A list of available tools (functions) that the model may suggest invoking before producing a text response.\n\nWhen `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.\n" - citation_mode: - enum: - - FAST - - ACCURATE - - OFF - type: string - description: "Defaults to `\"accurate\"`.\nDictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `\"accurate\"` results, `\"fast\"` results or no results.\n" + documents: + type: array + items: + oneOf: + - type: string + - $ref: '#/components/schemas/Document' + description: "A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.\n" + citation_options: + $ref: '#/components/schemas/CitationOptions' response_format: - $ref: '#/components/schemas/ResponseFormat-2' + $ref: '#/components/schemas/ResponseFormatV2' + safety_mode: + enum: + - CONTEXTUAL + - STRICT + - NONE + description: "Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `NONE` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" max_tokens: type: integer description: "The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations.\n" @@ -796,8 +823,8 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/NonStreamedChatResponse-2' - - $ref: '#/components/schemas/StreamedChatResponse-2' + - $ref: '#/components/schemas/ChatResponse' + - $ref: '#/components/schemas/StreamedChatResponseV2' '400': $ref: '#/components/responses/BadRequest' '401': @@ -830,7 +857,6 @@ paths: format: sse stream-condition: $request.stream response: - x-fern-sdk-group-name: v2 required: - id - finish_reason @@ -846,7 +872,6 @@ paths: usage: $ref: '#/components/schemas/Usage' response-stream: - x-fern-sdk-group-name: v2 description: StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). oneOf: - $ref: '#/components/schemas/ChatMessageStartEvent' @@ -894,24 +919,28 @@ paths: - code-samples: - sdk: typescript name: Documents - code: "const { CohereClientV2 } = require('cohere-ai');\n\nconst cohere = new CohereClientV2({\n token: '<>',\n});\n\n(async () => {\n const response = await cohere.chat({\n model: 'command-r-plus',\n messages: [\n {\n role: 'user',\n content: [{ type: 'text', text: \"Who's the best?\" }],\n documents: [{ id: '1', text: 'Cohere is the best!' }],\n },\n ],\n });\n\n console.log(response);\n})();\n" + code: "const { CohereClientV2 } = require('cohere-ai');\n\nconst cohere = new CohereClientV2({\n token: '<>',\n});\n\n(async () => {\n const response = await cohere.chat({\n model: 'command-r-plus',\n documents: [{ id: '1', data: 'Cohere is the best!' }],\n messages: [\n {\n role: 'user',\n content: [{ type: 'text', text: \"Who's the best?\" }],\n },\n ],\n });\n\n console.log(response);\n})();\n" - sdk: python name: Documents - code: "import cohere\n\nco = cohere.ClientV2(\"<>\")\n\nresponse = co.chat(\n model=\"command-r-plus\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Who's the best?\",\n \"documents\": [{'id': '1', 'title': 'The best', 'text': 'Cohere is the best!'}]\n }\n ]\n)\n\nprint(response)\n" + code: "import cohere\n\nco = cohere.ClientV2(\"<>\")\n\nresponse = co.chat(\n model=\"command-r-plus\",\n documents=[{'id': '1', 'data': {'text': 'Cohere is the best!', 'title': 'The best'}}],\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Who's the best?\"\n }\n ]\n)\n\nprint(response)\n" request: model: command-r + documents: + - data: + content: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' + snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." + - data: + content: 'CSPC: NSYNC Popularity Analysis - ChartMasters' + snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." + - data: + content: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' + snippet: "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers – especially teenagers and young women’s – embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." + - data: + content: 'CSPC: NSYNC Popularity Analysis - ChartMasters' + snippet: "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I’ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC‘s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." messages: - role: user content: 'Who is more popular: Nsync or Backstreet Boys?' - documents: - - title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' - snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." - - title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' - snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." - - title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' - snippet: "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers – especially teenagers and young women’s – embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." - - title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' - snippet: "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I’ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC‘s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." stream: false response: body: @@ -927,7 +956,7 @@ paths: text: extremely popular at the turn of the millennium. sources: - type: document - id: doc_1 + id: doc:1 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' @@ -936,7 +965,7 @@ paths: text: massive album sales across the globe sources: - type: document - id: doc_0 + id: doc:0 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -945,7 +974,7 @@ paths: text: great singles sales sources: - type: document - id: doc_0 + id: doc:0 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -954,7 +983,7 @@ paths: text: plenty of chart-topping releases sources: - type: document - id: doc_0 + id: doc:0 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -963,7 +992,7 @@ paths: text: hyped tours sources: - type: document - id: doc_0 + id: doc:0 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -972,7 +1001,7 @@ paths: text: tremendous media coverage. sources: - type: document - id: doc_0 + id: doc:0 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHernán Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -981,7 +1010,7 @@ paths: text: album No Strings Attached selling 2.4 million units in its first week. sources: - type: document - id: doc_1 + id: doc:1 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' @@ -990,7 +1019,7 @@ paths: text: second fastest-selling album of the Soundscan era before 2015 sources: - type: document - id: doc_1 + id: doc:1 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' @@ -999,7 +1028,7 @@ paths: text: Celebrity debuting at 1.88 million units sold. sources: - type: document - id: doc_1 + id: doc:1 document: snippet: "↓ Skip to Main Content\n\nMusic industry – One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven’t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn’t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." title: 'CSPC: NSYNC Popularity Analysis - ChartMasters' @@ -1008,7 +1037,7 @@ paths: text: success in some countries that were traditionally hard to penetrate for Western artists. sources: - type: document - id: doc_2 + id: doc:2 document: snippet: "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers – especially teenagers and young women’s – embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." title: 'CSPC: Backstreet Boys Popularity Analysis - ChartMasters' @@ -1035,90 +1064,110 @@ paths: stream: true response: stream: - - type: message-start - id: 29f14a5a-11de-4cae-9800-25e4747408ea - delta: - message: - role: assistant - content: [ ] - tool_plan: '' - tool_calls: [ ] - citations: [ ] - - type: content-start - index: 0 - delta: - message: - content: - type: text - text: '' - - type: content-delta - index: 0 - delta: - message: - content: - text: Hello - - type: content-delta - index: 0 - delta: - message: - content: - text: '!' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' How' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' can' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' I' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' help' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' you' - - type: content-delta - index: 0 - delta: - message: - content: - text: ' today' - - type: content-delta - index: 0 - delta: - message: - content: - text: '?' - - type: content-end - index: 0 - - event_type: message-end - delta: - finish_reason: complete - usage: - api_version: - version: '2' - billed_units: - input_tokens: 3 - output_tokens: 9 - tokens: - input_tokens: 69 - output_tokens: 9 + - event: stream-start + data: + type: message-start + id: 29f14a5a-11de-4cae-9800-25e4747408ea + delta: + message: + role: assistant + - event: text-generation + data: + type: content-start + index: 0 + delta: + message: + content: + type: text + text: '' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: Hello + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: '!' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' How' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' can' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' I' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' help' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' you' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: ' today' + - event: text-generation + data: + type: content-delta + index: 0 + delta: + message: + content: + text: '?' + - event: text-generation + data: + type: content-end + index: 0 + - event: stream-end + data: + type: message-end + delta: + finish_reason: complete + usage: + billed_units: + input_tokens: 3 + output_tokens: 9 + tokens: + input_tokens: 69 + output_tokens: 9 - code-samples: - sdk: typescript name: Tools @@ -1162,26 +1211,26 @@ paths: id: 9e5f00aa-bf1e-481a-abe3-0eceac18c3ec message: role: assistant - tool_plan: 'I will first find the sales summary for 29th September 2023. Then, I wil' - find the details of the products in the 'Electronics' category." tool_calls: - - id: query_daily_sales_report_hgxxmkby3wta - type: function - function: - name: query_daily_sales_report - arguments: '{"day": "2023-09-29"}' - - id: query_product_catalog_rpg0z5h8yyz2 - type: function - function: - name: query_product_catalog - arguments: '{"category": "Electronics"}' - finish_reason: tool_call - usage: - billed_units: - input_tokens: 127 - output_tokens: 69 - tokens: - input_tokens: 1032 - output_tokens: 124 + tool_plan: 'I will first find the sales summary for 29th September 2023. Then, I will find the details of the products in the ''Electronics'' category.' + tool_calls: + - id: query_daily_sales_report_hgxxmkby3wta + type: function + function: + name: query_daily_sales_report + arguments: '{"day": "2023-09-29"}' + - id: query_product_catalog_rpg0z5h8yyz2 + type: function + function: + name: query_product_catalog + arguments: '{"category": "Electronics"}' + finish_reason: tool_call + usage: + billed_units: + input_tokens: 127 + output_tokens: 69 + tokens: + input_tokens: 1032 + output_tokens: 124 /v1/generate: post: summary: Generate @@ -1451,8 +1500,6 @@ paths: content: application/json: schema: - required: - - texts type: object properties: texts: @@ -3628,6 +3675,106 @@ paths: billed_units: input_tokens: 2 response_type: embeddings_floats + /v2/embed: + post: + summary: Embed + description: "This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.\n\nEmbeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search)." + operationId: embedv2 + parameters: + - $ref: '#/components/parameters/RequestSource' + requestBody: + description: '' + content: + application/json: + schema: + required: + - model + type: object + properties: + texts: + maxItems: 96 + minItems: 1 + type: array + items: + type: string + writeOnly: true + x-fern-audiences: + - public + description: An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality. + writeOnly: true + x-fern-audiences: + - public + model: + type: string + description: "Defaults to embed-english-v2.0\n\nThe identifier of the model. Smaller \"light\" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.\n\nAvailable models and corresponding embedding dimensions:\n\n* `embed-english-v3.0` 1024\n* `embed-multilingual-v3.0` 1024\n* `embed-english-light-v3.0` 384\n* `embed-multilingual-light-v3.0` 384\n\n* `embed-english-v2.0` 4096\n* `embed-english-light-v2.0` 1024\n* `embed-multilingual-v2.0` 768" + writeOnly: true + x-fern-audiences: + - public + input_type: + $ref: '#/components/schemas/EmbedInputType' + embedding_types: + type: array + items: + $ref: '#/components/schemas/EmbeddingType' + description: "Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.\n\n* `\"float\"`: Use this when you want to get back the default float embeddings. Valid for all models.\n* `\"int8\"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.\n* `\"uint8\"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.\n* `\"binary\"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.\n* `\"ubinary\"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models." + writeOnly: true + x-fern-audiences: + - public + truncate: + enum: + - NONE + - START + - END + type: string + description: "One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.\n\nPassing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.\n\nIf `NONE` is selected, when the input exceeds the maximum input token length an error will be returned." + default: END + writeOnly: true + x-fern-audiences: + - public + x-fern-audiences: + - public + responses: + '200': + description: OK + headers: + X-API-Warning: + description: Warning description for incorrect usage of the API + schema: + type: string + x-fern-audiences: + - public + content: + application/json: + schema: + $ref: '#/components/schemas/EmbedByTypeResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '429': + $ref: '#/components/responses/RateLimit' + '498': + $ref: '#/components/responses/InvalidToken' + '499': + $ref: '#/components/responses/RequestCancelled' + '500': + $ref: '#/components/responses/InternalServerError' + '501': + $ref: '#/components/responses/NotImplemented' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '504': + $ref: '#/components/responses/GatewayTimeout' + x-fern-audiences: + - v2-beta + x-fern-sdk-group-name: v2 + x-fern-sdk-method-name: embed /v1/embed-jobs: post: tags: @@ -4120,6 +4267,156 @@ paths: version: '1' billed_units: search_units: 1 + /v2/rerank: + post: + summary: Rerank + description: This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + operationId: rerankv2 + parameters: + - $ref: '#/components/parameters/RequestSource' + requestBody: + description: '' + content: + application/json: + schema: + required: + - query + - documents + - model + type: object + properties: + model: + type: string + description: 'The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`' + x-fern-audiences: + - public + query: + type: string + description: The search query + x-fern-audiences: + - public + documents: + type: array + items: + oneOf: + - type: string + - $ref: '#/components/schemas/RerankDocument' + description: "A list of document objects or strings to rerank.\nIf a document is provided the text fields is required and all other fields will be preserved in the response.\n\nThe total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.\n\nWe recommend a maximum of 1,000 documents for optimal endpoint performance." + x-fern-audiences: + - public + top_n: + minimum: 1 + type: integer + description: 'The number of most relevant documents or indices to return, defaults to the length of the documents' + x-fern-audiences: + - public + rank_fields: + type: array + items: + type: string + x-fern-audiences: + - public + description: 'If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=[''title'',''author'',''text''] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.' + x-fern-audiences: + - public + return_documents: + type: boolean + description: "- If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.\n- If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request." + default: false + x-fern-audiences: + - public + max_chunks_per_doc: + type: integer + description: The maximum number of chunks to produce internally from a document + default: 10 + x-fern-audiences: + - public + x-fern-audiences: + - public + responses: + '200': + description: OK + content: + application/json: + schema: + required: + - results + type: object + properties: + id: + type: string + x-fern-audiences: + - public + results: + type: array + items: + required: + - index + - relevance_score + type: object + properties: + document: + required: + - text + type: object + properties: + text: + type: string + description: The text of the document to rerank + x-fern-audiences: + - public + description: 'If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in' + x-fern-audiences: + - public + index: + type: integer + description: 'Corresponds to the index in the original list of documents to which the ranked document belongs. (i.e. if the first value in the `results` object has an `index` value of 3, it means in the list of documents passed in, the document at `index=3` had the highest relevance)' + x-fern-audiences: + - public + relevance_score: + type: number + description: 'Relevance scores are normalized to be in the range `[0, 1]`. Scores close to `1` indicate a high relevance to the query, and scores closer to `0` indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45' + format: float + readOnly: true + x-fern-audiences: + - public + x-fern-audiences: + - public + description: An ordered list of ranked documents + x-fern-audiences: + - public + meta: + $ref: '#/components/schemas/ApiMeta' + x-fern-audiences: + - public + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' + '429': + $ref: '#/components/responses/RateLimit' + '498': + $ref: '#/components/responses/InvalidToken' + '499': + $ref: '#/components/responses/RequestCancelled' + '500': + $ref: '#/components/responses/InternalServerError' + '501': + $ref: '#/components/responses/NotImplemented' + '503': + $ref: '#/components/responses/ServiceUnavailable' + '504': + $ref: '#/components/responses/GatewayTimeout' + x-fern-audiences: + - v2-beta + x-fern-sdk-group-name: v2 + x-fern-sdk-method-name: rerank /v1/classify: post: summary: Classify @@ -4547,16 +4844,16 @@ paths: - code-samples: - sdk: go name: Cohere Go SDK - code: "package main\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log\"\n\t\"strings\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\ntype MyReader struct {\n\tio.Reader\n\tname string\n}\n\nfunc (m *MyReader) Name() string {\n\treturn m.name\n}\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(\"<>\"))\n\n\tresp, err := co.Datasets.Create(\n\t\tcontext.TODO(),\n\t\t&MyReader{Reader: strings.NewReader(`{\"text\": \"The quick brown fox jumps over the lazy dog\"}`), name: \"test.jsonl\"},\n\t\t&MyReader{Reader: strings.NewReader(\"\"), name: \"a.jsonl\"},\n\t\t&cohere.DatasetsCreateRequest{\n\t\t\tName: \"prompt-completion-dataset\",\n\t\t\tType: cohere.DatasetTypeEmbedResult,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" + code: "package main\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log\"\n\t\"strings\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\ntype MyReader struct {\n\tio.Reader\n\tname string\n}\n\nfunc (m *MyReader) Name() string {\n\treturn m.name\n}\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(\"<>\"))\n\n\tresp, err := co.Datasets.Create(\n\t\tcontext.TODO(),\n\t\t&MyReader{Reader: strings.NewReader(`{\"text\": \"The quick brown fox jumps over the lazy dog\"}`), name: \"test.jsonl\"},\n\t\t&MyReader{Reader: strings.NewReader(\"\"), name: \"a.jsonl\"},\n\t\t&cohere.DatasetsCreateRequest{\n\t\t\tName: \"embed-dataset\",\n\t\t\tType: cohere.DatasetTypeEmbedResult,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" - sdk: python name: Sync - code: "import cohere\n\nco = cohere.Client(\"<>\")\n\n# upload a dataset\nmy_dataset = co.datasets.create(\n name=\"prompt-completion-dataset\",\n data=open(\"./prompt-completion.jsonl\", \"rb\"),\n type=\"prompt-completion-finetune-input\",\n)\n\n# wait for validation to complete\nresponse = co.wait(my_dataset)\n\nprint(response)\n" + code: "import cohere\n\nco = cohere.Client(\"<>\")\n\n# upload a dataset\nmy_dataset = co.datasets.create(\n name=\"chat-dataset\",\n data=open(\"./chat.jsonl\", \"rb\"),\n type=\"chat-finetune-input\",\n)\n\n# wait for validation to complete\nresponse = co.wait(my_dataset)\n\nprint(response)\n" - sdk: python name: Async - code: "import cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<>\")\n\n\nasync def main():\n\n # upload a dataset\n response = await co.datasets.create(\n name=\"prompt-completion-dataset\",\n data=open(\"./prompt-completion.jsonl\", \"rb\"),\n type=\"prompt-completion-finetune-input\",\n )\n\n # wait for validation to complete\n response = await co.wait(response)\n\n print(response)\n\nasyncio.run(main())\n" + code: "import cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<>\")\n\n\nasync def main():\n\n # upload a dataset\n response = await co.datasets.create(\n name=\"chat-dataset\",\n data=open(\"./chat.jsonl\", \"rb\"),\n type=\"chat-finetune-input\",\n )\n\n # wait for validation to complete\n response = await co.wait(response)\n\n print(response)\n\nasyncio.run(main())\n" - sdk: java name: Cohere java SDK - code: "import com.cohere.api.Cohere;\nimport com.cohere.api.resources.datasets.requests.DatasetsCreateRequest;\nimport com.cohere.api.resources.datasets.types.DatasetsCreateResponse;\nimport com.cohere.api.types.DatasetType;\n\nimport java.util.Optional;\n\n\npublic class DatasetPost {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name(\"prompt-completion-dataset\").type(DatasetType.PROMPT_COMPLETION_FINETUNE_INPUT).build());\n\n System.out.println(response);\n }\n}\n" + code: "import com.cohere.api.Cohere;\nimport com.cohere.api.resources.datasets.requests.DatasetsCreateRequest;\nimport com.cohere.api.resources.datasets.types.DatasetsCreateResponse;\nimport com.cohere.api.types.DatasetType;\n\nimport java.util.Optional;\n\n\npublic class DatasetPost {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name(\"chat-dataset\").type(DatasetType.CHAT_FINETUNE_INPUT).build());\n\n System.out.println(response);\n }\n}\n" - sdk: typescript name: Cohere TypeScript SDK code: "const { CohereClient } = require('cohere-ai');\nconst fs = require('fs');\n\nconst cohere = new CohereClient({\n token: '<>',\n});\n\n(async () => {\n const file = fs.createReadStream('embed_jobs_sample_data.jsonl'); // {\"text\": \"The quick brown fox jumps over the lazy dog\"}\n\n const dataset = await cohere.datasets.create({ name: 'my-dataset', type: 'embed-input' }, file);\n\n console.log(dataset);\n})();\n" @@ -6036,14 +6333,14 @@ paths: example: finetuned_models: - id: fee37446-7fc7-42f9-a026-c6ba2fcc422d - name: prompt-completion-ft + name: chat-ft creator_id: 7a317d97-4d05-427d-9396-f31b9fb92c55 organization_id: 6bdca3d5-3eae-4de0-ac34-786d8063b7ee settings: base_model: name: medium version: 14.2.0 - base_type: BASE_TYPE_GENERATIVE + base_type: BASE_TYPE_CHAT strategy: STRATEGY_TFEW dataset_id: my-dataset-d701tr hyperparameters: @@ -6148,7 +6445,7 @@ paths: name: api-test settings: base_model: - base_type: BASE_TYPE_GENERATIVE + base_type: BASE_TYPE_CHAT dataset_id: my-dataset-id required: true responses: @@ -6198,22 +6495,22 @@ paths: - code-samples: - sdk: java name: Cohere java SDK - code: "package finetuning;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.finetuning.finetuning.types.*;\n\npublic class CreateFinetunedModel {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name(\"test-finetuned-model\").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId(\"my-dataset-id\").build()).build());\n\n System.out.println(response);\n }\n}\n\n\n" + code: "package finetuning;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.finetuning.finetuning.types.*;\n\npublic class CreateFinetunedModel {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name(\"test-finetuned-model\").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId(\"my-dataset-id\").build()).build());\n\n System.out.println(response);\n }\n}\n\n\n" - sdk: go name: Cohere Go SDK - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/cohere-ai/cohere-go/v2/client\"\n\t\"github.com/cohere-ai/cohere-go/v2/finetuning\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(\"<>\"))\n\n\tresp, err := co.Finetuning.CreateFinetunedModel(\n\t\tcontext.TODO(),\n\t\t&finetuning.FinetunedModel{\n\t\t\tName: \"test-finetuned-model\",\n\t\t\tSettings: &finetuning.Settings{\n\t\t\t\tDatasetId: \"my-dataset-id\",\n\t\t\t\tBaseModel: &finetuning.BaseModel{\n\t\t\t\t\tBaseType: finetuning.BaseTypeBaseTypeGenerative,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp.FinetunedModel)\n}\n" + code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/cohere-ai/cohere-go/v2/client\"\n\t\"github.com/cohere-ai/cohere-go/v2/finetuning\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(\"<>\"))\n\n\tresp, err := co.Finetuning.CreateFinetunedModel(\n\t\tcontext.TODO(),\n\t\t&finetuning.FinetunedModel{\n\t\t\tName: \"test-finetuned-model\",\n\t\t\tSettings: &finetuning.Settings{\n\t\t\t\tDatasetId: \"my-dataset-id\",\n\t\t\t\tBaseModel: &finetuning.BaseModel{\n\t\t\t\t\tBaseType: finetuning.BaseTypeBaseTypeChat,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp.FinetunedModel)\n}\n" - sdk: typescript name: Cohere TypeScript SDK - code: "const { Cohere, CohereClient } = require('cohere-ai');\n\nconst cohere = new CohereClient({\n token: '<>',\n});\n\n(async () => {\n const finetunedModel = await cohere.finetuning.createFinetunedModel({\n name: 'test-finetuned-model',\n settings: {\n base_model: {\n base_type: Cohere.Finetuning.BaseType.BaseTypeGenerative,\n },\n dataset_id: 'test-dataset-id',\n },\n });\n\n console.log(finetunedModel);\n})();\n" + code: "const { Cohere, CohereClient } = require('cohere-ai');\n\nconst cohere = new CohereClient({\n token: '<>',\n});\n\n(async () => {\n const finetunedModel = await cohere.finetuning.createFinetunedModel({\n name: 'test-finetuned-model',\n settings: {\n base_model: {\n base_type: Cohere.Finetuning.BaseType.BaseTypeChat,\n },\n dataset_id: 'test-dataset-id',\n },\n });\n\n console.log(finetunedModel);\n})();\n" - sdk: python name: Sync code: "from cohere.finetuning import (\n BaseModel,\n FinetunedModel,\n Hyperparameters,\n Settings,\n WandbConfig\n)\nimport cohere\n\nco = cohere.Client(\"<>\")\nhp = Hyperparameters(\n early_stopping_patience=10,\n early_stopping_threshold=0.001,\n train_batch_size=16,\n train_epoch=1,\n learning_rate=0.01,\n)\nwnb_config = WandbConfig(\n project=\"test-project\",\n api_key=\"<>\",\n entity=\"test-entity\",\n)\nfinetuned_model = co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=\"BASE_TYPE_CHAT\",\n ),\n dataset_id=\"my-dataset-id\",\n hyperparameters=hp,\n wandb=wnb_config,\n ),\n )\n)\nprint(finetuned_model)\n" - sdk: python name: Async - code: "from cohere.finetuning import (\n BaseModel,\n BaseType,\n FinetunedModel,\n Settings,\n)\nimport cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<>\")\n\n\nasync def main():\n response = await co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=BaseType.BASE_TYPE_CHAT,\n ),\n dataset_id=\"my-dataset-id\",\n ),\n )\n )\n print(response)\n\nasyncio.run(main())\n" + code: "from cohere.finetuning import (\n BaseModel,\n FinetunedModel,\n Settings,\n)\nimport cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<>\")\n\n\nasync def main():\n response = await co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=\"BASE_TYPE_CHAT\",\n ),\n dataset_id=\"my-dataset-id\",\n ),\n )\n )\n print(response)\n\nasyncio.run(main())\n" - sdk: curl name: cURL - code: "curl --request POST \\\n --url https://api.cohere.com/v1/finetuning/finetuned-models \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"name\": \"test-finetuned-model\",\n \"settings\": {\n \"base_model\": {\n \"base_type\": \"BASE_TYPE_GENERATIVE\",\n },\n \"dataset_id\": \"test-dataset-id\"\n }\n }'\n" + code: "curl --request POST \\\n --url https://api.cohere.com/v1/finetuning/finetuned-models \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"name\": \"test-finetuned-model\",\n \"settings\": {\n \"base_model\": {\n \"base_type\": \"BASE_TYPE_CHAT\",\n },\n \"dataset_id\": \"test-dataset-id\"\n }\n }'\n" x-fern-sdk-group-name: finetuning x-fern-audiences: - public @@ -6325,7 +6622,7 @@ paths: - code-samples: - sdk: java name: Cohere java SDK - code: "package finetuning;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.finetuning.finetuning.types.BaseModel;\nimport com.cohere.api.resources.finetuning.finetuning.types.BaseType;\nimport com.cohere.api.resources.finetuning.finetuning.types.Settings;\nimport com.cohere.api.resources.finetuning.finetuning.types.UpdateFinetunedModelResponse;\nimport com.cohere.api.resources.finetuning.requests.FinetuningUpdateFinetunedModelRequest;\n\n\npublic class UpdateFinetunedModel {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel(\"test-id\", FinetuningUpdateFinetunedModelRequest.builder().name(\"new name\").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId(\"my-dataset-id\").build()).build());\n\n System.out.println(response);\n }\n}\n" + code: "package finetuning;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.finetuning.finetuning.types.BaseModel;\nimport com.cohere.api.resources.finetuning.finetuning.types.BaseType;\nimport com.cohere.api.resources.finetuning.finetuning.types.Settings;\nimport com.cohere.api.resources.finetuning.finetuning.types.UpdateFinetunedModelResponse;\nimport com.cohere.api.resources.finetuning.requests.FinetuningUpdateFinetunedModelRequest;\n\n\npublic class UpdateFinetunedModel {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().token(\"<>\").clientName(\"snippet\").build();\n\n UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel(\"test-id\", FinetuningUpdateFinetunedModelRequest.builder().name(\"new name\").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId(\"my-dataset-id\").build()).build());\n\n System.out.println(response);\n }\n}\n" - sdk: go name: Cohere Go SDK code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\t\"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(\"<>\"))\n\n\tresp, err := co.Finetuning.UpdateFinetunedModel(\n\t\tcontext.TODO(),\n\t\t\"test-id\",\n\t\t&cohere.FinetuningUpdateFinetunedModelRequest{\n\t\t\tName: \"new-name\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp.FinetunedModel)\n}\n" @@ -6368,14 +6665,14 @@ paths: example: finetuned_model: id: fee37446-7fc7-42f9-a026-c6ba2fcc422d - name: prompt-completion-ft + name: chat-ft creator_id: 7a317d97-4d05-427d-9396-f31b9fb92c55 organization_id: 6bdca3d5-3eae-4de0-ac34-786d8063b7ee settings: base_model: name: medium version: 14.2.0 - base_type: BASE_TYPE_GENERATIVE + base_type: BASE_TYPE_CHAT strategy: STRATEGY_TFEW dataset_id: my-dataset-d701tr hyperparameters: @@ -6927,7 +7224,7 @@ components: oneOf: - $ref: '#/components/schemas/TextResponseFormat' - $ref: '#/components/schemas/JSONResponseFormat' - description: "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**Note**: When using `{ \"type\": \"json_object\" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _\"Generate a JSON ...\"_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.\n**Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided).\n" + description: "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**Note**: When using `{ \"type\": \"json_object\" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _\"Generate a JSON ...\"_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.\n**Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided).\n" ChatCitation: required: - start @@ -7362,12 +7659,10 @@ components: text: type: string description: Text content of the message. - x-fern-sdk-group-name: v2 Content: oneOf: - $ref: '#/components/schemas/TextContent' description: A Content block which contains information about the content type and the content itself. - x-fern-sdk-group-name: v2 UserMessage: required: - role @@ -7385,15 +7680,8 @@ components: items: $ref: '#/components/schemas/Content' description: "The content of the message. This can be a string or a list of content blocks.\nIf a string is provided, it will be treated as a text content block.\n" - documents: - minItems: 0 - type: array - items: - $ref: '#/components/schemas/ChatDocument' - description: Documents seen by the model when generating the reply. description: A message from the user. - x-fern-sdk-group-name: v2 - ToolCall-2: + ToolCallV2: type: object properties: id: @@ -7410,7 +7698,6 @@ components: arguments: type: string description: A array of tool calls to be made. - x-fern-sdk-group-name: v2 ToolSource: type: object properties: @@ -7419,7 +7706,6 @@ components: description: The unique identifier of the document tool_output: type: object - x-fern-sdk-group-name: v2 DocumentSource: type: object properties: @@ -7429,13 +7715,11 @@ components: document: type: object description: A document source object containing the unique identifier of the document and the document itself. - x-fern-sdk-group-name: v2 Source: oneOf: - $ref: '#/components/schemas/ToolSource' - $ref: '#/components/schemas/DocumentSource' description: A source object containing information about the source of the data cited. - x-fern-sdk-group-name: v2 Citation: type: object properties: @@ -7450,7 +7734,6 @@ components: items: $ref: '#/components/schemas/Source' description: Citation information containing sources and the text cited. - x-fern-sdk-group-name: v2 AssistantMessage: required: - role @@ -7463,7 +7746,7 @@ components: tool_calls: type: array items: - $ref: '#/components/schemas/ToolCall-2' + $ref: '#/components/schemas/ToolCallV2' tool_plan: type: string content: @@ -7478,7 +7761,6 @@ components: items: $ref: '#/components/schemas/Citation' description: A message from the assistant role can contain text and tool call information. - x-fern-sdk-group-name: v2 SystemMessage: required: - role @@ -7497,22 +7779,40 @@ components: oneOf: - $ref: '#/components/schemas/TextContent' description: A message from the system. - x-fern-sdk-group-name: v2 - ToolContent: + Document: + required: + - data + type: object + properties: + data: + type: object + additionalProperties: + type: string + description: "A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.\n" + x-fern-type: 'map' + id: + type: string + description: Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated + description: "Relevant information that could be used by the model to generate a more accurate reply.\nThe content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be\npassed to the model.\n" + DocumentContent: required: - type - - output + - document type: object properties: type: enum: - - tool_result_object + - document type: string - output: - type: object - description: Tool content result object - x-fern-sdk-group-name: v2 - ToolMessage-2: + document: + $ref: '#/components/schemas/Document' + description: Document content. + ToolContent: + oneOf: + - $ref: '#/components/schemas/TextContent' + - $ref: '#/components/schemas/DocumentContent' + description: A content block which contains information about the content of a tool result + ToolMessageV2: required: - role - tool_call_id @@ -7525,19 +7825,21 @@ components: type: string tool_call_id: type: string + description: The id of the associated tool call that has provided the given content tool_content: - type: array - items: - oneOf: - - $ref: '#/components/schemas/ToolContent' + oneOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ToolContent' + description: 'A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks' description: A message from the system. - x-fern-sdk-group-name: v2 - ChatMessage-2: + ChatMessageV2: oneOf: - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolMessage-2' + - $ref: '#/components/schemas/ToolMessageV2' description: Represents a single message in the chat history from a given role. discriminator: propertyName: role @@ -7545,15 +7847,13 @@ components: user: '#/components/schemas/UserMessage' assistant: '#/components/schemas/AssistantMessage' system: '#/components/schemas/SystemMessage' - tool: '#/components/schemas/ToolMessage-2' - x-fern-sdk-group-name: v2 + tool: '#/components/schemas/ToolMessageV2' ChatMessages: type: array items: - $ref: '#/components/schemas/ChatMessage-2' + $ref: '#/components/schemas/ChatMessageV2' description: "A list of chat messages in chronological order, representing a conversation between the user and the model.\n\nMessages can be from `User`, `Assistant`, `Tool` and `System` roles. Learn more about messages and roles in [the Chat API guide](https://docs.cohere.com/docs/chat-api).\n" - x-fern-sdk-group-name: v2 - Tool-2: + ToolV2: type: object properties: type: @@ -7573,29 +7873,56 @@ components: type: object description: The parameters of the function as a JSON schema. description: The function to be executed. - x-fern-sdk-group-name: v2 - JSONResponseFormat-2: + CitationOptions: + type: object + properties: + mode: + enum: + - FAST + - ACCURATE + - OFF + type: string + description: "Defaults to `\"accurate\"`.\nDictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `\"accurate\"` results, `\"fast\"` results or no results.\n" + description: Options for controlling citation generation. + ResponseFormatTypeV2: + enum: + - text + - json_object + type: string + description: "Defaults to `\"text\"`.\n\nWhen set to `\"json_object\"`, the model's output will be a valid JSON Object.\n" + x-fern-audiences: + - public + TextResponseFormatV2: required: - type type: object properties: type: - $ref: '#/components/schemas/ResponseFormatType' + $ref: '#/components/schemas/ResponseFormatTypeV2' + x-fern-audiences: + - public + JsonResponseFormatV2: + required: + - type + type: object + properties: + type: + $ref: '#/components/schemas/ResponseFormatTypeV2' json_schema: type: object description: "[BETA] A JSON schema object that the output will adhere to. There are some restrictions we have on the schema, refer to [our guide](/docs/structured-outputs-json#schema-constraints) for more information.\nExample (required name and age object):\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n}\n```\n\n**Note**: This field must not be specified when the `type` is set to `\"text\"`.\n" x-fern-audiences: - public - ResponseFormat-2: + ResponseFormatV2: oneOf: - - $ref: '#/components/schemas/TextResponseFormat' - - $ref: '#/components/schemas/JSONResponseFormat-2' + - $ref: '#/components/schemas/TextResponseFormatV2' + - $ref: '#/components/schemas/JsonResponseFormatV2' description: "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**Note**: When using `{ \"type\": \"json_object\" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _\"Generate a JSON ...\"_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.\n**Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided).\n" discriminator: propertyName: type mapping: - text: '#/components/schemas/TextResponseFormat' - json_object: '#/components/schemas/JSONResponseFormat-2' + text: '#/components/schemas/TextResponseFormatV2' + json_object: '#/components/schemas/JsonResponseFormatV2' ChatFinishReason: enum: - complete @@ -7607,7 +7934,6 @@ components: - error_limit type: string description: The reason a chat request has finished. - x-fern-sdk-group-name: v2 AssistantMessageResponse: required: - role @@ -7620,7 +7946,7 @@ components: tool_calls: type: array items: - $ref: '#/components/schemas/ToolCall-2' + $ref: '#/components/schemas/ToolCallV2' tool_plan: type: string content: @@ -7637,7 +7963,6 @@ components: items: $ref: '#/components/schemas/Citation' description: A message from the assistant role can contain text and tool call information. - x-fern-sdk-group-name: v2 Usage: type: object properties: @@ -7665,8 +7990,7 @@ components: output_tokens: type: number description: "The number of tokens produced by the model.\n" - x-fern-sdk-group-name: v2 - NonStreamedChatResponse-2: + ChatResponse: required: - id - finish_reason @@ -7681,7 +8005,6 @@ components: $ref: '#/components/schemas/AssistantMessageResponse' usage: $ref: '#/components/schemas/Usage' - x-fern-sdk-group-name: v2 ChatStreamEventType: required: - type @@ -7701,7 +8024,6 @@ components: - message-end type: string description: The streamed event types - x-fern-sdk-group-name: v2 ChatMessageStartEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7722,7 +8044,6 @@ components: type: string description: The role of the message. description: A streamed event which signifies that a stream has started. - x-fern-sdk-group-name: v2 ChatContentStartEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7746,7 +8067,6 @@ components: - text type: string description: A streamed delta event which signifies that a new content block has started. - x-fern-sdk-group-name: v2 ChatContentDeltaEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7766,7 +8086,6 @@ components: text: type: string description: A streamed delta event which contains a delta of chat text content. - x-fern-sdk-group-name: v2 ChatContentEndEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7775,7 +8094,6 @@ components: index: type: integer description: A streamed delta event which signifies that the content block has ended. - x-fern-sdk-group-name: v2 ChatToolPlanDeltaEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7787,7 +8105,6 @@ components: tool_plan: type: string description: A streamed event which contains a delta of tool plan text. - x-fern-sdk-group-name: v2 ChatToolCallStartEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7815,7 +8132,6 @@ components: arguments: type: string description: A streamed event delta which signifies a tool call has started streaming. - x-fern-sdk-group-name: v2 ChatToolCallDeltaEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7835,7 +8151,6 @@ components: arguments: type: string description: A streamed event delta which signifies a delta in tool call arguments. - x-fern-sdk-group-name: v2 ChatToolCallEndEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7844,7 +8159,6 @@ components: index: type: integer description: A streamed event delta which signifies a tool call has finished streaming. - x-fern-sdk-group-name: v2 CitationStartEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -7884,8 +8198,7 @@ components: usage: $ref: '#/components/schemas/Usage' description: A streamed event which signifies that the chat message has ended. - x-fern-sdk-group-name: v2 - StreamedChatResponse-2: + StreamedChatResponseV2: oneOf: - $ref: '#/components/schemas/ChatMessageStartEvent' - $ref: '#/components/schemas/ChatContentStartEvent' @@ -7897,7 +8210,6 @@ components: - $ref: '#/components/schemas/ChatToolCallEndEvent' - $ref: '#/components/schemas/ChatMessageEndEvent' description: StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). - x-fern-sdk-group-name: v2 SingleGeneration: required: - text @@ -8091,8 +8403,9 @@ components: - search_query - classification - clustering + - image type: string - description: "Specifies the type of input passed to the model. Required for embedding models v3 and higher.\n\n- `\"search_document\"`: Used for embeddings stored in a vector database for search use-cases.\n- `\"search_query\"`: Used for embeddings of search queries run against a vector DB to find relevant documents.\n- `\"classification\"`: Used for embeddings passed through a text classifier.\n- `\"clustering\"`: Used for the embeddings run through a clustering algorithm.\n" + description: "Specifies the type of input passed to the model. Required for embedding models v3 and higher.\n\n- `\"search_document\"`: Used for embeddings stored in a vector database for search use-cases.\n- `\"search_query\"`: Used for embeddings of search queries run against a vector DB to find relevant documents.\n- `\"classification\"`: Used for embeddings passed through a text classifier.\n- `\"clustering\"`: Used for the embeddings run through a clustering algorithm.\n- `\"image\"`: Used for embeddings with image input.\n" EmbeddingType: enum: - float @@ -11645,7 +11958,7 @@ components: - BASE_TYPE_RERANK - BASE_TYPE_CHAT type: string - description: "The possible types of fine-tuned models.\n\n - BASE_TYPE_UNSPECIFIED: Unspecified model.\n - BASE_TYPE_GENERATIVE: Generative model.\n - BASE_TYPE_CLASSIFICATION: Classification model.\n - BASE_TYPE_RERANK: Rerank model.\n - BASE_TYPE_CHAT: Chat model." + description: "The possible types of fine-tuned models.\n\n - BASE_TYPE_UNSPECIFIED: Unspecified model.\n - BASE_TYPE_GENERATIVE: Deprecated: Generative model.\n - BASE_TYPE_CLASSIFICATION: Classification model.\n - BASE_TYPE_RERANK: Rerank model.\n - BASE_TYPE_CHAT: Chat model." default: BASE_TYPE_UNSPECIFIED x-fern-sdk-group-name: - finetuning @@ -11656,7 +11969,7 @@ components: - STRATEGY_VANILLA - STRATEGY_TFEW type: string - description: "The possible strategy used to serve a fine-tuned models.\n\n - STRATEGY_UNSPECIFIED: Unspecified strategy.\n - STRATEGY_VANILLA: Serve the fine-tuned model on a dedicated GPU.\n - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU." + description: "The possible strategy used to serve a fine-tuned models.\n\n - STRATEGY_UNSPECIFIED: Unspecified strategy.\n - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU.\n - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU." default: STRATEGY_UNSPECIFIED x-fern-sdk-group-name: - finetuning @@ -11681,6 +11994,18 @@ components: x-fern-sdk-group-name: - finetuning - finetuning + LoraTargetModules: + enum: + - LORA_TARGET_MODULES_UNSPECIFIED + - LORA_TARGET_MODULES_QV + - LORA_TARGET_MODULES_QKVO + - LORA_TARGET_MODULES_QKVO_FFN + type: string + description: "The possible combinations of LoRA modules to target.\n\n - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules.\n - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers.\n - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers.\n - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN)." + default: LORA_TARGET_MODULES_UNSPECIFIED + x-fern-sdk-group-name: + - finetuning + - finetuning Hyperparameters: type: object properties: @@ -11704,6 +12029,16 @@ components: type: number description: The learning rate to be used during training. format: double + lora_alpha: + type: integer + description: "Controls the scaling factor for LoRA updates. Higher values make the\nupdates more impactful." + format: int32 + lora_rank: + type: integer + description: "Specifies the rank for low-rank matrices. Lower ranks reduce parameters\nbut may limit model flexibility." + format: int32 + lora_target_modules: + $ref: '#/components/schemas/LoraTargetModules' description: The fine-tuning hyperparameters. x-fern-sdk-group-name: - finetuning diff --git a/src/libs/AutoSDK/Sources/Sources.Methods.cs b/src/libs/AutoSDK/Sources/Sources.Methods.cs index 1a118c9234..f6782f3896 100644 --- a/src/libs/AutoSDK/Sources/Sources.Methods.cs +++ b/src/libs/AutoSDK/Sources/Sources.Methods.cs @@ -142,13 +142,13 @@ public static string GenerateMethod( {endPoint.Parameters .Where(x => x is { Location: ParameterLocation.Header, IsRequired: true }) .Select(x => $@" - _httpClient.DefaultRequestHeaders.TryAddWithoutValidation(""{x.Id}"", {x.ParameterName});").Inject()} + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation(""{x.Id}"", {x.ParameterName}{(x.Type.IsEnum ? ".ToValueString()" : "")});").Inject()} {endPoint.Parameters .Where(x => x is { Location: ParameterLocation.Header, IsRequired: false }) .Select(x => $@" if ({x.ParameterName} != default) {{ - _httpClient.DefaultRequestHeaders.TryAddWithoutValidation(""{x.Id}"", {x.ParameterName}); + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation(""{x.Id}"", {x.ParameterName}{(x.Type.IsEnum ? "?.ToValueString() ?? string.Empty" : "")}); }}").Inject()} {(endPoint.Settings.JsonSerializerType == JsonSerializerType.NewtonsoftJson ? endPoint.Parameters diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chat.g.verified.cs index 8dbf1f717f..a6131643d4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chat.g.verified.cs @@ -9,11 +9,13 @@ public partial class Api partial void PrepareChatArguments( global::System.Net.Http.HttpClient httpClient, ref string? xClientName, + ref global::G.ChatAccepts? accepts, global::G.ChatRequest request); partial void PrepareChatRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string? xClientName, + global::G.ChatAccepts? accepts, global::G.ChatRequest request); partial void ProcessChatResponse( global::System.Net.Http.HttpClient httpClient, @@ -27,15 +29,17 @@ partial void ProcessChatResponseContent( /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ChatAsync( global::G.ChatRequest request, string? xClientName = default, + global::G.ChatAccepts? accepts = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -45,13 +49,23 @@ partial void ProcessChatResponseContent( PrepareChatArguments( httpClient: _httpClient, xClientName: ref xClientName, + accepts: ref accepts, request: request); if (xClientName != default) { _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); } + if (accepts != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Accepts", accepts?.ToValueString() ?? string.Empty); + } + var acceptsValue = accepts switch + { + global::G.ChatAccepts.TextEventStream => "text/event-stream", + _ => throw new global::System.NotImplementedException("Enum value not implemented."), + }; var __pathBuilder = new PathBuilder( path: "/v1/chat", baseUri: _httpClient.BaseAddress); @@ -73,6 +87,7 @@ partial void ProcessChatResponseContent( httpClient: _httpClient, httpRequestMessage: httpRequest, xClientName: xClientName, + accepts: accepts, request: request); using var response = await _httpClient.SendAsync( @@ -115,15 +130,16 @@ partial void ProcessChatResponseContent( /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// Text input for the model to respond to.
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments /// @@ -155,7 +171,9 @@ partial void ProcessChatResponseContent( /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// /// Accepts `{"id": "web-search"}`, and/or the `"id"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.
@@ -275,12 +293,19 @@ partial void ProcessChatResponseContent( /// Forces the chat to be single step. Defaults to `false`. /// /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ChatAsync( @@ -293,6 +318,7 @@ partial void ProcessChatResponseContent( double frequencyPenalty, double presencePenalty, string? xClientName = default, + global::G.ChatAccepts? accepts = default, string? model = default, bool? stream = default, string? preamble = default, @@ -309,6 +335,7 @@ partial void ProcessChatResponseContent( global::System.Collections.Generic.IList? toolResults = default, bool? forceSingleStep = default, global::G.ResponseFormat? responseFormat = default, + global::G.ChatRequestSafetyMode? safetyMode = default, global::System.Threading.CancellationToken cancellationToken = default) { var request = new global::G.ChatRequest @@ -337,10 +364,12 @@ partial void ProcessChatResponseContent( ToolResults = toolResults, ForceSingleStep = forceSingleStep, ResponseFormat = responseFormat, + SafetyMode = safetyMode, }; return await ChatAsync( xClientName: xClientName, + accepts: accepts, request: request, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chatv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chatv2.g.verified.cs index 90cb2eda89..5ec2f8eb33 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chatv2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Chatv2.g.verified.cs @@ -29,7 +29,7 @@ partial void ProcessChatv2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task> Chatv2Async( + public async global::System.Threading.Tasks.Task> Chatv2Async( global::G.Chatv2Request request, global::System.Threading.CancellationToken cancellationToken = default) { @@ -96,7 +96,7 @@ partial void ProcessChatv2ResponseContent( } return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, JsonSerializerOptions) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, JsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } @@ -115,9 +115,11 @@ partial void ProcessChatv2ResponseContent( /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. /// - /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + /// + /// Options for controlling citation generation. /// /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -126,6 +128,13 @@ partial void ProcessChatv2ResponseContent( /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. /// @@ -163,12 +172,14 @@ partial void ProcessChatv2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task> Chatv2Async( + public async global::System.Threading.Tasks.Task> Chatv2Async( string model, - global::System.Collections.Generic.IList messages, - global::System.Collections.Generic.IList? tools = default, - global::G.Chatv2RequestCitationMode? citationMode = default, - global::G.ResponseFormat2? responseFormat = default, + global::System.Collections.Generic.IList messages, + global::System.Collections.Generic.IList? tools = default, + global::System.Collections.Generic.IList>? documents = default, + global::G.CitationOptions? citationOptions = default, + global::G.ResponseFormatV2? responseFormat = default, + global::G.Chatv2RequestSafetyMode? safetyMode = default, int? maxTokens = default, global::System.Collections.Generic.IList? stopSequences = default, float? temperature = default, @@ -184,8 +195,10 @@ partial void ProcessChatv2ResponseContent( Model = model, Messages = messages, Tools = tools, - CitationMode = citationMode, + Documents = documents, + CitationOptions = citationOptions, ResponseFormat = responseFormat, + SafetyMode = safetyMode, MaxTokens = maxTokens, StopSequences = stopSequences, Temperature = temperature, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embed.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embed.g.verified.cs index 56bb87bcdd..5f8e95c0b4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embed.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embed.g.verified.cs @@ -142,7 +142,8 @@ partial void ProcessEmbedResponseContent( /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embedv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embedv2.g.verified.cs new file mode 100644 index 0000000000..1fec777824 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Embedv2.g.verified.cs @@ -0,0 +1,190 @@ +//HintName: G.Api.Embedv2.g.cs + +#nullable enable + +namespace G +{ + public partial class Api + { + partial void PrepareEmbedv2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xClientName, + global::G.Embedv2Request request); + partial void PrepareEmbedv2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xClientName, + global::G.Embedv2Request request); + partial void ProcessEmbedv2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEmbedv2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Embedv2Async( + global::G.Embedv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareEmbedv2Arguments( + httpClient: _httpClient, + xClientName: ref xClientName, + request: request); + + if (xClientName != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); + } + + var __pathBuilder = new PathBuilder( + path: "/v2/embed", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + var __httpRequestContentBody = global::Newtonsoft.Json.JsonConvert.SerializeObject(request, JsonSerializerOptions); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareEmbedv2Request( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + xClientName: xClientName, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessEmbedv2Response( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessEmbedv2ResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, JsonSerializerOptions) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + /// + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + /// + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + /// + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + /// + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Embedv2Async( + global::System.Collections.Generic.IList texts, + string model, + global::System.Collections.Generic.IList embeddingTypes, + global::G.Embedv2RequestTruncate truncate, + string? xClientName = default, + global::G.EmbedInputType? inputType = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::G.Embedv2Request + { + Texts = texts, + Model = model, + InputType = inputType, + EmbeddingTypes = embeddingTypes, + Truncate = truncate, + }; + + return await Embedv2Async( + xClientName: xClientName, + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Rerankv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Rerankv2.g.verified.cs new file mode 100644 index 0000000000..6e52f540a9 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Api.Rerankv2.g.verified.cs @@ -0,0 +1,176 @@ +//HintName: G.Api.Rerankv2.g.cs + +#nullable enable + +namespace G +{ + public partial class Api + { + partial void PrepareRerankv2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xClientName, + global::G.Rerankv2Request request); + partial void PrepareRerankv2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xClientName, + global::G.Rerankv2Request request); + partial void ProcessRerankv2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRerankv2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Rerankv2Async( + global::G.Rerankv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareRerankv2Arguments( + httpClient: _httpClient, + xClientName: ref xClientName, + request: request); + + if (xClientName != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); + } + + var __pathBuilder = new PathBuilder( + path: "/v2/rerank", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + var __httpRequestContentBody = global::Newtonsoft.Json.JsonConvert.SerializeObject(request, JsonSerializerOptions); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareRerankv2Request( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + xClientName: xClientName, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessRerankv2Response( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessRerankv2ResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, JsonSerializerOptions) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + /// + /// The search query + /// + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + /// + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Rerankv2Async( + string model, + string query, + global::System.Collections.Generic.IList> documents, + string? xClientName = default, + int? topN = default, + global::System.Collections.Generic.IList? rankFields = default, + bool? returnDocuments = false, + int? maxChunksPerDoc = 10, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::G.Rerankv2Request + { + Model = model, + Query = query, + Documents = documents, + TopN = topN, + RankFields = rankFields, + ReturnDocuments = returnDocuments, + MaxChunksPerDoc = maxChunksPerDoc, + }; + + return await Rerankv2Async( + xClientName: xClientName, + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs index 55d98e75bc..98b9d5654f 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs @@ -132,7 +132,8 @@ partial void ProcessCreateEmbedJobResponseContent( /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// The name of the embed job. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chat.g.verified.cs index 2a05ee4e70..f43f9431e4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chat.g.verified.cs @@ -8,29 +8,32 @@ public partial interface IApi /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ChatAsync( global::G.ChatRequest request, string? xClientName = default, + global::G.ChatAccepts? accepts = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// Text input for the model to respond to.
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments /// @@ -62,7 +65,9 @@ public partial interface IApi /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// /// Accepts `{"id": "web-search"}`, and/or the `"id"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.
@@ -182,12 +187,19 @@ public partial interface IApi /// Forces the chat to be single step. Defaults to `false`. /// /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ChatAsync( @@ -200,6 +212,7 @@ public partial interface IApi double frequencyPenalty, double presencePenalty, string? xClientName = default, + global::G.ChatAccepts? accepts = default, string? model = default, bool? stream = default, string? preamble = default, @@ -216,6 +229,7 @@ public partial interface IApi global::System.Collections.Generic.IList? toolResults = default, bool? forceSingleStep = default, global::G.ResponseFormat? responseFormat = default, + global::G.ChatRequestSafetyMode? safetyMode = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chatv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chatv2.g.verified.cs index 19e330faa5..c48d35dcd3 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chatv2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Chatv2.g.verified.cs @@ -12,7 +12,7 @@ public partial interface IApi /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task> Chatv2Async( + global::System.Threading.Tasks.Task> Chatv2Async( global::G.Chatv2Request request, global::System.Threading.CancellationToken cancellationToken = default); @@ -31,9 +31,11 @@ public partial interface IApi /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. /// - /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + /// + /// Options for controlling citation generation. /// /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -42,6 +44,13 @@ public partial interface IApi /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. /// @@ -79,12 +88,14 @@ public partial interface IApi /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task> Chatv2Async( + global::System.Threading.Tasks.Task> Chatv2Async( string model, - global::System.Collections.Generic.IList messages, - global::System.Collections.Generic.IList? tools = default, - global::G.Chatv2RequestCitationMode? citationMode = default, - global::G.ResponseFormat2? responseFormat = default, + global::System.Collections.Generic.IList messages, + global::System.Collections.Generic.IList? tools = default, + global::System.Collections.Generic.IList>? documents = default, + global::G.CitationOptions? citationOptions = default, + global::G.ResponseFormatV2? responseFormat = default, + global::G.Chatv2RequestSafetyMode? safetyMode = default, int? maxTokens = default, global::System.Collections.Generic.IList? stopSequences = default, float? temperature = default, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embed.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embed.g.verified.cs index af7e6dde99..bf0c2a1bb3 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embed.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embed.g.verified.cs @@ -49,7 +49,8 @@ public partial interface IApi /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embedv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embedv2.g.verified.cs new file mode 100644 index 0000000000..45dd9c0ecd --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Embedv2.g.verified.cs @@ -0,0 +1,82 @@ +//HintName: G.IApi.Embedv2.g.cs +#nullable enable + +namespace G +{ + public partial interface IApi + { + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Embedv2Async( + global::G.Embedv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + /// + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + /// + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + /// + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + /// + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Embedv2Async( + global::System.Collections.Generic.IList texts, + string model, + global::System.Collections.Generic.IList embeddingTypes, + global::G.Embedv2RequestTruncate truncate, + string? xClientName = default, + global::G.EmbedInputType? inputType = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Rerankv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Rerankv2.g.verified.cs new file mode 100644 index 0000000000..bd881f7216 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IApi.Rerankv2.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: G.IApi.Rerankv2.g.cs +#nullable enable + +namespace G +{ + public partial interface IApi + { + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Rerankv2Async( + global::G.Rerankv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + /// + /// The search query + /// + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + /// + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Rerankv2Async( + string model, + string query, + global::System.Collections.Generic.IList> documents, + string? xClientName = default, + int? topN = default, + global::System.Collections.Generic.IList? rankFields = default, + bool? returnDocuments = false, + int? maxChunksPerDoc = 10, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs index b66b0517d7..f096899845 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs @@ -39,7 +39,8 @@ public partial interface IEmbedJobsClient /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// The name of the embed job. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessage.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessage.g.verified.cs index 480c10b9d9..7e921a11c6 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessage.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessage.g.verified.cs @@ -21,7 +21,7 @@ public sealed partial class AssistantMessage /// /// [global::Newtonsoft.Json.JsonProperty("tool_calls")] - public global::System.Collections.Generic.IList? ToolCalls { get; set; } + public global::System.Collections.Generic.IList? ToolCalls { get; set; } /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessageResponse.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessageResponse.g.verified.cs index 6c38146b4f..d9341cf324 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessageResponse.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.AssistantMessageResponse.g.verified.cs @@ -21,7 +21,7 @@ public sealed partial class AssistantMessageResponse /// /// [global::Newtonsoft.Json.JsonProperty("tool_calls")] - public global::System.Collections.Generic.IList? ToolCalls { get; set; } + public global::System.Collections.Generic.IList? ToolCalls { get; set; } /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseModel.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseModel.g.verified.cs index 7f75702643..927303cd75 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseModel.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseModel.g.verified.cs @@ -25,7 +25,7 @@ public sealed partial class BaseModel /// /// The possible types of fine-tuned models.
/// - BASE_TYPE_UNSPECIFIED: Unspecified model.
- /// - BASE_TYPE_GENERATIVE: Generative model.
+ /// - BASE_TYPE_GENERATIVE: Deprecated: Generative model.
/// - BASE_TYPE_CLASSIFICATION: Classification model.
/// - BASE_TYPE_RERANK: Rerank model.
/// - BASE_TYPE_CHAT: Chat model.
@@ -37,7 +37,7 @@ public sealed partial class BaseModel /// /// The possible strategy used to serve a fine-tuned models.
/// - STRATEGY_UNSPECIFIED: Unspecified strategy.
- /// - STRATEGY_VANILLA: Serve the fine-tuned model on a dedicated GPU.
+ /// - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU.
/// - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU.
/// Default Value: STRATEGY_UNSPECIFIED ///
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseType.g.verified.cs index b2123a1eec..56b3ee1094 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.BaseType.g.verified.cs @@ -7,7 +7,7 @@ namespace G /// /// The possible types of fine-tuned models.
/// - BASE_TYPE_UNSPECIFIED: Unspecified model.
- /// - BASE_TYPE_GENERATIVE: Generative model.
+ /// - BASE_TYPE_GENERATIVE: Deprecated: Generative model.
/// - BASE_TYPE_CLASSIFICATION: Classification model.
/// - BASE_TYPE_RERANK: Rerank model.
/// - BASE_TYPE_CHAT: Chat model.
@@ -22,7 +22,7 @@ public enum BaseType [global::System.Runtime.Serialization.EnumMember(Value="BASE_TYPE_UNSPECIFIED")] UNSPECIFIED, /// - /// Generative model. + /// Deprecated: Generative model. /// [global::System.Runtime.Serialization.EnumMember(Value="BASE_TYPE_GENERATIVE")] GENERATIVE, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatAccepts.g.verified.cs similarity index 65% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentType.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatAccepts.g.verified.cs index 251c88b180..4141e8ac3c 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatAccepts.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolContentType.g.cs +//HintName: G.Models.ChatAccepts.g.cs #nullable enable @@ -8,39 +8,39 @@ namespace G /// ///
[global::System.Runtime.Serialization.DataContract] - public enum ToolContentType + public enum ChatAccepts { /// /// /// - [global::System.Runtime.Serialization.EnumMember(Value="tool_result_object")] - ToolResultObject, + [global::System.Runtime.Serialization.EnumMember(Value="text/event-stream")] + TextEventStream, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolContentTypeExtensions + public static class ChatAcceptsExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolContentType value) + public static string ToValueString(this ChatAccepts value) { return value switch { - ToolContentType.ToolResultObject => "tool_result_object", + ChatAccepts.TextEventStream => "text/event-stream", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolContentType? ToEnum(string value) + public static ChatAccepts? ToEnum(string value) { return value switch { - "tool_result_object" => ToolContentType.ToolResultObject, + "text/event-stream" => ChatAccepts.TextEventStream, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessage2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessageV2.g.verified.cs similarity index 55% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessage2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessageV2.g.verified.cs index f51403db09..fa13b91461 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessage2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatMessageV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ChatMessage2.g.cs +//HintName: G.Models.ChatMessageV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -9,120 +9,120 @@ namespace G /// /// Represents a single message in the chat history from a given role. /// - public readonly partial struct ChatMessage2 : global::System.IEquatable + public readonly partial struct ChatMessageV2 : global::System.IEquatable { /// /// A message from the user. /// #if NET6_0_OR_GREATER - public global::G.UserMessage? UserMessage { get; init; } + public global::G.UserMessage? User { get; init; } #else - public global::G.UserMessage? UserMessage { get; } + public global::G.UserMessage? User { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(User))] #endif - public bool IsUserMessage => UserMessage != null; + public bool IsUser => User != null; /// /// /// - public static implicit operator ChatMessage2(global::G.UserMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.UserMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.UserMessage?(ChatMessage2 @this) => @this.UserMessage; + public static implicit operator global::G.UserMessage?(ChatMessageV2 @this) => @this.User; /// /// /// - public ChatMessage2(global::G.UserMessage? value) + public ChatMessageV2(global::G.UserMessage? value) { - UserMessage = value; + User = value; } /// /// A message from the assistant role can contain text and tool call information. /// #if NET6_0_OR_GREATER - public global::G.AssistantMessage? AssistantMessage { get; init; } + public global::G.AssistantMessage? Assistant { get; init; } #else - public global::G.AssistantMessage? AssistantMessage { get; } + public global::G.AssistantMessage? Assistant { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AssistantMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Assistant))] #endif - public bool IsAssistantMessage => AssistantMessage != null; + public bool IsAssistant => Assistant != null; /// /// /// - public static implicit operator ChatMessage2(global::G.AssistantMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.AssistantMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.AssistantMessage?(ChatMessage2 @this) => @this.AssistantMessage; + public static implicit operator global::G.AssistantMessage?(ChatMessageV2 @this) => @this.Assistant; /// /// /// - public ChatMessage2(global::G.AssistantMessage? value) + public ChatMessageV2(global::G.AssistantMessage? value) { - AssistantMessage = value; + Assistant = value; } /// /// A message from the system. /// #if NET6_0_OR_GREATER - public global::G.SystemMessage? SystemMessage { get; init; } + public global::G.SystemMessage? System { get; init; } #else - public global::G.SystemMessage? SystemMessage { get; } + public global::G.SystemMessage? System { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SystemMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif - public bool IsSystemMessage => SystemMessage != null; + public bool IsSystem => System != null; /// /// /// - public static implicit operator ChatMessage2(global::G.SystemMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.SystemMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.SystemMessage?(ChatMessage2 @this) => @this.SystemMessage; + public static implicit operator global::G.SystemMessage?(ChatMessageV2 @this) => @this.System; /// /// /// - public ChatMessage2(global::G.SystemMessage? value) + public ChatMessageV2(global::G.SystemMessage? value) { - SystemMessage = value; + System = value; } /// /// A message from the system. /// #if NET6_0_OR_GREATER - public global::G.ToolMessage2? Tool { get; init; } + public global::G.ToolMessageV2? Tool { get; init; } #else - public global::G.ToolMessage2? Tool { get; } + public global::G.ToolMessageV2? Tool { get; } #endif /// @@ -136,17 +136,17 @@ public ChatMessage2(global::G.SystemMessage? value) /// /// /// - public static implicit operator ChatMessage2(global::G.ToolMessage2 value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.ToolMessageV2 value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.ToolMessage2?(ChatMessage2 @this) => @this.Tool; + public static implicit operator global::G.ToolMessageV2?(ChatMessageV2 @this) => @this.Tool; /// /// /// - public ChatMessage2(global::G.ToolMessage2? value) + public ChatMessageV2(global::G.ToolMessageV2? value) { Tool = value; } @@ -154,16 +154,16 @@ public ChatMessage2(global::G.ToolMessage2? value) /// /// /// - public ChatMessage2( - global::G.UserMessage? userMessage, - global::G.AssistantMessage? assistantMessage, - global::G.SystemMessage? systemMessage, - global::G.ToolMessage2? tool + public ChatMessageV2( + global::G.UserMessage? user, + global::G.AssistantMessage? assistant, + global::G.SystemMessage? system, + global::G.ToolMessageV2? tool ) { - UserMessage = userMessage; - AssistantMessage = assistantMessage; - SystemMessage = systemMessage; + User = user; + Assistant = assistant; + System = system; Tool = tool; } @@ -172,9 +172,9 @@ public ChatMessage2( /// public object? Object => Tool as object ?? - SystemMessage as object ?? - AssistantMessage as object ?? - UserMessage as object + System as object ?? + Assistant as object ?? + User as object ; /// @@ -182,7 +182,7 @@ UserMessage as object /// public bool Validate() { - return IsUserMessage && !IsAssistantMessage && !IsSystemMessage && !IsTool || !IsUserMessage && IsAssistantMessage && !IsSystemMessage && !IsTool || !IsUserMessage && !IsAssistantMessage && IsSystemMessage && !IsTool || !IsUserMessage && !IsAssistantMessage && !IsSystemMessage && IsTool; + return IsUser && !IsAssistant && !IsSystem && !IsTool || !IsUser && IsAssistant && !IsSystem && !IsTool || !IsUser && !IsAssistant && IsSystem && !IsTool || !IsUser && !IsAssistant && !IsSystem && IsTool; } /// @@ -192,14 +192,14 @@ public override int GetHashCode() { var fields = new object?[] { - UserMessage, + User, typeof(global::G.UserMessage), - AssistantMessage, + Assistant, typeof(global::G.AssistantMessage), - SystemMessage, + System, typeof(global::G.SystemMessage), Tool, - typeof(global::G.ToolMessage2), + typeof(global::G.ToolMessageV2), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -212,28 +212,28 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(ChatMessage2 other) + public bool Equals(ChatMessageV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(UserMessage, other.UserMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(AssistantMessage, other.AssistantMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(SystemMessage, other.SystemMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) + global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) ; } /// /// /// - public static bool operator ==(ChatMessage2 obj1, ChatMessage2 obj2) + public static bool operator ==(ChatMessageV2 obj1, ChatMessageV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(ChatMessage2 obj1, ChatMessage2 obj2) + public static bool operator !=(ChatMessageV2 obj1, ChatMessageV2 obj2) { return !(obj1 == obj2); } @@ -243,7 +243,7 @@ public bool Equals(ChatMessage2 other) /// public override bool Equals(object? obj) { - return obj is ChatMessage2 o && Equals(o); + return obj is ChatMessageV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequest.g.verified.cs index d2ebd8c357..9ab3a1cb91 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequest.g.verified.cs @@ -17,7 +17,7 @@ public sealed partial class ChatRequest public string Message { get; set; } = default!; /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments ///
@@ -64,7 +64,9 @@ public sealed partial class ChatRequest /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments ///
[global::Newtonsoft.Json.JsonProperty("prompt_truncation")] public global::G.ChatRequestPromptTruncation? PromptTruncation { get; set; } @@ -235,7 +237,7 @@ public sealed partial class ChatRequest public bool? ForceSingleStep { get; set; } /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
@@ -244,6 +246,16 @@ public sealed partial class ChatRequest [global::Newtonsoft.Json.JsonProperty("response_format")] public global::G.ResponseFormat? ResponseFormat { get; set; } + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::Newtonsoft.Json.JsonProperty("safety_mode")] + public global::G.ChatRequestSafetyMode? SafetyMode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs index bec5ad5dcc..cd311cfdde 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs @@ -10,7 +10,9 @@ namespace G /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments ///
[global::System.Runtime.Serialization.DataContract] public enum ChatRequestPromptTruncation @@ -21,12 +23,12 @@ public enum ChatRequestPromptTruncation [global::System.Runtime.Serialization.EnumMember(Value="OFF")] OFF, /// - /// Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Cohere Platform Only /// [global::System.Runtime.Serialization.EnumMember(Value="AUTO")] AUTO, /// - /// Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Azure, AWS Sagemaker/Bedrock, Private Deployments /// [global::System.Runtime.Serialization.EnumMember(Value="AUTO_PRESERVE_ORDER")] AUTOPRESERVEORDER, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..26ed0bc84a --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: G.Models.ChatRequestSafetyMode.g.cs + +#nullable enable + +namespace G +{ + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::System.Runtime.Serialization.DataContract] + public enum ChatRequestSafetyMode + { + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="CONTEXTUAL")] + CONTEXTUAL, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="STRICT")] + STRICT, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="NONE")] + NONE, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ChatRequestSafetyModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ChatRequestSafetyMode value) + { + return value switch + { + ChatRequestSafetyMode.CONTEXTUAL => "CONTEXTUAL", + ChatRequestSafetyMode.STRICT => "STRICT", + ChatRequestSafetyMode.NONE => "NONE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ChatRequestSafetyMode? ToEnum(string value) + { + return value switch + { + "CONTEXTUAL" => ChatRequestSafetyMode.CONTEXTUAL, + "STRICT" => ChatRequestSafetyMode.STRICT, + "NONE" => ChatRequestSafetyMode.NONE, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse.g.verified.cs similarity index 92% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse.g.verified.cs index edee16125e..c27c9b12c2 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.NonStreamedChatResponse2.g.cs +//HintName: G.Models.ChatResponse.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class NonStreamedChatResponse2 + public sealed partial class ChatResponse { /// /// Unique identifier for the generated reply. Useful for submitting feedback. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse14.g.verified.cs similarity index 87% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse14.g.verified.cs index 9c026b82ea..992397a30b 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ChatResponse14.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ChatResponse2.g.cs +//HintName: G.Models.ChatResponse14.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class ChatResponse2 + public sealed partial class ChatResponse14 { /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2Request.g.verified.cs index 9dad491a75..d17317a744 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2Request.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2Request.g.verified.cs @@ -1,5 +1,7 @@ //HintName: G.Models.Chatv2Request.g.cs +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace G @@ -20,21 +22,26 @@ public sealed partial class Chatv2Request /// Messages can be from `User`, `Assistant`, `Tool` and `System` roles. Learn more about messages and roles in [the Chat API guide](https://docs.cohere.com/docs/chat-api). /// [global::Newtonsoft.Json.JsonProperty("messages", Required = global::Newtonsoft.Json.Required.Always)] - public global::System.Collections.Generic.IList Messages { get; set; } = default!; + public global::System.Collections.Generic.IList Messages { get; set; } = default!; /// /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. ///
[global::Newtonsoft.Json.JsonProperty("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } + public global::System.Collections.Generic.IList? Tools { get; set; } + + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + [global::Newtonsoft.Json.JsonProperty("documents")] + public global::System.Collections.Generic.IList>? Documents { get; set; } /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// Options for controlling citation generation. ///
- [global::Newtonsoft.Json.JsonProperty("citation_mode")] - public global::G.Chatv2RequestCitationMode? CitationMode { get; set; } + [global::Newtonsoft.Json.JsonProperty("citation_options")] + public global::G.CitationOptions? CitationOptions { get; set; } /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -44,7 +51,17 @@ public sealed partial class Chatv2Request /// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). ///
[global::Newtonsoft.Json.JsonProperty("response_format")] - public global::G.ResponseFormat2? ResponseFormat { get; set; } + public global::G.ResponseFormatV2? ResponseFormat { get; set; } + + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::Newtonsoft.Json.JsonProperty("safety_mode")] + public global::G.Chatv2RequestSafetyMode? SafetyMode { get; set; } /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..402dc47683 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: G.Models.Chatv2RequestSafetyMode.g.cs + +#nullable enable + +namespace G +{ + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::System.Runtime.Serialization.DataContract] + public enum Chatv2RequestSafetyMode + { + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="CONTEXTUAL")] + CONTEXTUAL, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="STRICT")] + STRICT, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="NONE")] + NONE, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class Chatv2RequestSafetyModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this Chatv2RequestSafetyMode value) + { + return value switch + { + Chatv2RequestSafetyMode.CONTEXTUAL => "CONTEXTUAL", + Chatv2RequestSafetyMode.STRICT => "STRICT", + Chatv2RequestSafetyMode.NONE => "NONE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static Chatv2RequestSafetyMode? ToEnum(string value) + { + return value switch + { + "CONTEXTUAL" => Chatv2RequestSafetyMode.CONTEXTUAL, + "STRICT" => Chatv2RequestSafetyMode.STRICT, + "NONE" => Chatv2RequestSafetyMode.NONE, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptions.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptions.g.verified.cs new file mode 100644 index 0000000000..644ed05b01 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptions.g.verified.cs @@ -0,0 +1,25 @@ +//HintName: G.Models.CitationOptions.g.cs + +#nullable enable + +namespace G +{ + /// + /// Options for controlling citation generation. + /// + public sealed partial class CitationOptions + { + /// + /// Defaults to `"accurate"`.
+ /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + ///
+ [global::Newtonsoft.Json.JsonProperty("mode")] + public global::G.CitationOptionsMode? Mode { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptionsMode.g.verified.cs similarity index 67% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptionsMode.g.verified.cs index d1220fb17e..2d6b4b0d28 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CitationOptionsMode.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Chatv2RequestCitationMode.g.cs +//HintName: G.Models.CitationOptionsMode.g.cs #nullable enable @@ -9,7 +9,7 @@ namespace G /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. ///
[global::System.Runtime.Serialization.DataContract] - public enum Chatv2RequestCitationMode + public enum CitationOptionsMode { /// /// @@ -31,31 +31,31 @@ public enum Chatv2RequestCitationMode /// /// Enum extensions to do fast conversions without the reflection. /// - public static class Chatv2RequestCitationModeExtensions + public static class CitationOptionsModeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this Chatv2RequestCitationMode value) + public static string ToValueString(this CitationOptionsMode value) { return value switch { - Chatv2RequestCitationMode.FAST => "FAST", - Chatv2RequestCitationMode.ACCURATE => "ACCURATE", - Chatv2RequestCitationMode.OFF => "OFF", + CitationOptionsMode.FAST => "FAST", + CitationOptionsMode.ACCURATE => "ACCURATE", + CitationOptionsMode.OFF => "OFF", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static Chatv2RequestCitationMode? ToEnum(string value) + public static CitationOptionsMode? ToEnum(string value) { return value switch { - "FAST" => Chatv2RequestCitationMode.FAST, - "ACCURATE" => Chatv2RequestCitationMode.ACCURATE, - "OFF" => Chatv2RequestCitationMode.OFF, + "FAST" => CitationOptionsMode.FAST, + "ACCURATE" => CitationOptionsMode.ACCURATE, + "OFF" => CitationOptionsMode.OFF, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs index 0e88805371..ac72a64a8d 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs @@ -31,7 +31,8 @@ public sealed partial class CreateEmbedJobRequest /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
[global::Newtonsoft.Json.JsonProperty("input_type", Required = global::Newtonsoft.Json.Required.Always)] public global::G.EmbedInputType InputType { get; set; } = default!; diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Document.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Document.g.verified.cs new file mode 100644 index 0000000000..5266d6118e --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Document.g.verified.cs @@ -0,0 +1,32 @@ +//HintName: G.Models.Document.g.cs + +#nullable enable + +namespace G +{ + /// + /// Relevant information that could be used by the model to generate a more accurate reply.
+ /// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be
+ /// passed to the model. + ///
+ public sealed partial class Document + { + /// + /// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary. + /// + [global::Newtonsoft.Json.JsonProperty("data", Required = global::Newtonsoft.Json.Required.Always)] + public global::G.DocumentData Data { get; set; } = default!; + + /// + /// Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated + /// + [global::Newtonsoft.Json.JsonProperty("id")] + public string? Id { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContent.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContent.g.verified.cs new file mode 100644 index 0000000000..8c509ad79e --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContent.g.verified.cs @@ -0,0 +1,32 @@ +//HintName: G.Models.DocumentContent.g.cs + +#nullable enable + +namespace G +{ + /// + /// Document content. + /// + public sealed partial class DocumentContent + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("type")] + public global::G.DocumentContentType Type { get; set; } + + /// + /// Relevant information that could be used by the model to generate a more accurate reply.
+ /// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be
+ /// passed to the model. + ///
+ [global::Newtonsoft.Json.JsonProperty("document", Required = global::Newtonsoft.Json.Required.Always)] + public global::G.Document Document { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContentType.g.verified.cs new file mode 100644 index 0000000000..80a4082163 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentContentType.g.verified.cs @@ -0,0 +1,48 @@ +//HintName: G.Models.DocumentContentType.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + [global::System.Runtime.Serialization.DataContract] + public enum DocumentContentType + { + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="document")] + Document, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DocumentContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DocumentContentType value) + { + return value switch + { + DocumentContentType.Document => "document", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DocumentContentType? ToEnum(string value) + { + return value switch + { + "document" => DocumentContentType.Document, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentOutput.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentData.g.verified.cs similarity index 66% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentOutput.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentData.g.verified.cs index 4ad2aa2321..639756dd22 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContentOutput.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.DocumentData.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: G.Models.ToolContentOutput.g.cs +//HintName: G.Models.DocumentData.g.cs #nullable enable namespace G { /// - /// + /// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary. /// - public sealed partial class ToolContentOutput + public sealed partial class DocumentData { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedInputType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedInputType.g.verified.cs index 956e918abf..64b1ff3b6a 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedInputType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedInputType.g.verified.cs @@ -9,7 +9,8 @@ namespace G /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
[global::System.Runtime.Serialization.DataContract] public enum EmbedInputType @@ -34,6 +35,11 @@ public enum EmbedInputType ///
[global::System.Runtime.Serialization.EnumMember(Value="clustering")] Clustering, + /// + /// Used for embeddings with image input. + /// + [global::System.Runtime.Serialization.EnumMember(Value="image")] + Image, } /// @@ -52,6 +58,7 @@ public static string ToValueString(this EmbedInputType value) EmbedInputType.SearchQuery => "search_query", EmbedInputType.Classification => "classification", EmbedInputType.Clustering => "clustering", + EmbedInputType.Image => "image", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -66,6 +73,7 @@ public static string ToValueString(this EmbedInputType value) "search_query" => EmbedInputType.SearchQuery, "classification" => EmbedInputType.Classification, "clustering" => EmbedInputType.Clustering, + "image" => EmbedInputType.Image, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedRequest.g.verified.cs index e419d594f7..4d71b51266 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.EmbedRequest.g.verified.cs @@ -37,7 +37,8 @@ public sealed partial class EmbedRequest /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
[global::Newtonsoft.Json.JsonProperty("input_type")] public global::G.EmbedInputType? InputType { get; set; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Request.g.verified.cs new file mode 100644 index 0000000000..1215058a20 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Request.g.verified.cs @@ -0,0 +1,74 @@ +//HintName: G.Models.Embedv2Request.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Request + { + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + ///
+ [global::Newtonsoft.Json.JsonProperty("texts")] + public global::System.Collections.Generic.IList? Texts { get; set; } + + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + ///
+ [global::Newtonsoft.Json.JsonProperty("model")] + public string? Model { get; set; } + + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + ///
+ [global::Newtonsoft.Json.JsonProperty("input_type")] + public global::G.EmbedInputType? InputType { get; set; } + + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + ///
+ [global::Newtonsoft.Json.JsonProperty("embedding_types")] + public global::System.Collections.Generic.IList? EmbeddingTypes { get; set; } + + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + ///
+ [global::Newtonsoft.Json.JsonProperty("truncate")] + public global::G.Embedv2RequestTruncate? Truncate { get; set; } = global::G.Embedv2RequestTruncate.END; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs new file mode 100644 index 0000000000..8d32c52bea --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: G.Models.Embedv2RequestTruncate.g.cs + +#nullable enable + +namespace G +{ + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + ///
+ [global::System.Runtime.Serialization.DataContract] + public enum Embedv2RequestTruncate + { + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="NONE")] + NONE, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="START")] + START, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="END")] + END, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class Embedv2RequestTruncateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this Embedv2RequestTruncate value) + { + return value switch + { + Embedv2RequestTruncate.NONE => "NONE", + Embedv2RequestTruncate.START => "START", + Embedv2RequestTruncate.END => "END", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static Embedv2RequestTruncate? ToEnum(string value) + { + return value switch + { + "NONE" => Embedv2RequestTruncate.NONE, + "START" => Embedv2RequestTruncate.START, + "END" => Embedv2RequestTruncate.END, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response.g.verified.cs new file mode 100644 index 0000000000..b6f61f84fd --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response10.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response10.g.verified.cs new file mode 100644 index 0000000000..81b851e756 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response10.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response10.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response10 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response11.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response11.g.verified.cs new file mode 100644 index 0000000000..584cceafd4 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response11.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response11.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response11 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response12.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response12.g.verified.cs new file mode 100644 index 0000000000..2e100aeab3 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response12.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response12.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response12 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response2.g.verified.cs new file mode 100644 index 0000000000..10771c4453 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response2.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response2 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response3.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response3.g.verified.cs new file mode 100644 index 0000000000..7953f5ba14 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response3.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response3.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response3 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response4.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response4.g.verified.cs new file mode 100644 index 0000000000..9bf2ca7093 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response4.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response4.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response4 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response5.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response5.g.verified.cs new file mode 100644 index 0000000000..edef52ccc3 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response5.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response5.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response5 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response6.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response6.g.verified.cs new file mode 100644 index 0000000000..8ed4865d9d --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response6.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response6.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response6 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response7.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response7.g.verified.cs new file mode 100644 index 0000000000..3b11be38f1 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response7.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response7.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response7 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response8.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response8.g.verified.cs new file mode 100644 index 0000000000..8c6384f9ab --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response8.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response8.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response8 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response9.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response9.g.verified.cs new file mode 100644 index 0000000000..d5bffef068 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Embedv2Response9.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response9.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response9 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Hyperparameters.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Hyperparameters.g.verified.cs index 6a8d45ca6b..bcd3265d83 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Hyperparameters.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Hyperparameters.g.verified.cs @@ -41,6 +41,31 @@ public sealed partial class Hyperparameters [global::Newtonsoft.Json.JsonProperty("learning_rate")] public double? LearningRate { get; set; } + /// + /// Controls the scaling factor for LoRA updates. Higher values make the
+ /// updates more impactful. + ///
+ [global::Newtonsoft.Json.JsonProperty("lora_alpha")] + public int? LoraAlpha { get; set; } + + /// + /// Specifies the rank for low-rank matrices. Lower ranks reduce parameters
+ /// but may limit model flexibility. + ///
+ [global::Newtonsoft.Json.JsonProperty("lora_rank")] + public int? LoraRank { get; set; } + + /// + /// The possible combinations of LoRA modules to target.
+ /// - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules.
+ /// - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers.
+ /// - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers.
+ /// - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN).
+ /// Default Value: LORA_TARGET_MODULES_UNSPECIFIED + ///
+ [global::Newtonsoft.Json.JsonProperty("lora_target_modules")] + public global::G.LoraTargetModules? LoraTargetModules { get; set; } = global::G.LoraTargetModules.UNSPECIFIED; + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2.g.verified.cs similarity index 85% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2.g.verified.cs index f4c0629d8e..62c07eebe2 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.JSONResponseFormat2.g.cs +//HintName: G.Models.JsonResponseFormatV2.g.cs #nullable enable @@ -7,14 +7,14 @@ namespace G /// /// /// - public sealed partial class JSONResponseFormat2 + public sealed partial class JsonResponseFormatV2 { /// /// Defaults to `"text"`.
/// When set to `"json_object"`, the model's output will be a valid JSON Object. ///
[global::Newtonsoft.Json.JsonProperty("type", Required = global::Newtonsoft.Json.Required.Always)] - public global::G.ResponseFormatType Type { get; set; } = default!; + public global::G.ResponseFormatTypeV2 Type { get; set; } = default!; /// /// [BETA] A JSON schema object that the output will adhere to. There are some restrictions we have on the schema, refer to [our guide](/docs/structured-outputs-json#schema-constraints) for more information.
@@ -32,7 +32,7 @@ public sealed partial class JSONResponseFormat2 /// **Note**: This field must not be specified when the `type` is set to `"text"`. ///
[global::Newtonsoft.Json.JsonProperty("json_schema")] - public global::G.JSONResponseFormat2JsonSchema? JsonSchema { get; set; } + public global::G.JsonResponseFormatV2JsonSchema? JsonSchema { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs similarity index 89% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs index ab7f3204be..151fc54fba 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.JSONResponseFormat2JsonSchema.g.cs +//HintName: G.Models.JsonResponseFormatV2JsonSchema.g.cs #nullable enable @@ -19,7 +19,7 @@ namespace G /// ```
/// **Note**: This field must not be specified when the `type` is set to `"text"`. ///
- public sealed partial class JSONResponseFormat2JsonSchema + public sealed partial class JsonResponseFormatV2JsonSchema { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.LoraTargetModules.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.LoraTargetModules.g.verified.cs new file mode 100644 index 0000000000..32bfc78ad0 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.LoraTargetModules.g.verified.cs @@ -0,0 +1,74 @@ +//HintName: G.Models.LoraTargetModules.g.cs + +#nullable enable + +namespace G +{ + /// + /// The possible combinations of LoRA modules to target.
+ /// - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules.
+ /// - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers.
+ /// - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers.
+ /// - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN).
+ /// Default Value: LORA_TARGET_MODULES_UNSPECIFIED + ///
+ [global::System.Runtime.Serialization.DataContract] + public enum LoraTargetModules + { + /// + /// Unspecified LoRA target modules. + /// + [global::System.Runtime.Serialization.EnumMember(Value="LORA_TARGET_MODULES_UNSPECIFIED")] + UNSPECIFIED, + /// + /// LoRA adapts the query and value matrices in transformer attention layers. + /// + [global::System.Runtime.Serialization.EnumMember(Value="LORA_TARGET_MODULES_QV")] + QV, + /// + /// LoRA adapts query, key, value, and output matrices in attention layers. + /// + [global::System.Runtime.Serialization.EnumMember(Value="LORA_TARGET_MODULES_QKVO")] + QKVO, + /// + /// LoRA adapts attention projection matrices and feed-forward networks (FFN). + /// + [global::System.Runtime.Serialization.EnumMember(Value="LORA_TARGET_MODULES_QKVO_FFN")] + QKVOFFN, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class LoraTargetModulesExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this LoraTargetModules value) + { + return value switch + { + LoraTargetModules.UNSPECIFIED => "LORA_TARGET_MODULES_UNSPECIFIED", + LoraTargetModules.QV => "LORA_TARGET_MODULES_QV", + LoraTargetModules.QKVO => "LORA_TARGET_MODULES_QKVO", + LoraTargetModules.QKVOFFN => "LORA_TARGET_MODULES_QKVO_FFN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static LoraTargetModules? ToEnum(string value) + { + return value switch + { + "LORA_TARGET_MODULES_UNSPECIFIED" => LoraTargetModules.UNSPECIFIED, + "LORA_TARGET_MODULES_QV" => LoraTargetModules.QV, + "LORA_TARGET_MODULES_QKVO" => LoraTargetModules.QKVO, + "LORA_TARGET_MODULES_QKVO_FFN" => LoraTargetModules.QKVOFFN, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Request.g.verified.cs new file mode 100644 index 0000000000..24c33bae66 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Request.g.verified.cs @@ -0,0 +1,68 @@ +//HintName: G.Models.Rerankv2Request.g.cs + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Request + { + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + [global::Newtonsoft.Json.JsonProperty("model", Required = global::Newtonsoft.Json.Required.Always)] + public string Model { get; set; } = default!; + + /// + /// The search query + /// + [global::Newtonsoft.Json.JsonProperty("query", Required = global::Newtonsoft.Json.Required.Always)] + public string Query { get; set; } = default!; + + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + ///
+ [global::Newtonsoft.Json.JsonProperty("documents", Required = global::Newtonsoft.Json.Required.Always)] + public global::System.Collections.Generic.IList> Documents { get; set; } = default!; + + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + [global::Newtonsoft.Json.JsonProperty("top_n")] + public int? TopN { get; set; } + + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + [global::Newtonsoft.Json.JsonProperty("rank_fields")] + public global::System.Collections.Generic.IList? RankFields { get; set; } + + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + ///
+ [global::Newtonsoft.Json.JsonProperty("return_documents")] + public bool? ReturnDocuments { get; set; } = false; + + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + ///
+ [global::Newtonsoft.Json.JsonProperty("max_chunks_per_doc")] + public int? MaxChunksPerDoc { get; set; } = 10; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response.g.verified.cs new file mode 100644 index 0000000000..2531c3ef7e --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response.g.verified.cs @@ -0,0 +1,36 @@ +//HintName: G.Models.Rerankv2Response.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("id")] + public string? Id { get; set; } + + /// + /// An ordered list of ranked documents + /// + [global::Newtonsoft.Json.JsonProperty("results", Required = global::Newtonsoft.Json.Required.Always)] + public global::System.Collections.Generic.IList Results { get; set; } = default!; + + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("meta")] + public global::G.ApiMeta? Meta { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response10.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response10.g.verified.cs new file mode 100644 index 0000000000..f8ed8e23fc --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response10.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response10.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response10 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response11.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response11.g.verified.cs new file mode 100644 index 0000000000..13363ebb15 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response11.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response11.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response11 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response12.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response12.g.verified.cs new file mode 100644 index 0000000000..eaafef4217 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response12.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response12.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response12 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response13.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response13.g.verified.cs new file mode 100644 index 0000000000..f8d137e374 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response13.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response13.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response13 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response2.g.verified.cs new file mode 100644 index 0000000000..8065a57363 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response2.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response2 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response3.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response3.g.verified.cs new file mode 100644 index 0000000000..64bb024ff8 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response3.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response3.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response3 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response4.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response4.g.verified.cs new file mode 100644 index 0000000000..7ef4590141 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response4.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response4.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response4 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response5.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response5.g.verified.cs new file mode 100644 index 0000000000..96303e4e1d --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response5.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response5.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response5 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response6.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response6.g.verified.cs new file mode 100644 index 0000000000..d28dee4512 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response6.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response6.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response6 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response7.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response7.g.verified.cs new file mode 100644 index 0000000000..9230d5272c --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response7.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response7.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response7 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response8.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response8.g.verified.cs new file mode 100644 index 0000000000..149279136b --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response8.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response8.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response8 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response9.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response9.g.verified.cs new file mode 100644 index 0000000000..8fe9d3faf1 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2Response9.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response9.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response9 + { + /// + /// + /// + [global::Newtonsoft.Json.JsonProperty("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs new file mode 100644 index 0000000000..9a4c215ce3 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs @@ -0,0 +1,37 @@ +//HintName: G.Models.Rerankv2ResponseResult.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2ResponseResult + { + /// + /// If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in + /// + [global::Newtonsoft.Json.JsonProperty("document")] + public global::G.Rerankv2ResponseResultDocument? Document { get; set; } + + /// + /// Corresponds to the index in the original list of documents to which the ranked document belongs. (i.e. if the first value in the `results` object has an `index` value of 3, it means in the list of documents passed in, the document at `index=3` had the highest relevance) + /// + [global::Newtonsoft.Json.JsonProperty("index", Required = global::Newtonsoft.Json.Required.Always)] + public int Index { get; set; } = default!; + + /// + /// Relevance scores are normalized to be in the range `[0, 1]`. Scores close to `1` indicate a high relevance to the query, and scores closer to `0` indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
+ /// Included only in responses + ///
+ [global::Newtonsoft.Json.JsonProperty("relevance_score")] + public float RelevanceScore { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs new file mode 100644 index 0000000000..39fbd7471f --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2ResponseResultDocument.g.cs + +#nullable enable + +namespace G +{ + /// + /// If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in + /// + public sealed partial class Rerankv2ResponseResultDocument + { + /// + /// The text of the document to rerank + /// + [global::Newtonsoft.Json.JsonProperty("text", Required = global::Newtonsoft.Json.Required.Always)] + public string Text { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat.g.verified.cs index a6ebfb5ab1..a85c12e8ac 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat.g.verified.cs @@ -7,7 +7,7 @@ namespace G { /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs new file mode 100644 index 0000000000..f97f081f0c --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs @@ -0,0 +1,56 @@ +//HintName: G.Models.ResponseFormatTypeV2.g.cs + +#nullable enable + +namespace G +{ + /// + /// Defaults to `"text"`.
+ /// When set to `"json_object"`, the model's output will be a valid JSON Object. + ///
+ [global::System.Runtime.Serialization.DataContract] + public enum ResponseFormatTypeV2 + { + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="text")] + Text, + /// + /// + /// + [global::System.Runtime.Serialization.EnumMember(Value="json_object")] + JsonObject, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ResponseFormatTypeV2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ResponseFormatTypeV2 value) + { + return value switch + { + ResponseFormatTypeV2.Text => "text", + ResponseFormatTypeV2.JsonObject => "json_object", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ResponseFormatTypeV2? ToEnum(string value) + { + return value switch + { + "text" => ResponseFormatTypeV2.Text, + "json_object" => ResponseFormatTypeV2.JsonObject, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatV2.g.verified.cs similarity index 62% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatV2.g.verified.cs index b91c596f44..e01694b9da 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormat2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ResponseFormatV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ResponseFormat2.g.cs +//HintName: G.Models.ResponseFormatV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -13,96 +13,96 @@ namespace G /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). ///
- public readonly partial struct ResponseFormat2 : global::System.IEquatable + public readonly partial struct ResponseFormatV2 : global::System.IEquatable { /// /// /// #if NET6_0_OR_GREATER - public global::G.TextResponseFormat? TextFormat { get; init; } + public global::G.TextResponseFormatV2? Text { get; init; } #else - public global::G.TextResponseFormat? TextFormat { get; } + public global::G.TextResponseFormatV2? Text { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextFormat))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif - public bool IsTextFormat => TextFormat != null; + public bool IsText => Text != null; /// /// /// - public static implicit operator ResponseFormat2(global::G.TextResponseFormat value) => new ResponseFormat2(value); + public static implicit operator ResponseFormatV2(global::G.TextResponseFormatV2 value) => new ResponseFormatV2(value); /// /// /// - public static implicit operator global::G.TextResponseFormat?(ResponseFormat2 @this) => @this.TextFormat; + public static implicit operator global::G.TextResponseFormatV2?(ResponseFormatV2 @this) => @this.Text; /// /// /// - public ResponseFormat2(global::G.TextResponseFormat? value) + public ResponseFormatV2(global::G.TextResponseFormatV2? value) { - TextFormat = value; + Text = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.JSONResponseFormat2? JSON { get; init; } + public global::G.JsonResponseFormatV2? Json { get; init; } #else - public global::G.JSONResponseFormat2? JSON { get; } + public global::G.JsonResponseFormatV2? Json { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JSON))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Json))] #endif - public bool IsJSON => JSON != null; + public bool IsJson => Json != null; /// /// /// - public static implicit operator ResponseFormat2(global::G.JSONResponseFormat2 value) => new ResponseFormat2(value); + public static implicit operator ResponseFormatV2(global::G.JsonResponseFormatV2 value) => new ResponseFormatV2(value); /// /// /// - public static implicit operator global::G.JSONResponseFormat2?(ResponseFormat2 @this) => @this.JSON; + public static implicit operator global::G.JsonResponseFormatV2?(ResponseFormatV2 @this) => @this.Json; /// /// /// - public ResponseFormat2(global::G.JSONResponseFormat2? value) + public ResponseFormatV2(global::G.JsonResponseFormatV2? value) { - JSON = value; + Json = value; } /// /// /// - public ResponseFormat2( - global::G.TextResponseFormat? textFormat, - global::G.JSONResponseFormat2? jSON + public ResponseFormatV2( + global::G.TextResponseFormatV2? text, + global::G.JsonResponseFormatV2? json ) { - TextFormat = textFormat; - JSON = jSON; + Text = text; + Json = json; } /// /// /// public object? Object => - JSON as object ?? - TextFormat as object + Json as object ?? + Text as object ; /// @@ -110,7 +110,7 @@ TextFormat as object /// public bool Validate() { - return IsTextFormat && !IsJSON || !IsTextFormat && IsJSON; + return IsText && !IsJson || !IsText && IsJson; } /// @@ -120,10 +120,10 @@ public override int GetHashCode() { var fields = new object?[] { - TextFormat, - typeof(global::G.TextResponseFormat), - JSON, - typeof(global::G.JSONResponseFormat2), + Text, + typeof(global::G.TextResponseFormatV2), + Json, + typeof(global::G.JsonResponseFormatV2), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -136,26 +136,26 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(ResponseFormat2 other) + public bool Equals(ResponseFormatV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(TextFormat, other.TextFormat) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(JSON, other.JSON) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Json, other.Json) ; } /// /// /// - public static bool operator ==(ResponseFormat2 obj1, ResponseFormat2 obj2) + public static bool operator ==(ResponseFormatV2 obj1, ResponseFormatV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(ResponseFormat2 obj1, ResponseFormat2 obj2) + public static bool operator !=(ResponseFormatV2 obj1, ResponseFormatV2 obj2) { return !(obj1 == obj2); } @@ -165,7 +165,7 @@ public bool Equals(ResponseFormat2 other) /// public override bool Equals(object? obj) { - return obj is ResponseFormat2 o && Equals(o); + return obj is ResponseFormatV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Strategy.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Strategy.g.verified.cs index c99a1aa0b4..200d87aa25 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Strategy.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Strategy.g.verified.cs @@ -7,7 +7,7 @@ namespace G /// /// The possible strategy used to serve a fine-tuned models.
/// - STRATEGY_UNSPECIFIED: Unspecified strategy.
- /// - STRATEGY_VANILLA: Serve the fine-tuned model on a dedicated GPU.
+ /// - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU.
/// - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU.
/// Default Value: STRATEGY_UNSPECIFIED ///
@@ -20,7 +20,7 @@ public enum Strategy [global::System.Runtime.Serialization.EnumMember(Value="STRATEGY_UNSPECIFIED")] UNSPECIFIED, /// - /// Serve the fine-tuned model on a dedicated GPU. + /// Deprecated: Serve the fine-tuned model on a dedicated GPU. /// [global::System.Runtime.Serialization.EnumMember(Value="STRATEGY_VANILLA")] VANILLA, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponseV2.g.verified.cs similarity index 83% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponseV2.g.verified.cs index 54ce386ac7..7222b13cfc 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.StreamedChatResponseV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.StreamedChatResponse2.g.cs +//HintName: G.Models.StreamedChatResponseV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -9,7 +9,7 @@ namespace G /// /// StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). /// - public readonly partial struct StreamedChatResponse2 : global::System.IEquatable + public readonly partial struct StreamedChatResponseV2 : global::System.IEquatable { /// /// A streamed event which signifies that a stream has started. @@ -31,17 +31,17 @@ namespace G /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatMessageStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatMessageStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatMessageStartEvent?(StreamedChatResponse2 @this) => @this.MessageStartEvent; + public static implicit operator global::G.ChatMessageStartEvent?(StreamedChatResponseV2 @this) => @this.MessageStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatMessageStartEvent? value) + public StreamedChatResponseV2(global::G.ChatMessageStartEvent? value) { MessageStartEvent = value; } @@ -66,17 +66,17 @@ public StreamedChatResponse2(global::G.ChatMessageStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentStartEvent?(StreamedChatResponse2 @this) => @this.ContentStartEvent; + public static implicit operator global::G.ChatContentStartEvent?(StreamedChatResponseV2 @this) => @this.ContentStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentStartEvent? value) + public StreamedChatResponseV2(global::G.ChatContentStartEvent? value) { ContentStartEvent = value; } @@ -101,17 +101,17 @@ public StreamedChatResponse2(global::G.ChatContentStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentDeltaEvent?(StreamedChatResponse2 @this) => @this.ContentDeltaEvent; + public static implicit operator global::G.ChatContentDeltaEvent?(StreamedChatResponseV2 @this) => @this.ContentDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatContentDeltaEvent? value) { ContentDeltaEvent = value; } @@ -136,17 +136,17 @@ public StreamedChatResponse2(global::G.ChatContentDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentEndEvent?(StreamedChatResponse2 @this) => @this.ContentEndEvent; + public static implicit operator global::G.ChatContentEndEvent?(StreamedChatResponseV2 @this) => @this.ContentEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentEndEvent? value) + public StreamedChatResponseV2(global::G.ChatContentEndEvent? value) { ContentEndEvent = value; } @@ -171,17 +171,17 @@ public StreamedChatResponse2(global::G.ChatContentEndEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolPlanDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolPlanDeltaEvent?(StreamedChatResponse2 @this) => @this.ToolPlanDeltaEvent; + public static implicit operator global::G.ChatToolPlanDeltaEvent?(StreamedChatResponseV2 @this) => @this.ToolPlanDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatToolPlanDeltaEvent? value) { ToolPlanDeltaEvent = value; } @@ -206,17 +206,17 @@ public StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallStartEvent?(StreamedChatResponse2 @this) => @this.ToolCallStartEvent; + public static implicit operator global::G.ChatToolCallStartEvent?(StreamedChatResponseV2 @this) => @this.ToolCallStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallStartEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallStartEvent? value) { ToolCallStartEvent = value; } @@ -241,17 +241,17 @@ public StreamedChatResponse2(global::G.ChatToolCallStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallDeltaEvent?(StreamedChatResponse2 @this) => @this.ToolCallDeltaEvent; + public static implicit operator global::G.ChatToolCallDeltaEvent?(StreamedChatResponseV2 @this) => @this.ToolCallDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallDeltaEvent? value) { ToolCallDeltaEvent = value; } @@ -276,17 +276,17 @@ public StreamedChatResponse2(global::G.ChatToolCallDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallEndEvent?(StreamedChatResponse2 @this) => @this.ToolCallEndEvent; + public static implicit operator global::G.ChatToolCallEndEvent?(StreamedChatResponseV2 @this) => @this.ToolCallEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallEndEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallEndEvent? value) { ToolCallEndEvent = value; } @@ -311,17 +311,17 @@ public StreamedChatResponse2(global::G.ChatToolCallEndEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatMessageEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatMessageEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatMessageEndEvent?(StreamedChatResponse2 @this) => @this.MessageEndEvent; + public static implicit operator global::G.ChatMessageEndEvent?(StreamedChatResponseV2 @this) => @this.MessageEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatMessageEndEvent? value) + public StreamedChatResponseV2(global::G.ChatMessageEndEvent? value) { MessageEndEvent = value; } @@ -329,7 +329,7 @@ public StreamedChatResponse2(global::G.ChatMessageEndEvent? value) /// /// /// - public StreamedChatResponse2( + public StreamedChatResponseV2( global::G.ChatMessageStartEvent? messageStartEvent, global::G.ChatContentStartEvent? contentStartEvent, global::G.ChatContentDeltaEvent? contentDeltaEvent, @@ -412,7 +412,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(StreamedChatResponse2 other) + public bool Equals(StreamedChatResponseV2 other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(MessageStartEvent, other.MessageStartEvent) && @@ -430,15 +430,15 @@ public bool Equals(StreamedChatResponse2 other) /// /// /// - public static bool operator ==(StreamedChatResponse2 obj1, StreamedChatResponse2 obj2) + public static bool operator ==(StreamedChatResponseV2 obj1, StreamedChatResponseV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(StreamedChatResponse2 obj1, StreamedChatResponse2 obj2) + public static bool operator !=(StreamedChatResponseV2 obj1, StreamedChatResponseV2 obj2) { return !(obj1 == obj2); } @@ -448,7 +448,7 @@ public bool Equals(StreamedChatResponse2 other) /// public override bool Equals(object? obj) { - return obj is StreamedChatResponse2 o && Equals(o); + return obj is StreamedChatResponseV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.TextResponseFormatV2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.TextResponseFormatV2.g.verified.cs new file mode 100644 index 0000000000..13aa2b11af --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.TextResponseFormatV2.g.verified.cs @@ -0,0 +1,25 @@ +//HintName: G.Models.TextResponseFormatV2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class TextResponseFormatV2 + { + /// + /// Defaults to `"text"`.
+ /// When set to `"json_object"`, the model's output will be a valid JSON Object. + ///
+ [global::Newtonsoft.Json.JsonProperty("type", Required = global::Newtonsoft.Json.Required.Always)] + public global::G.ResponseFormatTypeV2 Type { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::Newtonsoft.Json.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2.g.verified.cs similarity index 80% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2.g.verified.cs index 296f50ca0c..aef84707ce 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2.g.cs +//HintName: G.Models.ToolCallV2.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// A array of tool calls to be made. /// - public sealed partial class ToolCall2 + public sealed partial class ToolCallV2 { /// /// @@ -19,13 +19,13 @@ public sealed partial class ToolCall2 /// /// [global::Newtonsoft.Json.JsonProperty("type")] - public global::G.ToolCall2Type? Type { get; set; } + public global::G.ToolCallV2Type? Type { get; set; } /// /// /// [global::Newtonsoft.Json.JsonProperty("function")] - public global::G.ToolCall2Function? Function { get; set; } + public global::G.ToolCallV2Function? Function { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Function.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Function.g.verified.cs similarity index 88% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Function.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Function.g.verified.cs index df3d55b019..93fa9be29d 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Function.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Function.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2Function.g.cs +//HintName: G.Models.ToolCallV2Function.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class ToolCall2Function + public sealed partial class ToolCallV2Function { /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Type.g.verified.cs similarity index 70% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Type.g.verified.cs index 6b7fe4a376..6b13a3e216 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCall2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolCallV2Type.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2Type.g.cs +//HintName: G.Models.ToolCallV2Type.g.cs #nullable enable @@ -8,7 +8,7 @@ namespace G /// /// [global::System.Runtime.Serialization.DataContract] - public enum ToolCall2Type + public enum ToolCallV2Type { /// /// @@ -20,27 +20,27 @@ public enum ToolCall2Type /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolCall2TypeExtensions + public static class ToolCallV2TypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolCall2Type value) + public static string ToValueString(this ToolCallV2Type value) { return value switch { - ToolCall2Type.Function => "function", + ToolCallV2Type.Function => "function", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolCall2Type? ToEnum(string value) + public static ToolCallV2Type? ToEnum(string value) { return value switch { - "function" => ToolCall2Type.Function, + "function" => ToolCallV2Type.Function, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContent.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContent.g.verified.cs index 50d6b65dbc..5099dd58cf 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContent.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolContent.g.verified.cs @@ -1,30 +1,167 @@ //HintName: G.Models.ToolContent.g.cs +using System.Linq; +#pragma warning disable CS0618 // Type or member is obsolete #nullable enable namespace G { /// - /// Tool content result object + /// A content block which contains information about the content of a tool result /// - public sealed partial class ToolContent + public readonly partial struct ToolContent : global::System.IEquatable { + /// + /// Text content of the message. + /// +#if NET6_0_OR_GREATER + public global::G.TextContent? Text { get; init; } +#else + public global::G.TextContent? Text { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] +#endif + public bool IsText => Text != null; + + /// + /// + /// + public static implicit operator ToolContent(global::G.TextContent value) => new ToolContent(value); + + /// + /// + /// + public static implicit operator global::G.TextContent?(ToolContent @this) => @this.Text; + + /// + /// + /// + public ToolContent(global::G.TextContent? value) + { + Text = value; + } + + /// + /// Document content. + /// +#if NET6_0_OR_GREATER + public global::G.DocumentContent? Document { get; init; } +#else + public global::G.DocumentContent? Document { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Document))] +#endif + public bool IsDocument => Document != null; + + /// + /// + /// + public static implicit operator ToolContent(global::G.DocumentContent value) => new ToolContent(value); + /// /// /// - [global::Newtonsoft.Json.JsonProperty("type")] - public global::G.ToolContentType Type { get; set; } + public static implicit operator global::G.DocumentContent?(ToolContent @this) => @this.Document; /// /// /// - [global::Newtonsoft.Json.JsonProperty("output", Required = global::Newtonsoft.Json.Required.Always)] - public global::G.ToolContentOutput Output { get; set; } = default!; + public ToolContent(global::G.DocumentContent? value) + { + Document = value; + } /// - /// Additional properties that are not explicitly defined in the schema + /// + /// + public ToolContent( + global::G.TextContent? text, + global::G.DocumentContent? document + ) + { + Text = text; + Document = document; + } + + /// + /// + /// + public object? Object => + Document as object ?? + Text as object + ; + + /// + /// + /// + public bool Validate() + { + return IsText && !IsDocument || !IsText && IsDocument; + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Text, + typeof(global::G.TextContent), + Document, + typeof(global::G.DocumentContent), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + return fields.Aggregate(offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ToolContent other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) + ; + } + + /// + /// + /// + public static bool operator ==(ToolContent obj1, ToolContent obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ToolContent obj1, ToolContent obj2) + { + return !(obj1 == obj2); + } + + /// + /// /// - [global::Newtonsoft.Json.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + public override bool Equals(object? obj) + { + return obj is ToolContent o && Equals(o); + } } -} \ No newline at end of file +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2.g.verified.cs similarity index 66% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2.g.verified.cs index 65bb1ebd6a..27ab7a0d67 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolMessage2.g.cs +//HintName: G.Models.ToolMessageV2.g.cs #pragma warning disable CS0618 // Type or member is obsolete @@ -9,25 +9,25 @@ namespace G /// /// A message from the system. /// - public sealed partial class ToolMessage2 + public sealed partial class ToolMessageV2 { /// /// /// [global::Newtonsoft.Json.JsonProperty("role")] - public global::G.ToolMessage2Role Role { get; set; } + public global::G.ToolMessageV2Role Role { get; set; } /// - /// + /// The id of the associated tool call that has provided the given content /// [global::Newtonsoft.Json.JsonProperty("tool_call_id", Required = global::Newtonsoft.Json.Required.Always)] public string ToolCallId { get; set; } = default!; /// - /// + /// A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks /// [global::Newtonsoft.Json.JsonProperty("tool_content", Required = global::Newtonsoft.Json.Required.Always)] - public global::System.Collections.Generic.IList> ToolContent { get; set; } = default!; + public global::G.OneOf> ToolContent { get; set; } = default!; /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2Role.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2Role.g.verified.cs similarity index 70% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2Role.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2Role.g.verified.cs index 07881679ad..89b45b89c0 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessage2Role.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolMessageV2Role.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolMessage2Role.g.cs +//HintName: G.Models.ToolMessageV2Role.g.cs #nullable enable @@ -8,7 +8,7 @@ namespace G /// /// [global::System.Runtime.Serialization.DataContract] - public enum ToolMessage2Role + public enum ToolMessageV2Role { /// /// @@ -20,27 +20,27 @@ public enum ToolMessage2Role /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolMessage2RoleExtensions + public static class ToolMessageV2RoleExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolMessage2Role value) + public static string ToValueString(this ToolMessageV2Role value) { return value switch { - ToolMessage2Role.Tool => "tool", + ToolMessageV2Role.Tool => "tool", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolMessage2Role? ToEnum(string value) + public static ToolMessageV2Role? ToEnum(string value) { return value switch { - "tool" => ToolMessage2Role.Tool, + "tool" => ToolMessageV2Role.Tool, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2.g.verified.cs similarity index 78% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2.g.verified.cs index aec283a7bd..d44d0f3560 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2.g.cs +//HintName: G.Models.ToolV2.g.cs #nullable enable @@ -7,19 +7,19 @@ namespace G /// /// /// - public sealed partial class Tool2 + public sealed partial class ToolV2 { /// /// /// [global::Newtonsoft.Json.JsonProperty("type")] - public global::G.Tool2Type? Type { get; set; } + public global::G.ToolV2Type? Type { get; set; } /// /// The function to be executed. /// [global::Newtonsoft.Json.JsonProperty("function")] - public global::G.Tool2Function? Function { get; set; } + public global::G.ToolV2Function? Function { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Function.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Function.g.verified.cs similarity index 86% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Function.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Function.g.verified.cs index acaa04885b..1fe29f1289 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Function.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Function.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2Function.g.cs +//HintName: G.Models.ToolV2Function.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// The function to be executed. /// - public sealed partial class Tool2Function + public sealed partial class ToolV2Function { /// /// The name of the function. @@ -25,7 +25,7 @@ public sealed partial class Tool2Function /// The parameters of the function as a JSON schema. /// [global::Newtonsoft.Json.JsonProperty("parameters")] - public global::G.Tool2FunctionParameters? Parameters { get; set; } + public global::G.ToolV2FunctionParameters? Parameters { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2FunctionParameters.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs similarity index 81% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2FunctionParameters.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs index 84a136efae..0ab86109a5 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2FunctionParameters.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2FunctionParameters.g.cs +//HintName: G.Models.ToolV2FunctionParameters.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// The parameters of the function as a JSON schema. /// - public sealed partial class Tool2FunctionParameters + public sealed partial class ToolV2FunctionParameters { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Type.g.verified.cs similarity index 72% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Type.g.verified.cs index c708575a52..c68dc1c6ce 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.Tool2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.ToolV2Type.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2Type.g.cs +//HintName: G.Models.ToolV2Type.g.cs #nullable enable @@ -8,7 +8,7 @@ namespace G /// /// [global::System.Runtime.Serialization.DataContract] - public enum Tool2Type + public enum ToolV2Type { /// /// @@ -20,27 +20,27 @@ public enum Tool2Type /// /// Enum extensions to do fast conversions without the reflection. /// - public static class Tool2TypeExtensions + public static class ToolV2TypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this Tool2Type value) + public static string ToValueString(this ToolV2Type value) { return value switch { - Tool2Type.Function => "function", + ToolV2Type.Function => "function", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static Tool2Type? ToEnum(string value) + public static ToolV2Type? ToEnum(string value) { return value switch { - "function" => Tool2Type.Function, + "function" => ToolV2Type.Function, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.UserMessage.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.UserMessage.g.verified.cs index f2ccfa6168..8965bae7f4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.UserMessage.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/NewtonsoftJson/_#G.Models.UserMessage.g.verified.cs @@ -24,12 +24,6 @@ public sealed partial class UserMessage [global::Newtonsoft.Json.JsonProperty("content", Required = global::Newtonsoft.Json.Required.Always)] public global::G.OneOf> Content { get; set; } = default!; - /// - /// Documents seen by the model when generating the reply. - /// - [global::Newtonsoft.Json.JsonProperty("documents")] - public global::System.Collections.Generic.IList? Documents { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chat.g.verified.cs index 9ef6e6551c..ef39a43e32 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chat.g.verified.cs @@ -9,11 +9,13 @@ public partial class Api partial void PrepareChatArguments( global::System.Net.Http.HttpClient httpClient, ref string? xClientName, + ref global::G.ChatAccepts? accepts, global::G.ChatRequest request); partial void PrepareChatRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string? xClientName, + global::G.ChatAccepts? accepts, global::G.ChatRequest request); partial void ProcessChatResponse( global::System.Net.Http.HttpClient httpClient, @@ -27,15 +29,17 @@ partial void ProcessChatResponseContent( /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ChatAsync( global::G.ChatRequest request, string? xClientName = default, + global::G.ChatAccepts? accepts = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -45,12 +49,17 @@ partial void ProcessChatResponseContent( PrepareChatArguments( httpClient: _httpClient, xClientName: ref xClientName, + accepts: ref accepts, request: request); if (xClientName != default) { _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); } + if (accepts != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Accepts", accepts?.ToValueString() ?? string.Empty); + } var __pathBuilder = new PathBuilder( path: "/v1/chat", @@ -73,6 +82,7 @@ partial void ProcessChatResponseContent( httpClient: _httpClient, httpRequestMessage: httpRequest, xClientName: xClientName, + accepts: accepts, request: request); using var response = await _httpClient.SendAsync( @@ -115,15 +125,16 @@ partial void ProcessChatResponseContent( /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// Text input for the model to respond to.
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments /// @@ -155,7 +166,9 @@ partial void ProcessChatResponseContent( /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// /// Accepts `{"id": "web-search"}`, and/or the `"id"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.
@@ -275,12 +288,19 @@ partial void ProcessChatResponseContent( /// Forces the chat to be single step. Defaults to `false`. /// /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ChatAsync( @@ -293,6 +313,7 @@ partial void ProcessChatResponseContent( double frequencyPenalty, double presencePenalty, string? xClientName = default, + global::G.ChatAccepts? accepts = default, string? model = default, bool? stream = default, string? preamble = default, @@ -309,6 +330,7 @@ partial void ProcessChatResponseContent( global::System.Collections.Generic.IList? toolResults = default, bool? forceSingleStep = default, global::G.ResponseFormat? responseFormat = default, + global::G.ChatRequestSafetyMode? safetyMode = default, global::System.Threading.CancellationToken cancellationToken = default) { var request = new global::G.ChatRequest @@ -337,10 +359,12 @@ partial void ProcessChatResponseContent( ToolResults = toolResults, ForceSingleStep = forceSingleStep, ResponseFormat = responseFormat, + SafetyMode = safetyMode, }; return await ChatAsync( xClientName: xClientName, + accepts: accepts, request: request, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chatv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chatv2.g.verified.cs index 66251b783b..4756948e85 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chatv2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Chatv2.g.verified.cs @@ -29,7 +29,7 @@ partial void ProcessChatv2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task> Chatv2Async( + public async global::System.Threading.Tasks.Task> Chatv2Async( global::G.Chatv2Request request, global::System.Threading.CancellationToken cancellationToken = default) { @@ -96,7 +96,7 @@ partial void ProcessChatv2ResponseContent( } return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content, JsonSerializerOptions) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, JsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } @@ -115,9 +115,11 @@ partial void ProcessChatv2ResponseContent( /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. /// - /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + /// + /// Options for controlling citation generation. /// /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -126,6 +128,13 @@ partial void ProcessChatv2ResponseContent( /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. /// @@ -163,12 +172,14 @@ partial void ProcessChatv2ResponseContent( /// /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task> Chatv2Async( + public async global::System.Threading.Tasks.Task> Chatv2Async( string model, - global::System.Collections.Generic.IList messages, - global::System.Collections.Generic.IList? tools = default, - global::G.Chatv2RequestCitationMode? citationMode = default, - global::G.ResponseFormat2? responseFormat = default, + global::System.Collections.Generic.IList messages, + global::System.Collections.Generic.IList? tools = default, + global::System.Collections.Generic.IList>? documents = default, + global::G.CitationOptions? citationOptions = default, + global::G.ResponseFormatV2? responseFormat = default, + global::G.Chatv2RequestSafetyMode? safetyMode = default, int? maxTokens = default, global::System.Collections.Generic.IList? stopSequences = default, float? temperature = default, @@ -184,8 +195,10 @@ partial void ProcessChatv2ResponseContent( Model = model, Messages = messages, Tools = tools, - CitationMode = citationMode, + Documents = documents, + CitationOptions = citationOptions, ResponseFormat = responseFormat, + SafetyMode = safetyMode, MaxTokens = maxTokens, StopSequences = stopSequences, Temperature = temperature, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embed.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embed.g.verified.cs index 3157afa879..7848a8bf7e 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embed.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embed.g.verified.cs @@ -142,7 +142,8 @@ partial void ProcessEmbedResponseContent( /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embedv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embedv2.g.verified.cs new file mode 100644 index 0000000000..0ae4a5bd4b --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Embedv2.g.verified.cs @@ -0,0 +1,190 @@ +//HintName: G.Api.Embedv2.g.cs + +#nullable enable + +namespace G +{ + public partial class Api + { + partial void PrepareEmbedv2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xClientName, + global::G.Embedv2Request request); + partial void PrepareEmbedv2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xClientName, + global::G.Embedv2Request request); + partial void ProcessEmbedv2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEmbedv2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Embedv2Async( + global::G.Embedv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareEmbedv2Arguments( + httpClient: _httpClient, + xClientName: ref xClientName, + request: request); + + if (xClientName != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); + } + + var __pathBuilder = new PathBuilder( + path: "/v2/embed", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, JsonSerializerOptions); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareEmbedv2Request( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + xClientName: xClientName, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessEmbedv2Response( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessEmbedv2ResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, JsonSerializerOptions) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + /// + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + /// + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + /// + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + /// + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Embedv2Async( + global::System.Collections.Generic.IList texts, + string model, + global::System.Collections.Generic.IList embeddingTypes, + global::G.Embedv2RequestTruncate truncate, + string? xClientName = default, + global::G.EmbedInputType? inputType = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::G.Embedv2Request + { + Texts = texts, + Model = model, + InputType = inputType, + EmbeddingTypes = embeddingTypes, + Truncate = truncate, + }; + + return await Embedv2Async( + xClientName: xClientName, + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Rerankv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Rerankv2.g.verified.cs new file mode 100644 index 0000000000..8e040723d5 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.Rerankv2.g.verified.cs @@ -0,0 +1,176 @@ +//HintName: G.Api.Rerankv2.g.cs + +#nullable enable + +namespace G +{ + public partial class Api + { + partial void PrepareRerankv2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xClientName, + global::G.Rerankv2Request request); + partial void PrepareRerankv2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xClientName, + global::G.Rerankv2Request request); + partial void ProcessRerankv2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRerankv2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Rerankv2Async( + global::G.Rerankv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: _httpClient); + PrepareRerankv2Arguments( + httpClient: _httpClient, + xClientName: ref xClientName, + request: request); + + if (xClientName != default) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Client-Name", xClientName); + } + + var __pathBuilder = new PathBuilder( + path: "/v2/rerank", + baseUri: _httpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, JsonSerializerOptions); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareRerankv2Request( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + xClientName: xClientName, + request: request); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessRerankv2Response( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessRerankv2ResponseContent( + httpClient: _httpClient, + httpResponseMessage: response, + content: ref __content); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, JsonSerializerOptions) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + /// + /// The search query + /// + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + /// + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Rerankv2Async( + string model, + string query, + global::System.Collections.Generic.IList> documents, + string? xClientName = default, + int? topN = default, + global::System.Collections.Generic.IList? rankFields = default, + bool? returnDocuments = false, + int? maxChunksPerDoc = 10, + global::System.Threading.CancellationToken cancellationToken = default) + { + var request = new global::G.Rerankv2Request + { + Model = model, + Query = query, + Documents = documents, + TopN = topN, + RankFields = rankFields, + ReturnDocuments = returnDocuments, + MaxChunksPerDoc = maxChunksPerDoc, + }; + + return await Rerankv2Async( + xClientName: xClientName, + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.g.verified.cs index d565d491fe..91b7a229d9 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Api.g.verified.cs @@ -43,18 +43,22 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable new global::G.JsonConverters.TextContentTypeNullableJsonConverter(), new global::G.JsonConverters.UserMessageRoleJsonConverter(), new global::G.JsonConverters.UserMessageRoleNullableJsonConverter(), - new global::G.JsonConverters.ToolCall2TypeJsonConverter(), - new global::G.JsonConverters.ToolCall2TypeNullableJsonConverter(), + new global::G.JsonConverters.ToolCallV2TypeJsonConverter(), + new global::G.JsonConverters.ToolCallV2TypeNullableJsonConverter(), new global::G.JsonConverters.AssistantMessageRoleJsonConverter(), new global::G.JsonConverters.AssistantMessageRoleNullableJsonConverter(), new global::G.JsonConverters.SystemMessageRoleJsonConverter(), new global::G.JsonConverters.SystemMessageRoleNullableJsonConverter(), - new global::G.JsonConverters.ToolContentTypeJsonConverter(), - new global::G.JsonConverters.ToolContentTypeNullableJsonConverter(), - new global::G.JsonConverters.ToolMessage2RoleJsonConverter(), - new global::G.JsonConverters.ToolMessage2RoleNullableJsonConverter(), - new global::G.JsonConverters.Tool2TypeJsonConverter(), - new global::G.JsonConverters.Tool2TypeNullableJsonConverter(), + new global::G.JsonConverters.DocumentContentTypeJsonConverter(), + new global::G.JsonConverters.DocumentContentTypeNullableJsonConverter(), + new global::G.JsonConverters.ToolMessageV2RoleJsonConverter(), + new global::G.JsonConverters.ToolMessageV2RoleNullableJsonConverter(), + new global::G.JsonConverters.ToolV2TypeJsonConverter(), + new global::G.JsonConverters.ToolV2TypeNullableJsonConverter(), + new global::G.JsonConverters.CitationOptionsModeJsonConverter(), + new global::G.JsonConverters.CitationOptionsModeNullableJsonConverter(), + new global::G.JsonConverters.ResponseFormatTypeV2JsonConverter(), + new global::G.JsonConverters.ResponseFormatTypeV2NullableJsonConverter(), new global::G.JsonConverters.ChatFinishReasonJsonConverter(), new global::G.JsonConverters.ChatFinishReasonNullableJsonConverter(), new global::G.JsonConverters.AssistantMessageResponseRoleJsonConverter(), @@ -101,20 +105,26 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable new global::G.JsonConverters.BaseTypeNullableJsonConverter(), new global::G.JsonConverters.StrategyJsonConverter(), new global::G.JsonConverters.StrategyNullableJsonConverter(), + new global::G.JsonConverters.LoraTargetModulesJsonConverter(), + new global::G.JsonConverters.LoraTargetModulesNullableJsonConverter(), new global::G.JsonConverters.StatusJsonConverter(), new global::G.JsonConverters.StatusNullableJsonConverter(), new global::G.JsonConverters.ChatRequestPromptTruncationJsonConverter(), new global::G.JsonConverters.ChatRequestPromptTruncationNullableJsonConverter(), new global::G.JsonConverters.ChatRequestCitationQualityJsonConverter(), new global::G.JsonConverters.ChatRequestCitationQualityNullableJsonConverter(), - new global::G.JsonConverters.Chatv2RequestCitationModeJsonConverter(), - new global::G.JsonConverters.Chatv2RequestCitationModeNullableJsonConverter(), + new global::G.JsonConverters.ChatRequestSafetyModeJsonConverter(), + new global::G.JsonConverters.ChatRequestSafetyModeNullableJsonConverter(), + new global::G.JsonConverters.Chatv2RequestSafetyModeJsonConverter(), + new global::G.JsonConverters.Chatv2RequestSafetyModeNullableJsonConverter(), new global::G.JsonConverters.GenerateRequestTruncateJsonConverter(), new global::G.JsonConverters.GenerateRequestTruncateNullableJsonConverter(), new global::G.JsonConverters.GenerateRequestReturnLikelihoodsJsonConverter(), new global::G.JsonConverters.GenerateRequestReturnLikelihoodsNullableJsonConverter(), new global::G.JsonConverters.EmbedRequestTruncateJsonConverter(), new global::G.JsonConverters.EmbedRequestTruncateNullableJsonConverter(), + new global::G.JsonConverters.Embedv2RequestTruncateJsonConverter(), + new global::G.JsonConverters.Embedv2RequestTruncateNullableJsonConverter(), new global::G.JsonConverters.ClassifyRequestTruncateJsonConverter(), new global::G.JsonConverters.ClassifyRequestTruncateNullableJsonConverter(), new global::G.JsonConverters.SummarizeRequestLengthJsonConverter(), @@ -123,6 +133,8 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable new global::G.JsonConverters.SummarizeRequestFormatNullableJsonConverter(), new global::G.JsonConverters.SummarizeRequestExtractivenessJsonConverter(), new global::G.JsonConverters.SummarizeRequestExtractivenessNullableJsonConverter(), + new global::G.JsonConverters.ChatAcceptsJsonConverter(), + new global::G.JsonConverters.ChatAcceptsNullableJsonConverter(), new global::G.JsonConverters.ClassifyResponseClassificationClassificationTypeJsonConverter(), new global::G.JsonConverters.ClassifyResponseClassificationClassificationTypeNullableJsonConverter(), new global::G.JsonConverters.MessageJsonConverter(), @@ -140,8 +152,9 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable new global::G.JsonConverters.OneOfJsonConverterFactory2(), new global::G.JsonConverters.SourceJsonConverter(), new global::G.JsonConverters.OneOfJsonConverterFactory1(), - new global::G.JsonConverters.ChatMessage2JsonConverter(), - new global::G.JsonConverters.ResponseFormat2JsonConverter(), + new global::G.JsonConverters.ToolContentJsonConverter(), + new global::G.JsonConverters.ChatMessageV2JsonConverter(), + new global::G.JsonConverters.ResponseFormatV2JsonConverter(), new global::G.JsonConverters.ChatMessageStartEventJsonConverter(), new global::G.JsonConverters.ChatContentStartEventJsonConverter(), new global::G.JsonConverters.ChatContentDeltaEventJsonConverter(), @@ -153,7 +166,7 @@ public sealed partial class Api : global::G.IApi, global::System.IDisposable new global::G.JsonConverters.CitationStartEventJsonConverter(), new global::G.JsonConverters.CitationEndEventJsonConverter(), new global::G.JsonConverters.ChatMessageEndEventJsonConverter(), - new global::G.JsonConverters.StreamedChatResponse2JsonConverter(), + new global::G.JsonConverters.StreamedChatResponseV2JsonConverter(), new global::G.JsonConverters.GenerateStreamTextJsonConverter(), new global::G.JsonConverters.GenerateStreamEndJsonConverter(), new global::G.JsonConverters.GenerateStreamErrorJsonConverter(), diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs index 13246ff5d1..fc658b0ca7 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.EmbedJobsClient.CreateEmbedJob.g.verified.cs @@ -132,7 +132,8 @@ partial void ProcessCreateEmbedJobResponseContent( /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// The name of the embed job. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chat.g.verified.cs index 2a05ee4e70..f43f9431e4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chat.g.verified.cs @@ -8,29 +8,32 @@ public partial interface IApi /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ChatAsync( global::G.ChatRequest request, string? xClientName = default, + global::G.ChatAccepts? accepts = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Chat
/// Generates a text response to a user message.
- /// To learn how to use the Chat API with Streaming and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). + /// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
/// + /// /// /// Text input for the model to respond to.
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments /// @@ -62,7 +65,9 @@ public partial interface IApi /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments /// /// /// Accepts `{"id": "web-search"}`, and/or the `"id"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/docs/creating-and-deploying-a-connector) one.
@@ -182,12 +187,19 @@ public partial interface IApi /// Forces the chat to be single step. Defaults to `false`. /// /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ChatAsync( @@ -200,6 +212,7 @@ public partial interface IApi double frequencyPenalty, double presencePenalty, string? xClientName = default, + global::G.ChatAccepts? accepts = default, string? model = default, bool? stream = default, string? preamble = default, @@ -216,6 +229,7 @@ public partial interface IApi global::System.Collections.Generic.IList? toolResults = default, bool? forceSingleStep = default, global::G.ResponseFormat? responseFormat = default, + global::G.ChatRequestSafetyMode? safetyMode = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chatv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chatv2.g.verified.cs index 19e330faa5..c48d35dcd3 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chatv2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Chatv2.g.verified.cs @@ -12,7 +12,7 @@ public partial interface IApi /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task> Chatv2Async( + global::System.Threading.Tasks.Task> Chatv2Async( global::G.Chatv2Request request, global::System.Threading.CancellationToken cancellationToken = default); @@ -31,9 +31,11 @@ public partial interface IApi /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. /// - /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + /// + /// Options for controlling citation generation. /// /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -42,6 +44,13 @@ public partial interface IApi /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). /// + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + /// /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. /// @@ -79,12 +88,14 @@ public partial interface IApi /// /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task> Chatv2Async( + global::System.Threading.Tasks.Task> Chatv2Async( string model, - global::System.Collections.Generic.IList messages, - global::System.Collections.Generic.IList? tools = default, - global::G.Chatv2RequestCitationMode? citationMode = default, - global::G.ResponseFormat2? responseFormat = default, + global::System.Collections.Generic.IList messages, + global::System.Collections.Generic.IList? tools = default, + global::System.Collections.Generic.IList>? documents = default, + global::G.CitationOptions? citationOptions = default, + global::G.ResponseFormatV2? responseFormat = default, + global::G.Chatv2RequestSafetyMode? safetyMode = default, int? maxTokens = default, global::System.Collections.Generic.IList? stopSequences = default, float? temperature = default, diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embed.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embed.g.verified.cs index af7e6dde99..bf0c2a1bb3 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embed.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embed.g.verified.cs @@ -49,7 +49,8 @@ public partial interface IApi /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embedv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embedv2.g.verified.cs new file mode 100644 index 0000000000..45dd9c0ecd --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Embedv2.g.verified.cs @@ -0,0 +1,82 @@ +//HintName: G.IApi.Embedv2.g.cs +#nullable enable + +namespace G +{ + public partial interface IApi + { + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Embedv2Async( + global::G.Embedv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Embed
+ /// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
+ /// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
+ /// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](/docs/semantic-search). + ///
+ /// + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + /// + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + /// + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + /// + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + /// + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Embedv2Async( + global::System.Collections.Generic.IList texts, + string model, + global::System.Collections.Generic.IList embeddingTypes, + global::G.Embedv2RequestTruncate truncate, + string? xClientName = default, + global::G.EmbedInputType? inputType = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Rerankv2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Rerankv2.g.verified.cs new file mode 100644 index 0000000000..bd881f7216 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IApi.Rerankv2.g.verified.cs @@ -0,0 +1,66 @@ +//HintName: G.IApi.Rerankv2.g.cs +#nullable enable + +namespace G +{ + public partial interface IApi + { + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Rerankv2Async( + global::G.Rerankv2Request request, + string? xClientName = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Rerank
+ /// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. + ///
+ /// + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + /// + /// The search query + /// + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + /// + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Rerankv2Async( + string model, + string query, + global::System.Collections.Generic.IList> documents, + string? xClientName = default, + int? topN = default, + global::System.Collections.Generic.IList? rankFields = default, + bool? returnDocuments = false, + int? maxChunksPerDoc = 10, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs index b66b0517d7..f096899845 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.IEmbedJobsClient.CreateEmbedJob.g.verified.cs @@ -39,7 +39,8 @@ public partial interface IEmbedJobsClient /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. /// /// /// The name of the embed job. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessage.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessage.g.verified.cs index a106a235d3..8c3b84c642 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessage.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessage.g.verified.cs @@ -22,7 +22,7 @@ public sealed partial class AssistantMessage /// ///
[global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] - public global::System.Collections.Generic.IList? ToolCalls { get; set; } + public global::System.Collections.Generic.IList? ToolCalls { get; set; } /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessageResponse.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessageResponse.g.verified.cs index a6319f848c..2a4df8f8c4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessageResponse.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.AssistantMessageResponse.g.verified.cs @@ -22,7 +22,7 @@ public sealed partial class AssistantMessageResponse /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] - public global::System.Collections.Generic.IList? ToolCalls { get; set; } + public global::System.Collections.Generic.IList? ToolCalls { get; set; } /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseModel.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseModel.g.verified.cs index b39830a5e0..ab45f48ff4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseModel.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseModel.g.verified.cs @@ -25,7 +25,7 @@ public sealed partial class BaseModel /// /// The possible types of fine-tuned models.
/// - BASE_TYPE_UNSPECIFIED: Unspecified model.
- /// - BASE_TYPE_GENERATIVE: Generative model.
+ /// - BASE_TYPE_GENERATIVE: Deprecated: Generative model.
/// - BASE_TYPE_CLASSIFICATION: Classification model.
/// - BASE_TYPE_RERANK: Rerank model.
/// - BASE_TYPE_CHAT: Chat model.
@@ -39,7 +39,7 @@ public sealed partial class BaseModel /// /// The possible strategy used to serve a fine-tuned models.
/// - STRATEGY_UNSPECIFIED: Unspecified strategy.
- /// - STRATEGY_VANILLA: Serve the fine-tuned model on a dedicated GPU.
+ /// - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU.
/// - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU.
/// Default Value: STRATEGY_UNSPECIFIED ///
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseType.g.verified.cs index 5f77a51e76..454e2cf36e 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.BaseType.g.verified.cs @@ -7,7 +7,7 @@ namespace G /// /// The possible types of fine-tuned models.
/// - BASE_TYPE_UNSPECIFIED: Unspecified model.
- /// - BASE_TYPE_GENERATIVE: Generative model.
+ /// - BASE_TYPE_GENERATIVE: Deprecated: Generative model.
/// - BASE_TYPE_CLASSIFICATION: Classification model.
/// - BASE_TYPE_RERANK: Rerank model.
/// - BASE_TYPE_CHAT: Chat model.
@@ -20,7 +20,7 @@ public enum BaseType ///
UNSPECIFIED, /// - /// Generative model. + /// Deprecated: Generative model. /// GENERATIVE, /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatAccepts.g.verified.cs similarity index 63% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentType.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatAccepts.g.verified.cs index 9f359a762c..aaf292ff22 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatAccepts.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolContentType.g.cs +//HintName: G.Models.ChatAccepts.g.cs #nullable enable @@ -7,38 +7,38 @@ namespace G /// /// /// - public enum ToolContentType + public enum ChatAccepts { /// /// /// - ToolResultObject, + TextEventStream, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolContentTypeExtensions + public static class ChatAcceptsExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolContentType value) + public static string ToValueString(this ChatAccepts value) { return value switch { - ToolContentType.ToolResultObject => "tool_result_object", + ChatAccepts.TextEventStream => "text/event-stream", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolContentType? ToEnum(string value) + public static ChatAccepts? ToEnum(string value) { return value switch { - "tool_result_object" => ToolContentType.ToolResultObject, + "text/event-stream" => ChatAccepts.TextEventStream, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessage2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessageV2.g.verified.cs similarity index 55% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessage2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessageV2.g.verified.cs index f51403db09..fa13b91461 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessage2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatMessageV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ChatMessage2.g.cs +//HintName: G.Models.ChatMessageV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -9,120 +9,120 @@ namespace G /// /// Represents a single message in the chat history from a given role. /// - public readonly partial struct ChatMessage2 : global::System.IEquatable + public readonly partial struct ChatMessageV2 : global::System.IEquatable { /// /// A message from the user. /// #if NET6_0_OR_GREATER - public global::G.UserMessage? UserMessage { get; init; } + public global::G.UserMessage? User { get; init; } #else - public global::G.UserMessage? UserMessage { get; } + public global::G.UserMessage? User { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(User))] #endif - public bool IsUserMessage => UserMessage != null; + public bool IsUser => User != null; /// /// /// - public static implicit operator ChatMessage2(global::G.UserMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.UserMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.UserMessage?(ChatMessage2 @this) => @this.UserMessage; + public static implicit operator global::G.UserMessage?(ChatMessageV2 @this) => @this.User; /// /// /// - public ChatMessage2(global::G.UserMessage? value) + public ChatMessageV2(global::G.UserMessage? value) { - UserMessage = value; + User = value; } /// /// A message from the assistant role can contain text and tool call information. /// #if NET6_0_OR_GREATER - public global::G.AssistantMessage? AssistantMessage { get; init; } + public global::G.AssistantMessage? Assistant { get; init; } #else - public global::G.AssistantMessage? AssistantMessage { get; } + public global::G.AssistantMessage? Assistant { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AssistantMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Assistant))] #endif - public bool IsAssistantMessage => AssistantMessage != null; + public bool IsAssistant => Assistant != null; /// /// /// - public static implicit operator ChatMessage2(global::G.AssistantMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.AssistantMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.AssistantMessage?(ChatMessage2 @this) => @this.AssistantMessage; + public static implicit operator global::G.AssistantMessage?(ChatMessageV2 @this) => @this.Assistant; /// /// /// - public ChatMessage2(global::G.AssistantMessage? value) + public ChatMessageV2(global::G.AssistantMessage? value) { - AssistantMessage = value; + Assistant = value; } /// /// A message from the system. /// #if NET6_0_OR_GREATER - public global::G.SystemMessage? SystemMessage { get; init; } + public global::G.SystemMessage? System { get; init; } #else - public global::G.SystemMessage? SystemMessage { get; } + public global::G.SystemMessage? System { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SystemMessage))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif - public bool IsSystemMessage => SystemMessage != null; + public bool IsSystem => System != null; /// /// /// - public static implicit operator ChatMessage2(global::G.SystemMessage value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.SystemMessage value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.SystemMessage?(ChatMessage2 @this) => @this.SystemMessage; + public static implicit operator global::G.SystemMessage?(ChatMessageV2 @this) => @this.System; /// /// /// - public ChatMessage2(global::G.SystemMessage? value) + public ChatMessageV2(global::G.SystemMessage? value) { - SystemMessage = value; + System = value; } /// /// A message from the system. /// #if NET6_0_OR_GREATER - public global::G.ToolMessage2? Tool { get; init; } + public global::G.ToolMessageV2? Tool { get; init; } #else - public global::G.ToolMessage2? Tool { get; } + public global::G.ToolMessageV2? Tool { get; } #endif /// @@ -136,17 +136,17 @@ public ChatMessage2(global::G.SystemMessage? value) /// /// /// - public static implicit operator ChatMessage2(global::G.ToolMessage2 value) => new ChatMessage2(value); + public static implicit operator ChatMessageV2(global::G.ToolMessageV2 value) => new ChatMessageV2(value); /// /// /// - public static implicit operator global::G.ToolMessage2?(ChatMessage2 @this) => @this.Tool; + public static implicit operator global::G.ToolMessageV2?(ChatMessageV2 @this) => @this.Tool; /// /// /// - public ChatMessage2(global::G.ToolMessage2? value) + public ChatMessageV2(global::G.ToolMessageV2? value) { Tool = value; } @@ -154,16 +154,16 @@ public ChatMessage2(global::G.ToolMessage2? value) /// /// /// - public ChatMessage2( - global::G.UserMessage? userMessage, - global::G.AssistantMessage? assistantMessage, - global::G.SystemMessage? systemMessage, - global::G.ToolMessage2? tool + public ChatMessageV2( + global::G.UserMessage? user, + global::G.AssistantMessage? assistant, + global::G.SystemMessage? system, + global::G.ToolMessageV2? tool ) { - UserMessage = userMessage; - AssistantMessage = assistantMessage; - SystemMessage = systemMessage; + User = user; + Assistant = assistant; + System = system; Tool = tool; } @@ -172,9 +172,9 @@ public ChatMessage2( /// public object? Object => Tool as object ?? - SystemMessage as object ?? - AssistantMessage as object ?? - UserMessage as object + System as object ?? + Assistant as object ?? + User as object ; /// @@ -182,7 +182,7 @@ UserMessage as object /// public bool Validate() { - return IsUserMessage && !IsAssistantMessage && !IsSystemMessage && !IsTool || !IsUserMessage && IsAssistantMessage && !IsSystemMessage && !IsTool || !IsUserMessage && !IsAssistantMessage && IsSystemMessage && !IsTool || !IsUserMessage && !IsAssistantMessage && !IsSystemMessage && IsTool; + return IsUser && !IsAssistant && !IsSystem && !IsTool || !IsUser && IsAssistant && !IsSystem && !IsTool || !IsUser && !IsAssistant && IsSystem && !IsTool || !IsUser && !IsAssistant && !IsSystem && IsTool; } /// @@ -192,14 +192,14 @@ public override int GetHashCode() { var fields = new object?[] { - UserMessage, + User, typeof(global::G.UserMessage), - AssistantMessage, + Assistant, typeof(global::G.AssistantMessage), - SystemMessage, + System, typeof(global::G.SystemMessage), Tool, - typeof(global::G.ToolMessage2), + typeof(global::G.ToolMessageV2), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -212,28 +212,28 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(ChatMessage2 other) + public bool Equals(ChatMessageV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(UserMessage, other.UserMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(AssistantMessage, other.AssistantMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(SystemMessage, other.SystemMessage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) + global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) ; } /// /// /// - public static bool operator ==(ChatMessage2 obj1, ChatMessage2 obj2) + public static bool operator ==(ChatMessageV2 obj1, ChatMessageV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(ChatMessage2 obj1, ChatMessage2 obj2) + public static bool operator !=(ChatMessageV2 obj1, ChatMessageV2 obj2) { return !(obj1 == obj2); } @@ -243,7 +243,7 @@ public bool Equals(ChatMessage2 other) /// public override bool Equals(object? obj) { - return obj is ChatMessage2 o && Equals(o); + return obj is ChatMessageV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequest.g.verified.cs index e40e584de4..06c8654213 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequest.g.verified.cs @@ -18,7 +18,7 @@ public sealed partial class ChatRequest public required string Message { get; set; } /// - /// Defaults to `command-r-plus`.
+ /// Defaults to `command-r-plus-08-2024`.
/// The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
/// Compatible Deployments: Cohere Platform, Private Deployments ///
@@ -65,7 +65,9 @@ public sealed partial class ChatRequest /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments ///
[global::System.Text.Json.Serialization.JsonPropertyName("prompt_truncation")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ChatRequestPromptTruncationJsonConverter))] @@ -238,7 +240,7 @@ public sealed partial class ChatRequest public bool? ForceSingleStep { get; set; } /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
@@ -248,6 +250,17 @@ public sealed partial class ChatRequest [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormatJsonConverter))] public global::G.ResponseFormat? ResponseFormat { get; set; } + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("safety_mode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ChatRequestSafetyModeJsonConverter))] + public global::G.ChatRequestSafetyMode? SafetyMode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs index 0977c5831a..53c37cf98c 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestPromptTruncation.g.verified.cs @@ -10,7 +10,9 @@ namespace G /// With `prompt_truncation` set to "AUTO", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be changed and ranked by relevance.
/// With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_history` and `documents` will be dropped in an attempt to construct a prompt that fits within the model's context length limit. During this process the order of the documents and chat history will be preserved as they are inputted into the API.
/// With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
- /// Compatible Deployments: Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Compatible Deployments:
+ /// - AUTO: Cohere Platform Only
+ /// - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments ///
public enum ChatRequestPromptTruncation { @@ -19,11 +21,11 @@ public enum ChatRequestPromptTruncation ///
OFF, /// - /// Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Cohere Platform Only /// AUTO, /// - /// Cohere Platform Only AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + /// Azure, AWS Sagemaker/Bedrock, Private Deployments /// AUTOPRESERVEORDER, } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..ac54102162 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatRequestSafetyMode.g.verified.cs @@ -0,0 +1,62 @@ +//HintName: G.Models.ChatRequestSafetyMode.g.cs + +#nullable enable + +namespace G +{ + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ public enum ChatRequestSafetyMode + { + /// + /// + /// + CONTEXTUAL, + /// + /// + /// + STRICT, + /// + /// + /// + NONE, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ChatRequestSafetyModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ChatRequestSafetyMode value) + { + return value switch + { + ChatRequestSafetyMode.CONTEXTUAL => "CONTEXTUAL", + ChatRequestSafetyMode.STRICT => "STRICT", + ChatRequestSafetyMode.NONE => "NONE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ChatRequestSafetyMode? ToEnum(string value) + { + return value switch + { + "CONTEXTUAL" => ChatRequestSafetyMode.CONTEXTUAL, + "STRICT" => ChatRequestSafetyMode.STRICT, + "NONE" => ChatRequestSafetyMode.NONE, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse.g.verified.cs similarity index 93% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse.g.verified.cs index a580bbf841..392ade2b34 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.NonStreamedChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.NonStreamedChatResponse2.g.cs +//HintName: G.Models.ChatResponse.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class NonStreamedChatResponse2 + public sealed partial class ChatResponse { /// /// Unique identifier for the generated reply. Useful for submitting feedback. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse14.g.verified.cs similarity index 87% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse14.g.verified.cs index 6a348372cf..da22beccaa 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ChatResponse14.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ChatResponse2.g.cs +//HintName: G.Models.ChatResponse14.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class ChatResponse2 + public sealed partial class ChatResponse14 { /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2Request.g.verified.cs index 2dc94fddd2..4226552e4d 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2Request.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2Request.g.verified.cs @@ -1,5 +1,7 @@ //HintName: G.Models.Chatv2Request.g.cs +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace G @@ -22,22 +24,26 @@ public sealed partial class Chatv2Request /// [global::System.Text.Json.Serialization.JsonPropertyName("messages")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Messages { get; set; } + public required global::System.Collections.Generic.IList Messages { get; set; } /// /// A list of available tools (functions) that the model may suggest invoking before producing a text response.
/// When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty. ///
[global::System.Text.Json.Serialization.JsonPropertyName("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } + public global::System.Collections.Generic.IList? Tools { get; set; } + + /// + /// A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("documents")] + public global::System.Collections.Generic.IList>? Documents { get; set; } /// - /// Defaults to `"accurate"`.
- /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + /// Options for controlling citation generation. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("citation_mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.Chatv2RequestCitationModeJsonConverter))] - public global::G.Chatv2RequestCitationMode? CitationMode { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("citation_options")] + public global::G.CitationOptions? CitationOptions { get; set; } /// /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
@@ -47,8 +53,19 @@ public sealed partial class Chatv2Request /// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). ///
[global::System.Text.Json.Serialization.JsonPropertyName("response_format")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormat2JsonConverter))] - public global::G.ResponseFormat2? ResponseFormat { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormatV2JsonConverter))] + public global::G.ResponseFormatV2? ResponseFormat { get; set; } + + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("safety_mode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.Chatv2RequestSafetyModeJsonConverter))] + public global::G.Chatv2RequestSafetyMode? SafetyMode { get; set; } /// /// The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..823b66c964 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestSafetyMode.g.verified.cs @@ -0,0 +1,62 @@ +//HintName: G.Models.Chatv2RequestSafetyMode.g.cs + +#nullable enable + +namespace G +{ + /// + /// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.
+ /// When `NONE` is specified, the safety instruction will be omitted.
+ /// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.
+ /// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.
+ /// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments + ///
+ public enum Chatv2RequestSafetyMode + { + /// + /// + /// + CONTEXTUAL, + /// + /// + /// + STRICT, + /// + /// + /// + NONE, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class Chatv2RequestSafetyModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this Chatv2RequestSafetyMode value) + { + return value switch + { + Chatv2RequestSafetyMode.CONTEXTUAL => "CONTEXTUAL", + Chatv2RequestSafetyMode.STRICT => "STRICT", + Chatv2RequestSafetyMode.NONE => "NONE", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static Chatv2RequestSafetyMode? ToEnum(string value) + { + return value switch + { + "CONTEXTUAL" => Chatv2RequestSafetyMode.CONTEXTUAL, + "STRICT" => Chatv2RequestSafetyMode.STRICT, + "NONE" => Chatv2RequestSafetyMode.NONE, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptions.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptions.g.verified.cs new file mode 100644 index 0000000000..aed836c755 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptions.g.verified.cs @@ -0,0 +1,26 @@ +//HintName: G.Models.CitationOptions.g.cs + +#nullable enable + +namespace G +{ + /// + /// Options for controlling citation generation. + /// + public sealed partial class CitationOptions + { + /// + /// Defaults to `"accurate"`.
+ /// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("mode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.CitationOptionsModeJsonConverter))] + public global::G.CitationOptionsMode? Mode { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptionsMode.g.verified.cs similarity index 62% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptionsMode.g.verified.cs index f474889f61..791822335c 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Chatv2RequestCitationMode.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CitationOptionsMode.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Chatv2RequestCitationMode.g.cs +//HintName: G.Models.CitationOptionsMode.g.cs #nullable enable @@ -8,7 +8,7 @@ namespace G /// Defaults to `"accurate"`.
/// Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results. ///
- public enum Chatv2RequestCitationMode + public enum CitationOptionsMode { /// /// @@ -27,31 +27,31 @@ public enum Chatv2RequestCitationMode /// /// Enum extensions to do fast conversions without the reflection. /// - public static class Chatv2RequestCitationModeExtensions + public static class CitationOptionsModeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this Chatv2RequestCitationMode value) + public static string ToValueString(this CitationOptionsMode value) { return value switch { - Chatv2RequestCitationMode.FAST => "FAST", - Chatv2RequestCitationMode.ACCURATE => "ACCURATE", - Chatv2RequestCitationMode.OFF => "OFF", + CitationOptionsMode.FAST => "FAST", + CitationOptionsMode.ACCURATE => "ACCURATE", + CitationOptionsMode.OFF => "OFF", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static Chatv2RequestCitationMode? ToEnum(string value) + public static CitationOptionsMode? ToEnum(string value) { return value switch { - "FAST" => Chatv2RequestCitationMode.FAST, - "ACCURATE" => Chatv2RequestCitationMode.ACCURATE, - "OFF" => Chatv2RequestCitationMode.OFF, + "FAST" => CitationOptionsMode.FAST, + "ACCURATE" => CitationOptionsMode.ACCURATE, + "OFF" => CitationOptionsMode.OFF, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs index 8adf63a58b..b103c183ab 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.CreateEmbedJobRequest.g.verified.cs @@ -33,7 +33,8 @@ public sealed partial class CreateEmbedJobRequest /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
[global::System.Text.Json.Serialization.JsonPropertyName("input_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.EmbedInputTypeJsonConverter))] diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Document.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Document.g.verified.cs new file mode 100644 index 0000000000..f66193819f --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Document.g.verified.cs @@ -0,0 +1,33 @@ +//HintName: G.Models.Document.g.cs + +#nullable enable + +namespace G +{ + /// + /// Relevant information that could be used by the model to generate a more accurate reply.
+ /// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be
+ /// passed to the model. + ///
+ public sealed partial class Document + { + /// + /// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::G.DocumentData Data { get; set; } + + /// + /// Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContent.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContent.g.verified.cs new file mode 100644 index 0000000000..daad6bad26 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContent.g.verified.cs @@ -0,0 +1,34 @@ +//HintName: G.Models.DocumentContent.g.cs + +#nullable enable + +namespace G +{ + /// + /// Document content. + /// + public sealed partial class DocumentContent + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.DocumentContentTypeJsonConverter))] + public global::G.DocumentContentType Type { get; set; } + + /// + /// Relevant information that could be used by the model to generate a more accurate reply.
+ /// The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be
+ /// passed to the model. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("document")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::G.Document Document { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContentType.g.verified.cs new file mode 100644 index 0000000000..7e10d6b728 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentContentType.g.verified.cs @@ -0,0 +1,46 @@ +//HintName: G.Models.DocumentContentType.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public enum DocumentContentType + { + /// + /// + /// + Document, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DocumentContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DocumentContentType value) + { + return value switch + { + DocumentContentType.Document => "document", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DocumentContentType? ToEnum(string value) + { + return value switch + { + "document" => DocumentContentType.Document, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentOutput.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentData.g.verified.cs similarity index 67% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentOutput.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentData.g.verified.cs index 18e8cd4c57..9d8440a43f 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContentOutput.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.DocumentData.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: G.Models.ToolContentOutput.g.cs +//HintName: G.Models.DocumentData.g.cs #nullable enable namespace G { /// - /// + /// A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary. /// - public sealed partial class ToolContentOutput + public sealed partial class DocumentData { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedInputType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedInputType.g.verified.cs index 22ac4bac39..c1d35d2267 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedInputType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedInputType.g.verified.cs @@ -9,7 +9,8 @@ namespace G /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
public enum EmbedInputType { @@ -29,6 +30,10 @@ public enum EmbedInputType /// Used for the embeddings run through a clustering algorithm. ///
Clustering, + /// + /// Used for embeddings with image input. + /// + Image, } /// @@ -47,6 +52,7 @@ public static string ToValueString(this EmbedInputType value) EmbedInputType.SearchQuery => "search_query", EmbedInputType.Classification => "classification", EmbedInputType.Clustering => "clustering", + EmbedInputType.Image => "image", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -61,6 +67,7 @@ public static string ToValueString(this EmbedInputType value) "search_query" => EmbedInputType.SearchQuery, "classification" => EmbedInputType.Classification, "clustering" => EmbedInputType.Clustering, + "image" => EmbedInputType.Image, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedRequest.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedRequest.g.verified.cs index 2e0ae59b68..b0347b0b28 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedRequest.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.EmbedRequest.g.verified.cs @@ -37,7 +37,8 @@ public sealed partial class EmbedRequest /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
/// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
/// - `"classification"`: Used for embeddings passed through a text classifier.
- /// - `"clustering"`: Used for the embeddings run through a clustering algorithm. + /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. ///
[global::System.Text.Json.Serialization.JsonPropertyName("input_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.EmbedInputTypeJsonConverter))] diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Request.g.verified.cs new file mode 100644 index 0000000000..9f52db8c71 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Request.g.verified.cs @@ -0,0 +1,76 @@ +//HintName: G.Models.Embedv2Request.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Request + { + /// + /// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.
+ /// Included only in requests + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("texts")] + public global::System.Collections.Generic.IList? Texts { get; set; } + + /// + /// Defaults to embed-english-v2.0
+ /// The identifier of the model. Smaller "light" models are faster, while larger models will perform better. [Custom models](/docs/training-custom-models) can also be supplied with their full ID.
+ /// Available models and corresponding embedding dimensions:
+ /// * `embed-english-v3.0` 1024
+ /// * `embed-multilingual-v3.0` 1024
+ /// * `embed-english-light-v3.0` 384
+ /// * `embed-multilingual-light-v3.0` 384
+ /// * `embed-english-v2.0` 4096
+ /// * `embed-english-light-v2.0` 1024
+ /// * `embed-multilingual-v2.0` 768
+ /// Included only in requests + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Specifies the type of input passed to the model. Required for embedding models v3 and higher.
+ /// - `"search_document"`: Used for embeddings stored in a vector database for search use-cases.
+ /// - `"search_query"`: Used for embeddings of search queries run against a vector DB to find relevant documents.
+ /// - `"classification"`: Used for embeddings passed through a text classifier.
+ /// - `"clustering"`: Used for the embeddings run through a clustering algorithm.
+ /// - `"image"`: Used for embeddings with image input. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("input_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.EmbedInputTypeJsonConverter))] + public global::G.EmbedInputType? InputType { get; set; } + + /// + /// Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.
+ /// * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
+ /// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.
+ /// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.
+ /// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.
+ /// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.
+ /// Included only in requests + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("embedding_types")] + public global::System.Collections.Generic.IList? EmbeddingTypes { get; set; } + + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("truncate")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.Embedv2RequestTruncateJsonConverter))] + public global::G.Embedv2RequestTruncate? Truncate { get; set; } = global::G.Embedv2RequestTruncate.END; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs new file mode 100644 index 0000000000..7440152254 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2RequestTruncate.g.verified.cs @@ -0,0 +1,62 @@ +//HintName: G.Models.Embedv2RequestTruncate.g.cs + +#nullable enable + +namespace G +{ + /// + /// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
+ /// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
+ /// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.
+ /// Default Value: END
+ /// Included only in requests + ///
+ public enum Embedv2RequestTruncate + { + /// + /// + /// + NONE, + /// + /// + /// + START, + /// + /// + /// + END, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class Embedv2RequestTruncateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this Embedv2RequestTruncate value) + { + return value switch + { + Embedv2RequestTruncate.NONE => "NONE", + Embedv2RequestTruncate.START => "START", + Embedv2RequestTruncate.END => "END", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static Embedv2RequestTruncate? ToEnum(string value) + { + return value switch + { + "NONE" => Embedv2RequestTruncate.NONE, + "START" => Embedv2RequestTruncate.START, + "END" => Embedv2RequestTruncate.END, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response.g.verified.cs new file mode 100644 index 0000000000..ad74192000 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response10.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response10.g.verified.cs new file mode 100644 index 0000000000..a8a06174aa --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response10.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response10.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response10 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response11.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response11.g.verified.cs new file mode 100644 index 0000000000..883776fb48 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response11.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response11.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response11 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response12.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response12.g.verified.cs new file mode 100644 index 0000000000..9dd2e54004 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response12.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response12.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response12 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response2.g.verified.cs new file mode 100644 index 0000000000..2dfb57625e --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response2.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response2 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response3.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response3.g.verified.cs new file mode 100644 index 0000000000..5a1d783781 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response3.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response3.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response3 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response4.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response4.g.verified.cs new file mode 100644 index 0000000000..878428dc40 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response4.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response4.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response4 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response5.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response5.g.verified.cs new file mode 100644 index 0000000000..85c0521f9a --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response5.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response5.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response5 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response6.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response6.g.verified.cs new file mode 100644 index 0000000000..ae5acc6afa --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response6.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response6.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response6 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response7.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response7.g.verified.cs new file mode 100644 index 0000000000..14a982c99d --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response7.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response7.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response7 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response8.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response8.g.verified.cs new file mode 100644 index 0000000000..13170c2e32 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response8.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response8.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response8 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response9.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response9.g.verified.cs new file mode 100644 index 0000000000..a2a8efa36b --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Embedv2Response9.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Embedv2Response9.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Embedv2Response9 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Hyperparameters.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Hyperparameters.g.verified.cs index b9e93c8a4f..dd33322e0a 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Hyperparameters.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Hyperparameters.g.verified.cs @@ -41,6 +41,32 @@ public sealed partial class Hyperparameters [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] public double? LearningRate { get; set; } + /// + /// Controls the scaling factor for LoRA updates. Higher values make the
+ /// updates more impactful. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("lora_alpha")] + public int? LoraAlpha { get; set; } + + /// + /// Specifies the rank for low-rank matrices. Lower ranks reduce parameters
+ /// but may limit model flexibility. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] + public int? LoraRank { get; set; } + + /// + /// The possible combinations of LoRA modules to target.
+ /// - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules.
+ /// - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers.
+ /// - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers.
+ /// - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN).
+ /// Default Value: LORA_TARGET_MODULES_UNSPECIFIED + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("lora_target_modules")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.LoraTargetModulesJsonConverter))] + public global::G.LoraTargetModules? LoraTargetModules { get; set; } = global::G.LoraTargetModules.UNSPECIFIED; + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2.g.verified.cs similarity index 83% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2.g.verified.cs index 06db5b8592..a91d4a6fbe 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.JSONResponseFormat2.g.cs +//HintName: G.Models.JsonResponseFormatV2.g.cs #nullable enable @@ -7,16 +7,16 @@ namespace G /// /// /// - public sealed partial class JSONResponseFormat2 + public sealed partial class JsonResponseFormatV2 { /// /// Defaults to `"text"`.
/// When set to `"json_object"`, the model's output will be a valid JSON Object. ///
[global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormatTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormatTypeV2JsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::G.ResponseFormatType Type { get; set; } + public required global::G.ResponseFormatTypeV2 Type { get; set; } /// /// [BETA] A JSON schema object that the output will adhere to. There are some restrictions we have on the schema, refer to [our guide](/docs/structured-outputs-json#schema-constraints) for more information.
@@ -34,7 +34,7 @@ public sealed partial class JSONResponseFormat2 /// **Note**: This field must not be specified when the `type` is set to `"text"`. ///
[global::System.Text.Json.Serialization.JsonPropertyName("json_schema")] - public global::G.JSONResponseFormat2JsonSchema? JsonSchema { get; set; } + public global::G.JsonResponseFormatV2JsonSchema? JsonSchema { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs similarity index 89% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs index 71681dcd0a..b9c71c78b3 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JSONResponseFormat2JsonSchema.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.JsonResponseFormatV2JsonSchema.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.JSONResponseFormat2JsonSchema.g.cs +//HintName: G.Models.JsonResponseFormatV2JsonSchema.g.cs #nullable enable @@ -19,7 +19,7 @@ namespace G /// ```
/// **Note**: This field must not be specified when the `type` is set to `"text"`. ///
- public sealed partial class JSONResponseFormat2JsonSchema + public sealed partial class JsonResponseFormatV2JsonSchema { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.LoraTargetModules.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.LoraTargetModules.g.verified.cs new file mode 100644 index 0000000000..eff61f3fa7 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.LoraTargetModules.g.verified.cs @@ -0,0 +1,69 @@ +//HintName: G.Models.LoraTargetModules.g.cs + +#nullable enable + +namespace G +{ + /// + /// The possible combinations of LoRA modules to target.
+ /// - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules.
+ /// - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers.
+ /// - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers.
+ /// - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN).
+ /// Default Value: LORA_TARGET_MODULES_UNSPECIFIED + ///
+ public enum LoraTargetModules + { + /// + /// Unspecified LoRA target modules. + /// + UNSPECIFIED, + /// + /// LoRA adapts the query and value matrices in transformer attention layers. + /// + QV, + /// + /// LoRA adapts query, key, value, and output matrices in attention layers. + /// + QKVO, + /// + /// LoRA adapts attention projection matrices and feed-forward networks (FFN). + /// + QKVOFFN, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class LoraTargetModulesExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this LoraTargetModules value) + { + return value switch + { + LoraTargetModules.UNSPECIFIED => "LORA_TARGET_MODULES_UNSPECIFIED", + LoraTargetModules.QV => "LORA_TARGET_MODULES_QV", + LoraTargetModules.QKVO => "LORA_TARGET_MODULES_QKVO", + LoraTargetModules.QKVOFFN => "LORA_TARGET_MODULES_QKVO_FFN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static LoraTargetModules? ToEnum(string value) + { + return value switch + { + "LORA_TARGET_MODULES_UNSPECIFIED" => LoraTargetModules.UNSPECIFIED, + "LORA_TARGET_MODULES_QV" => LoraTargetModules.QV, + "LORA_TARGET_MODULES_QKVO" => LoraTargetModules.QKVO, + "LORA_TARGET_MODULES_QKVO_FFN" => LoraTargetModules.QKVOFFN, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Request.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Request.g.verified.cs new file mode 100644 index 0000000000..553864fcc9 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Request.g.verified.cs @@ -0,0 +1,71 @@ +//HintName: G.Models.Rerankv2Request.g.cs + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Request + { + /// + /// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0` + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// The search query + /// + [global::System.Text.Json.Serialization.JsonPropertyName("query")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Query { get; set; } + + /// + /// A list of document objects or strings to rerank.
+ /// If a document is provided the text fields is required and all other fields will be preserved in the response.
+ /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
+ /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("documents")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList> Documents { get; set; } + + /// + /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// + [global::System.Text.Json.Serialization.JsonPropertyName("top_n")] + public int? TopN { get; set; } + + /// + /// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rank_fields")] + public global::System.Collections.Generic.IList? RankFields { get; set; } + + /// + /// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.
+ /// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("return_documents")] + public bool? ReturnDocuments { get; set; } = false; + + /// + /// The maximum number of chunks to produce internally from a document
+ /// Default Value: 10 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("max_chunks_per_doc")] + public int? MaxChunksPerDoc { get; set; } = 10; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response.g.verified.cs new file mode 100644 index 0000000000..446e272c3c --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response.g.verified.cs @@ -0,0 +1,37 @@ +//HintName: G.Models.Rerankv2Response.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// An ordered list of ranked documents + /// + [global::System.Text.Json.Serialization.JsonPropertyName("results")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Results { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("meta")] + public global::G.ApiMeta? Meta { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response10.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response10.g.verified.cs new file mode 100644 index 0000000000..3347e3ef54 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response10.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response10.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response10 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response11.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response11.g.verified.cs new file mode 100644 index 0000000000..9caaf6ef7d --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response11.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response11.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response11 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response12.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response12.g.verified.cs new file mode 100644 index 0000000000..a8f9865d97 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response12.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response12.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response12 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response13.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response13.g.verified.cs new file mode 100644 index 0000000000..cb1bd98357 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response13.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response13.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response13 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response2.g.verified.cs new file mode 100644 index 0000000000..a80321c86b --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response2.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response2 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response3.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response3.g.verified.cs new file mode 100644 index 0000000000..3dca67dbd0 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response3.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response3.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response3 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response4.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response4.g.verified.cs new file mode 100644 index 0000000000..7bc0adc226 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response4.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response4.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response4 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response5.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response5.g.verified.cs new file mode 100644 index 0000000000..cd8c182b87 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response5.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response5.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response5 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response6.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response6.g.verified.cs new file mode 100644 index 0000000000..9930b97aac --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response6.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response6.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response6 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response7.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response7.g.verified.cs new file mode 100644 index 0000000000..d1f5fe4764 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response7.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response7.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response7 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response8.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response8.g.verified.cs new file mode 100644 index 0000000000..c6e5333e30 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response8.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response8.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response8 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response9.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response9.g.verified.cs new file mode 100644 index 0000000000..c4af618a58 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2Response9.g.verified.cs @@ -0,0 +1,24 @@ +//HintName: G.Models.Rerankv2Response9.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2Response9 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs new file mode 100644 index 0000000000..1be03fdbbb --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResult.g.verified.cs @@ -0,0 +1,38 @@ +//HintName: G.Models.Rerankv2ResponseResult.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class Rerankv2ResponseResult + { + /// + /// If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in + /// + [global::System.Text.Json.Serialization.JsonPropertyName("document")] + public global::G.Rerankv2ResponseResultDocument? Document { get; set; } + + /// + /// Corresponds to the index in the original list of documents to which the ranked document belongs. (i.e. if the first value in the `results` object has an `index` value of 3, it means in the list of documents passed in, the document at `index=3` had the highest relevance) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("index")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Index { get; set; } + + /// + /// Relevance scores are normalized to be in the range `[0, 1]`. Scores close to `1` indicate a high relevance to the query, and scores closer to `0` indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
+ /// Included only in responses + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("relevance_score")] + public float RelevanceScore { get; set; } = default!; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs new file mode 100644 index 0000000000..382d83ba1f --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Rerankv2ResponseResultDocument.g.verified.cs @@ -0,0 +1,25 @@ +//HintName: G.Models.Rerankv2ResponseResultDocument.g.cs + +#nullable enable + +namespace G +{ + /// + /// If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in + /// + public sealed partial class Rerankv2ResponseResultDocument + { + /// + /// The text of the document to rerank + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat.g.verified.cs index a6ebfb5ab1..a85c12e8ac 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat.g.verified.cs @@ -7,7 +7,7 @@ namespace G { /// - /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/docs/command-r), [Command R+](https://docs.cohere.com/docs/command-r-plus) and newer models.
+ /// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.
/// The model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ "type": "json_object" }`.
/// A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.
/// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs new file mode 100644 index 0000000000..094309b9f2 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatTypeV2.g.verified.cs @@ -0,0 +1,53 @@ +//HintName: G.Models.ResponseFormatTypeV2.g.cs + +#nullable enable + +namespace G +{ + /// + /// Defaults to `"text"`.
+ /// When set to `"json_object"`, the model's output will be a valid JSON Object. + ///
+ public enum ResponseFormatTypeV2 + { + /// + /// + /// + Text, + /// + /// + /// + JsonObject, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ResponseFormatTypeV2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ResponseFormatTypeV2 value) + { + return value switch + { + ResponseFormatTypeV2.Text => "text", + ResponseFormatTypeV2.JsonObject => "json_object", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ResponseFormatTypeV2? ToEnum(string value) + { + return value switch + { + "text" => ResponseFormatTypeV2.Text, + "json_object" => ResponseFormatTypeV2.JsonObject, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatV2.g.verified.cs similarity index 62% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatV2.g.verified.cs index b91c596f44..e01694b9da 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormat2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ResponseFormatV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ResponseFormat2.g.cs +//HintName: G.Models.ResponseFormatV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -13,96 +13,96 @@ namespace G /// **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.
/// **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). ///
- public readonly partial struct ResponseFormat2 : global::System.IEquatable + public readonly partial struct ResponseFormatV2 : global::System.IEquatable { /// /// /// #if NET6_0_OR_GREATER - public global::G.TextResponseFormat? TextFormat { get; init; } + public global::G.TextResponseFormatV2? Text { get; init; } #else - public global::G.TextResponseFormat? TextFormat { get; } + public global::G.TextResponseFormatV2? Text { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TextFormat))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif - public bool IsTextFormat => TextFormat != null; + public bool IsText => Text != null; /// /// /// - public static implicit operator ResponseFormat2(global::G.TextResponseFormat value) => new ResponseFormat2(value); + public static implicit operator ResponseFormatV2(global::G.TextResponseFormatV2 value) => new ResponseFormatV2(value); /// /// /// - public static implicit operator global::G.TextResponseFormat?(ResponseFormat2 @this) => @this.TextFormat; + public static implicit operator global::G.TextResponseFormatV2?(ResponseFormatV2 @this) => @this.Text; /// /// /// - public ResponseFormat2(global::G.TextResponseFormat? value) + public ResponseFormatV2(global::G.TextResponseFormatV2? value) { - TextFormat = value; + Text = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.JSONResponseFormat2? JSON { get; init; } + public global::G.JsonResponseFormatV2? Json { get; init; } #else - public global::G.JSONResponseFormat2? JSON { get; } + public global::G.JsonResponseFormatV2? Json { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JSON))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Json))] #endif - public bool IsJSON => JSON != null; + public bool IsJson => Json != null; /// /// /// - public static implicit operator ResponseFormat2(global::G.JSONResponseFormat2 value) => new ResponseFormat2(value); + public static implicit operator ResponseFormatV2(global::G.JsonResponseFormatV2 value) => new ResponseFormatV2(value); /// /// /// - public static implicit operator global::G.JSONResponseFormat2?(ResponseFormat2 @this) => @this.JSON; + public static implicit operator global::G.JsonResponseFormatV2?(ResponseFormatV2 @this) => @this.Json; /// /// /// - public ResponseFormat2(global::G.JSONResponseFormat2? value) + public ResponseFormatV2(global::G.JsonResponseFormatV2? value) { - JSON = value; + Json = value; } /// /// /// - public ResponseFormat2( - global::G.TextResponseFormat? textFormat, - global::G.JSONResponseFormat2? jSON + public ResponseFormatV2( + global::G.TextResponseFormatV2? text, + global::G.JsonResponseFormatV2? json ) { - TextFormat = textFormat; - JSON = jSON; + Text = text; + Json = json; } /// /// /// public object? Object => - JSON as object ?? - TextFormat as object + Json as object ?? + Text as object ; /// @@ -110,7 +110,7 @@ TextFormat as object /// public bool Validate() { - return IsTextFormat && !IsJSON || !IsTextFormat && IsJSON; + return IsText && !IsJson || !IsText && IsJson; } /// @@ -120,10 +120,10 @@ public override int GetHashCode() { var fields = new object?[] { - TextFormat, - typeof(global::G.TextResponseFormat), - JSON, - typeof(global::G.JSONResponseFormat2), + Text, + typeof(global::G.TextResponseFormatV2), + Json, + typeof(global::G.JsonResponseFormatV2), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -136,26 +136,26 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(ResponseFormat2 other) + public bool Equals(ResponseFormatV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(TextFormat, other.TextFormat) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(JSON, other.JSON) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Json, other.Json) ; } /// /// /// - public static bool operator ==(ResponseFormat2 obj1, ResponseFormat2 obj2) + public static bool operator ==(ResponseFormatV2 obj1, ResponseFormatV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(ResponseFormat2 obj1, ResponseFormat2 obj2) + public static bool operator !=(ResponseFormatV2 obj1, ResponseFormatV2 obj2) { return !(obj1 == obj2); } @@ -165,7 +165,7 @@ public bool Equals(ResponseFormat2 other) /// public override bool Equals(object? obj) { - return obj is ResponseFormat2 o && Equals(o); + return obj is ResponseFormatV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Strategy.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Strategy.g.verified.cs index 248a362960..792d97df16 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Strategy.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Strategy.g.verified.cs @@ -7,7 +7,7 @@ namespace G /// /// The possible strategy used to serve a fine-tuned models.
/// - STRATEGY_UNSPECIFIED: Unspecified strategy.
- /// - STRATEGY_VANILLA: Serve the fine-tuned model on a dedicated GPU.
+ /// - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU.
/// - STRATEGY_TFEW: Serve the fine-tuned model on a shared GPU.
/// Default Value: STRATEGY_UNSPECIFIED ///
@@ -18,7 +18,7 @@ public enum Strategy ///
UNSPECIFIED, /// - /// Serve the fine-tuned model on a dedicated GPU. + /// Deprecated: Serve the fine-tuned model on a dedicated GPU. /// VANILLA, /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponseV2.g.verified.cs similarity index 83% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponseV2.g.verified.cs index 54ce386ac7..7222b13cfc 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.StreamedChatResponseV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.StreamedChatResponse2.g.cs +//HintName: G.Models.StreamedChatResponseV2.g.cs using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete @@ -9,7 +9,7 @@ namespace G /// /// StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). /// - public readonly partial struct StreamedChatResponse2 : global::System.IEquatable + public readonly partial struct StreamedChatResponseV2 : global::System.IEquatable { /// /// A streamed event which signifies that a stream has started. @@ -31,17 +31,17 @@ namespace G /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatMessageStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatMessageStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatMessageStartEvent?(StreamedChatResponse2 @this) => @this.MessageStartEvent; + public static implicit operator global::G.ChatMessageStartEvent?(StreamedChatResponseV2 @this) => @this.MessageStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatMessageStartEvent? value) + public StreamedChatResponseV2(global::G.ChatMessageStartEvent? value) { MessageStartEvent = value; } @@ -66,17 +66,17 @@ public StreamedChatResponse2(global::G.ChatMessageStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentStartEvent?(StreamedChatResponse2 @this) => @this.ContentStartEvent; + public static implicit operator global::G.ChatContentStartEvent?(StreamedChatResponseV2 @this) => @this.ContentStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentStartEvent? value) + public StreamedChatResponseV2(global::G.ChatContentStartEvent? value) { ContentStartEvent = value; } @@ -101,17 +101,17 @@ public StreamedChatResponse2(global::G.ChatContentStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentDeltaEvent?(StreamedChatResponse2 @this) => @this.ContentDeltaEvent; + public static implicit operator global::G.ChatContentDeltaEvent?(StreamedChatResponseV2 @this) => @this.ContentDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatContentDeltaEvent? value) { ContentDeltaEvent = value; } @@ -136,17 +136,17 @@ public StreamedChatResponse2(global::G.ChatContentDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatContentEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatContentEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatContentEndEvent?(StreamedChatResponse2 @this) => @this.ContentEndEvent; + public static implicit operator global::G.ChatContentEndEvent?(StreamedChatResponseV2 @this) => @this.ContentEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatContentEndEvent? value) + public StreamedChatResponseV2(global::G.ChatContentEndEvent? value) { ContentEndEvent = value; } @@ -171,17 +171,17 @@ public StreamedChatResponse2(global::G.ChatContentEndEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolPlanDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolPlanDeltaEvent?(StreamedChatResponse2 @this) => @this.ToolPlanDeltaEvent; + public static implicit operator global::G.ChatToolPlanDeltaEvent?(StreamedChatResponseV2 @this) => @this.ToolPlanDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatToolPlanDeltaEvent? value) { ToolPlanDeltaEvent = value; } @@ -206,17 +206,17 @@ public StreamedChatResponse2(global::G.ChatToolPlanDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallStartEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallStartEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallStartEvent?(StreamedChatResponse2 @this) => @this.ToolCallStartEvent; + public static implicit operator global::G.ChatToolCallStartEvent?(StreamedChatResponseV2 @this) => @this.ToolCallStartEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallStartEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallStartEvent? value) { ToolCallStartEvent = value; } @@ -241,17 +241,17 @@ public StreamedChatResponse2(global::G.ChatToolCallStartEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallDeltaEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallDeltaEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallDeltaEvent?(StreamedChatResponse2 @this) => @this.ToolCallDeltaEvent; + public static implicit operator global::G.ChatToolCallDeltaEvent?(StreamedChatResponseV2 @this) => @this.ToolCallDeltaEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallDeltaEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallDeltaEvent? value) { ToolCallDeltaEvent = value; } @@ -276,17 +276,17 @@ public StreamedChatResponse2(global::G.ChatToolCallDeltaEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatToolCallEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatToolCallEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatToolCallEndEvent?(StreamedChatResponse2 @this) => @this.ToolCallEndEvent; + public static implicit operator global::G.ChatToolCallEndEvent?(StreamedChatResponseV2 @this) => @this.ToolCallEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatToolCallEndEvent? value) + public StreamedChatResponseV2(global::G.ChatToolCallEndEvent? value) { ToolCallEndEvent = value; } @@ -311,17 +311,17 @@ public StreamedChatResponse2(global::G.ChatToolCallEndEvent? value) /// /// /// - public static implicit operator StreamedChatResponse2(global::G.ChatMessageEndEvent value) => new StreamedChatResponse2(value); + public static implicit operator StreamedChatResponseV2(global::G.ChatMessageEndEvent value) => new StreamedChatResponseV2(value); /// /// /// - public static implicit operator global::G.ChatMessageEndEvent?(StreamedChatResponse2 @this) => @this.MessageEndEvent; + public static implicit operator global::G.ChatMessageEndEvent?(StreamedChatResponseV2 @this) => @this.MessageEndEvent; /// /// /// - public StreamedChatResponse2(global::G.ChatMessageEndEvent? value) + public StreamedChatResponseV2(global::G.ChatMessageEndEvent? value) { MessageEndEvent = value; } @@ -329,7 +329,7 @@ public StreamedChatResponse2(global::G.ChatMessageEndEvent? value) /// /// /// - public StreamedChatResponse2( + public StreamedChatResponseV2( global::G.ChatMessageStartEvent? messageStartEvent, global::G.ChatContentStartEvent? contentStartEvent, global::G.ChatContentDeltaEvent? contentDeltaEvent, @@ -412,7 +412,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(StreamedChatResponse2 other) + public bool Equals(StreamedChatResponseV2 other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(MessageStartEvent, other.MessageStartEvent) && @@ -430,15 +430,15 @@ public bool Equals(StreamedChatResponse2 other) /// /// /// - public static bool operator ==(StreamedChatResponse2 obj1, StreamedChatResponse2 obj2) + public static bool operator ==(StreamedChatResponseV2 obj1, StreamedChatResponseV2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(StreamedChatResponse2 obj1, StreamedChatResponse2 obj2) + public static bool operator !=(StreamedChatResponseV2 obj1, StreamedChatResponseV2 obj2) { return !(obj1 == obj2); } @@ -448,7 +448,7 @@ public bool Equals(StreamedChatResponse2 other) /// public override bool Equals(object? obj) { - return obj is StreamedChatResponse2 o && Equals(o); + return obj is StreamedChatResponseV2 o && Equals(o); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.TextResponseFormatV2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.TextResponseFormatV2.g.verified.cs new file mode 100644 index 0000000000..c78ad46314 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.TextResponseFormatV2.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: G.Models.TextResponseFormatV2.g.cs + +#nullable enable + +namespace G +{ + /// + /// + /// + public sealed partial class TextResponseFormatV2 + { + /// + /// Defaults to `"text"`.
+ /// When set to `"json_object"`, the model's output will be a valid JSON Object. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ResponseFormatTypeV2JsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::G.ResponseFormatTypeV2 Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2.g.verified.cs similarity index 78% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2.g.verified.cs index 961a618a39..33ad8d90ac 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2.g.cs +//HintName: G.Models.ToolCallV2.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// A array of tool calls to be made. /// - public sealed partial class ToolCall2 + public sealed partial class ToolCallV2 { /// /// @@ -19,14 +19,14 @@ public sealed partial class ToolCall2 /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolCall2TypeJsonConverter))] - public global::G.ToolCall2Type? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolCallV2TypeJsonConverter))] + public global::G.ToolCallV2Type? Type { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("function")] - public global::G.ToolCall2Function? Function { get; set; } + public global::G.ToolCallV2Function? Function { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Function.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Function.g.verified.cs similarity index 89% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Function.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Function.g.verified.cs index fa8f5f4c1a..df025edd55 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Function.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Function.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2Function.g.cs +//HintName: G.Models.ToolCallV2Function.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public sealed partial class ToolCall2Function + public sealed partial class ToolCallV2Function { /// /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Type.g.verified.cs similarity index 67% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Type.g.verified.cs index 46204d21f2..defbe6f333 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCall2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolCallV2Type.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolCall2Type.g.cs +//HintName: G.Models.ToolCallV2Type.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public enum ToolCall2Type + public enum ToolCallV2Type { /// /// @@ -18,27 +18,27 @@ public enum ToolCall2Type /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolCall2TypeExtensions + public static class ToolCallV2TypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolCall2Type value) + public static string ToValueString(this ToolCallV2Type value) { return value switch { - ToolCall2Type.Function => "function", + ToolCallV2Type.Function => "function", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolCall2Type? ToEnum(string value) + public static ToolCallV2Type? ToEnum(string value) { return value switch { - "function" => ToolCall2Type.Function, + "function" => ToolCallV2Type.Function, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContent.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContent.g.verified.cs index 225fbdf3c5..5099dd58cf 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContent.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolContent.g.verified.cs @@ -1,32 +1,167 @@ //HintName: G.Models.ToolContent.g.cs +using System.Linq; +#pragma warning disable CS0618 // Type or member is obsolete #nullable enable namespace G { /// - /// Tool content result object + /// A content block which contains information about the content of a tool result /// - public sealed partial class ToolContent + public readonly partial struct ToolContent : global::System.IEquatable { + /// + /// Text content of the message. + /// +#if NET6_0_OR_GREATER + public global::G.TextContent? Text { get; init; } +#else + public global::G.TextContent? Text { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] +#endif + public bool IsText => Text != null; + + /// + /// + /// + public static implicit operator ToolContent(global::G.TextContent value) => new ToolContent(value); + + /// + /// + /// + public static implicit operator global::G.TextContent?(ToolContent @this) => @this.Text; + + /// + /// + /// + public ToolContent(global::G.TextContent? value) + { + Text = value; + } + + /// + /// Document content. + /// +#if NET6_0_OR_GREATER + public global::G.DocumentContent? Document { get; init; } +#else + public global::G.DocumentContent? Document { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Document))] +#endif + public bool IsDocument => Document != null; + + /// + /// + /// + public static implicit operator ToolContent(global::G.DocumentContent value) => new ToolContent(value); + /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolContentTypeJsonConverter))] - public global::G.ToolContentType Type { get; set; } + public static implicit operator global::G.DocumentContent?(ToolContent @this) => @this.Document; /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("output")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::G.ToolContentOutput Output { get; set; } + public ToolContent(global::G.DocumentContent? value) + { + Document = value; + } /// - /// Additional properties that are not explicitly defined in the schema + /// + /// + public ToolContent( + global::G.TextContent? text, + global::G.DocumentContent? document + ) + { + Text = text; + Document = document; + } + + /// + /// + /// + public object? Object => + Document as object ?? + Text as object + ; + + /// + /// + /// + public bool Validate() + { + return IsText && !IsDocument || !IsText && IsDocument; + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Text, + typeof(global::G.TextContent), + Document, + typeof(global::G.DocumentContent), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + return fields.Aggregate(offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ToolContent other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) + ; + } + + /// + /// + /// + public static bool operator ==(ToolContent obj1, ToolContent obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ToolContent obj1, ToolContent obj2) + { + return !(obj1 == obj2); + } + + /// + /// /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + public override bool Equals(object? obj) + { + return obj is ToolContent o && Equals(o); + } } -} \ No newline at end of file +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2.g.verified.cs similarity index 62% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2.g.verified.cs index 020ba80cae..f7780b491a 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolMessage2.g.cs +//HintName: G.Models.ToolMessageV2.g.cs #pragma warning disable CS0618 // Type or member is obsolete @@ -9,28 +9,29 @@ namespace G /// /// A message from the system. /// - public sealed partial class ToolMessage2 + public sealed partial class ToolMessageV2 { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolMessage2RoleJsonConverter))] - public global::G.ToolMessage2Role Role { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolMessageV2RoleJsonConverter))] + public global::G.ToolMessageV2Role Role { get; set; } /// - /// + /// The id of the associated tool call that has provided the given content /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_call_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string ToolCallId { get; set; } /// - /// + /// A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_content")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.OneOfJsonConverterFactory2))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList> ToolContent { get; set; } + public required global::G.OneOf> ToolContent { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2Role.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2Role.g.verified.cs similarity index 67% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2Role.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2Role.g.verified.cs index 3560ea8e29..2935bb0847 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessage2Role.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolMessageV2Role.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.ToolMessage2Role.g.cs +//HintName: G.Models.ToolMessageV2Role.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public enum ToolMessage2Role + public enum ToolMessageV2Role { /// /// @@ -18,27 +18,27 @@ public enum ToolMessage2Role /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ToolMessage2RoleExtensions + public static class ToolMessageV2RoleExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ToolMessage2Role value) + public static string ToValueString(this ToolMessageV2Role value) { return value switch { - ToolMessage2Role.Tool => "tool", + ToolMessageV2Role.Tool => "tool", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ToolMessage2Role? ToEnum(string value) + public static ToolMessageV2Role? ToEnum(string value) { return value switch { - "tool" => ToolMessage2Role.Tool, + "tool" => ToolMessageV2Role.Tool, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2.g.verified.cs similarity index 76% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2.g.verified.cs index d332ffd88a..abbe0aa8b6 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2.g.cs +//HintName: G.Models.ToolV2.g.cs #nullable enable @@ -7,20 +7,20 @@ namespace G /// /// /// - public sealed partial class Tool2 + public sealed partial class ToolV2 { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.Tool2TypeJsonConverter))] - public global::G.Tool2Type? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::G.JsonConverters.ToolV2TypeJsonConverter))] + public global::G.ToolV2Type? Type { get; set; } /// /// The function to be executed. /// [global::System.Text.Json.Serialization.JsonPropertyName("function")] - public global::G.Tool2Function? Function { get; set; } + public global::G.ToolV2Function? Function { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Function.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Function.g.verified.cs similarity index 86% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Function.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Function.g.verified.cs index 154e50afdd..bee9c2c2bb 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Function.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Function.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2Function.g.cs +//HintName: G.Models.ToolV2Function.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// The function to be executed. /// - public sealed partial class Tool2Function + public sealed partial class ToolV2Function { /// /// The name of the function. @@ -25,7 +25,7 @@ public sealed partial class Tool2Function /// The parameters of the function as a JSON schema. /// [global::System.Text.Json.Serialization.JsonPropertyName("parameters")] - public global::G.Tool2FunctionParameters? Parameters { get; set; } + public global::G.ToolV2FunctionParameters? Parameters { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2FunctionParameters.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs similarity index 82% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2FunctionParameters.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs index 34ce950377..30ffa9b860 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2FunctionParameters.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2FunctionParameters.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2FunctionParameters.g.cs +//HintName: G.Models.ToolV2FunctionParameters.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// The parameters of the function as a JSON schema. /// - public sealed partial class Tool2FunctionParameters + public sealed partial class ToolV2FunctionParameters { /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Type.g.verified.cs similarity index 69% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Type.g.verified.cs index 719a9611f9..d2f9a35558 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.Tool2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.ToolV2Type.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: G.Models.Tool2Type.g.cs +//HintName: G.Models.ToolV2Type.g.cs #nullable enable @@ -7,7 +7,7 @@ namespace G /// /// /// - public enum Tool2Type + public enum ToolV2Type { /// /// @@ -18,27 +18,27 @@ public enum Tool2Type /// /// Enum extensions to do fast conversions without the reflection. /// - public static class Tool2TypeExtensions + public static class ToolV2TypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this Tool2Type value) + public static string ToValueString(this ToolV2Type value) { return value switch { - Tool2Type.Function => "function", + ToolV2Type.Function => "function", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static Tool2Type? ToEnum(string value) + public static ToolV2Type? ToEnum(string value) { return value switch { - "function" => Tool2Type.Function, + "function" => ToolV2Type.Function, _ => null, }; } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.UserMessage.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.UserMessage.g.verified.cs index 17696b7b95..cf9436fd28 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.UserMessage.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#G.Models.UserMessage.g.verified.cs @@ -27,12 +27,6 @@ public sealed partial class UserMessage [global::System.Text.Json.Serialization.JsonRequired] public required global::G.OneOf> Content { get; set; } - /// - /// Documents seen by the model when generating the reply. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("documents")] - public global::System.Collections.Generic.IList? Documents { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAccepts.g.verified.cs similarity index 70% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAccepts.g.verified.cs index c2d13c920d..61a4115eb2 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAccepts.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolCall2Type.g.cs +//HintName: JsonConverters.ChatAccepts.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolCall2TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChatAcceptsJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolCall2Type Read( + public override global::G.ChatAccepts Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolCall2TypeJsonConverter : global::System.Text.Json.Serial var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolCall2TypeExtensions.ToEnum(stringValue) ?? default; + return global::G.ChatAcceptsExtensions.ToEnum(stringValue) ?? default; } break; @@ -27,7 +27,7 @@ public sealed class ToolCall2TypeJsonConverter : global::System.Text.Json.Serial case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolCall2Type)numValue; + return (global::G.ChatAccepts)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,12 +39,12 @@ public sealed class ToolCall2TypeJsonConverter : global::System.Text.Json.Serial /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolCall2Type value, + global::G.ChatAccepts value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::G.ToolCall2TypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::G.ChatAcceptsExtensions.ToValueString(value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2TypeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAcceptsNullable.g.verified.cs similarity index 72% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2TypeNullable.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAcceptsNullable.g.verified.cs index ed592345b6..e259b171da 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCall2TypeNullable.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatAcceptsNullable.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolCall2TypeNullable.g.cs +//HintName: JsonConverters.ChatAcceptsNullable.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolCall2TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChatAcceptsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolCall2Type? Read( + public override global::G.ChatAccepts? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolCall2TypeNullableJsonConverter : global::System.Text.Jso var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolCall2TypeExtensions.ToEnum(stringValue); + return global::G.ChatAcceptsExtensions.ToEnum(stringValue); } break; @@ -27,7 +27,7 @@ public sealed class ToolCall2TypeNullableJsonConverter : global::System.Text.Jso case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolCall2Type)numValue; + return (global::G.ChatAccepts)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,7 +39,7 @@ public sealed class ToolCall2TypeNullableJsonConverter : global::System.Text.Jso /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolCall2Type? value, + global::G.ChatAccepts? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -50,7 +50,7 @@ public override void Write( } else { - writer.WriteStringValue(global::G.ToolCall2TypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::G.ChatAcceptsExtensions.ToValueString(value.Value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessage2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessageV2.g.verified.cs similarity index 78% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessage2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessageV2.g.verified.cs index f117990e79..4d6a56f85c 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessage2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatMessageV2.g.verified.cs @@ -1,14 +1,14 @@ -//HintName: JsonConverters.ChatMessage2.g.cs +//HintName: JsonConverters.ChatMessageV2.g.cs #nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace G.JsonConverters { /// - public class ChatMessage2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class ChatMessageV2JsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ChatMessage2 Read( + public override global::G.ChatMessageV2 Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,73 +18,73 @@ public class ChatMessage2JsonConverter : global::System.Text.Json.Serialization. var readerCopy = reader; - global::G.UserMessage? userMessage = default; + global::G.UserMessage? user = default; try { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.UserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.UserMessage).Name}"); - userMessage = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + user = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.AssistantMessage? assistantMessage = default; + global::G.AssistantMessage? assistant = default; try { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.AssistantMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.AssistantMessage).Name}"); - assistantMessage = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + assistant = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.SystemMessage? systemMessage = default; + global::G.SystemMessage? system = default; try { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.SystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.SystemMessage).Name}"); - systemMessage = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + system = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ToolMessage2? tool = default; + global::G.ToolMessageV2? tool = default; try { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessage2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessage2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessageV2).Name}"); tool = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } - var result = new global::G.ChatMessage2( - userMessage, - assistantMessage, - systemMessage, + var result = new global::G.ChatMessageV2( + user, + assistant, + system, tool ); - if (userMessage != null) + if (user != null) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.UserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.UserMessage).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - else if (assistantMessage != null) + else if (assistant != null) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.AssistantMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.AssistantMessage).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - else if (systemMessage != null) + else if (system != null) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.SystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.SystemMessage).Name}"); @@ -92,8 +92,8 @@ public class ChatMessage2JsonConverter : global::System.Text.Json.Serialization. } else if (tool != null) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessage2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessage2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessageV2).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -103,34 +103,34 @@ public class ChatMessage2JsonConverter : global::System.Text.Json.Serialization. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ChatMessage2 value, + global::G.ChatMessageV2 value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - if (value.IsUserMessage) + if (value.IsUser) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.UserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.UserMessage).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.UserMessage, typeInfo); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.User, typeInfo); } - else if (value.IsAssistantMessage) + else if (value.IsAssistant) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.AssistantMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.AssistantMessage).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.AssistantMessage, typeInfo); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Assistant, typeInfo); } - else if (value.IsSystemMessage) + else if (value.IsSystem) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.SystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.SystemMessage).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.SystemMessage, typeInfo); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.System, typeInfo); } else if (value.IsTool) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessage2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessage2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.ToolMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.ToolMessageV2).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Tool, typeInfo); } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..0c4c0a3866 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyMode.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.ChatRequestSafetyMode.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ChatRequestSafetyModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatRequestSafetyMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatRequestSafetyModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatRequestSafetyMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatRequestSafetyMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.ChatRequestSafetyModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyModeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyModeNullable.g.verified.cs new file mode 100644 index 0000000000..979a3ac945 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ChatRequestSafetyModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatRequestSafetyModeNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ChatRequestSafetyModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatRequestSafetyMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatRequestSafetyModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatRequestSafetyMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatRequestSafetyMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatRequestSafetyModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationMode.g.verified.cs deleted file mode 100644 index 0bb4011552..0000000000 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationMode.g.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//HintName: JsonConverters.Chatv2RequestCitationMode.g.cs -#nullable enable - -namespace G.JsonConverters -{ - /// - public sealed class Chatv2RequestCitationModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::G.Chatv2RequestCitationMode Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::G.Chatv2RequestCitationModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::G.Chatv2RequestCitationMode)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::G.Chatv2RequestCitationMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::G.Chatv2RequestCitationModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationModeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationModeNullable.g.verified.cs deleted file mode 100644 index 9ea9dc179b..0000000000 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestCitationModeNullable.g.verified.cs +++ /dev/null @@ -1,57 +0,0 @@ -//HintName: JsonConverters.Chatv2RequestCitationModeNullable.g.cs -#nullable enable - -namespace G.JsonConverters -{ - /// - public sealed class Chatv2RequestCitationModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::G.Chatv2RequestCitationMode? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::G.Chatv2RequestCitationModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::G.Chatv2RequestCitationMode)numValue; - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::G.Chatv2RequestCitationMode? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::G.Chatv2RequestCitationModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyMode.g.verified.cs new file mode 100644 index 0000000000..5c95e3dff0 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyMode.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.Chatv2RequestSafetyMode.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class Chatv2RequestSafetyModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.Chatv2RequestSafetyMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.Chatv2RequestSafetyModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.Chatv2RequestSafetyMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.Chatv2RequestSafetyMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.Chatv2RequestSafetyModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyModeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyModeNullable.g.verified.cs new file mode 100644 index 0000000000..f5855958fa --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Chatv2RequestSafetyModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.Chatv2RequestSafetyModeNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class Chatv2RequestSafetyModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.Chatv2RequestSafetyMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.Chatv2RequestSafetyModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.Chatv2RequestSafetyMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.Chatv2RequestSafetyMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.Chatv2RequestSafetyModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsMode.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsMode.g.verified.cs new file mode 100644 index 0000000000..37c48954d4 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsMode.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.CitationOptionsMode.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class CitationOptionsModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CitationOptionsMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CitationOptionsModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CitationOptionsMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CitationOptionsMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.CitationOptionsModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsModeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsModeNullable.g.verified.cs new file mode 100644 index 0000000000..2f81030da3 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.CitationOptionsModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CitationOptionsModeNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class CitationOptionsModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CitationOptionsMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CitationOptionsModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CitationOptionsMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CitationOptionsMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CitationOptionsModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentType.g.verified.cs new file mode 100644 index 0000000000..276db26afa --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentType.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.DocumentContentType.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class DocumentContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DocumentContentType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DocumentContentTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DocumentContentType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DocumentContentType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.DocumentContentTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentTypeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentTypeNullable.g.verified.cs new file mode 100644 index 0000000000..01c7f5e404 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.DocumentContentTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DocumentContentTypeNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class DocumentContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DocumentContentType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DocumentContentTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DocumentContentType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DocumentContentType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DocumentContentTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncate.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncate.g.verified.cs new file mode 100644 index 0000000000..e478b854d4 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncate.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.Embedv2RequestTruncate.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class Embedv2RequestTruncateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.Embedv2RequestTruncate Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.Embedv2RequestTruncateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.Embedv2RequestTruncate)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.Embedv2RequestTruncate value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.Embedv2RequestTruncateExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncateNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncateNullable.g.verified.cs new file mode 100644 index 0000000000..cc2a56ab93 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Embedv2RequestTruncateNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.Embedv2RequestTruncateNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class Embedv2RequestTruncateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.Embedv2RequestTruncate? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.Embedv2RequestTruncateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.Embedv2RequestTruncate)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.Embedv2RequestTruncate? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.Embedv2RequestTruncateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2Role.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModules.g.verified.cs similarity index 69% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2Role.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModules.g.verified.cs index 1551ad1ca7..8f221336b4 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2Role.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModules.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolMessage2Role.g.cs +//HintName: JsonConverters.LoraTargetModules.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolMessage2RoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class LoraTargetModulesJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolMessage2Role Read( + public override global::G.LoraTargetModules Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolMessage2RoleJsonConverter : global::System.Text.Json.Ser var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolMessage2RoleExtensions.ToEnum(stringValue) ?? default; + return global::G.LoraTargetModulesExtensions.ToEnum(stringValue) ?? default; } break; @@ -27,7 +27,7 @@ public sealed class ToolMessage2RoleJsonConverter : global::System.Text.Json.Ser case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolMessage2Role)numValue; + return (global::G.LoraTargetModules)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,12 +39,12 @@ public sealed class ToolMessage2RoleJsonConverter : global::System.Text.Json.Ser /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolMessage2Role value, + global::G.LoraTargetModules value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::G.ToolMessage2RoleExtensions.ToValueString(value)); + writer.WriteStringValue(global::G.LoraTargetModulesExtensions.ToValueString(value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2RoleNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModulesNullable.g.verified.cs similarity index 71% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2RoleNullable.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModulesNullable.g.verified.cs index 293a40807d..fa6602ef1d 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessage2RoleNullable.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.LoraTargetModulesNullable.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolMessage2RoleNullable.g.cs +//HintName: JsonConverters.LoraTargetModulesNullable.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolMessage2RoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class LoraTargetModulesNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolMessage2Role? Read( + public override global::G.LoraTargetModules? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolMessage2RoleNullableJsonConverter : global::System.Text. var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolMessage2RoleExtensions.ToEnum(stringValue); + return global::G.LoraTargetModulesExtensions.ToEnum(stringValue); } break; @@ -27,7 +27,7 @@ public sealed class ToolMessage2RoleNullableJsonConverter : global::System.Text. case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolMessage2Role)numValue; + return (global::G.LoraTargetModules)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,7 +39,7 @@ public sealed class ToolMessage2RoleNullableJsonConverter : global::System.Text. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolMessage2Role? value, + global::G.LoraTargetModules? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -50,7 +50,7 @@ public override void Write( } else { - writer.WriteStringValue(global::G.ToolMessage2RoleExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::G.LoraTargetModulesExtensions.ToValueString(value.Value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2.g.verified.cs new file mode 100644 index 0000000000..394b83d38f --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.ResponseFormatTypeV2.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ResponseFormatTypeV2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ResponseFormatTypeV2 Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ResponseFormatTypeV2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ResponseFormatTypeV2)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ResponseFormatTypeV2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.ResponseFormatTypeV2Extensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2Nullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2Nullable.g.verified.cs new file mode 100644 index 0000000000..5fbcf98739 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatTypeV2Nullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ResponseFormatTypeV2Nullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ResponseFormatTypeV2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ResponseFormatTypeV2? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ResponseFormatTypeV2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ResponseFormatTypeV2)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ResponseFormatTypeV2? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ResponseFormatTypeV2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormat2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatV2.g.verified.cs similarity index 61% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormat2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatV2.g.verified.cs index 8a8d66b2bd..1d06f754bd 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormat2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ResponseFormatV2.g.verified.cs @@ -1,14 +1,14 @@ -//HintName: JsonConverters.ResponseFormat2.g.cs +//HintName: JsonConverters.ResponseFormatV2.g.cs #nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace G.JsonConverters { /// - public class ResponseFormat2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class ResponseFormatV2JsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ResponseFormat2 Read( + public override global::G.ResponseFormatV2 Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,44 +18,44 @@ public class ResponseFormat2JsonConverter : global::System.Text.Json.Serializati var readerCopy = reader; - global::G.TextResponseFormat? textFormat = default; + global::G.TextResponseFormatV2? text = default; try { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormat).Name}"); - textFormat = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormatV2).Name}"); + text = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.JSONResponseFormat2? jSON = default; + global::G.JsonResponseFormatV2? json = default; try { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JSONResponseFormat2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JSONResponseFormat2).Name}"); - jSON = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JsonResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JsonResponseFormatV2).Name}"); + json = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } - var result = new global::G.ResponseFormat2( - textFormat, - jSON + var result = new global::G.ResponseFormatV2( + text, + json ); - if (textFormat != null) + if (text != null) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormat).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormatV2).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - else if (jSON != null) + else if (json != null) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JSONResponseFormat2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JSONResponseFormat2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JsonResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JsonResponseFormatV2).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -65,23 +65,23 @@ public class ResponseFormat2JsonConverter : global::System.Text.Json.Serializati /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ResponseFormat2 value, + global::G.ResponseFormatV2 value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - if (value.IsTextFormat) + if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormat).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.TextFormat, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextResponseFormatV2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } - else if (value.IsJSON) + else if (value.IsJson) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JSONResponseFormat2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JSONResponseFormat2).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.JSON, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.JsonResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.JsonResponseFormatV2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Json, typeInfo); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponse2.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponseV2.g.verified.cs similarity index 97% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponse2.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponseV2.g.verified.cs index 083fcab20d..677c4a05aa 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponse2.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.StreamedChatResponseV2.g.verified.cs @@ -1,14 +1,14 @@ -//HintName: JsonConverters.StreamedChatResponse2.g.cs +//HintName: JsonConverters.StreamedChatResponseV2.g.cs #nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace G.JsonConverters { /// - public class StreamedChatResponse2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class StreamedChatResponseV2JsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.StreamedChatResponse2 Read( + public override global::G.StreamedChatResponseV2 Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -125,7 +125,7 @@ public class StreamedChatResponse2JsonConverter : global::System.Text.Json.Seria { } - var result = new global::G.StreamedChatResponse2( + var result = new global::G.StreamedChatResponseV2( messageStartEvent, contentStartEvent, contentDeltaEvent, @@ -198,7 +198,7 @@ public class StreamedChatResponse2JsonConverter : global::System.Text.Json.Seria /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.StreamedChatResponse2 value, + global::G.StreamedChatResponseV2 value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentType.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2Type.g.verified.cs similarity index 70% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentType.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2Type.g.verified.cs index 4bac7b533a..220e6429c2 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentType.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2Type.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolContentType.g.cs +//HintName: JsonConverters.ToolCallV2Type.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolCallV2TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolContentType Read( + public override global::G.ToolCallV2Type Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolContentTypeJsonConverter : global::System.Text.Json.Seri var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolContentTypeExtensions.ToEnum(stringValue) ?? default; + return global::G.ToolCallV2TypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -27,7 +27,7 @@ public sealed class ToolContentTypeJsonConverter : global::System.Text.Json.Seri case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolContentType)numValue; + return (global::G.ToolCallV2Type)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,12 +39,12 @@ public sealed class ToolContentTypeJsonConverter : global::System.Text.Json.Seri /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolContentType value, + global::G.ToolCallV2Type value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::G.ToolContentTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::G.ToolCallV2TypeExtensions.ToValueString(value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentTypeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2TypeNullable.g.verified.cs similarity index 71% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentTypeNullable.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2TypeNullable.g.verified.cs index 52c54fa4a8..140114a7bf 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContentTypeNullable.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolCallV2TypeNullable.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.ToolContentTypeNullable.g.cs +//HintName: JsonConverters.ToolCallV2TypeNullable.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class ToolContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolCallV2TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.ToolContentType? Read( + public override global::G.ToolCallV2Type? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class ToolContentTypeNullableJsonConverter : global::System.Text.J var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.ToolContentTypeExtensions.ToEnum(stringValue); + return global::G.ToolCallV2TypeExtensions.ToEnum(stringValue); } break; @@ -27,7 +27,7 @@ public sealed class ToolContentTypeNullableJsonConverter : global::System.Text.J case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.ToolContentType)numValue; + return (global::G.ToolCallV2Type)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,7 +39,7 @@ public sealed class ToolContentTypeNullableJsonConverter : global::System.Text.J /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.ToolContentType? value, + global::G.ToolCallV2Type? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -50,7 +50,7 @@ public override void Write( } else { - writer.WriteStringValue(global::G.ToolContentTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::G.ToolCallV2TypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContent.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContent.g.verified.cs new file mode 100644 index 0000000000..229647e584 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolContent.g.verified.cs @@ -0,0 +1,88 @@ +//HintName: JsonConverters.ToolContent.g.cs +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace G.JsonConverters +{ + /// + public class ToolContentJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ToolContent Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + var + readerCopy = reader; + global::G.TextContent? text = default; + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextContent).Name}"); + text = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + + readerCopy = reader; + global::G.DocumentContent? document = default; + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.DocumentContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.DocumentContent).Name}"); + document = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + + var result = new global::G.ToolContent( + text, + document + ); + + if (text != null) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextContent).Name}"); + _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + else if (document != null) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.DocumentContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.DocumentContent).Name}"); + _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + return result; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ToolContent value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsText) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.TextContent).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); + } + else if (value.IsDocument) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::G.DocumentContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::G.DocumentContent).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Document, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2Role.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2Role.g.verified.cs new file mode 100644 index 0000000000..fd7693daa3 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2Role.g.verified.cs @@ -0,0 +1,50 @@ +//HintName: JsonConverters.ToolMessageV2Role.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ToolMessageV2RoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ToolMessageV2Role Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ToolMessageV2RoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ToolMessageV2Role)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ToolMessageV2Role value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::G.ToolMessageV2RoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2RoleNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2RoleNullable.g.verified.cs new file mode 100644 index 0000000000..0b516b1506 --- /dev/null +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolMessageV2RoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ToolMessageV2RoleNullable.g.cs +#nullable enable + +namespace G.JsonConverters +{ + /// + public sealed class ToolMessageV2RoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ToolMessageV2Role? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ToolMessageV2RoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ToolMessageV2Role)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ToolMessageV2Role? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ToolMessageV2RoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2Type.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2Type.g.verified.cs similarity index 71% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2Type.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2Type.g.verified.cs index 8ec643a8ab..a32d88502e 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2Type.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2Type.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.Tool2Type.g.cs +//HintName: JsonConverters.ToolV2Type.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class Tool2TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolV2TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.Tool2Type Read( + public override global::G.ToolV2Type Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class Tool2TypeJsonConverter : global::System.Text.Json.Serializat var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.Tool2TypeExtensions.ToEnum(stringValue) ?? default; + return global::G.ToolV2TypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -27,7 +27,7 @@ public sealed class Tool2TypeJsonConverter : global::System.Text.Json.Serializat case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.Tool2Type)numValue; + return (global::G.ToolV2Type)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,12 +39,12 @@ public sealed class Tool2TypeJsonConverter : global::System.Text.Json.Serializat /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.Tool2Type value, + global::G.ToolV2Type value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::G.Tool2TypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::G.ToolV2TypeExtensions.ToValueString(value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2TypeNullable.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2TypeNullable.g.verified.cs similarity index 73% rename from src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2TypeNullable.g.verified.cs rename to src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2TypeNullable.g.verified.cs index 35844f7c6d..06fcd1ee28 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.Tool2TypeNullable.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonConverters.ToolV2TypeNullable.g.verified.cs @@ -1,13 +1,13 @@ -//HintName: JsonConverters.Tool2TypeNullable.g.cs +//HintName: JsonConverters.ToolV2TypeNullable.g.cs #nullable enable namespace G.JsonConverters { /// - public sealed class Tool2TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ToolV2TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::G.Tool2Type? Read( + public override global::G.ToolV2Type? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -19,7 +19,7 @@ public sealed class Tool2TypeNullableJsonConverter : global::System.Text.Json.Se var stringValue = reader.GetString(); if (stringValue != null) { - return global::G.Tool2TypeExtensions.ToEnum(stringValue); + return global::G.ToolV2TypeExtensions.ToEnum(stringValue); } break; @@ -27,7 +27,7 @@ public sealed class Tool2TypeNullableJsonConverter : global::System.Text.Json.Se case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::G.Tool2Type)numValue; + return (global::G.ToolV2Type)numValue; } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -39,7 +39,7 @@ public sealed class Tool2TypeNullableJsonConverter : global::System.Text.Json.Se /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::G.Tool2Type? value, + global::G.ToolV2Type? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -50,7 +50,7 @@ public override void Write( } else { - writer.WriteStringValue(global::G.Tool2TypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::G.ToolV2TypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextConverters.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextConverters.g.verified.cs index 42505fa667..19f410fbc9 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextConverters.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextConverters.g.verified.cs @@ -25,18 +25,22 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::G.JsonConverters.TextContentTypeNullableJsonConverter), typeof(global::G.JsonConverters.UserMessageRoleJsonConverter), typeof(global::G.JsonConverters.UserMessageRoleNullableJsonConverter), - typeof(global::G.JsonConverters.ToolCall2TypeJsonConverter), - typeof(global::G.JsonConverters.ToolCall2TypeNullableJsonConverter), + typeof(global::G.JsonConverters.ToolCallV2TypeJsonConverter), + typeof(global::G.JsonConverters.ToolCallV2TypeNullableJsonConverter), typeof(global::G.JsonConverters.AssistantMessageRoleJsonConverter), typeof(global::G.JsonConverters.AssistantMessageRoleNullableJsonConverter), typeof(global::G.JsonConverters.SystemMessageRoleJsonConverter), typeof(global::G.JsonConverters.SystemMessageRoleNullableJsonConverter), - typeof(global::G.JsonConverters.ToolContentTypeJsonConverter), - typeof(global::G.JsonConverters.ToolContentTypeNullableJsonConverter), - typeof(global::G.JsonConverters.ToolMessage2RoleJsonConverter), - typeof(global::G.JsonConverters.ToolMessage2RoleNullableJsonConverter), - typeof(global::G.JsonConverters.Tool2TypeJsonConverter), - typeof(global::G.JsonConverters.Tool2TypeNullableJsonConverter), + typeof(global::G.JsonConverters.DocumentContentTypeJsonConverter), + typeof(global::G.JsonConverters.DocumentContentTypeNullableJsonConverter), + typeof(global::G.JsonConverters.ToolMessageV2RoleJsonConverter), + typeof(global::G.JsonConverters.ToolMessageV2RoleNullableJsonConverter), + typeof(global::G.JsonConverters.ToolV2TypeJsonConverter), + typeof(global::G.JsonConverters.ToolV2TypeNullableJsonConverter), + typeof(global::G.JsonConverters.CitationOptionsModeJsonConverter), + typeof(global::G.JsonConverters.CitationOptionsModeNullableJsonConverter), + typeof(global::G.JsonConverters.ResponseFormatTypeV2JsonConverter), + typeof(global::G.JsonConverters.ResponseFormatTypeV2NullableJsonConverter), typeof(global::G.JsonConverters.ChatFinishReasonJsonConverter), typeof(global::G.JsonConverters.ChatFinishReasonNullableJsonConverter), typeof(global::G.JsonConverters.AssistantMessageResponseRoleJsonConverter), @@ -83,20 +87,26 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::G.JsonConverters.BaseTypeNullableJsonConverter), typeof(global::G.JsonConverters.StrategyJsonConverter), typeof(global::G.JsonConverters.StrategyNullableJsonConverter), + typeof(global::G.JsonConverters.LoraTargetModulesJsonConverter), + typeof(global::G.JsonConverters.LoraTargetModulesNullableJsonConverter), typeof(global::G.JsonConverters.StatusJsonConverter), typeof(global::G.JsonConverters.StatusNullableJsonConverter), typeof(global::G.JsonConverters.ChatRequestPromptTruncationJsonConverter), typeof(global::G.JsonConverters.ChatRequestPromptTruncationNullableJsonConverter), typeof(global::G.JsonConverters.ChatRequestCitationQualityJsonConverter), typeof(global::G.JsonConverters.ChatRequestCitationQualityNullableJsonConverter), - typeof(global::G.JsonConverters.Chatv2RequestCitationModeJsonConverter), - typeof(global::G.JsonConverters.Chatv2RequestCitationModeNullableJsonConverter), + typeof(global::G.JsonConverters.ChatRequestSafetyModeJsonConverter), + typeof(global::G.JsonConverters.ChatRequestSafetyModeNullableJsonConverter), + typeof(global::G.JsonConverters.Chatv2RequestSafetyModeJsonConverter), + typeof(global::G.JsonConverters.Chatv2RequestSafetyModeNullableJsonConverter), typeof(global::G.JsonConverters.GenerateRequestTruncateJsonConverter), typeof(global::G.JsonConverters.GenerateRequestTruncateNullableJsonConverter), typeof(global::G.JsonConverters.GenerateRequestReturnLikelihoodsJsonConverter), typeof(global::G.JsonConverters.GenerateRequestReturnLikelihoodsNullableJsonConverter), typeof(global::G.JsonConverters.EmbedRequestTruncateJsonConverter), typeof(global::G.JsonConverters.EmbedRequestTruncateNullableJsonConverter), + typeof(global::G.JsonConverters.Embedv2RequestTruncateJsonConverter), + typeof(global::G.JsonConverters.Embedv2RequestTruncateNullableJsonConverter), typeof(global::G.JsonConverters.ClassifyRequestTruncateJsonConverter), typeof(global::G.JsonConverters.ClassifyRequestTruncateNullableJsonConverter), typeof(global::G.JsonConverters.SummarizeRequestLengthJsonConverter), @@ -105,6 +115,8 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::G.JsonConverters.SummarizeRequestFormatNullableJsonConverter), typeof(global::G.JsonConverters.SummarizeRequestExtractivenessJsonConverter), typeof(global::G.JsonConverters.SummarizeRequestExtractivenessNullableJsonConverter), + typeof(global::G.JsonConverters.ChatAcceptsJsonConverter), + typeof(global::G.JsonConverters.ChatAcceptsNullableJsonConverter), typeof(global::G.JsonConverters.ClassifyResponseClassificationClassificationTypeJsonConverter), typeof(global::G.JsonConverters.ClassifyResponseClassificationClassificationTypeNullableJsonConverter), typeof(global::G.JsonConverters.MessageJsonConverter), @@ -122,8 +134,9 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::G.JsonConverters.OneOfJsonConverterFactory2), typeof(global::G.JsonConverters.SourceJsonConverter), typeof(global::G.JsonConverters.OneOfJsonConverterFactory1), - typeof(global::G.JsonConverters.ChatMessage2JsonConverter), - typeof(global::G.JsonConverters.ResponseFormat2JsonConverter), + typeof(global::G.JsonConverters.ToolContentJsonConverter), + typeof(global::G.JsonConverters.ChatMessageV2JsonConverter), + typeof(global::G.JsonConverters.ResponseFormatV2JsonConverter), typeof(global::G.JsonConverters.ChatMessageStartEventJsonConverter), typeof(global::G.JsonConverters.ChatContentStartEventJsonConverter), typeof(global::G.JsonConverters.ChatContentDeltaEventJsonConverter), @@ -135,7 +148,7 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::G.JsonConverters.CitationStartEventJsonConverter), typeof(global::G.JsonConverters.CitationEndEventJsonConverter), typeof(global::G.JsonConverters.ChatMessageEndEventJsonConverter), - typeof(global::G.JsonConverters.StreamedChatResponse2JsonConverter), + typeof(global::G.JsonConverters.StreamedChatResponseV2JsonConverter), typeof(global::G.JsonConverters.GenerateStreamTextJsonConverter), typeof(global::G.JsonConverters.GenerateStreamEndJsonConverter), typeof(global::G.JsonConverters.GenerateStreamErrorJsonConverter), diff --git a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextTypes.g.verified.cs b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextTypes.g.verified.cs index 0e03abb0c4..f910930a35 100644 --- a/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextTypes.g.verified.cs +++ b/src/tests/AutoSDK.SnapshotTests/Snapshots/Cohere/SystemTextJson/_#JsonSerializerContextTypes.g.verified.cs @@ -294,15 +294,15 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::G.ToolCall2? Type70 { get; set; } + public global::G.ToolCallV2? Type70 { get; set; } /// /// /// - public global::G.ToolCall2Type? Type71 { get; set; } + public global::G.ToolCallV2Type? Type71 { get; set; } /// /// /// - public global::G.ToolCall2Function? Type72 { get; set; } + public global::G.ToolCallV2Function? Type72 { get; set; } /// /// /// @@ -342,7 +342,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type82 { get; set; } + public global::System.Collections.Generic.IList? Type82 { get; set; } /// /// /// @@ -370,2238 +370,2406 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::G.ToolContent? Type89 { get; set; } + public global::G.Document? Type89 { get; set; } /// /// /// - public global::G.ToolContentType? Type90 { get; set; } + public global::G.DocumentData? Type90 { get; set; } /// /// /// - public global::G.ToolContentOutput? Type91 { get; set; } + public global::G.DocumentContent? Type91 { get; set; } /// /// /// - public global::G.ToolMessage2? Type92 { get; set; } + public global::G.DocumentContentType? Type92 { get; set; } /// /// /// - public global::G.ToolMessage2Role? Type93 { get; set; } + public global::G.ToolContent? Type93 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type94 { get; set; } + public global::G.ToolMessageV2? Type94 { get; set; } /// /// /// - public global::G.OneOf? Type95 { get; set; } + public global::G.ToolMessageV2Role? Type95 { get; set; } /// /// /// - public global::G.ChatMessage2? Type96 { get; set; } + public global::G.OneOf>? Type96 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type97 { get; set; } + public global::System.Collections.Generic.IList? Type97 { get; set; } /// /// /// - public global::G.Tool2? Type98 { get; set; } + public global::G.ChatMessageV2? Type98 { get; set; } /// /// /// - public global::G.Tool2Type? Type99 { get; set; } + public global::System.Collections.Generic.IList? Type99 { get; set; } /// /// /// - public global::G.Tool2Function? Type100 { get; set; } + public global::G.ToolV2? Type100 { get; set; } /// /// /// - public global::G.Tool2FunctionParameters? Type101 { get; set; } + public global::G.ToolV2Type? Type101 { get; set; } /// /// /// - public global::G.JSONResponseFormat2? Type102 { get; set; } + public global::G.ToolV2Function? Type102 { get; set; } /// /// /// - public global::G.JSONResponseFormat2JsonSchema? Type103 { get; set; } + public global::G.ToolV2FunctionParameters? Type103 { get; set; } /// /// /// - public global::G.ResponseFormat2? Type104 { get; set; } + public global::G.CitationOptions? Type104 { get; set; } /// /// /// - public global::G.ChatFinishReason? Type105 { get; set; } + public global::G.CitationOptionsMode? Type105 { get; set; } /// /// /// - public global::G.AssistantMessageResponse? Type106 { get; set; } + public global::G.ResponseFormatTypeV2? Type106 { get; set; } /// /// /// - public global::G.AssistantMessageResponseRole? Type107 { get; set; } + public global::G.TextResponseFormatV2? Type107 { get; set; } /// /// /// - public global::G.Usage? Type108 { get; set; } + public global::G.JsonResponseFormatV2? Type108 { get; set; } /// /// /// - public global::G.UsageBilledUnits? Type109 { get; set; } + public global::G.JsonResponseFormatV2JsonSchema? Type109 { get; set; } /// /// /// - public global::G.UsageTokens? Type110 { get; set; } + public global::G.ResponseFormatV2? Type110 { get; set; } /// /// /// - public global::G.NonStreamedChatResponse2? Type111 { get; set; } + public global::G.ChatFinishReason? Type111 { get; set; } /// /// /// - public global::G.ChatStreamEventType? Type112 { get; set; } + public global::G.AssistantMessageResponse? Type112 { get; set; } /// /// /// - public global::G.ChatStreamEventTypeType? Type113 { get; set; } + public global::G.AssistantMessageResponseRole? Type113 { get; set; } /// /// /// - public global::G.ChatMessageStartEvent? Type114 { get; set; } + public global::G.Usage? Type114 { get; set; } /// /// /// - public global::G.ChatMessageStartEventVariant2? Type115 { get; set; } + public global::G.UsageBilledUnits? Type115 { get; set; } /// /// /// - public global::G.ChatMessageStartEventVariant2Delta? Type116 { get; set; } + public global::G.UsageTokens? Type116 { get; set; } /// /// /// - public global::G.ChatMessageStartEventVariant2DeltaMessage? Type117 { get; set; } + public global::G.ChatResponse? Type117 { get; set; } /// /// /// - public global::G.ChatMessageStartEventVariant2DeltaMessageRole? Type118 { get; set; } + public global::G.ChatStreamEventType? Type118 { get; set; } /// /// /// - public global::G.ChatContentStartEvent? Type119 { get; set; } + public global::G.ChatStreamEventTypeType? Type119 { get; set; } /// /// /// - public global::G.ChatContentStartEventVariant2? Type120 { get; set; } + public global::G.ChatMessageStartEvent? Type120 { get; set; } /// /// /// - public global::G.ChatContentStartEventVariant2Delta? Type121 { get; set; } + public global::G.ChatMessageStartEventVariant2? Type121 { get; set; } /// /// /// - public global::G.ChatContentStartEventVariant2DeltaMessage? Type122 { get; set; } + public global::G.ChatMessageStartEventVariant2Delta? Type122 { get; set; } /// /// /// - public global::G.ChatContentStartEventVariant2DeltaMessageContent? Type123 { get; set; } + public global::G.ChatMessageStartEventVariant2DeltaMessage? Type123 { get; set; } /// /// /// - public global::G.ChatContentStartEventVariant2DeltaMessageContentType? Type124 { get; set; } + public global::G.ChatMessageStartEventVariant2DeltaMessageRole? Type124 { get; set; } /// /// /// - public global::G.ChatContentDeltaEvent? Type125 { get; set; } + public global::G.ChatContentStartEvent? Type125 { get; set; } /// /// /// - public global::G.ChatContentDeltaEventVariant2? Type126 { get; set; } + public global::G.ChatContentStartEventVariant2? Type126 { get; set; } /// /// /// - public global::G.ChatContentDeltaEventVariant2Delta? Type127 { get; set; } + public global::G.ChatContentStartEventVariant2Delta? Type127 { get; set; } /// /// /// - public global::G.ChatContentDeltaEventVariant2DeltaMessage? Type128 { get; set; } + public global::G.ChatContentStartEventVariant2DeltaMessage? Type128 { get; set; } /// /// /// - public global::G.ChatContentDeltaEventVariant2DeltaMessageContent? Type129 { get; set; } + public global::G.ChatContentStartEventVariant2DeltaMessageContent? Type129 { get; set; } /// /// /// - public global::G.ChatContentEndEvent? Type130 { get; set; } + public global::G.ChatContentStartEventVariant2DeltaMessageContentType? Type130 { get; set; } /// /// /// - public global::G.ChatContentEndEventVariant2? Type131 { get; set; } + public global::G.ChatContentDeltaEvent? Type131 { get; set; } /// /// /// - public global::G.ChatToolPlanDeltaEvent? Type132 { get; set; } + public global::G.ChatContentDeltaEventVariant2? Type132 { get; set; } /// /// /// - public global::G.ChatToolPlanDeltaEventVariant2? Type133 { get; set; } + public global::G.ChatContentDeltaEventVariant2Delta? Type133 { get; set; } /// /// /// - public global::G.ChatToolPlanDeltaEventVariant2Delta? Type134 { get; set; } + public global::G.ChatContentDeltaEventVariant2DeltaMessage? Type134 { get; set; } /// /// /// - public global::G.ChatToolCallStartEvent? Type135 { get; set; } + public global::G.ChatContentDeltaEventVariant2DeltaMessageContent? Type135 { get; set; } /// /// /// - public global::G.ChatToolCallStartEventVariant2? Type136 { get; set; } + public global::G.ChatContentEndEvent? Type136 { get; set; } /// /// /// - public global::G.ChatToolCallStartEventVariant2Delta? Type137 { get; set; } + public global::G.ChatContentEndEventVariant2? Type137 { get; set; } /// /// /// - public global::G.ChatToolCallStartEventVariant2DeltaToolCall? Type138 { get; set; } + public global::G.ChatToolPlanDeltaEvent? Type138 { get; set; } /// /// /// - public global::G.ChatToolCallStartEventVariant2DeltaToolCallType? Type139 { get; set; } + public global::G.ChatToolPlanDeltaEventVariant2? Type139 { get; set; } /// /// /// - public global::G.ChatToolCallStartEventVariant2DeltaToolCallFunction? Type140 { get; set; } + public global::G.ChatToolPlanDeltaEventVariant2Delta? Type140 { get; set; } /// /// /// - public global::G.ChatToolCallDeltaEvent? Type141 { get; set; } + public global::G.ChatToolCallStartEvent? Type141 { get; set; } /// /// /// - public global::G.ChatToolCallDeltaEventVariant2? Type142 { get; set; } + public global::G.ChatToolCallStartEventVariant2? Type142 { get; set; } /// /// /// - public global::G.ChatToolCallDeltaEventVariant2Delta? Type143 { get; set; } + public global::G.ChatToolCallStartEventVariant2Delta? Type143 { get; set; } /// /// /// - public global::G.ChatToolCallDeltaEventVariant2DeltaToolCall? Type144 { get; set; } + public global::G.ChatToolCallStartEventVariant2DeltaToolCall? Type144 { get; set; } /// /// /// - public global::G.ChatToolCallDeltaEventVariant2DeltaToolCallFunction? Type145 { get; set; } + public global::G.ChatToolCallStartEventVariant2DeltaToolCallType? Type145 { get; set; } /// /// /// - public global::G.ChatToolCallEndEvent? Type146 { get; set; } + public global::G.ChatToolCallStartEventVariant2DeltaToolCallFunction? Type146 { get; set; } /// /// /// - public global::G.ChatToolCallEndEventVariant2? Type147 { get; set; } + public global::G.ChatToolCallDeltaEvent? Type147 { get; set; } /// /// /// - public global::G.CitationStartEvent? Type148 { get; set; } + public global::G.ChatToolCallDeltaEventVariant2? Type148 { get; set; } /// /// /// - public global::G.CitationStartEventVariant2? Type149 { get; set; } + public global::G.ChatToolCallDeltaEventVariant2Delta? Type149 { get; set; } /// /// /// - public global::G.CitationStartEventVariant2Delta? Type150 { get; set; } + public global::G.ChatToolCallDeltaEventVariant2DeltaToolCall? Type150 { get; set; } /// /// /// - public global::G.CitationStartEventVariant2DeltaMessage? Type151 { get; set; } + public global::G.ChatToolCallDeltaEventVariant2DeltaToolCallFunction? Type151 { get; set; } /// /// /// - public global::G.CitationEndEvent? Type152 { get; set; } + public global::G.ChatToolCallEndEvent? Type152 { get; set; } /// /// /// - public global::G.CitationEndEventVariant2? Type153 { get; set; } + public global::G.ChatToolCallEndEventVariant2? Type153 { get; set; } /// /// /// - public global::G.ChatMessageEndEvent? Type154 { get; set; } + public global::G.CitationStartEvent? Type154 { get; set; } /// /// /// - public global::G.ChatMessageEndEventVariant2? Type155 { get; set; } + public global::G.CitationStartEventVariant2? Type155 { get; set; } /// /// /// - public global::G.ChatMessageEndEventVariant2Delta? Type156 { get; set; } + public global::G.CitationStartEventVariant2Delta? Type156 { get; set; } /// /// /// - public global::G.StreamedChatResponse2? Type157 { get; set; } + public global::G.CitationStartEventVariant2DeltaMessage? Type157 { get; set; } /// /// /// - public global::G.SingleGeneration? Type158 { get; set; } + public global::G.CitationEndEvent? Type158 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type159 { get; set; } + public global::G.CitationEndEventVariant2? Type159 { get; set; } /// /// /// - public global::G.SingleGenerationTokenLikelihood? Type160 { get; set; } + public global::G.ChatMessageEndEvent? Type160 { get; set; } /// /// /// - public global::G.Generation? Type161 { get; set; } + public global::G.ChatMessageEndEventVariant2? Type161 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type162 { get; set; } + public global::G.ChatMessageEndEventVariant2Delta? Type162 { get; set; } /// /// /// - public global::G.GenerateStreamEvent? Type163 { get; set; } + public global::G.StreamedChatResponseV2? Type163 { get; set; } /// /// /// - public global::G.GenerateStreamEventEventType? Type164 { get; set; } + public global::G.SingleGeneration? Type164 { get; set; } /// /// /// - public global::G.GenerateStreamText? Type165 { get; set; } + public global::System.Collections.Generic.IList? Type165 { get; set; } /// /// /// - public global::G.GenerateStreamTextVariant2? Type166 { get; set; } + public global::G.SingleGenerationTokenLikelihood? Type166 { get; set; } /// /// /// - public global::G.SingleGenerationInStream? Type167 { get; set; } + public global::G.Generation? Type167 { get; set; } /// /// /// - public global::G.GenerateStreamEnd? Type168 { get; set; } + public global::System.Collections.Generic.IList? Type168 { get; set; } /// /// /// - public global::G.GenerateStreamEndVariant2? Type169 { get; set; } + public global::G.GenerateStreamEvent? Type169 { get; set; } /// /// /// - public global::G.GenerateStreamEndVariant2Response? Type170 { get; set; } + public global::G.GenerateStreamEventEventType? Type170 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type171 { get; set; } + public global::G.GenerateStreamText? Type171 { get; set; } /// /// /// - public global::G.GenerateStreamError? Type172 { get; set; } + public global::G.GenerateStreamTextVariant2? Type172 { get; set; } /// /// /// - public global::G.GenerateStreamErrorVariant2? Type173 { get; set; } + public global::G.SingleGenerationInStream? Type173 { get; set; } /// /// /// - public global::G.GenerateStreamedResponse? Type174 { get; set; } + public global::G.GenerateStreamEnd? Type174 { get; set; } /// /// /// - public global::G.EmbedInputType? Type175 { get; set; } + public global::G.GenerateStreamEndVariant2? Type175 { get; set; } /// /// /// - public global::G.EmbeddingType? Type176 { get; set; } + public global::G.GenerateStreamEndVariant2Response? Type176 { get; set; } /// /// /// - public global::G.EmbedFloatsResponse? Type177 { get; set; } + public global::System.Collections.Generic.IList? Type177 { get; set; } /// /// /// - public global::G.EmbedFloatsResponseResponseType? Type178 { get; set; } + public global::G.GenerateStreamError? Type178 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type179 { get; set; } + public global::G.GenerateStreamErrorVariant2? Type179 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type180 { get; set; } + public global::G.GenerateStreamedResponse? Type180 { get; set; } /// /// /// - public global::G.EmbedByTypeResponse? Type181 { get; set; } + public global::G.EmbedInputType? Type181 { get; set; } /// /// /// - public global::G.EmbedByTypeResponseResponseType? Type182 { get; set; } + public global::G.EmbeddingType? Type182 { get; set; } /// /// /// - public global::G.EmbedByTypeResponseEmbeddings? Type183 { get; set; } + public global::G.EmbedFloatsResponse? Type183 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type184 { get; set; } + public global::G.EmbedFloatsResponseResponseType? Type184 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type185 { get; set; } + public global::System.Collections.Generic.IList>? Type185 { get; set; } /// /// /// - public global::G.EmbedJob? Type186 { get; set; } + public global::System.Collections.Generic.IList? Type186 { get; set; } /// /// /// - public global::G.EmbedJobStatus? Type187 { get; set; } + public global::G.EmbedByTypeResponse? Type187 { get; set; } /// /// /// - public global::System.DateTime? Type188 { get; set; } + public global::G.EmbedByTypeResponseResponseType? Type188 { get; set; } /// /// /// - public global::G.EmbedJobTruncate? Type189 { get; set; } + public global::G.EmbedByTypeResponseEmbeddings? Type189 { get; set; } /// /// /// - public global::G.ListEmbedJobResponse? Type190 { get; set; } + public global::System.Collections.Generic.IList>? Type190 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type191 { get; set; } + public global::System.Collections.Generic.IList? Type191 { get; set; } /// /// /// - public global::G.CreateEmbedJobRequest? Type192 { get; set; } + public global::G.EmbedJob? Type192 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type193 { get; set; } + public global::G.EmbedJobStatus? Type193 { get; set; } /// /// /// - public global::G.CreateEmbedJobRequestTruncate? Type194 { get; set; } + public global::System.DateTime? Type194 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse? Type195 { get; set; } + public global::G.EmbedJobTruncate? Type195 { get; set; } /// /// /// - public global::G.RerankDocument? Type196 { get; set; } + public global::G.ListEmbedJobResponse? Type196 { get; set; } /// /// /// - public global::G.ClassifyExample? Type197 { get; set; } + public global::System.Collections.Generic.IList? Type197 { get; set; } /// /// /// - public global::G.DatasetValidationStatus? Type198 { get; set; } + public global::G.CreateEmbedJobRequest? Type198 { get; set; } /// /// /// - public global::G.DatasetType? Type199 { get; set; } + public global::System.Collections.Generic.IList? Type199 { get; set; } /// /// /// - public global::G.DatasetPart? Type200 { get; set; } + public global::G.CreateEmbedJobRequestTruncate? Type200 { get; set; } /// /// /// - public global::G.ParseInfo? Type201 { get; set; } + public global::G.CreateEmbedJobResponse? Type201 { get; set; } /// /// /// - public global::G.RerankerDataMetrics? Type202 { get; set; } + public global::G.RerankDocument? Type202 { get; set; } /// /// /// - public global::G.ChatDataMetrics? Type203 { get; set; } + public global::G.ClassifyExample? Type203 { get; set; } /// /// /// - public global::G.LabelMetric? Type204 { get; set; } + public global::G.DatasetValidationStatus? Type204 { get; set; } /// /// /// - public global::G.ClassifyDataMetrics? Type205 { get; set; } + public global::G.DatasetType? Type205 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type206 { get; set; } + public global::G.DatasetPart? Type206 { get; set; } /// /// /// - public global::G.FinetuneDatasetMetrics? Type207 { get; set; } + public global::G.ParseInfo? Type207 { get; set; } /// /// /// - public global::G.Metrics? Type208 { get; set; } + public global::G.RerankerDataMetrics? Type208 { get; set; } /// /// /// - public global::G.Dataset? Type209 { get; set; } + public global::G.ChatDataMetrics? Type209 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type210 { get; set; } + public global::G.LabelMetric? Type210 { get; set; } /// /// /// - public global::G.ConnectorOAuth? Type211 { get; set; } + public global::G.ClassifyDataMetrics? Type211 { get; set; } /// /// /// - public global::G.Connector? Type212 { get; set; } + public global::System.Collections.Generic.IList? Type212 { get; set; } /// /// /// - public global::G.ConnectorAuthStatus? Type213 { get; set; } + public global::G.FinetuneDatasetMetrics? Type213 { get; set; } /// /// /// - public global::G.ListConnectorsResponse? Type214 { get; set; } + public global::G.Metrics? Type214 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type215 { get; set; } + public global::G.Dataset? Type215 { get; set; } /// /// /// - public global::G.CreateConnectorOAuth? Type216 { get; set; } + public global::System.Collections.Generic.IList? Type216 { get; set; } /// /// /// - public global::G.AuthTokenType? Type217 { get; set; } + public global::G.ConnectorOAuth? Type217 { get; set; } /// /// /// - public global::G.CreateConnectorServiceAuth? Type218 { get; set; } + public global::G.Connector? Type218 { get; set; } /// /// /// - public global::G.CreateConnectorRequest? Type219 { get; set; } + public global::G.ConnectorAuthStatus? Type219 { get; set; } /// /// /// - public global::G.CreateConnectorResponse? Type220 { get; set; } + public global::G.ListConnectorsResponse? Type220 { get; set; } /// /// /// - public global::G.GetConnectorResponse? Type221 { get; set; } + public global::System.Collections.Generic.IList? Type221 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse? Type222 { get; set; } + public global::G.CreateConnectorOAuth? Type222 { get; set; } /// /// /// - public global::G.UpdateConnectorRequest? Type223 { get; set; } + public global::G.AuthTokenType? Type223 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse? Type224 { get; set; } + public global::G.CreateConnectorServiceAuth? Type224 { get; set; } /// /// /// - public global::G.OAuthAuthorizeResponse? Type225 { get; set; } + public global::G.CreateConnectorRequest? Type225 { get; set; } /// /// /// - public global::G.ConnectorLog? Type226 { get; set; } + public global::G.CreateConnectorResponse? Type226 { get; set; } /// /// /// - public global::G.GetConnectorsLogsResponse? Type227 { get; set; } + public global::G.GetConnectorResponse? Type227 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::G.DeleteConnectorResponse? Type228 { get; set; } /// /// /// - public global::G.TokenLikelihood? Type229 { get; set; } + public global::G.UpdateConnectorRequest? Type229 { get; set; } /// /// /// - public global::G.LogLikelihoodResponse? Type230 { get; set; } + public global::G.UpdateConnectorResponse? Type230 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type231 { get; set; } + public global::G.OAuthAuthorizeResponse? Type231 { get; set; } /// /// /// - public global::G.Cluster? Type232 { get; set; } + public global::G.ConnectorLog? Type232 { get; set; } /// /// /// - public global::G.GetClusterJobResponse? Type233 { get; set; } + public global::G.GetConnectorsLogsResponse? Type233 { get; set; } /// /// /// - public global::G.GetClusterJobResponseStatus? Type234 { get; set; } + public global::System.Collections.Generic.IList? Type234 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type235 { get; set; } + public global::G.TokenLikelihood? Type235 { get; set; } /// /// /// - public global::G.ListClusterJobsResponse? Type236 { get; set; } + public global::G.LogLikelihoodResponse? Type236 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type237 { get; set; } + public global::System.Collections.Generic.IList? Type237 { get; set; } /// /// /// - public global::G.CreateClusterJobRequest? Type238 { get; set; } + public global::G.Cluster? Type238 { get; set; } /// /// /// - public global::G.CreateClusterJobResponse? Type239 { get; set; } + public global::G.GetClusterJobResponse? Type239 { get; set; } /// /// /// - public global::G.UpdateClusterJobRequest? Type240 { get; set; } + public global::G.GetClusterJobResponseStatus? Type240 { get; set; } /// /// /// - public global::G.UpdateClusterJobRequestStatus? Type241 { get; set; } + public global::System.Collections.Generic.IList? Type241 { get; set; } /// /// /// - public global::G.UpdateClusterJobRequestInputTrackingMetrics? Type242 { get; set; } + public global::G.ListClusterJobsResponse? Type242 { get; set; } /// /// /// - public global::G.UpdateClusterJobRequestOutputTrackingMetrics? Type243 { get; set; } + public global::System.Collections.Generic.IList? Type243 { get; set; } /// /// /// - public global::G.UpdateClusterJobResponse? Type244 { get; set; } + public global::G.CreateClusterJobRequest? Type244 { get; set; } /// /// /// - public global::G.CompatibleEndpoint? Type245 { get; set; } + public global::G.CreateClusterJobResponse? Type245 { get; set; } /// /// /// - public global::G.GetModelResponse? Type246 { get; set; } + public global::G.UpdateClusterJobRequest? Type246 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type247 { get; set; } + public global::G.UpdateClusterJobRequestStatus? Type247 { get; set; } /// /// /// - public global::G.ListModelsResponse? Type248 { get; set; } + public global::G.UpdateClusterJobRequestInputTrackingMetrics? Type248 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type249 { get; set; } + public global::G.UpdateClusterJobRequestOutputTrackingMetrics? Type249 { get; set; } /// /// /// - public global::G.BaseType? Type250 { get; set; } + public global::G.UpdateClusterJobResponse? Type250 { get; set; } /// /// /// - public global::G.Strategy? Type251 { get; set; } + public global::G.CompatibleEndpoint? Type251 { get; set; } /// /// /// - public global::G.BaseModel? Type252 { get; set; } + public global::G.GetModelResponse? Type252 { get; set; } /// /// /// - public global::G.Hyperparameters? Type253 { get; set; } + public global::System.Collections.Generic.IList? Type253 { get; set; } /// /// /// - public global::G.WandbConfig? Type254 { get; set; } + public global::G.ListModelsResponse? Type254 { get; set; } /// /// /// - public global::G.Settings? Type255 { get; set; } + public global::System.Collections.Generic.IList? Type255 { get; set; } /// /// /// - public global::G.Status? Type256 { get; set; } + public global::G.BaseType? Type256 { get; set; } /// /// /// - public global::G.FinetunedModel? Type257 { get; set; } + public global::G.Strategy? Type257 { get; set; } /// /// /// - public global::G.ListFinetunedModelsResponse? Type258 { get; set; } + public global::G.BaseModel? Type258 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type259 { get; set; } + public global::G.LoraTargetModules? Type259 { get; set; } /// /// /// - public global::G.Error? Type260 { get; set; } + public global::G.Hyperparameters? Type260 { get; set; } /// /// /// - public global::G.CreateFinetunedModelResponse? Type261 { get; set; } + public global::G.WandbConfig? Type261 { get; set; } /// /// /// - public global::G.GetFinetunedModelResponse? Type262 { get; set; } + public global::G.Settings? Type262 { get; set; } /// /// /// - public global::G.DeleteFinetunedModelResponse? Type263 { get; set; } + public global::G.Status? Type263 { get; set; } /// /// /// - public global::G.UpdateFinetunedModelResponse? Type264 { get; set; } + public global::G.FinetunedModel? Type264 { get; set; } /// /// /// - public global::G.Event? Type265 { get; set; } + public global::G.ListFinetunedModelsResponse? Type265 { get; set; } /// /// /// - public global::G.ListEventsResponse? Type266 { get; set; } + public global::System.Collections.Generic.IList? Type266 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type267 { get; set; } + public global::G.Error? Type267 { get; set; } /// /// /// - public global::G.TrainingStepMetrics? Type268 { get; set; } + public global::G.CreateFinetunedModelResponse? Type268 { get; set; } /// /// /// - public global::G.TrainingStepMetricsMetrics? Type269 { get; set; } + public global::G.GetFinetunedModelResponse? Type269 { get; set; } /// /// /// - public global::G.ListTrainingStepMetricsResponse? Type270 { get; set; } + public global::G.DeleteFinetunedModelResponse? Type270 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type271 { get; set; } + public global::G.UpdateFinetunedModelResponse? Type271 { get; set; } /// /// /// - public global::G.ChatRequest? Type272 { get; set; } + public global::G.Event? Type272 { get; set; } /// /// /// - public global::G.ChatRequestPromptTruncation? Type273 { get; set; } + public global::G.ListEventsResponse? Type273 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type274 { get; set; } + public global::System.Collections.Generic.IList? Type274 { get; set; } /// /// /// - public global::G.ChatRequestCitationQuality? Type275 { get; set; } + public global::G.TrainingStepMetrics? Type275 { get; set; } /// /// /// - public float? Type276 { get; set; } + public global::G.TrainingStepMetricsMetrics? Type276 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type277 { get; set; } + public global::G.ListTrainingStepMetricsResponse? Type277 { get; set; } /// /// /// - public global::G.Chatv2Request? Type278 { get; set; } + public global::System.Collections.Generic.IList? Type278 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type279 { get; set; } + public global::G.ChatRequest? Type279 { get; set; } /// /// /// - public global::G.Chatv2RequestCitationMode? Type280 { get; set; } + public global::G.ChatRequestPromptTruncation? Type280 { get; set; } /// /// /// - public global::G.GenerateRequest? Type281 { get; set; } + public global::System.Collections.Generic.IList? Type281 { get; set; } /// /// /// - public global::G.GenerateRequestTruncate? Type282 { get; set; } + public global::G.ChatRequestCitationQuality? Type282 { get; set; } /// /// /// - public global::G.GenerateRequestReturnLikelihoods? Type283 { get; set; } + public float? Type283 { get; set; } /// /// /// - public global::G.EmbedRequest? Type284 { get; set; } + public global::System.Collections.Generic.IList? Type284 { get; set; } /// /// /// - public global::G.EmbedRequestTruncate? Type285 { get; set; } + public global::G.ChatRequestSafetyMode? Type285 { get; set; } /// /// /// - public global::G.RerankRequest? Type286 { get; set; } + public global::G.Chatv2Request? Type286 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type287 { get; set; } + public global::System.Collections.Generic.IList? Type287 { get; set; } /// /// /// - public global::G.OneOf? Type288 { get; set; } + public global::System.Collections.Generic.IList>? Type288 { get; set; } /// /// /// - public global::G.ClassifyRequest? Type289 { get; set; } + public global::G.OneOf? Type289 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type290 { get; set; } + public global::G.Chatv2RequestSafetyMode? Type290 { get; set; } /// /// /// - public global::G.ClassifyRequestTruncate? Type291 { get; set; } + public global::G.GenerateRequest? Type291 { get; set; } /// /// /// - public global::G.CreateDatasetRequest? Type292 { get; set; } + public global::G.GenerateRequestTruncate? Type292 { get; set; } /// /// /// - public byte[]? Type293 { get; set; } + public global::G.GenerateRequestReturnLikelihoods? Type293 { get; set; } /// /// /// - public global::G.SummarizeRequest? Type294 { get; set; } + public global::G.EmbedRequest? Type294 { get; set; } /// /// /// - public global::G.SummarizeRequestLength? Type295 { get; set; } + public global::G.EmbedRequestTruncate? Type295 { get; set; } /// /// /// - public global::G.SummarizeRequestFormat? Type296 { get; set; } + public global::G.Embedv2Request? Type296 { get; set; } /// /// /// - public global::G.SummarizeRequestExtractiveness? Type297 { get; set; } + public global::G.Embedv2RequestTruncate? Type297 { get; set; } /// /// /// - public global::G.TokenizeRequest? Type298 { get; set; } + public global::G.RerankRequest? Type298 { get; set; } /// /// /// - public global::G.DetokenizeRequest? Type299 { get; set; } + public global::System.Collections.Generic.IList>? Type299 { get; set; } /// /// /// - public global::G.UpdateFinetunedModelRequest? Type300 { get; set; } + public global::G.OneOf? Type300 { get; set; } /// /// /// - public global::G.OneOf? Type301 { get; set; } + public global::G.Rerankv2Request? Type301 { get; set; } /// /// /// - public global::G.ChatResponse2? Type302 { get; set; } + public global::G.ClassifyRequest? Type302 { get; set; } /// /// /// - public global::G.ChatResponse3? Type303 { get; set; } + public global::System.Collections.Generic.IList? Type303 { get; set; } /// /// /// - public global::G.ChatResponse4? Type304 { get; set; } + public global::G.ClassifyRequestTruncate? Type304 { get; set; } /// /// /// - public global::G.ChatResponse5? Type305 { get; set; } + public global::G.CreateDatasetRequest? Type305 { get; set; } /// /// /// - public global::G.ChatResponse6? Type306 { get; set; } + public byte[]? Type306 { get; set; } /// /// /// - public global::G.ChatResponse7? Type307 { get; set; } + public global::G.SummarizeRequest? Type307 { get; set; } /// /// /// - public global::G.ChatResponse8? Type308 { get; set; } + public global::G.SummarizeRequestLength? Type308 { get; set; } /// /// /// - public global::G.ChatResponse9? Type309 { get; set; } + public global::G.SummarizeRequestFormat? Type309 { get; set; } /// /// /// - public global::G.ChatResponse10? Type310 { get; set; } + public global::G.SummarizeRequestExtractiveness? Type310 { get; set; } /// /// /// - public global::G.ChatResponse11? Type311 { get; set; } + public global::G.TokenizeRequest? Type311 { get; set; } /// /// /// - public global::G.ChatResponse12? Type312 { get; set; } + public global::G.DetokenizeRequest? Type312 { get; set; } /// /// /// - public global::G.ChatResponse13? Type313 { get; set; } + public global::G.UpdateFinetunedModelRequest? Type313 { get; set; } /// /// /// - public global::G.OneOf? Type314 { get; set; } + public global::G.ChatAccepts? Type314 { get; set; } /// /// /// - public global::G.Chatv2Response2? Type315 { get; set; } + public global::G.OneOf? Type315 { get; set; } /// /// /// - public global::G.Chatv2Response3? Type316 { get; set; } + public global::G.ChatResponse3? Type316 { get; set; } /// /// /// - public global::G.Chatv2Response4? Type317 { get; set; } + public global::G.ChatResponse4? Type317 { get; set; } /// /// /// - public global::G.Chatv2Response5? Type318 { get; set; } + public global::G.ChatResponse5? Type318 { get; set; } /// /// /// - public global::G.Chatv2Response6? Type319 { get; set; } + public global::G.ChatResponse6? Type319 { get; set; } /// /// /// - public global::G.Chatv2Response7? Type320 { get; set; } + public global::G.ChatResponse7? Type320 { get; set; } /// /// /// - public global::G.Chatv2Response8? Type321 { get; set; } + public global::G.ChatResponse8? Type321 { get; set; } /// /// /// - public global::G.Chatv2Response9? Type322 { get; set; } + public global::G.ChatResponse9? Type322 { get; set; } /// /// /// - public global::G.Chatv2Response10? Type323 { get; set; } + public global::G.ChatResponse10? Type323 { get; set; } /// /// /// - public global::G.Chatv2Response11? Type324 { get; set; } + public global::G.ChatResponse11? Type324 { get; set; } /// /// /// - public global::G.Chatv2Response12? Type325 { get; set; } + public global::G.ChatResponse12? Type325 { get; set; } /// /// /// - public global::G.Chatv2Response13? Type326 { get; set; } + public global::G.ChatResponse13? Type326 { get; set; } /// /// /// - public global::G.GenerateResponse? Type327 { get; set; } + public global::G.ChatResponse14? Type327 { get; set; } /// /// /// - public global::G.GenerateResponse2? Type328 { get; set; } + public global::G.OneOf? Type328 { get; set; } /// /// /// - public global::G.GenerateResponse3? Type329 { get; set; } + public global::G.Chatv2Response2? Type329 { get; set; } /// /// /// - public global::G.GenerateResponse4? Type330 { get; set; } + public global::G.Chatv2Response3? Type330 { get; set; } /// /// /// - public global::G.GenerateResponse5? Type331 { get; set; } + public global::G.Chatv2Response4? Type331 { get; set; } /// /// /// - public global::G.GenerateResponse6? Type332 { get; set; } + public global::G.Chatv2Response5? Type332 { get; set; } /// /// /// - public global::G.GenerateResponse7? Type333 { get; set; } + public global::G.Chatv2Response6? Type333 { get; set; } /// /// /// - public global::G.GenerateResponse8? Type334 { get; set; } + public global::G.Chatv2Response7? Type334 { get; set; } /// /// /// - public global::G.GenerateResponse9? Type335 { get; set; } + public global::G.Chatv2Response8? Type335 { get; set; } /// /// /// - public global::G.GenerateResponse10? Type336 { get; set; } + public global::G.Chatv2Response9? Type336 { get; set; } /// /// /// - public global::G.GenerateResponse11? Type337 { get; set; } + public global::G.Chatv2Response10? Type337 { get; set; } /// /// /// - public global::G.GenerateResponse12? Type338 { get; set; } + public global::G.Chatv2Response11? Type338 { get; set; } /// /// /// - public global::G.OneOf? Type339 { get; set; } + public global::G.Chatv2Response12? Type339 { get; set; } /// /// /// - public global::G.EmbedResponse2? Type340 { get; set; } + public global::G.Chatv2Response13? Type340 { get; set; } /// /// /// - public global::G.EmbedResponse3? Type341 { get; set; } + public global::G.GenerateResponse? Type341 { get; set; } /// /// /// - public global::G.EmbedResponse4? Type342 { get; set; } + public global::G.GenerateResponse2? Type342 { get; set; } /// /// /// - public global::G.EmbedResponse5? Type343 { get; set; } + public global::G.GenerateResponse3? Type343 { get; set; } /// /// /// - public global::G.EmbedResponse6? Type344 { get; set; } + public global::G.GenerateResponse4? Type344 { get; set; } /// /// /// - public global::G.EmbedResponse7? Type345 { get; set; } + public global::G.GenerateResponse5? Type345 { get; set; } /// /// /// - public global::G.EmbedResponse8? Type346 { get; set; } + public global::G.GenerateResponse6? Type346 { get; set; } /// /// /// - public global::G.EmbedResponse9? Type347 { get; set; } + public global::G.GenerateResponse7? Type347 { get; set; } /// /// /// - public global::G.EmbedResponse10? Type348 { get; set; } + public global::G.GenerateResponse8? Type348 { get; set; } /// /// /// - public global::G.EmbedResponse11? Type349 { get; set; } + public global::G.GenerateResponse9? Type349 { get; set; } /// /// /// - public global::G.EmbedResponse12? Type350 { get; set; } + public global::G.GenerateResponse10? Type350 { get; set; } /// /// /// - public global::G.EmbedResponse13? Type351 { get; set; } + public global::G.GenerateResponse11? Type351 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse2? Type352 { get; set; } + public global::G.GenerateResponse12? Type352 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse3? Type353 { get; set; } + public global::G.OneOf? Type353 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse4? Type354 { get; set; } + public global::G.EmbedResponse2? Type354 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse5? Type355 { get; set; } + public global::G.EmbedResponse3? Type355 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse6? Type356 { get; set; } + public global::G.EmbedResponse4? Type356 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse7? Type357 { get; set; } + public global::G.EmbedResponse5? Type357 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse8? Type358 { get; set; } + public global::G.EmbedResponse6? Type358 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse9? Type359 { get; set; } + public global::G.EmbedResponse7? Type359 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse10? Type360 { get; set; } + public global::G.EmbedResponse8? Type360 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse11? Type361 { get; set; } + public global::G.EmbedResponse9? Type361 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse12? Type362 { get; set; } + public global::G.EmbedResponse10? Type362 { get; set; } /// /// /// - public global::G.CreateEmbedJobResponse13? Type363 { get; set; } + public global::G.EmbedResponse11? Type363 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse? Type364 { get; set; } + public global::G.EmbedResponse12? Type364 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse2? Type365 { get; set; } + public global::G.EmbedResponse13? Type365 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse3? Type366 { get; set; } + public global::G.Embedv2Response? Type366 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse4? Type367 { get; set; } + public global::G.Embedv2Response2? Type367 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse5? Type368 { get; set; } + public global::G.Embedv2Response3? Type368 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse6? Type369 { get; set; } + public global::G.Embedv2Response4? Type369 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse7? Type370 { get; set; } + public global::G.Embedv2Response5? Type370 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse8? Type371 { get; set; } + public global::G.Embedv2Response6? Type371 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse9? Type372 { get; set; } + public global::G.Embedv2Response7? Type372 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse10? Type373 { get; set; } + public global::G.Embedv2Response8? Type373 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse11? Type374 { get; set; } + public global::G.Embedv2Response9? Type374 { get; set; } /// /// /// - public global::G.ListEmbedJobsResponse12? Type375 { get; set; } + public global::G.Embedv2Response10? Type375 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse? Type376 { get; set; } + public global::G.Embedv2Response11? Type376 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse2? Type377 { get; set; } + public global::G.Embedv2Response12? Type377 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse3? Type378 { get; set; } + public global::G.CreateEmbedJobResponse2? Type378 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse4? Type379 { get; set; } + public global::G.CreateEmbedJobResponse3? Type379 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse5? Type380 { get; set; } + public global::G.CreateEmbedJobResponse4? Type380 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse6? Type381 { get; set; } + public global::G.CreateEmbedJobResponse5? Type381 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse7? Type382 { get; set; } + public global::G.CreateEmbedJobResponse6? Type382 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse8? Type383 { get; set; } + public global::G.CreateEmbedJobResponse7? Type383 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse9? Type384 { get; set; } + public global::G.CreateEmbedJobResponse8? Type384 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse10? Type385 { get; set; } + public global::G.CreateEmbedJobResponse9? Type385 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse11? Type386 { get; set; } + public global::G.CreateEmbedJobResponse10? Type386 { get; set; } /// /// /// - public global::G.GetEmbedJobResponse12? Type387 { get; set; } + public global::G.CreateEmbedJobResponse11? Type387 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse? Type388 { get; set; } + public global::G.CreateEmbedJobResponse12? Type388 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse2? Type389 { get; set; } + public global::G.CreateEmbedJobResponse13? Type389 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse3? Type390 { get; set; } + public global::G.ListEmbedJobsResponse? Type390 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse4? Type391 { get; set; } + public global::G.ListEmbedJobsResponse2? Type391 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse5? Type392 { get; set; } + public global::G.ListEmbedJobsResponse3? Type392 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse6? Type393 { get; set; } + public global::G.ListEmbedJobsResponse4? Type393 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse7? Type394 { get; set; } + public global::G.ListEmbedJobsResponse5? Type394 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse8? Type395 { get; set; } + public global::G.ListEmbedJobsResponse6? Type395 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse9? Type396 { get; set; } + public global::G.ListEmbedJobsResponse7? Type396 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse10? Type397 { get; set; } + public global::G.ListEmbedJobsResponse8? Type397 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse11? Type398 { get; set; } + public global::G.ListEmbedJobsResponse9? Type398 { get; set; } /// /// /// - public global::G.CancelEmbedJobResponse12? Type399 { get; set; } + public global::G.ListEmbedJobsResponse10? Type399 { get; set; } /// /// /// - public global::G.RerankResponse? Type400 { get; set; } + public global::G.ListEmbedJobsResponse11? Type400 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type401 { get; set; } + public global::G.ListEmbedJobsResponse12? Type401 { get; set; } /// /// /// - public global::G.RerankResponseResult? Type402 { get; set; } + public global::G.GetEmbedJobResponse? Type402 { get; set; } /// /// /// - public global::G.RerankResponseResultDocument? Type403 { get; set; } + public global::G.GetEmbedJobResponse2? Type403 { get; set; } /// /// /// - public global::G.RerankResponse2? Type404 { get; set; } + public global::G.GetEmbedJobResponse3? Type404 { get; set; } /// /// /// - public global::G.RerankResponse3? Type405 { get; set; } + public global::G.GetEmbedJobResponse4? Type405 { get; set; } /// /// /// - public global::G.RerankResponse4? Type406 { get; set; } + public global::G.GetEmbedJobResponse5? Type406 { get; set; } /// /// /// - public global::G.RerankResponse5? Type407 { get; set; } + public global::G.GetEmbedJobResponse6? Type407 { get; set; } /// /// /// - public global::G.RerankResponse6? Type408 { get; set; } + public global::G.GetEmbedJobResponse7? Type408 { get; set; } /// /// /// - public global::G.RerankResponse7? Type409 { get; set; } + public global::G.GetEmbedJobResponse8? Type409 { get; set; } /// /// /// - public global::G.RerankResponse8? Type410 { get; set; } + public global::G.GetEmbedJobResponse9? Type410 { get; set; } /// /// /// - public global::G.RerankResponse9? Type411 { get; set; } + public global::G.GetEmbedJobResponse10? Type411 { get; set; } /// /// /// - public global::G.RerankResponse10? Type412 { get; set; } + public global::G.GetEmbedJobResponse11? Type412 { get; set; } /// /// /// - public global::G.RerankResponse11? Type413 { get; set; } + public global::G.GetEmbedJobResponse12? Type413 { get; set; } /// /// /// - public global::G.RerankResponse12? Type414 { get; set; } + public global::G.CancelEmbedJobResponse? Type414 { get; set; } /// /// /// - public global::G.RerankResponse13? Type415 { get; set; } + public global::G.CancelEmbedJobResponse2? Type415 { get; set; } /// /// /// - public global::G.ClassifyResponse? Type416 { get; set; } + public global::G.CancelEmbedJobResponse3? Type416 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type417 { get; set; } + public global::G.CancelEmbedJobResponse4? Type417 { get; set; } /// /// /// - public global::G.ClassifyResponseClassification? Type418 { get; set; } + public global::G.CancelEmbedJobResponse5? Type418 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type419 { get; set; } + public global::G.CancelEmbedJobResponse6? Type419 { get; set; } /// /// /// - public global::G.ClassifyResponseClassificationLabels? Type420 { get; set; } + public global::G.CancelEmbedJobResponse7? Type420 { get; set; } /// /// /// - public global::G.ClassifyResponseClassificationClassificationType? Type421 { get; set; } + public global::G.CancelEmbedJobResponse8? Type421 { get; set; } /// /// /// - public global::G.ClassifyResponse2? Type422 { get; set; } + public global::G.CancelEmbedJobResponse9? Type422 { get; set; } /// /// /// - public global::G.ClassifyResponse3? Type423 { get; set; } + public global::G.CancelEmbedJobResponse10? Type423 { get; set; } /// /// /// - public global::G.ClassifyResponse4? Type424 { get; set; } + public global::G.CancelEmbedJobResponse11? Type424 { get; set; } /// /// /// - public global::G.ClassifyResponse5? Type425 { get; set; } + public global::G.CancelEmbedJobResponse12? Type425 { get; set; } /// /// /// - public global::G.ClassifyResponse6? Type426 { get; set; } + public global::G.RerankResponse? Type426 { get; set; } /// /// /// - public global::G.ClassifyResponse7? Type427 { get; set; } + public global::System.Collections.Generic.IList? Type427 { get; set; } /// /// /// - public global::G.ClassifyResponse8? Type428 { get; set; } + public global::G.RerankResponseResult? Type428 { get; set; } /// /// /// - public global::G.ClassifyResponse9? Type429 { get; set; } + public global::G.RerankResponseResultDocument? Type429 { get; set; } /// /// /// - public global::G.ClassifyResponse10? Type430 { get; set; } + public global::G.RerankResponse2? Type430 { get; set; } /// /// /// - public global::G.ClassifyResponse11? Type431 { get; set; } + public global::G.RerankResponse3? Type431 { get; set; } /// /// /// - public global::G.ClassifyResponse12? Type432 { get; set; } + public global::G.RerankResponse4? Type432 { get; set; } /// /// /// - public global::G.ClassifyResponse13? Type433 { get; set; } + public global::G.RerankResponse5? Type433 { get; set; } /// /// /// - public global::G.CreateDatasetResponse? Type434 { get; set; } + public global::G.RerankResponse6? Type434 { get; set; } /// /// /// - public global::G.CreateDatasetResponse2? Type435 { get; set; } + public global::G.RerankResponse7? Type435 { get; set; } /// /// /// - public global::G.CreateDatasetResponse3? Type436 { get; set; } + public global::G.RerankResponse8? Type436 { get; set; } /// /// /// - public global::G.CreateDatasetResponse4? Type437 { get; set; } + public global::G.RerankResponse9? Type437 { get; set; } /// /// /// - public global::G.CreateDatasetResponse5? Type438 { get; set; } + public global::G.RerankResponse10? Type438 { get; set; } /// /// /// - public global::G.CreateDatasetResponse6? Type439 { get; set; } + public global::G.RerankResponse11? Type439 { get; set; } /// /// /// - public global::G.CreateDatasetResponse7? Type440 { get; set; } + public global::G.RerankResponse12? Type440 { get; set; } /// /// /// - public global::G.CreateDatasetResponse8? Type441 { get; set; } + public global::G.RerankResponse13? Type441 { get; set; } /// /// /// - public global::G.CreateDatasetResponse9? Type442 { get; set; } + public global::G.Rerankv2Response? Type442 { get; set; } /// /// /// - public global::G.CreateDatasetResponse10? Type443 { get; set; } + public global::System.Collections.Generic.IList? Type443 { get; set; } /// /// /// - public global::G.CreateDatasetResponse11? Type444 { get; set; } + public global::G.Rerankv2ResponseResult? Type444 { get; set; } /// /// /// - public global::G.CreateDatasetResponse12? Type445 { get; set; } + public global::G.Rerankv2ResponseResultDocument? Type445 { get; set; } /// /// /// - public global::G.CreateDatasetResponse13? Type446 { get; set; } + public global::G.Rerankv2Response2? Type446 { get; set; } /// /// /// - public global::G.ListDatasetsResponse? Type447 { get; set; } + public global::G.Rerankv2Response3? Type447 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type448 { get; set; } + public global::G.Rerankv2Response4? Type448 { get; set; } /// /// /// - public global::G.ListDatasetsResponse2? Type449 { get; set; } + public global::G.Rerankv2Response5? Type449 { get; set; } /// /// /// - public global::G.ListDatasetsResponse3? Type450 { get; set; } + public global::G.Rerankv2Response6? Type450 { get; set; } /// /// /// - public global::G.ListDatasetsResponse4? Type451 { get; set; } + public global::G.Rerankv2Response7? Type451 { get; set; } /// /// /// - public global::G.ListDatasetsResponse5? Type452 { get; set; } + public global::G.Rerankv2Response8? Type452 { get; set; } /// /// /// - public global::G.ListDatasetsResponse6? Type453 { get; set; } + public global::G.Rerankv2Response9? Type453 { get; set; } /// /// /// - public global::G.ListDatasetsResponse7? Type454 { get; set; } + public global::G.Rerankv2Response10? Type454 { get; set; } /// /// /// - public global::G.ListDatasetsResponse8? Type455 { get; set; } + public global::G.Rerankv2Response11? Type455 { get; set; } /// /// /// - public global::G.ListDatasetsResponse9? Type456 { get; set; } + public global::G.Rerankv2Response12? Type456 { get; set; } /// /// /// - public global::G.ListDatasetsResponse10? Type457 { get; set; } + public global::G.Rerankv2Response13? Type457 { get; set; } /// /// /// - public global::G.ListDatasetsResponse11? Type458 { get; set; } + public global::G.ClassifyResponse? Type458 { get; set; } /// /// /// - public global::G.ListDatasetsResponse12? Type459 { get; set; } + public global::System.Collections.Generic.IList? Type459 { get; set; } /// /// /// - public global::G.ListDatasetsResponse13? Type460 { get; set; } + public global::G.ClassifyResponseClassification? Type460 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse? Type461 { get; set; } + public global::System.Collections.Generic.IList? Type461 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse2? Type462 { get; set; } + public global::G.ClassifyResponseClassificationLabels? Type462 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse3? Type463 { get; set; } + public global::G.ClassifyResponseClassificationClassificationType? Type463 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse4? Type464 { get; set; } + public global::G.ClassifyResponse2? Type464 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse5? Type465 { get; set; } + public global::G.ClassifyResponse3? Type465 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse6? Type466 { get; set; } + public global::G.ClassifyResponse4? Type466 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse7? Type467 { get; set; } + public global::G.ClassifyResponse5? Type467 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse8? Type468 { get; set; } + public global::G.ClassifyResponse6? Type468 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse9? Type469 { get; set; } + public global::G.ClassifyResponse7? Type469 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse10? Type470 { get; set; } + public global::G.ClassifyResponse8? Type470 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse11? Type471 { get; set; } + public global::G.ClassifyResponse9? Type471 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse12? Type472 { get; set; } + public global::G.ClassifyResponse10? Type472 { get; set; } /// /// /// - public global::G.GetDatasetUsageResponse13? Type473 { get; set; } + public global::G.ClassifyResponse11? Type473 { get; set; } /// /// /// - public global::G.GetDatasetResponse? Type474 { get; set; } + public global::G.ClassifyResponse12? Type474 { get; set; } /// /// /// - public global::G.GetDatasetResponse2? Type475 { get; set; } + public global::G.ClassifyResponse13? Type475 { get; set; } /// /// /// - public global::G.GetDatasetResponse3? Type476 { get; set; } + public global::G.CreateDatasetResponse? Type476 { get; set; } /// /// /// - public global::G.GetDatasetResponse4? Type477 { get; set; } + public global::G.CreateDatasetResponse2? Type477 { get; set; } /// /// /// - public global::G.GetDatasetResponse5? Type478 { get; set; } + public global::G.CreateDatasetResponse3? Type478 { get; set; } /// /// /// - public global::G.GetDatasetResponse6? Type479 { get; set; } + public global::G.CreateDatasetResponse4? Type479 { get; set; } /// /// /// - public global::G.GetDatasetResponse7? Type480 { get; set; } + public global::G.CreateDatasetResponse5? Type480 { get; set; } /// /// /// - public global::G.GetDatasetResponse8? Type481 { get; set; } + public global::G.CreateDatasetResponse6? Type481 { get; set; } /// /// /// - public global::G.GetDatasetResponse9? Type482 { get; set; } + public global::G.CreateDatasetResponse7? Type482 { get; set; } /// /// /// - public global::G.GetDatasetResponse10? Type483 { get; set; } + public global::G.CreateDatasetResponse8? Type483 { get; set; } /// /// /// - public global::G.GetDatasetResponse11? Type484 { get; set; } + public global::G.CreateDatasetResponse9? Type484 { get; set; } /// /// /// - public global::G.GetDatasetResponse12? Type485 { get; set; } + public global::G.CreateDatasetResponse10? Type485 { get; set; } /// /// /// - public global::G.GetDatasetResponse13? Type486 { get; set; } + public global::G.CreateDatasetResponse11? Type486 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse? Type487 { get; set; } + public global::G.CreateDatasetResponse12? Type487 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse2? Type488 { get; set; } + public global::G.CreateDatasetResponse13? Type488 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse3? Type489 { get; set; } + public global::G.ListDatasetsResponse? Type489 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse4? Type490 { get; set; } + public global::System.Collections.Generic.IList? Type490 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse5? Type491 { get; set; } + public global::G.ListDatasetsResponse2? Type491 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse6? Type492 { get; set; } + public global::G.ListDatasetsResponse3? Type492 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse7? Type493 { get; set; } + public global::G.ListDatasetsResponse4? Type493 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse8? Type494 { get; set; } + public global::G.ListDatasetsResponse5? Type494 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse9? Type495 { get; set; } + public global::G.ListDatasetsResponse6? Type495 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse10? Type496 { get; set; } + public global::G.ListDatasetsResponse7? Type496 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse11? Type497 { get; set; } + public global::G.ListDatasetsResponse8? Type497 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse12? Type498 { get; set; } + public global::G.ListDatasetsResponse9? Type498 { get; set; } /// /// /// - public global::G.DeleteDatasetResponse13? Type499 { get; set; } + public global::G.ListDatasetsResponse10? Type499 { get; set; } /// /// /// - public global::G.SummarizeResponse? Type500 { get; set; } + public global::G.ListDatasetsResponse11? Type500 { get; set; } /// /// /// - public global::G.SummarizeResponse2? Type501 { get; set; } + public global::G.ListDatasetsResponse12? Type501 { get; set; } /// /// /// - public global::G.SummarizeResponse3? Type502 { get; set; } + public global::G.ListDatasetsResponse13? Type502 { get; set; } /// /// /// - public global::G.SummarizeResponse4? Type503 { get; set; } + public global::G.GetDatasetUsageResponse? Type503 { get; set; } /// /// /// - public global::G.SummarizeResponse5? Type504 { get; set; } + public global::G.GetDatasetUsageResponse2? Type504 { get; set; } /// /// /// - public global::G.SummarizeResponse6? Type505 { get; set; } + public global::G.GetDatasetUsageResponse3? Type505 { get; set; } /// /// /// - public global::G.SummarizeResponse7? Type506 { get; set; } + public global::G.GetDatasetUsageResponse4? Type506 { get; set; } /// /// /// - public global::G.SummarizeResponse8? Type507 { get; set; } + public global::G.GetDatasetUsageResponse5? Type507 { get; set; } /// /// /// - public global::G.SummarizeResponse9? Type508 { get; set; } + public global::G.GetDatasetUsageResponse6? Type508 { get; set; } /// /// /// - public global::G.SummarizeResponse10? Type509 { get; set; } + public global::G.GetDatasetUsageResponse7? Type509 { get; set; } /// /// /// - public global::G.SummarizeResponse11? Type510 { get; set; } + public global::G.GetDatasetUsageResponse8? Type510 { get; set; } /// /// /// - public global::G.SummarizeResponse12? Type511 { get; set; } + public global::G.GetDatasetUsageResponse9? Type511 { get; set; } /// /// /// - public global::G.SummarizeResponse13? Type512 { get; set; } + public global::G.GetDatasetUsageResponse10? Type512 { get; set; } /// /// /// - public global::G.TokenizeResponse? Type513 { get; set; } + public global::G.GetDatasetUsageResponse11? Type513 { get; set; } /// /// /// - public global::G.TokenizeResponse2? Type514 { get; set; } + public global::G.GetDatasetUsageResponse12? Type514 { get; set; } /// /// /// - public global::G.TokenizeResponse3? Type515 { get; set; } + public global::G.GetDatasetUsageResponse13? Type515 { get; set; } /// /// /// - public global::G.TokenizeResponse4? Type516 { get; set; } + public global::G.GetDatasetResponse? Type516 { get; set; } /// /// /// - public global::G.TokenizeResponse5? Type517 { get; set; } + public global::G.GetDatasetResponse2? Type517 { get; set; } /// /// /// - public global::G.TokenizeResponse6? Type518 { get; set; } + public global::G.GetDatasetResponse3? Type518 { get; set; } /// /// /// - public global::G.TokenizeResponse7? Type519 { get; set; } + public global::G.GetDatasetResponse4? Type519 { get; set; } /// /// /// - public global::G.TokenizeResponse8? Type520 { get; set; } + public global::G.GetDatasetResponse5? Type520 { get; set; } /// /// /// - public global::G.TokenizeResponse9? Type521 { get; set; } + public global::G.GetDatasetResponse6? Type521 { get; set; } /// /// /// - public global::G.TokenizeResponse10? Type522 { get; set; } + public global::G.GetDatasetResponse7? Type522 { get; set; } /// /// /// - public global::G.TokenizeResponse11? Type523 { get; set; } + public global::G.GetDatasetResponse8? Type523 { get; set; } /// /// /// - public global::G.TokenizeResponse12? Type524 { get; set; } + public global::G.GetDatasetResponse9? Type524 { get; set; } /// /// /// - public global::G.TokenizeResponse13? Type525 { get; set; } + public global::G.GetDatasetResponse10? Type525 { get; set; } /// /// /// - public global::G.DetokenizeResponse? Type526 { get; set; } + public global::G.GetDatasetResponse11? Type526 { get; set; } /// /// /// - public global::G.DetokenizeResponse2? Type527 { get; set; } + public global::G.GetDatasetResponse12? Type527 { get; set; } /// /// /// - public global::G.DetokenizeResponse3? Type528 { get; set; } + public global::G.GetDatasetResponse13? Type528 { get; set; } /// /// /// - public global::G.DetokenizeResponse4? Type529 { get; set; } + public global::G.DeleteDatasetResponse? Type529 { get; set; } /// /// /// - public global::G.DetokenizeResponse5? Type530 { get; set; } + public global::G.DeleteDatasetResponse2? Type530 { get; set; } /// /// /// - public global::G.DetokenizeResponse6? Type531 { get; set; } + public global::G.DeleteDatasetResponse3? Type531 { get; set; } /// /// /// - public global::G.DetokenizeResponse7? Type532 { get; set; } + public global::G.DeleteDatasetResponse4? Type532 { get; set; } /// /// /// - public global::G.DetokenizeResponse8? Type533 { get; set; } + public global::G.DeleteDatasetResponse5? Type533 { get; set; } /// /// /// - public global::G.DetokenizeResponse9? Type534 { get; set; } + public global::G.DeleteDatasetResponse6? Type534 { get; set; } /// /// /// - public global::G.DetokenizeResponse10? Type535 { get; set; } + public global::G.DeleteDatasetResponse7? Type535 { get; set; } /// /// /// - public global::G.DetokenizeResponse11? Type536 { get; set; } + public global::G.DeleteDatasetResponse8? Type536 { get; set; } /// /// /// - public global::G.DetokenizeResponse12? Type537 { get; set; } + public global::G.DeleteDatasetResponse9? Type537 { get; set; } /// /// /// - public global::G.DetokenizeResponse13? Type538 { get; set; } + public global::G.DeleteDatasetResponse10? Type538 { get; set; } /// /// /// - public global::G.ListConnectorsResponse2? Type539 { get; set; } + public global::G.DeleteDatasetResponse11? Type539 { get; set; } /// /// /// - public global::G.ListConnectorsResponse3? Type540 { get; set; } + public global::G.DeleteDatasetResponse12? Type540 { get; set; } /// /// /// - public global::G.ListConnectorsResponse4? Type541 { get; set; } + public global::G.DeleteDatasetResponse13? Type541 { get; set; } /// /// /// - public global::G.ListConnectorsResponse5? Type542 { get; set; } + public global::G.SummarizeResponse? Type542 { get; set; } /// /// /// - public global::G.ListConnectorsResponse6? Type543 { get; set; } + public global::G.SummarizeResponse2? Type543 { get; set; } /// /// /// - public global::G.ListConnectorsResponse7? Type544 { get; set; } + public global::G.SummarizeResponse3? Type544 { get; set; } /// /// /// - public global::G.ListConnectorsResponse8? Type545 { get; set; } + public global::G.SummarizeResponse4? Type545 { get; set; } /// /// /// - public global::G.ListConnectorsResponse9? Type546 { get; set; } + public global::G.SummarizeResponse5? Type546 { get; set; } /// /// /// - public global::G.ListConnectorsResponse10? Type547 { get; set; } + public global::G.SummarizeResponse6? Type547 { get; set; } /// /// /// - public global::G.ListConnectorsResponse11? Type548 { get; set; } + public global::G.SummarizeResponse7? Type548 { get; set; } /// /// /// - public global::G.ListConnectorsResponse12? Type549 { get; set; } + public global::G.SummarizeResponse8? Type549 { get; set; } /// /// /// - public global::G.ListConnectorsResponse13? Type550 { get; set; } + public global::G.SummarizeResponse9? Type550 { get; set; } /// /// /// - public global::G.CreateConnectorResponse2? Type551 { get; set; } + public global::G.SummarizeResponse10? Type551 { get; set; } /// /// /// - public global::G.CreateConnectorResponse3? Type552 { get; set; } + public global::G.SummarizeResponse11? Type552 { get; set; } /// /// /// - public global::G.CreateConnectorResponse4? Type553 { get; set; } + public global::G.SummarizeResponse12? Type553 { get; set; } /// /// /// - public global::G.CreateConnectorResponse5? Type554 { get; set; } + public global::G.SummarizeResponse13? Type554 { get; set; } /// /// /// - public global::G.CreateConnectorResponse6? Type555 { get; set; } + public global::G.TokenizeResponse? Type555 { get; set; } /// /// /// - public global::G.CreateConnectorResponse7? Type556 { get; set; } + public global::G.TokenizeResponse2? Type556 { get; set; } /// /// /// - public global::G.CreateConnectorResponse8? Type557 { get; set; } + public global::G.TokenizeResponse3? Type557 { get; set; } /// /// /// - public global::G.CreateConnectorResponse9? Type558 { get; set; } + public global::G.TokenizeResponse4? Type558 { get; set; } /// /// /// - public global::G.CreateConnectorResponse10? Type559 { get; set; } + public global::G.TokenizeResponse5? Type559 { get; set; } /// /// /// - public global::G.CreateConnectorResponse11? Type560 { get; set; } + public global::G.TokenizeResponse6? Type560 { get; set; } /// /// /// - public global::G.CreateConnectorResponse12? Type561 { get; set; } + public global::G.TokenizeResponse7? Type561 { get; set; } /// /// /// - public global::G.CreateConnectorResponse13? Type562 { get; set; } + public global::G.TokenizeResponse8? Type562 { get; set; } /// /// /// - public global::G.GetConnectorResponse2? Type563 { get; set; } + public global::G.TokenizeResponse9? Type563 { get; set; } /// /// /// - public global::G.GetConnectorResponse3? Type564 { get; set; } + public global::G.TokenizeResponse10? Type564 { get; set; } /// /// /// - public global::G.GetConnectorResponse4? Type565 { get; set; } + public global::G.TokenizeResponse11? Type565 { get; set; } /// /// /// - public global::G.GetConnectorResponse5? Type566 { get; set; } + public global::G.TokenizeResponse12? Type566 { get; set; } /// /// /// - public global::G.GetConnectorResponse6? Type567 { get; set; } + public global::G.TokenizeResponse13? Type567 { get; set; } /// /// /// - public global::G.GetConnectorResponse7? Type568 { get; set; } + public global::G.DetokenizeResponse? Type568 { get; set; } /// /// /// - public global::G.GetConnectorResponse8? Type569 { get; set; } + public global::G.DetokenizeResponse2? Type569 { get; set; } /// /// /// - public global::G.GetConnectorResponse9? Type570 { get; set; } + public global::G.DetokenizeResponse3? Type570 { get; set; } /// /// /// - public global::G.GetConnectorResponse10? Type571 { get; set; } + public global::G.DetokenizeResponse4? Type571 { get; set; } /// /// /// - public global::G.GetConnectorResponse11? Type572 { get; set; } + public global::G.DetokenizeResponse5? Type572 { get; set; } /// /// /// - public global::G.GetConnectorResponse12? Type573 { get; set; } + public global::G.DetokenizeResponse6? Type573 { get; set; } /// /// /// - public global::G.GetConnectorResponse13? Type574 { get; set; } + public global::G.DetokenizeResponse7? Type574 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse2? Type575 { get; set; } + public global::G.DetokenizeResponse8? Type575 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse3? Type576 { get; set; } + public global::G.DetokenizeResponse9? Type576 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse4? Type577 { get; set; } + public global::G.DetokenizeResponse10? Type577 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse5? Type578 { get; set; } + public global::G.DetokenizeResponse11? Type578 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse6? Type579 { get; set; } + public global::G.DetokenizeResponse12? Type579 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse7? Type580 { get; set; } + public global::G.DetokenizeResponse13? Type580 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse8? Type581 { get; set; } + public global::G.ListConnectorsResponse2? Type581 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse9? Type582 { get; set; } + public global::G.ListConnectorsResponse3? Type582 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse10? Type583 { get; set; } + public global::G.ListConnectorsResponse4? Type583 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse11? Type584 { get; set; } + public global::G.ListConnectorsResponse5? Type584 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse12? Type585 { get; set; } + public global::G.ListConnectorsResponse6? Type585 { get; set; } /// /// /// - public global::G.UpdateConnectorResponse13? Type586 { get; set; } + public global::G.ListConnectorsResponse7? Type586 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse2? Type587 { get; set; } + public global::G.ListConnectorsResponse8? Type587 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse3? Type588 { get; set; } + public global::G.ListConnectorsResponse9? Type588 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse4? Type589 { get; set; } + public global::G.ListConnectorsResponse10? Type589 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse5? Type590 { get; set; } + public global::G.ListConnectorsResponse11? Type590 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse6? Type591 { get; set; } + public global::G.ListConnectorsResponse12? Type591 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse7? Type592 { get; set; } + public global::G.ListConnectorsResponse13? Type592 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse8? Type593 { get; set; } + public global::G.CreateConnectorResponse2? Type593 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse9? Type594 { get; set; } + public global::G.CreateConnectorResponse3? Type594 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse10? Type595 { get; set; } + public global::G.CreateConnectorResponse4? Type595 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse11? Type596 { get; set; } + public global::G.CreateConnectorResponse5? Type596 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse12? Type597 { get; set; } + public global::G.CreateConnectorResponse6? Type597 { get; set; } /// /// /// - public global::G.DeleteConnectorResponse13? Type598 { get; set; } + public global::G.CreateConnectorResponse7? Type598 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse? Type599 { get; set; } + public global::G.CreateConnectorResponse8? Type599 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse2? Type600 { get; set; } + public global::G.CreateConnectorResponse9? Type600 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse3? Type601 { get; set; } + public global::G.CreateConnectorResponse10? Type601 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse4? Type602 { get; set; } + public global::G.CreateConnectorResponse11? Type602 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse5? Type603 { get; set; } + public global::G.CreateConnectorResponse12? Type603 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse6? Type604 { get; set; } + public global::G.CreateConnectorResponse13? Type604 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse7? Type605 { get; set; } + public global::G.GetConnectorResponse2? Type605 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse8? Type606 { get; set; } + public global::G.GetConnectorResponse3? Type606 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse9? Type607 { get; set; } + public global::G.GetConnectorResponse4? Type607 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse10? Type608 { get; set; } + public global::G.GetConnectorResponse5? Type608 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse11? Type609 { get; set; } + public global::G.GetConnectorResponse6? Type609 { get; set; } /// /// /// - public global::G.OAuthAuthorizeConnectorResponse12? Type610 { get; set; } + public global::G.GetConnectorResponse7? Type610 { get; set; } /// /// /// - public global::G.GetModelResponse2? Type611 { get; set; } + public global::G.GetConnectorResponse8? Type611 { get; set; } /// /// /// - public global::G.GetModelResponse3? Type612 { get; set; } + public global::G.GetConnectorResponse9? Type612 { get; set; } /// /// /// - public global::G.GetModelResponse4? Type613 { get; set; } + public global::G.GetConnectorResponse10? Type613 { get; set; } /// /// /// - public global::G.GetModelResponse5? Type614 { get; set; } + public global::G.GetConnectorResponse11? Type614 { get; set; } /// /// /// - public global::G.GetModelResponse6? Type615 { get; set; } + public global::G.GetConnectorResponse12? Type615 { get; set; } /// /// /// - public global::G.GetModelResponse7? Type616 { get; set; } + public global::G.GetConnectorResponse13? Type616 { get; set; } /// /// /// - public global::G.GetModelResponse8? Type617 { get; set; } + public global::G.UpdateConnectorResponse2? Type617 { get; set; } /// /// /// - public global::G.GetModelResponse9? Type618 { get; set; } + public global::G.UpdateConnectorResponse3? Type618 { get; set; } /// /// /// - public global::G.GetModelResponse10? Type619 { get; set; } + public global::G.UpdateConnectorResponse4? Type619 { get; set; } /// /// /// - public global::G.GetModelResponse11? Type620 { get; set; } + public global::G.UpdateConnectorResponse5? Type620 { get; set; } /// /// /// - public global::G.GetModelResponse12? Type621 { get; set; } + public global::G.UpdateConnectorResponse6? Type621 { get; set; } /// /// /// - public global::G.GetModelResponse13? Type622 { get; set; } + public global::G.UpdateConnectorResponse7? Type622 { get; set; } /// /// /// - public global::G.ListModelsResponse2? Type623 { get; set; } + public global::G.UpdateConnectorResponse8? Type623 { get; set; } /// /// /// - public global::G.ListModelsResponse3? Type624 { get; set; } + public global::G.UpdateConnectorResponse9? Type624 { get; set; } /// /// /// - public global::G.ListModelsResponse4? Type625 { get; set; } + public global::G.UpdateConnectorResponse10? Type625 { get; set; } /// /// /// - public global::G.ListModelsResponse5? Type626 { get; set; } + public global::G.UpdateConnectorResponse11? Type626 { get; set; } /// /// /// - public global::G.ListModelsResponse6? Type627 { get; set; } + public global::G.UpdateConnectorResponse12? Type627 { get; set; } /// /// /// - public global::G.ListModelsResponse7? Type628 { get; set; } + public global::G.UpdateConnectorResponse13? Type628 { get; set; } /// /// /// - public global::G.ListModelsResponse8? Type629 { get; set; } + public global::G.DeleteConnectorResponse2? Type629 { get; set; } /// /// /// - public global::G.ListModelsResponse9? Type630 { get; set; } + public global::G.DeleteConnectorResponse3? Type630 { get; set; } /// /// /// - public global::G.ListModelsResponse10? Type631 { get; set; } + public global::G.DeleteConnectorResponse4? Type631 { get; set; } /// /// /// - public global::G.ListModelsResponse11? Type632 { get; set; } + public global::G.DeleteConnectorResponse5? Type632 { get; set; } /// /// /// - public global::G.ListModelsResponse12? Type633 { get; set; } + public global::G.DeleteConnectorResponse6? Type633 { get; set; } /// /// /// - public global::G.ListModelsResponse13? Type634 { get; set; } + public global::G.DeleteConnectorResponse7? Type634 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse? Type635 { get; set; } + public global::G.DeleteConnectorResponse8? Type635 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse2? Type636 { get; set; } + public global::G.DeleteConnectorResponse9? Type636 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse3? Type637 { get; set; } + public global::G.DeleteConnectorResponse10? Type637 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse4? Type638 { get; set; } + public global::G.DeleteConnectorResponse11? Type638 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse5? Type639 { get; set; } + public global::G.DeleteConnectorResponse12? Type639 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse6? Type640 { get; set; } + public global::G.DeleteConnectorResponse13? Type640 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse7? Type641 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse? Type641 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse8? Type642 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse2? Type642 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse9? Type643 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse3? Type643 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse10? Type644 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse4? Type644 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse11? Type645 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse5? Type645 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse12? Type646 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse6? Type646 { get; set; } /// /// /// - public global::G.CheckAPIKeyResponse13? Type647 { get; set; } + public global::G.OAuthAuthorizeConnectorResponse7? Type647 { get; set; } + /// + /// + /// + public global::G.OAuthAuthorizeConnectorResponse8? Type648 { get; set; } + /// + /// + /// + public global::G.OAuthAuthorizeConnectorResponse9? Type649 { get; set; } + /// + /// + /// + public global::G.OAuthAuthorizeConnectorResponse10? Type650 { get; set; } + /// + /// + /// + public global::G.OAuthAuthorizeConnectorResponse11? Type651 { get; set; } + /// + /// + /// + public global::G.OAuthAuthorizeConnectorResponse12? Type652 { get; set; } + /// + /// + /// + public global::G.GetModelResponse2? Type653 { get; set; } + /// + /// + /// + public global::G.GetModelResponse3? Type654 { get; set; } + /// + /// + /// + public global::G.GetModelResponse4? Type655 { get; set; } + /// + /// + /// + public global::G.GetModelResponse5? Type656 { get; set; } + /// + /// + /// + public global::G.GetModelResponse6? Type657 { get; set; } + /// + /// + /// + public global::G.GetModelResponse7? Type658 { get; set; } + /// + /// + /// + public global::G.GetModelResponse8? Type659 { get; set; } + /// + /// + /// + public global::G.GetModelResponse9? Type660 { get; set; } + /// + /// + /// + public global::G.GetModelResponse10? Type661 { get; set; } + /// + /// + /// + public global::G.GetModelResponse11? Type662 { get; set; } + /// + /// + /// + public global::G.GetModelResponse12? Type663 { get; set; } + /// + /// + /// + public global::G.GetModelResponse13? Type664 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse2? Type665 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse3? Type666 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse4? Type667 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse5? Type668 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse6? Type669 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse7? Type670 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse8? Type671 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse9? Type672 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse10? Type673 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse11? Type674 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse12? Type675 { get; set; } + /// + /// + /// + public global::G.ListModelsResponse13? Type676 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse? Type677 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse2? Type678 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse3? Type679 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse4? Type680 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse5? Type681 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse6? Type682 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse7? Type683 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse8? Type684 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse9? Type685 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse10? Type686 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse11? Type687 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse12? Type688 { get; set; } + /// + /// + /// + public global::G.CheckAPIKeyResponse13? Type689 { get; set; } } } \ No newline at end of file diff --git a/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/ResolvedSchemas/_.verified.txt b/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/ResolvedSchemas/_.verified.txt index ef58db4bac..0b55c79721 100644 --- a/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/ResolvedSchemas/_.verified.txt +++ b/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/ResolvedSchemas/_.verified.txt @@ -158,12 +158,10 @@ ContentVariant1(string)[], ContentVariant2(array)[], Content(ref)[], - Documents(array)[], - ChatDocument(ref)[], - ToolCall2(class)[], + ToolCallV2(class)[], Id(string)[], - ToolCall2Type(enum)[], - ToolCall2Function(class)[], + ToolCallV2Type(enum)[], + ToolCallV2Function(class)[], Name(string)[], Arguments(string)[], ToolSource(class)[], @@ -184,7 +182,7 @@ AssistantMessage(class)[], AssistantMessageRole(enum)[], ToolCalls(array)[], - ToolCall2(ref)[], + ToolCallV2(ref)[], ToolPlan(string)[], Content3(oneOf)[], ContentVariant1(string)[], @@ -200,39 +198,51 @@ ContentVariant2(array)[], ContentVariant2Item2(oneOf)[], TextContent(ref)[], - ToolContent(class)[], - ToolContentType(enum)[], - ToolContentOutput(class)[], - ToolMessage2(class)[], - ToolMessage2Role(enum)[], + Document(class)[], + DocumentData(class)[], + Id(string)[], + DocumentContent(class)[], + DocumentContentType(enum)[], + Document(ref)[], + ToolContent(oneOf)[], + TextContent(ref)[], + DocumentContent(ref)[], + ToolMessageV2(class)[], + ToolMessageV2Role(enum)[], ToolCallId(string)[], - ToolContent(array)[], - ToolContentItem(oneOf)[], + ToolContent2(oneOf)[], + ToolContentVariant1(string)[], + ToolContentVariant2(array)[], ToolContent(ref)[], - ChatMessage2(oneOf)[], + ChatMessageV2(oneOf)[], UserMessage(ref)[], AssistantMessage(ref)[], SystemMessage(ref)[], - ToolMessage2(ref)[], + ToolMessageV2(ref)[], ChatMessages(array)[], - ChatMessage2(ref)[], - Tool2(class)[], - Tool2Type(enum)[], - Tool2Function(class)[], + ChatMessageV2(ref)[], + ToolV2(class)[], + ToolV2Type(enum)[], + ToolV2Function(class)[], Name(string)[], Description(string)[], - Tool2FunctionParameters(class)[], - JSONResponseFormat2(class)[], - ResponseFormatType(ref)[], - JSONResponseFormat2JsonSchema(class)[], - ResponseFormat2(oneOf)[], - TextResponseFormat(ref)[], - JSONResponseFormat2(ref)[], + ToolV2FunctionParameters(class)[], + CitationOptions(class)[], + CitationOptionsMode(enum)[], + ResponseFormatTypeV2(enum)[], + TextResponseFormatV2(class)[], + ResponseFormatTypeV2(ref)[], + JsonResponseFormatV2(class)[], + ResponseFormatTypeV2(ref)[], + JsonResponseFormatV2JsonSchema(class)[], + ResponseFormatV2(oneOf)[], + TextResponseFormatV2(ref)[], + JsonResponseFormatV2(ref)[], ChatFinishReason(enum)[], AssistantMessageResponse(class)[], AssistantMessageResponseRole(enum)[], ToolCalls(array)[], - ToolCall2(ref)[], + ToolCallV2(ref)[], ToolPlan(string)[], Content(array)[], ContentItem(oneOf)[], @@ -248,7 +258,7 @@ UsageTokens(class)[], InputTokens(double)[], OutputTokens(double)[], - NonStreamedChatResponse2(class)[], + ChatResponse(class)[], Id(string)[], ChatFinishReason(ref)[], AssistantMessageResponse(ref)[], @@ -329,7 +339,7 @@ ChatMessageEndEventVariant2Delta(class)[], ChatFinishReason(ref)[], Usage(ref)[], - StreamedChatResponse2(oneOf)[], + StreamedChatResponseV2(oneOf)[], ChatMessageStartEvent(ref)[], ChatContentStartEvent(ref)[], ChatContentDeltaEvent(ref)[], @@ -677,12 +687,16 @@ Version(string)[/finetuning], BaseType(ref)[/finetuning], Strategy(ref)[/finetuning], + LoraTargetModules(enum)[/finetuning], Hyperparameters(class)[/finetuning], EarlyStoppingPatience(int)[/finetuning], EarlyStoppingThreshold(double)[/finetuning], TrainBatchSize(int)[/finetuning], TrainEpochs(int)[/finetuning], LearningRate(double)[/finetuning], + LoraAlpha(int)[/finetuning], + LoraRank(int)[/finetuning], + LoraTargetModules(ref)[/finetuning], WandbConfig(class)[/finetuning], Project(string)[/finetuning], ApiKey(string)[/finetuning], @@ -767,13 +781,19 @@ ToolResult(ref)[], ForceSingleStep(bool)[], ResponseFormat(ref)[], + ChatRequestSafetyMode(enum)[], Chatv2Request(class)[], Model(string)[], ChatMessages(ref)[], Tools(array)[], - Tool2(ref)[], - Chatv2RequestCitationMode(enum)[], - ResponseFormat2(ref)[], + ToolV2(ref)[], + Documents(array)[], + DocumentsItem(oneOf)[], + DocumentsItemVariant1(string)[], + Document(ref)[], + CitationOptions(ref)[], + ResponseFormatV2(ref)[], + Chatv2RequestSafetyMode(enum)[], MaxTokens(int)[], StopSequences(array)[], StopSequencesItem(string)[], @@ -811,12 +831,32 @@ EmbeddingTypes(array)[], EmbeddingType(ref)[], EmbedRequestTruncate(enum)[], + Embedv2Request(class)[], + Texts(array)[], + TextsItem(string)[], + Model(string)[], + EmbedInputType(ref)[], + EmbeddingTypes(array)[], + EmbeddingType(ref)[], + Embedv2RequestTruncate(enum)[], CreateEmbedJobRequest(ref)[/embed-jobs], RerankRequest(class)[], Model(string)[], Query(string)[], Documents(array)[], - DocumentsItem(oneOf)[], + DocumentsItem2(oneOf)[], + DocumentsItemVariant1(string)[], + RerankDocument(ref)[], + TopN(int)[], + RankFields(array)[], + RankFieldsItem(string)[], + ReturnDocuments(bool)[], + MaxChunksPerDoc(int)[], + Rerankv2Request(class)[], + Model(string)[], + Query(string)[], + Documents(array)[], + DocumentsItem3(oneOf)[], DocumentsItemVariant1(string)[], RerankDocument(ref)[], TopN(int)[], @@ -864,8 +904,10 @@ CompletedAt(DateTime)[/finetuning], LastUsed(DateTime)[/finetuning], ChatXClientName(string)[], + ChatAccepts(enum)[], GenerateXClientName(string)[], EmbedXClientName(string)[], + Embedv2XClientName(string)[], CreateEmbedJobXClientName(string)[/embed-jobs], ListEmbedJobsXClientName(string)[/embed-jobs], GetEmbedJobId(string)[/embed-jobs], @@ -873,6 +915,7 @@ CancelEmbedJobId(string)[/embed-jobs], CancelEmbedJobXClientName(string)[/embed-jobs], RerankXClientName(string)[], + Rerankv2XClientName(string)[], ClassifyXClientName(string)[], CreateDatasetName(string)[/datasets], DatasetType(ref)[/datasets], @@ -940,11 +983,9 @@ ListTrainingStepMetricsPageSize(int)[/finetuning], ListTrainingStepMetricsPageToken(string)[/finetuning], ListTrainingStepMetricsXClientName(string)[/finetuning], - ChatResponse(oneOf)[], + ChatResponse2(oneOf)[], NonStreamedChatResponse(ref)[], StreamedChatResponse(ref)[], - ChatResponse2(class)[], - Data(string)[], ChatResponse3(class)[], Data(string)[], ChatResponse4(class)[], @@ -967,9 +1008,11 @@ Data(string)[], ChatResponse13(class)[], Data(string)[], + ChatResponse14(class)[], + Data(string)[], Chatv2Response(oneOf)[], - NonStreamedChatResponse2(ref)[], - StreamedChatResponse2(ref)[], + ChatResponse(ref)[], + StreamedChatResponseV2(ref)[], Chatv2Response2(class)[], Data(string)[], Chatv2Response3(class)[], @@ -1047,6 +1090,31 @@ Data(string)[], EmbedResponse13(class)[], Data(string)[], + EmbedByTypeResponse(ref)[], + Embedv2Response(class)[], + Data(string)[], + Embedv2Response2(class)[], + Data(string)[], + Embedv2Response3(class)[], + Data(string)[], + Embedv2Response4(class)[], + Data(string)[], + Embedv2Response5(class)[], + Data(string)[], + Embedv2Response6(class)[], + Data(string)[], + Embedv2Response7(class)[], + Data(string)[], + Embedv2Response8(class)[], + Data(string)[], + Embedv2Response9(class)[], + Data(string)[], + Embedv2Response10(class)[], + Data(string)[], + Embedv2Response11(class)[], + Data(string)[], + Embedv2Response12(class)[], + Data(string)[], CreateEmbedJobResponse(ref)[/embed-jobs], CreateEmbedJobResponse2(class)[/embed-jobs], Data(string)[/embed-jobs], @@ -1179,6 +1247,39 @@ Data(string)[], RerankResponse13(class)[], Data(string)[], + Rerankv2Response(class)[], + Id(string)[], + Results(array)[], + Rerankv2ResponseResult(class)[], + Rerankv2ResponseResultDocument(class)[], + Text(string)[], + Index(int)[], + RelevanceScore(float)[], + ApiMeta(ref)[], + Rerankv2Response2(class)[], + Data(string)[], + Rerankv2Response3(class)[], + Data(string)[], + Rerankv2Response4(class)[], + Data(string)[], + Rerankv2Response5(class)[], + Data(string)[], + Rerankv2Response6(class)[], + Data(string)[], + Rerankv2Response7(class)[], + Data(string)[], + Rerankv2Response8(class)[], + Data(string)[], + Rerankv2Response9(class)[], + Data(string)[], + Rerankv2Response10(class)[], + Data(string)[], + Rerankv2Response11(class)[], + Data(string)[], + Rerankv2Response12(class)[], + Data(string)[], + Rerankv2Response13(class)[], + Data(string)[], ClassifyResponse(class)[], Id(string)[], Classifications(array)[], diff --git a/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/Schemas/_.verified.txt b/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/Schemas/_.verified.txt index fd45b62c3e..87110ce0d8 100644 --- a/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/Schemas/_.verified.txt +++ b/src/tests/AutoSDK.UnitTests/Snapshots/Cohere/Schemas/_.verified.txt @@ -158,12 +158,10 @@ ContentVariant1(string), ContentVariant2(array), Content(ref), - Documents(array), - ChatDocument(ref), - ToolCall2(class), + ToolCallV2(class), Id(string), - ToolCall2Type(enum), - ToolCall2Function(class), + ToolCallV2Type(enum), + ToolCallV2Function(class), Name(string), Arguments(string), ToolSource(class), @@ -184,7 +182,7 @@ AssistantMessage(class), AssistantMessageRole(enum), ToolCalls(array), - ToolCall2(ref), + ToolCallV2(ref), ToolPlan(string), Content3(oneOf), ContentVariant1(string), @@ -200,39 +198,51 @@ ContentVariant2(array), ContentVariant2Item2(oneOf), TextContent(ref), - ToolContent(class), - ToolContentType(enum), - ToolContentOutput(class), - ToolMessage2(class), - ToolMessage2Role(enum), + Document(class), + DocumentData(class), + Id(string), + DocumentContent(class), + DocumentContentType(enum), + Document(ref), + ToolContent(oneOf), + TextContent(ref), + DocumentContent(ref), + ToolMessageV2(class), + ToolMessageV2Role(enum), ToolCallId(string), - ToolContent(array), - ToolContentItem(oneOf), + ToolContent2(oneOf), + ToolContentVariant1(string), + ToolContentVariant2(array), ToolContent(ref), - ChatMessage2(oneOf), + ChatMessageV2(oneOf), UserMessage(ref), AssistantMessage(ref), SystemMessage(ref), - ToolMessage2(ref), + ToolMessageV2(ref), ChatMessages(array), - ChatMessage2(ref), - Tool2(class), - Tool2Type(enum), - Tool2Function(class), + ChatMessageV2(ref), + ToolV2(class), + ToolV2Type(enum), + ToolV2Function(class), Name(string), Description(string), - Tool2FunctionParameters(class), - JSONResponseFormat2(class), - ResponseFormatType(ref), - JSONResponseFormat2JsonSchema(class), - ResponseFormat2(oneOf), - TextResponseFormat(ref), - JSONResponseFormat2(ref), + ToolV2FunctionParameters(class), + CitationOptions(class), + CitationOptionsMode(enum), + ResponseFormatTypeV2(enum), + TextResponseFormatV2(class), + ResponseFormatTypeV2(ref), + JsonResponseFormatV2(class), + ResponseFormatTypeV2(ref), + JsonResponseFormatV2JsonSchema(class), + ResponseFormatV2(oneOf), + TextResponseFormatV2(ref), + JsonResponseFormatV2(ref), ChatFinishReason(enum), AssistantMessageResponse(class), AssistantMessageResponseRole(enum), ToolCalls(array), - ToolCall2(ref), + ToolCallV2(ref), ToolPlan(string), Content(array), ContentItem(oneOf), @@ -248,7 +258,7 @@ UsageTokens(class), InputTokens(double), OutputTokens(double), - NonStreamedChatResponse2(class), + ChatResponse(class), Id(string), ChatFinishReason(ref), AssistantMessageResponse(ref), @@ -329,7 +339,7 @@ ChatMessageEndEventVariant2Delta(class), ChatFinishReason(ref), Usage(ref), - StreamedChatResponse2(oneOf), + StreamedChatResponseV2(oneOf), ChatMessageStartEvent(ref), ChatContentStartEvent(ref), ChatContentDeltaEvent(ref), @@ -677,12 +687,16 @@ Version(string), BaseType(ref), Strategy(ref), + LoraTargetModules(enum), Hyperparameters(class), EarlyStoppingPatience(int), EarlyStoppingThreshold(double), TrainBatchSize(int), TrainEpochs(int), LearningRate(double), + LoraAlpha(int), + LoraRank(int), + LoraTargetModules(ref), WandbConfig(class), Project(string), ApiKey(string), @@ -767,13 +781,19 @@ ToolResult(ref), ForceSingleStep(bool), ResponseFormat(ref), + ChatRequestSafetyMode(enum), Chatv2Request(class), Model(string), ChatMessages(ref), Tools(array), - Tool2(ref), - Chatv2RequestCitationMode(enum), - ResponseFormat2(ref), + ToolV2(ref), + Documents(array), + DocumentsItem(oneOf), + DocumentsItemVariant1(string), + Document(ref), + CitationOptions(ref), + ResponseFormatV2(ref), + Chatv2RequestSafetyMode(enum), MaxTokens(int), StopSequences(array), StopSequencesItem(string), @@ -811,12 +831,32 @@ EmbeddingTypes(array), EmbeddingType(ref), EmbedRequestTruncate(enum), + Embedv2Request(class), + Texts(array), + TextsItem(string), + Model(string), + EmbedInputType(ref), + EmbeddingTypes(array), + EmbeddingType(ref), + Embedv2RequestTruncate(enum), CreateEmbedJobRequest(ref), RerankRequest(class), Model(string), Query(string), Documents(array), - DocumentsItem(oneOf), + DocumentsItem2(oneOf), + DocumentsItemVariant1(string), + RerankDocument(ref), + TopN(int), + RankFields(array), + RankFieldsItem(string), + ReturnDocuments(bool), + MaxChunksPerDoc(int), + Rerankv2Request(class), + Model(string), + Query(string), + Documents(array), + DocumentsItem3(oneOf), DocumentsItemVariant1(string), RerankDocument(ref), TopN(int), @@ -864,8 +904,10 @@ CompletedAt(DateTime), LastUsed(DateTime), ChatXClientName(string), + ChatAccepts(enum), GenerateXClientName(string), EmbedXClientName(string), + Embedv2XClientName(string), CreateEmbedJobXClientName(string), ListEmbedJobsXClientName(string), GetEmbedJobId(string), @@ -873,6 +915,7 @@ CancelEmbedJobId(string), CancelEmbedJobXClientName(string), RerankXClientName(string), + Rerankv2XClientName(string), ClassifyXClientName(string), CreateDatasetName(string), DatasetType(ref), @@ -940,11 +983,9 @@ ListTrainingStepMetricsPageSize(int), ListTrainingStepMetricsPageToken(string), ListTrainingStepMetricsXClientName(string), - ChatResponse(oneOf), + ChatResponse2(oneOf), NonStreamedChatResponse(ref), StreamedChatResponse(ref), - ChatResponse2(class), - Data(string), ChatResponse3(class), Data(string), ChatResponse4(class), @@ -967,9 +1008,11 @@ Data(string), ChatResponse13(class), Data(string), + ChatResponse14(class), + Data(string), Chatv2Response(oneOf), - NonStreamedChatResponse2(ref), - StreamedChatResponse2(ref), + ChatResponse(ref), + StreamedChatResponseV2(ref), Chatv2Response2(class), Data(string), Chatv2Response3(class), @@ -1047,6 +1090,31 @@ Data(string), EmbedResponse13(class), Data(string), + EmbedByTypeResponse(ref), + Embedv2Response(class), + Data(string), + Embedv2Response2(class), + Data(string), + Embedv2Response3(class), + Data(string), + Embedv2Response4(class), + Data(string), + Embedv2Response5(class), + Data(string), + Embedv2Response6(class), + Data(string), + Embedv2Response7(class), + Data(string), + Embedv2Response8(class), + Data(string), + Embedv2Response9(class), + Data(string), + Embedv2Response10(class), + Data(string), + Embedv2Response11(class), + Data(string), + Embedv2Response12(class), + Data(string), CreateEmbedJobResponse(ref), CreateEmbedJobResponse2(class), Data(string), @@ -1179,6 +1247,39 @@ Data(string), RerankResponse13(class), Data(string), + Rerankv2Response(class), + Id(string), + Results(array), + Rerankv2ResponseResult(class), + Rerankv2ResponseResultDocument(class), + Text(string), + Index(int), + RelevanceScore(float), + ApiMeta(ref), + Rerankv2Response2(class), + Data(string), + Rerankv2Response3(class), + Data(string), + Rerankv2Response4(class), + Data(string), + Rerankv2Response5(class), + Data(string), + Rerankv2Response6(class), + Data(string), + Rerankv2Response7(class), + Data(string), + Rerankv2Response8(class), + Data(string), + Rerankv2Response9(class), + Data(string), + Rerankv2Response10(class), + Data(string), + Rerankv2Response11(class), + Data(string), + Rerankv2Response12(class), + Data(string), + Rerankv2Response13(class), + Data(string), ClassifyResponse(class), Id(string), Classifications(array),