Cppinecone
A C++ client for the Pinecone vector database
vector_types.hpp File Reference

Native C++ types modeling the results of vector operations. More...

#include <cstdint>
#include <optional>
#include <string>
#include <unordered_map>
#include <utility>
#include <variant>
#include <vector>
#include <nlohmann/json.hpp>
#include "pinecone/types/filters.hpp"
#include "pinecone/types/vector_metadata.hpp"
#include "pinecone/util/result.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pinecone::types::index_stats
 Statistics for a Pinecone index. More...
 
struct  pinecone::types::index_stats::namespace_summary
 
struct  pinecone::types::query< filter >
 A vector search. More...
 
struct  pinecone::types::query< filter >::builder
 
struct  pinecone::types::query_result
 The result of a vector search. More...
 
struct  pinecone::types::query_result::scored_vector
 A vector with its corresponding search score. More...
 
struct  pinecone::types::delete_request< filter >
 Deletes one or more vectors from an index. More...
 
struct  pinecone::types::delete_request< filter >::builder
 
struct  pinecone::types::vector
 Representation of an individual Pinecone vector. More...
 
struct  pinecone::types::upsert_request
 Insert or update vectors in an index. More...
 
struct  pinecone::types::upsert_request::builder
 
struct  pinecone::types::update_request
 Update existing vectors in an index. More...
 
struct  pinecone::types::update_request::builder
 

Typedefs

using json = nlohmann::json
 
using pinecone::types::ids = std::vector< std::string_view >
 

Functions

auto pinecone::types::query_builder (uint64_t top_k, std::vector< double > vector) noexcept -> query< no_filter >::builder
 Construct a query builder given a number of results and a target vector. More...
 
auto pinecone::types::query_builder (uint64_t top_k, std::string_view vector_id) noexcept -> query< no_filter >::builder
 Construct a query builder given a number of results and a target vector. More...
 
template<typename filter >
auto pinecone::types::query_builder (filter f, uint64_t top_k, std::vector< double > vector) noexcept -> typename query< filter >::builder
 Construct a query builder given a number of results and a target vector while applying a filter. More...
 
template<typename filter >
auto pinecone::types::query_builder (filter f, uint64_t top_k, std::string_view vector_id) noexcept -> typename query< filter >::builder
 Construct a query builder given a number of results and a target vector while applying a filter. More...
 

Detailed Description

Native C++ types modeling the results of vector operations.

Definition in file vector_types.hpp.

Function Documentation

◆ query_builder() [1/4]

template<typename filter >
auto pinecone::types::query_builder ( filter  f,
uint64_t  top_k,
std::string_view  vector_id 
) -> typename query<filter>::builder
inlinenoexcept

Construct a query builder given a number of results and a target vector while applying a filter.

Template Parameters
filterthe type of filter to apply to the query; should normally be deduced
Parameters
fthe filter to apply
top_kthe number of result vectors that should be returned
vector_idthe id of the target vector (within the same index) to search for
Returns
a query builder

Definition at line 217 of file vector_types.hpp.

◆ query_builder() [2/4]

template<typename filter >
auto pinecone::types::query_builder ( filter  f,
uint64_t  top_k,
std::vector< double >  vector 
) -> typename query<filter>::builder
inlinenoexcept

Construct a query builder given a number of results and a target vector while applying a filter.

Template Parameters
filterthe type of filter to apply to the query; should normally be deduced
Parameters
fthe filter to apply
top_kthe number of result vectors that should be returned
vectorthe the target vector to search for
Returns
a query builder

Definition at line 200 of file vector_types.hpp.

◆ query_builder() [3/4]

auto pinecone::types::query_builder ( uint64_t  top_k,
std::string_view  vector_id 
) -> query<no_filter>::builder
inlinenoexcept

Construct a query builder given a number of results and a target vector.

Parameters
top_kthe number of result vectors that should be returned
vector_idthe id of the target vector (within the same index) to search for
Returns
a query builder

Definition at line 183 of file vector_types.hpp.

◆ query_builder() [4/4]

auto pinecone::types::query_builder ( uint64_t  top_k,
std::vector< double >  vector 
) -> query<no_filter>::builder
inlinenoexcept

Construct a query builder given a number of results and a target vector.

Parameters
top_kthe number of result vectors that should be returned
vectorthe target vector to search for
Returns
a query builder
Examples
metadata_filtering.hpp.

Definition at line 170 of file vector_types.hpp.

Referenced by pinecone::types::query_builder().