openai_interface/vector_stores/
retrieve.rs1use url::Url;
7
8use crate::{
9 errors::OapiError,
10 rest::get::{Get, GetNoStream},
11 vector_stores::VectorStore,
12};
13
14#[derive(Debug, Clone)]
16pub struct RetrieveVectorStoreRequest<'a> {
17 pub vector_store_id: &'a str,
19}
20
21impl Get for RetrieveVectorStoreRequest<'_> {
22 fn build_url(&self, base_url: &str) -> Result<String, OapiError> {
26 let mut url = Url::parse(base_url.trim_end_matches('/')).map_err(OapiError::UrlError)?;
27 url.path_segments_mut()
28 .map_err(|_| OapiError::UrlCannotBeBase(base_url.to_string()))?
29 .push("vector_stores")
30 .push(self.vector_store_id);
31 Ok(url.to_string())
32 }
33}
34
35impl GetNoStream for RetrieveVectorStoreRequest<'_> {
36 type Response = VectorStore;
37}