yandex-cloud 2025.4.14

Generated gRPC clients for the Yandex Cloud API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
/// Enum representing the status of a batch inference.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BatchInferenceTaskStatus {
    Unspecified = 0,
    Created = 1,
    Pending = 2,
    InProgress = 3,
    Completed = 4,
    Failed = 5,
    Canceled = 6,
}
impl BatchInferenceTaskStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            BatchInferenceTaskStatus::Unspecified => {
                "BATCH_INFERENCE_TASK_STATUS_UNSPECIFIED"
            }
            BatchInferenceTaskStatus::Created => "CREATED",
            BatchInferenceTaskStatus::Pending => "PENDING",
            BatchInferenceTaskStatus::InProgress => "IN_PROGRESS",
            BatchInferenceTaskStatus::Completed => "COMPLETED",
            BatchInferenceTaskStatus::Failed => "FAILED",
            BatchInferenceTaskStatus::Canceled => "CANCELED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BATCH_INFERENCE_TASK_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "CREATED" => Some(Self::Created),
            "PENDING" => Some(Self::Pending),
            "IN_PROGRESS" => Some(Self::InProgress),
            "COMPLETED" => Some(Self::Completed),
            "FAILED" => Some(Self::Failed),
            "CANCELED" => Some(Self::Canceled),
            _ => None,
        }
    }
}
/// Request for the service to obtain text embeddings.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextEmbeddingRequest {
    /// The [model URI](/docs/foundation-models/concepts/embeddings) to be used for obtaining text embeddings.
    #[prost(string, tag = "1")]
    pub model_uri: ::prost::alloc::string::String,
    /// The input text for which the embedding is requested.
    #[prost(string, tag = "2")]
    pub text: ::prost::alloc::string::String,
    /// Optional parameter to specify embedding dimension for models that support multi-dimensional outputs
    #[prost(message, optional, tag = "3")]
    pub dim: ::core::option::Option<i64>,
}
/// Response containing generated text embedding.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextEmbeddingResponse {
    /// A repeated list of double values representing the embedding.
    #[prost(double, repeated, tag = "1")]
    pub embedding: ::prost::alloc::vec::Vec<f64>,
    /// The number of tokens in the input text.
    #[prost(int64, tag = "2")]
    pub num_tokens: i64,
    /// The model version changes with each new releases.
    #[prost(string, tag = "3")]
    pub model_version: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod embeddings_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for obtaining embeddings from input data.
    #[derive(Debug, Clone)]
    pub struct EmbeddingsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl EmbeddingsServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> EmbeddingsServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> EmbeddingsServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            EmbeddingsServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// A method for obtaining embeddings from text data.
        pub async fn text_embedding(
            &mut self,
            request: impl tonic::IntoRequest<super::TextEmbeddingRequest>,
        ) -> std::result::Result<
            tonic::Response<super::TextEmbeddingResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.EmbeddingsService/TextEmbedding",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.EmbeddingsService",
                        "TextEmbedding",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Defines the options for completion generation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionOptions {
    /// Enables streaming of partially generated text.
    #[prost(bool, tag = "1")]
    pub stream: bool,
    /// Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive).
    /// Lower values produce more straightforward responses while higher values lead to increased creativity and randomness.
    /// Default temperature: 0.3
    #[prost(message, optional, tag = "2")]
    pub temperature: ::core::option::Option<f64>,
    /// The limit on the number of tokens used for single completion generation.
    /// Must be greater than zero. This maximum allowed parameter value may depend on the model being used.
    #[prost(message, optional, tag = "3")]
    pub max_tokens: ::core::option::Option<i64>,
    /// Configures reasoning capabilities for the model, allowing it to perform internal reasoning before responding.
    #[prost(message, optional, tag = "4")]
    pub reasoning_options: ::core::option::Option<ReasoningOptions>,
}
/// Represents reasoning options that enable the model's ability to perform internal reasoning before generating a response.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReasoningOptions {
    /// Specifies the reasoning mode to be used.
    #[prost(enumeration = "reasoning_options::ReasoningMode", tag = "1")]
    pub mode: i32,
}
/// Nested message and enum types in `ReasoningOptions`.
pub mod reasoning_options {
    /// Enum representing the reasoning mode.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ReasoningMode {
        /// Unspecified reasoning mode.
        Unspecified = 0,
        /// Disables reasoning. The model will generate a response without performing any internal reasoning.
        Disabled = 1,
        /// Enables reasoning in a hidden manner without exposing the reasoning steps to the user.
        EnabledHidden = 2,
    }
    impl ReasoningMode {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                ReasoningMode::Unspecified => "REASONING_MODE_UNSPECIFIED",
                ReasoningMode::Disabled => "DISABLED",
                ReasoningMode::EnabledHidden => "ENABLED_HIDDEN",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "REASONING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "DISABLED" => Some(Self::Disabled),
                "ENABLED_HIDDEN" => Some(Self::EnabledHidden),
                _ => None,
            }
        }
    }
}
/// A message object representing a wrapper over the inputs and outputs of the completion model.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
    /// The ID of the message sender. Supported roles:
    /// * `system`: Special role used to define the behaviour of the completion model.
    /// * `assistant`: A role used by the model to generate responses.
    /// * `user`: A role used by the user to describe requests to the model.
    #[prost(string, tag = "1")]
    pub role: ::prost::alloc::string::String,
    /// Message content.
    #[prost(oneof = "message::Content", tags = "2, 3, 4")]
    pub content: ::core::option::Option<message::Content>,
}
/// Nested message and enum types in `Message`.
pub mod message {
    /// Message content.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        /// Textual content of the message.
        #[prost(string, tag = "2")]
        Text(::prost::alloc::string::String),
        /// List of tool calls made by the model as part of the response generation.
        #[prost(message, tag = "3")]
        ToolCallList(super::ToolCallList),
        /// List of tool results returned from external tools that were invoked by the model.
        #[prost(message, tag = "4")]
        ToolResultList(super::ToolResultList),
    }
}
/// An object representing the number of content \[tokens\](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContentUsage {
    /// The number of tokens in the textual part of the model input.
    #[prost(int64, tag = "1")]
    pub input_text_tokens: i64,
    /// The number of tokens in the generated completion.
    #[prost(int64, tag = "2")]
    pub completion_tokens: i64,
    /// The total number of tokens, including all input tokens and all generated tokens.
    #[prost(int64, tag = "3")]
    pub total_tokens: i64,
    /// Provides additional information about how the completion tokens were utilized.
    #[prost(message, optional, tag = "4")]
    pub completion_tokens_details: ::core::option::Option<
        content_usage::CompletionTokensDetails,
    >,
}
/// Nested message and enum types in `ContentUsage`.
pub mod content_usage {
    /// Provides additional information about how the completion tokens were utilized.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct CompletionTokensDetails {
        /// The number of tokens used specifically for internal reasoning performed by the model.
        #[prost(int64, tag = "1")]
        pub reasoning_tokens: i64,
    }
}
/// Represents a generated completion alternative, including its content and generation status.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Alternative {
    /// A message with the content of the alternative.
    #[prost(message, optional, tag = "1")]
    pub message: ::core::option::Option<Message>,
    /// The generation status of the alternative.
    #[prost(enumeration = "alternative::AlternativeStatus", tag = "2")]
    pub status: i32,
}
/// Nested message and enum types in `Alternative`.
pub mod alternative {
    /// Enum representing the generation status of the alternative.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum AlternativeStatus {
        /// Unspecified generation status.
        Unspecified = 0,
        /// Partially generated alternative.
        Partial = 1,
        /// Incomplete final alternative resulting from reaching the maximum allowed number of tokens.
        TruncatedFinal = 2,
        /// Final alternative generated without running into any limits.
        Final = 3,
        /// Generation was stopped due to the discovery of potentially sensitive content in the prompt or generated response.
        /// To fix, modify the prompt and restart generation.
        ContentFilter = 4,
        /// Tools were invoked during the completion generation.
        ToolCalls = 5,
    }
    impl AlternativeStatus {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                AlternativeStatus::Unspecified => "ALTERNATIVE_STATUS_UNSPECIFIED",
                AlternativeStatus::Partial => "ALTERNATIVE_STATUS_PARTIAL",
                AlternativeStatus::TruncatedFinal => "ALTERNATIVE_STATUS_TRUNCATED_FINAL",
                AlternativeStatus::Final => "ALTERNATIVE_STATUS_FINAL",
                AlternativeStatus::ContentFilter => "ALTERNATIVE_STATUS_CONTENT_FILTER",
                AlternativeStatus::ToolCalls => "ALTERNATIVE_STATUS_TOOL_CALLS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ALTERNATIVE_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
                "ALTERNATIVE_STATUS_PARTIAL" => Some(Self::Partial),
                "ALTERNATIVE_STATUS_TRUNCATED_FINAL" => Some(Self::TruncatedFinal),
                "ALTERNATIVE_STATUS_FINAL" => Some(Self::Final),
                "ALTERNATIVE_STATUS_CONTENT_FILTER" => Some(Self::ContentFilter),
                "ALTERNATIVE_STATUS_TOOL_CALLS" => Some(Self::ToolCalls),
                _ => None,
            }
        }
    }
}
/// Represents a token, the basic unit of content, used by the foundation model.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Token {
    /// An internal token identifier.
    #[prost(int64, tag = "1")]
    pub id: i64,
    /// The textual representation of the token.
    #[prost(string, tag = "2")]
    pub text: ::prost::alloc::string::String,
    /// Indicates whether the token is special or not. Special tokens may define the model's behavior and are not visible to users.
    #[prost(bool, tag = "3")]
    pub special: bool,
}
/// Represents a tool that can be invoked during completion generation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tool {
    #[prost(oneof = "tool::ToolType", tags = "1")]
    pub tool_type: ::core::option::Option<tool::ToolType>,
}
/// Nested message and enum types in `Tool`.
pub mod tool {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ToolType {
        /// Represents a function that can be called.
        #[prost(message, tag = "1")]
        Function(super::FunctionTool),
    }
}
/// Represents a function tool that can be invoked during completion generation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionTool {
    /// The name of the function.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// A description of the function's purpose or behavior.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// A JSON Schema that defines the expected parameters for the function.
    /// The schema should describe the required fields, their types, and any constraints or default values.
    #[prost(message, optional, tag = "3")]
    pub parameters: ::core::option::Option<::prost_types::Struct>,
}
/// Represents a call to a tool.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToolCall {
    #[prost(oneof = "tool_call::ToolCallType", tags = "1")]
    pub tool_call_type: ::core::option::Option<tool_call::ToolCallType>,
}
/// Nested message and enum types in `ToolCall`.
pub mod tool_call {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ToolCallType {
        /// Represents a call to a function.
        #[prost(message, tag = "1")]
        FunctionCall(super::FunctionCall),
    }
}
/// Represents the invocation of a function with specific arguments.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionCall {
    /// The name of the function being called.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The structured arguments passed to the function.
    /// These arguments must adhere to the JSON Schema defined in the corresponding function's parameters.
    #[prost(message, optional, tag = "2")]
    pub arguments: ::core::option::Option<::prost_types::Struct>,
}
/// Represents a list of tool calls.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToolCallList {
    /// A list of tool calls to be executed.
    #[prost(message, repeated, tag = "1")]
    pub tool_calls: ::prost::alloc::vec::Vec<ToolCall>,
}
/// Represents the result of a tool call.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToolResult {
    #[prost(oneof = "tool_result::ToolResultType", tags = "1")]
    pub tool_result_type: ::core::option::Option<tool_result::ToolResultType>,
}
/// Nested message and enum types in `ToolResult`.
pub mod tool_result {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ToolResultType {
        /// Represents the result of a function call.
        #[prost(message, tag = "1")]
        FunctionResult(super::FunctionResult),
    }
}
/// Represents the result of a function call.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionResult {
    /// The name of the function that was executed.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "function_result::ContentType", tags = "2")]
    pub content_type: ::core::option::Option<function_result::ContentType>,
}
/// Nested message and enum types in `FunctionResult`.
pub mod function_result {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ContentType {
        /// The result of the function call, represented as a string.
        /// This field can be used to store the output of the function.
        #[prost(string, tag = "2")]
        Content(::prost::alloc::string::String),
    }
}
/// Represents a list of tool results.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToolResultList {
    /// A list of tool results.
    #[prost(message, repeated, tag = "1")]
    pub tool_results: ::prost::alloc::vec::Vec<ToolResult>,
}
/// Represents the expected structure of the model's response using a JSON Schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JsonSchema {
    /// The JSON Schema that the model's output must conform to.
    #[prost(message, optional, tag = "1")]
    pub schema: ::core::option::Option<::prost_types::Struct>,
}
/// Request for the service to generate text completion.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionRequest {
    /// The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation.
    #[prost(string, tag = "1")]
    pub model_uri: ::prost::alloc::string::String,
    /// Configuration options for completion generation.
    #[prost(message, optional, tag = "2")]
    pub completion_options: ::core::option::Option<CompletionOptions>,
    /// A list of messages representing the context for the completion model.
    #[prost(message, repeated, tag = "3")]
    pub messages: ::prost::alloc::vec::Vec<Message>,
    /// List of tools that are available for the model to invoke during the completion generation.
    /// Note: This parameter is not yet supported and will be ignored if provided.
    #[prost(message, repeated, tag = "4")]
    pub tools: ::prost::alloc::vec::Vec<Tool>,
    /// Specifies the format of the model's response.
    #[prost(oneof = "completion_request::ResponseFormat", tags = "5, 6")]
    pub response_format: ::core::option::Option<completion_request::ResponseFormat>,
}
/// Nested message and enum types in `CompletionRequest`.
pub mod completion_request {
    /// Specifies the format of the model's response.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ResponseFormat {
        /// When set to true, the model will respond with a valid JSON object.
        /// Be sure to explicitly ask the model for JSON.
        /// Otherwise, it may generate excessive whitespace and run indefinitely until it reaches the token limit.
        #[prost(bool, tag = "5")]
        JsonObject(bool),
        /// Enforces a specific JSON structure for the model's response based on a provided schema.
        #[prost(message, tag = "6")]
        JsonSchema(super::JsonSchema),
    }
}
/// Response containing generated text completions.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletionResponse {
    /// A list of generated completion alternatives.
    #[prost(message, repeated, tag = "1")]
    pub alternatives: ::prost::alloc::vec::Vec<Alternative>,
    /// A set of statistics describing the number of content tokens used by the completion model.
    #[prost(message, optional, tag = "2")]
    pub usage: ::core::option::Option<ContentUsage>,
    /// The model version changes with each new releases.
    #[prost(string, tag = "3")]
    pub model_version: ::prost::alloc::string::String,
}
/// Request for the service to generate batch text completion.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCompletionRequest {
    /// The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for batch completion generation.
    #[prost(string, tag = "1")]
    pub model_uri: ::prost::alloc::string::String,
    /// Configuration options for completion generation.
    #[prost(message, optional, tag = "2")]
    pub completion_options: ::core::option::Option<CompletionOptions>,
    /// Specifies the format of the request.
    #[prost(oneof = "batch_completion_request::RequestFormat", tags = "3")]
    pub request_format: ::core::option::Option<batch_completion_request::RequestFormat>,
}
/// Nested message and enum types in `BatchCompletionRequest`.
pub mod batch_completion_request {
    /// Specifies the format of the request.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum RequestFormat {
        /// ID of the dataset containing the context for the completion model.
        #[prost(string, tag = "3")]
        SourceDatasetId(::prost::alloc::string::String),
    }
}
/// Metadata of the batch completion operation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCompletionMetadata {
    /// The ID of the batch completion task.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// The status of the batch completion task.
    #[prost(enumeration = "BatchInferenceTaskStatus", tag = "2")]
    pub task_status: i32,
    /// A number of currently completed batches of the completion task.
    #[prost(int64, tag = "3")]
    pub completed_batches: i64,
    /// A number of total batches of the completion task.
    #[prost(int64, tag = "4")]
    pub total_batches: i64,
}
/// Response containing information about completion task.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCompletionResponse {
    /// The ID of the batch completion task.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// The status of the batch completion task.
    #[prost(enumeration = "BatchInferenceTaskStatus", tag = "2")]
    pub task_status: i32,
    /// The ID of the dataset containing completion results.
    #[prost(string, tag = "3")]
    pub result_dataset_id: ::prost::alloc::string::String,
}
/// Request for the service to tokenize input text.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenizeRequest {
    /// The identifier of the model to be used for tokenization.
    #[prost(string, tag = "1")]
    pub model_uri: ::prost::alloc::string::String,
    /// Text to be tokenized.
    #[prost(string, tag = "2")]
    pub text: ::prost::alloc::string::String,
}
/// Response containing tokenized content from request.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TokenizeResponse {
    /// A list of tokens obtained from tokenization.
    #[prost(message, repeated, tag = "1")]
    pub tokens: ::prost::alloc::vec::Vec<Token>,
    /// Model version (changes with model releases).
    #[prost(string, tag = "2")]
    pub model_version: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod text_generation_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for text generation.
    #[derive(Debug, Clone)]
    pub struct TextGenerationServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TextGenerationServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> TextGenerationServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> TextGenerationServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            TextGenerationServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode).
        pub async fn completion(
            &mut self,
            request: impl tonic::IntoRequest<super::CompletionRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::CompletionResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.TextGenerationService/Completion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.TextGenerationService",
                        "Completion",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod text_generation_async_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for asynchronous text generation.
    #[derive(Debug, Clone)]
    pub struct TextGenerationAsyncServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TextGenerationAsyncServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> TextGenerationAsyncServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> TextGenerationAsyncServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            TextGenerationAsyncServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode).
        pub async fn completion(
            &mut self,
            request: impl tonic::IntoRequest<super::CompletionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::operation::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService/Completion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService",
                        "Completion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod text_generation_batch_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for text generation.
    #[derive(Debug, Clone)]
    pub struct TextGenerationBatchServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TextGenerationBatchServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> TextGenerationBatchServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> TextGenerationBatchServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            TextGenerationBatchServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode).
        /// Note: Not implemented yet
        pub async fn completion(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchCompletionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::operation::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.TextGenerationBatchService/Completion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.TextGenerationBatchService",
                        "Completion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod tokenizer_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for tokenizing input content.
    #[derive(Debug, Clone)]
    pub struct TokenizerServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl TokenizerServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> TokenizerServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> TokenizerServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            TokenizerServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// RPC method for tokenizing text.
        pub async fn tokenize(
            &mut self,
            request: impl tonic::IntoRequest<super::TokenizeRequest>,
        ) -> std::result::Result<
            tonic::Response<super::TokenizeResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.TokenizerService/Tokenize",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.TokenizerService",
                        "Tokenize",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// RPC method for tokenizing content of CompletionRequest
        pub async fn tokenize_completion(
            &mut self,
            request: impl tonic::IntoRequest<super::CompletionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::TokenizeResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/yandex.cloud.ai.foundation_models.v1.TokenizerService/TokenizeCompletion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.foundation_models.v1.TokenizerService",
                        "TokenizeCompletion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}