File tree Expand file tree Collapse file tree 3 files changed +20
-17
lines changed
Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,19 @@ package("llmapi")
1212 " https://github.com/mcpplibs/llmapi.git"
1313 )
1414
15+ add_versions (" 0.1.0" , " f01f5b0b6d11242b655f7c383e82a71e30a7696cdf4468d7ab3a3ae72f99b3e5" )
1516 add_versions (" 0.0.1" , " 174f86d3afdf48a57ad1cc9688718d1f1100a78a7e56686c823c573c3ccf99f4" )
1617
1718 add_includedirs (" include" )
18- add_deps (" libcurl 8.11.0 " )
19+ add_deps (" mbedtls 3.6.1 " )
1920
2021 on_load (function (package )
2122 package :add (" links" , " llmapi" )
23+ package :add (" links" , " tinyhttps" )
2224 end )
2325
2426 on_install (function (package )
25- import (" package.tools.xmake" ).install (package )
26- end )
27+ local configs = {}
28+ import (" package.tools.xmake" ).install (package , configs , {target = " tinyhttps" })
29+ import (" package.tools.xmake" ).install (package , configs , {target = " llmapi" })
30+ end )
Original file line number Diff line number Diff line change @@ -2,17 +2,16 @@ import std;
22import mcpplibs.llmapi;
33
44int main () {
5- using namespace mcpplibs ;
6-
7- llmapi::Client client (std::getenv (" OPENAI_API_KEY" ), llmapi::URL::Poe);
5+ using namespace mcpplibs ::llmapi;
86
9- client.model (" gpt-5" )
10- .system (" You are a helpful assistant." )
11- .user (" In one sentence, introduce modern C++. 并给出中文翻译" )
12- .request ([](std::string_view chunk) {
13- std::print (" {}" , chunk);
14- std::cout.flush ();
15- });
7+ auto client = Client (Config{
8+ .apiKey = " test-key" ,
9+ .model = " gpt-4o-mini" ,
10+ });
1611
17- return 0 ;
18- }
12+ client.system (" You are a helpful assistant." );
13+ client.user (" In one sentence, introduce modern C++." );
14+
15+ std::println (" llmapi {}" , VERSION);
16+ return client.conversation ().size () == 2 ? 0 : 1 ;
17+ }
Original file line number Diff line number Diff line change 1- add_requires (" llmapi 0.0.2 " )
1+ add_requires (" llmapi 0.1.0 " )
22
33target (" llmapi_test" )
44 set_kind (" binary" )
55 add_languages (" c++23" )
66 add_files (" main.cpp" )
77 add_packages (" llmapi" )
8- set_policy (" build.c++.modules" , true )
8+ set_policy (" build.c++.modules" , true )
You can’t perform that action at this time.
0 commit comments