Cppinecone
A C++ client for the Pinecone vector database
arguments.hpp
Go to the documentation of this file.
1 #pragma once
7 #include <string>
8 
9 namespace pinecone::net
10 {
14 enum class threading_mode {
19  sync
20 };
21 
32  connection_args(std::string environment, std::string api_key) noexcept
33  : _environment(std::move(environment)),
34  _api_key(std::move(api_key)),
35  _api_key_header("Api-Key: " + _api_key)
36  {
37  }
38 
39  [[nodiscard]] auto environment() const noexcept -> std::string const& { return _environment; }
40 
41  [[nodiscard]] auto api_key() const noexcept -> std::string const& { return _api_key; }
42 
46  [[nodiscard]] auto api_key_header() const noexcept -> char const*
47  {
48  return _api_key_header.c_str();
49  }
50 
51  private:
52  std::string _environment;
53  std::string _api_key;
54  std::string _api_key_header;
55 };
56 } // namespace pinecone::net
threading_mode
Threading behaviors supported by http_client.
Definition: arguments.hpp:14
@ sync
Synchronous operation; in this mode, http_client instances are not thread-safe.
T c_str(T... args)
T move(T... args)
STL namespace.
Arguments required to connect to a Pinecone server.
Definition: arguments.hpp:25
auto api_key_header() const noexcept -> char const *
Definition: arguments.hpp:46
connection_args(std::string environment, std::string api_key) noexcept
Construct a new connection args object.
Definition: arguments.hpp:32