File tree 4 files changed +24
-19
lines changed
4 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 1
1
# Check if a default C++ compiler exists, otherwise use g++
2
2
CXX ?= g++
3
+ CXXFLAGS = -Wall -Wextra -Wpedantic
4
+
5
+ CREATE_BUILD_DIR = mkdir -p build; cp -n llama.jpg build;
3
6
4
7
all : examples test-cpp11 test-cpp14 test-cpp20
5
8
examples : examples/main.cpp
6
- mkdir -p build
7
- $(CXX ) examples/main.cpp -Iinclude -o build/examples -std=c++11 -pthread -latomic
9
+ $( CREATE_BUILD_DIR )
10
+ $(CXX ) $( CXXFLAGS ) examples/main.cpp -Iinclude -o build/examples -std=c++11 -pthread -latomic
8
11
test : test-cpp11
9
12
test-cpp11 : test/test.cpp
10
- mkdir -p build
11
- $(CXX ) test/test.cpp -Iinclude -Itest -o build/test -std=c++11 -pthread -latomic
13
+ $( CREATE_BUILD_DIR )
14
+ $(CXX ) $( CXXFLAGS ) test/test.cpp -Iinclude -Itest -o build/test -std=c++11 -pthread -latomic
12
15
test-cpp14 : test/test.cpp
13
- mkdir -p build
14
- $(CXX ) test/test.cpp -Iinclude -Itest -o build/test-cpp14 -std=c++14 -pthread -latomic
16
+ $( CREATE_BUILD_DIR )
17
+ $(CXX ) $( CXXFLAGS ) test/test.cpp -Iinclude -Itest -o build/test-cpp14 -std=c++14 -pthread -latomic
15
18
test-cpp20 : test/test.cpp
16
- mkdir -p build
17
- $(CXX ) test/test.cpp -Iinclude -Itest -o build/test-cpp20 -std=c++2a -pthread -latomic
19
+ $( CREATE_BUILD_DIR )
20
+ $(CXX ) $( CXXFLAGS ) test/test.cpp -Iinclude -Itest -o build/test-cpp20 -std=c++2a -pthread -latomic
18
21
clean :
19
22
rm -rf build
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ namespace ollama
101
101
public:
102
102
image (const std::string base64_sequence, bool valid = true )
103
103
{
104
- this ->base64_sequence = base64_sequence;
104
+ this ->base64_sequence = base64_sequence; this -> valid = valid;
105
105
}
106
106
~image (){};
107
107
@@ -254,7 +254,7 @@ namespace ollama
254
254
(*this )[" stream" ] = stream;
255
255
256
256
if (options!=nullptr ) (*this )[" options" ] = options[" options" ];
257
- // (*this)["format"] = format; // Commented out as providing the format causes issues with some models.
257
+ ( void )format; // (*this)["format"] = format; // Commented out as providing the format causes issues with some models.
258
258
(*this )[" keep_alive" ] = keep_alive_duration;
259
259
type = message_type::chat;
260
260
@@ -329,7 +329,7 @@ namespace ollama
329
329
return simple_string;
330
330
}
331
331
332
- const bool has_error () const
332
+ bool has_error () const
333
333
{
334
334
if ( json_data.contains (" error" ) ) return true ;
335
335
return false ;
@@ -871,12 +871,13 @@ class Ollama
871
871
872
872
private:
873
873
874
+ /*
874
875
bool send_request(const ollama::request& request, std::function<void(const ollama::response&)> on_receive_response=nullptr)
875
876
{
876
877
877
878
return true;
878
879
}
879
-
880
+ */
880
881
881
882
std::string server_url;
882
883
httplib::Client *cli;
@@ -1039,7 +1040,7 @@ namespace ollama
1039
1040
ollama.setWriteTimeout (seconds);
1040
1041
}
1041
1042
1042
- };
1043
+ }
1043
1044
1044
1045
1045
1046
#endif
Original file line number Diff line number Diff line change @@ -34891,7 +34891,7 @@ namespace ollama
34891
34891
public:
34892
34892
image(const std::string base64_sequence, bool valid = true)
34893
34893
{
34894
- this->base64_sequence = base64_sequence;
34894
+ this->base64_sequence = base64_sequence; this->valid = valid;
34895
34895
}
34896
34896
~image(){};
34897
34897
@@ -35044,7 +35044,7 @@ namespace ollama
35044
35044
(*this)["stream"] = stream;
35045
35045
35046
35046
if (options!=nullptr) (*this)["options"] = options["options"];
35047
- //(*this)["format"] = format; // Commented out as providing the format causes issues with some models.
35047
+ (void)format; //(*this)["format"] = format; // Commented out as providing the format causes issues with some models.
35048
35048
(*this)["keep_alive"] = keep_alive_duration;
35049
35049
type = message_type::chat;
35050
35050
@@ -35119,7 +35119,7 @@ namespace ollama
35119
35119
return simple_string;
35120
35120
}
35121
35121
35122
- const bool has_error() const
35122
+ bool has_error() const
35123
35123
{
35124
35124
if ( json_data.contains("error") ) return true;
35125
35125
return false;
@@ -35661,12 +35661,13 @@ class Ollama
35661
35661
35662
35662
private:
35663
35663
35664
+ /*
35664
35665
bool send_request(const ollama::request& request, std::function<void(const ollama::response&)> on_receive_response=nullptr)
35665
35666
{
35666
35667
35667
35668
return true;
35668
35669
}
35669
-
35670
+ */
35670
35671
35671
35672
std::string server_url;
35672
35673
httplib::Client *cli;
@@ -35829,7 +35830,7 @@ namespace ollama
35829
35830
ollama.setWriteTimeout(seconds);
35830
35831
}
35831
35832
35832
- };
35833
+ }
35833
35834
35834
35835
35835
35836
#endif
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ TEST_SUITE("Ollama Tests") {
106
106
try {
107
107
ollama::generate (" Non-existent-model" , " Requesting this model will throw an error" );
108
108
}
109
- catch (ollama::exception e) { exception_handled = true ; }
109
+ catch (ollama::exception & e) { exception_handled = true ; }
110
110
111
111
CHECK ( exception_handled );
112
112
}
You can’t perform that action at this time.
0 commit comments