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
/// Represents a run of an assistant over a specific thread of messages.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Run {
    /// Unique identifier of the run.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Identifier for the assistant that is being run.
    #[prost(string, tag = "2")]
    pub assistant_id: ::prost::alloc::string::String,
    /// Identifier for the thread of messages that this run is associated with.
    #[prost(string, tag = "3")]
    pub thread_id: ::prost::alloc::string::String,
    /// Identifier of the subject who created this run.
    #[prost(string, tag = "4")]
    pub created_by: ::prost::alloc::string::String,
    /// Timestamp representing when the run was created.
    #[prost(message, optional, tag = "5")]
    pub created_at: ::core::option::Option<::prost_types::Timestamp>,
    /// Set of key-value pairs that can be used to organize and categorize the run.
    #[prost(map = "string, string", tag = "6")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Current state of the run, including its status and any associated data.
    #[prost(message, optional, tag = "7")]
    pub state: ::core::option::Option<RunState>,
    /// Information about the content usage during the run, such as the number of \[tokens\](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model.
    #[prost(message, optional, tag = "8")]
    pub usage: ::core::option::Option<ContentUsage>,
    /// Configuration options for truncating the prompt when the token count exceeds a specified limit.
    /// If specified, these options will override the assistant's prompt truncation settings for this run.
    #[prost(message, optional, tag = "9")]
    pub custom_prompt_truncation_options: ::core::option::Option<
        super::PromptTruncationOptions,
    >,
    /// Configuration options for completion generation.
    /// If specified, these options will override the assistant's completion settings for this run.
    #[prost(message, optional, tag = "10")]
    pub custom_completion_options: ::core::option::Option<super::CompletionOptions>,
    /// List of tools that are available for the assistant to use in this run.
    #[prost(message, repeated, tag = "11")]
    pub tools: ::prost::alloc::vec::Vec<super::Tool>,
}
/// Represents the current state of a run.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunState {
    /// Current status of a run.
    #[prost(enumeration = "run_state::RunStatus", tag = "1")]
    pub status: i32,
    /// Oneof field to capture additional data depending on the state of a run.
    #[prost(oneof = "run_state::StateData", tags = "2, 3, 4")]
    pub state_data: ::core::option::Option<run_state::StateData>,
}
/// Nested message and enum types in `RunState`.
pub mod run_state {
    /// Enum representing the status of a run.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RunStatus {
        /// Default unspecified status.
        Unspecified = 0,
        /// Run has been created but has not started yet.
        Pending = 1,
        /// Run is currently in progress.
        InProgress = 2,
        /// Run has failed due to an error.
        Failed = 3,
        /// Run has completed successfully.
        Completed = 4,
        /// The run is waiting for tool calls to be executed and their results to be submitted.
        ToolCalls = 5,
    }
    impl RunStatus {
        /// 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 {
                RunStatus::Unspecified => "RUN_STATUS_UNSPECIFIED",
                RunStatus::Pending => "PENDING",
                RunStatus::InProgress => "IN_PROGRESS",
                RunStatus::Failed => "FAILED",
                RunStatus::Completed => "COMPLETED",
                RunStatus::ToolCalls => "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 {
                "RUN_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
                "PENDING" => Some(Self::Pending),
                "IN_PROGRESS" => Some(Self::InProgress),
                "FAILED" => Some(Self::Failed),
                "COMPLETED" => Some(Self::Completed),
                "TOOL_CALLS" => Some(Self::ToolCalls),
                _ => None,
            }
        }
    }
    /// Oneof field to capture additional data depending on the state of a run.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum StateData {
        /// Error information if a run has failed.
        #[prost(message, tag = "2")]
        Error(super::super::super::super::common::Error),
        /// Final message generated by an assistant if a run has completed successfully.
        #[prost(message, tag = "3")]
        CompletedMessage(super::super::threads::Message),
        /// A list of tool calls requested by the assistant.
        #[prost(message, tag = "4")]
        ToolCallList(super::super::ToolCallList),
    }
}
/// Represents the content usage during a run, such as the number of \[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 used in the prompt.
    #[prost(int64, tag = "1")]
    pub prompt_tokens: i64,
    /// The number of tokens used in the completion response.
    #[prost(int64, tag = "2")]
    pub completion_tokens: i64,
    /// The total number of tokens used (prompt + completion).
    #[prost(int64, tag = "3")]
    pub total_tokens: i64,
}
/// Request message for creating a new run.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRunRequest {
    /// ID of the assistant for which the run is being created
    #[prost(string, tag = "1")]
    pub assistant_id: ::prost::alloc::string::String,
    /// ID of the thread associated with the run.
    #[prost(string, tag = "2")]
    pub thread_id: ::prost::alloc::string::String,
    /// Set of key-value pairs to label the run.
    #[prost(map = "string, string", tag = "3")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Additional messages that will be written to the thread before the run starts.
    #[prost(message, repeated, tag = "4")]
    pub additional_messages: ::prost::alloc::vec::Vec<super::threads::MessageData>,
    /// Configuration options for truncating the prompt when the token count exceeds a specified limit.
    /// If specified, these options will override the assistant's prompt truncation settings for this run.
    #[prost(message, optional, tag = "5")]
    pub custom_prompt_truncation_options: ::core::option::Option<
        super::PromptTruncationOptions,
    >,
    /// Configuration options for completion generation.
    /// If specified, these options will override the assistant's completion settings for this run.
    #[prost(message, optional, tag = "6")]
    pub custom_completion_options: ::core::option::Option<super::CompletionOptions>,
    /// Enables streaming of intermediate events, such as partial messages.
    #[prost(bool, tag = "7")]
    pub stream: bool,
    /// List of tools that are available for the assistant to use in this run.
    #[prost(message, repeated, tag = "8")]
    pub tools: ::prost::alloc::vec::Vec<super::Tool>,
}
/// Request message for listing to a run events.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListenRunRequest {
    /// ID of the run to listen to.
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
    /// Starting index for events. If provided, listening will start from this event.
    #[prost(message, optional, tag = "2")]
    pub events_start_idx: ::core::option::Option<i64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttachRunRequest {
    /// ID of the run to listen to.
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
    /// Starting index for events. If provided, listening will start from this event.
    #[prost(message, optional, tag = "2")]
    pub events_start_idx: ::core::option::Option<i64>,
    /// Event to submit to the run.
    #[prost(oneof = "attach_run_request::Event", tags = "3")]
    pub event: ::core::option::Option<attach_run_request::Event>,
}
/// Nested message and enum types in `AttachRunRequest`.
pub mod attach_run_request {
    /// Event to submit to the run.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Event {
        /// A list of tool results to submit to the run, such as the output of a function call.
        #[prost(message, tag = "3")]
        ToolResultList(super::super::ToolResultList),
    }
}
/// Request message for retrieving a specific run by its ID.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRunRequest {
    /// ID of the run to retrieve.
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
}
/// Request message for retrieving the last run associated with a specific thread.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastRunByThreadRequest {
    /// ID of the thread for which the last run is being fetched.
    #[prost(string, tag = "1")]
    pub thread_id: ::prost::alloc::string::String,
}
/// Request message for listing runs.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRunsRequest {
    /// Folder ID from which to list runs.
    #[prost(string, tag = "1")]
    pub folder_id: ::prost::alloc::string::String,
    /// Maximum number of threads to return per page.
    #[prost(int64, tag = "2")]
    pub page_size: i64,
    /// Token to retrieve the next page of results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the list operation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRunsResponse {
    /// List of runs in the specified folder.
    #[prost(message, repeated, tag = "1")]
    pub runs: ::prost::alloc::vec::Vec<Run>,
    /// Token to retrieve the next page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Represents the cursor position in a stream of events.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamCursor {
    /// Index of the current event in the stream.
    #[prost(int64, tag = "1")]
    pub current_event_idx: i64,
    /// The number of user events received so far.
    #[prost(int64, tag = "2")]
    pub num_user_events_received: i64,
}
/// Represents an event in the stream of a run.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamEvent {
    /// The type of event.
    #[prost(enumeration = "stream_event::EventType", tag = "1")]
    pub event_type: i32,
    /// The current position in the stream.
    #[prost(message, optional, tag = "2")]
    pub stream_cursor: ::core::option::Option<StreamCursor>,
    /// Event data, which can be one of several types.
    #[prost(oneof = "stream_event::EventData", tags = "3, 4, 5, 6")]
    pub event_data: ::core::option::Option<stream_event::EventData>,
}
/// Nested message and enum types in `StreamEvent`.
pub mod stream_event {
    /// Enum representing events that can occur in the stream.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum EventType {
        /// Unspecified event type.
        Unspecified = 0,
        /// Partial message is available.
        PartialMessage = 1,
        /// Run has failed due to an error.
        Error = 2,
        /// The run has completed.
        Done = 3,
        /// The run is waiting for tool calls to be executed and their results to be submitted.
        ToolCalls = 4,
    }
    impl EventType {
        /// 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 {
                EventType::Unspecified => "EVENT_TYPE_UNSPECIFIED",
                EventType::PartialMessage => "PARTIAL_MESSAGE",
                EventType::Error => "ERROR",
                EventType::Done => "DONE",
                EventType::ToolCalls => "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 {
                "EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "PARTIAL_MESSAGE" => Some(Self::PartialMessage),
                "ERROR" => Some(Self::Error),
                "DONE" => Some(Self::Done),
                "TOOL_CALLS" => Some(Self::ToolCalls),
                _ => None,
            }
        }
    }
    /// Event data, which can be one of several types.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum EventData {
        /// Error information if the run has failed.
        #[prost(message, tag = "3")]
        Error(super::super::super::super::common::Error),
        /// Partially generated message.
        #[prost(message, tag = "4")]
        PartialMessage(super::super::threads::MessageContent),
        /// Final message generated by an assistant if a run has completed successfully.
        #[prost(message, tag = "5")]
        CompletedMessage(super::super::threads::Message),
        /// A list of tool calls requested by the assistant.
        #[prost(message, tag = "6")]
        ToolCallList(super::super::ToolCallList),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitToRunRequest {
    /// ID of the run to submit to.
    #[prost(string, tag = "1")]
    pub run_id: ::prost::alloc::string::String,
    /// Event to submit to the run.
    #[prost(oneof = "submit_to_run_request::Event", tags = "2")]
    pub event: ::core::option::Option<submit_to_run_request::Event>,
}
/// Nested message and enum types in `SubmitToRunRequest`.
pub mod submit_to_run_request {
    /// Event to submit to the run.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Event {
        /// A list of tool results to submit to the run, such as the output of a function call.
        #[prost(message, tag = "2")]
        ToolResultList(super::super::ToolResultList),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitToRunResponse {}
/// Generated client implementations.
pub mod run_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// RunService provides operations for managing runs.
    #[derive(Debug, Clone)]
    pub struct RunServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl RunServiceClient<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> RunServiceClient<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,
        ) -> RunServiceClient<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,
        {
            RunServiceClient::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
        }
        /// Create a new run for a given assistant and thread.
        pub async fn create(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateRunRequest>,
        ) -> std::result::Result<tonic::Response<super::Run>, 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.assistants.v1.runs.RunService/Create",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "Create",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Listen to events from a specific run.
        /// If the run was created with `stream = false`, Listen will only respond with the final status of the run
        /// and will not stream partial messages or intermediate events.
        pub async fn listen(
            &mut self,
            request: impl tonic::IntoRequest<super::ListenRunRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::StreamEvent>>,
            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.assistants.v1.runs.RunService/Listen",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "Listen",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// Bi-directional streaming method to interact with a specific run.
        /// Like `Listen`, `Attach` streams events from the run, but also allows clients to send events back.
        /// For example, it can be used to submit function call results when the run is waiting for user input.
        pub async fn attach(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::AttachRunRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::StreamEvent>>,
            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.assistants.v1.runs.RunService/Attach",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "Attach",
                    ),
                );
            self.inner.streaming(req, path, codec).await
        }
        /// Retrieve details of a specific run by its ID.
        pub async fn get(
            &mut self,
            request: impl tonic::IntoRequest<super::GetRunRequest>,
        ) -> std::result::Result<tonic::Response<super::Run>, 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.assistants.v1.runs.RunService/Get",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "Get",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves the most recent run for a specific thread.
        pub async fn get_last_by_thread(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLastRunByThreadRequest>,
        ) -> std::result::Result<tonic::Response<super::Run>, 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.assistants.v1.runs.RunService/GetLastByThread",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "GetLastByThread",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// List runs in a specific folder.
        pub async fn list(
            &mut self,
            request: impl tonic::IntoRequest<super::ListRunsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListRunsResponse>,
            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.assistants.v1.runs.RunService/List",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "List",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Submit event to run
        /// For example, submit function call results when the run is waiting for user input.
        pub async fn submit(
            &mut self,
            request: impl tonic::IntoRequest<super::SubmitToRunRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SubmitToRunResponse>,
            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.assistants.v1.runs.RunService/Submit",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "yandex.cloud.ai.assistants.v1.runs.RunService",
                        "Submit",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}