Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compiler errors, gitignore config.toml and move to sample file #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Reksa97
Copy link

@Reksa97 Reksa97 commented Sep 12, 2024

Config files with sensitive data like api keys should be kept in a gitignored file to avoid leaking the keys, so I renamed config.toml to config.toml.sample and added config.toml to .gitignore.

Also got some errors (M1 Macbook, using VSCode C++ dev container) during compilation so fixed those.

/mentals-ai $ make
Using compiler: g++ version 11
mkdir -p build/./src/
g++ -DLINUX -I./src -I./src/tl -I./src/nlohmann -I./src/liboai -I./src/liboai/core -I./src/liboai/include -I./src/liboai/include/core -I./src/liboai/include/components -I./src/liboai/components -I./src/treehh -I./src/toml++ -I./src/toml++/impl -I/usr/include/poppler/cpp -I/usr/include/poppler -MMD -MP  -std=c++20 -Wall -Wextra -O3 -march=native  -c src/pgvector.cpp -o build/./src/pgvector.cpp.o
src/pgvector.cpp: In function ‘json pqxx_result_to_json(const pqxx::result&)’:
src/pgvector.cpp:35:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘pqxx::row::size_type’ {aka ‘unsigned int’} [-Wsign-compare]
   35 |         for (int colnum = 0; colnum < row.size(); ++colnum) {
      |                              ~~~~~~~^~~~~~~~~~~~
src/pgvector.cpp: In member function ‘tl::expected<void, std::__cxx11::basic_string<char> > PgVector::write_content(pqxx::work&, const string&, const string&, int, const string&, const vdb::vector&, const std::optional<std::__cxx11::basic_string<char> >&, const std::optional<std::__cxx11::basic_string<char> >&)’:
src/pgvector.cpp:166:45: error: ‘class std::basic_ostream<char>’ has no member named ‘str’
  166 |         (std::ostringstream() << embedding).str());
      |                                             ^~~
src/pgvector.cpp:149:15: warning: unused parameter ‘chunk_id’ [-Wunused-parameter]
  149 |     const int chunk_id,
      |     ~~~~~~~~~~^~~~~~~~
src/pgvector.cpp: In member function ‘tl::expected<nlohmann::json_abi_v3_11_2::basic_json<>, std::__cxx11::basic_string<char> > PgVector::search_content(const string&, const vdb::vector&, int, vdb::query_type)’:
src/pgvector.cpp:201:85: error: ‘class std::basic_ostream<char>’ has no member named ‘str’
  201 |     pqxx::result res = txn.exec_params(sql, (std::ostringstream() << search_vector).str());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant