File tree Expand file tree Collapse file tree 6 files changed +88
-16
lines changed Expand file tree Collapse file tree 6 files changed +88
-16
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,6 @@ COPTS_OV_TRACE = select({
23
23
"//conditions:default" : ["-DOV_TRACE=0" ],
24
24
"//:not_disable_ov_trace" : ["-DOV_TRACE=1" ],
25
25
})
26
- COPTS_ADJUSTED = COMMON_STATIC_LIBS_COPTS + select ({
27
- "//conditions:default" : [],
28
- "//:fuzzer_build" : COMMON_FUZZER_COPTS ,
29
- })
30
26
LINKOPTS_ADJUSTED = COMMON_STATIC_LIBS_LINKOPTS + select ({
31
27
"//conditions:default" : [],
32
28
"//:fuzzer_build" : COMMON_FUZZER_LINKOPTS ,
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ ovms_cc_library(
124
124
"//src:libovmslogging" ,
125
125
"//src:libovmsstring_utils" ,
126
126
"//src:libovmsstatus" ,
127
+ "//src/utils:rapidjson_utils" ,
127
128
] + select ({
128
129
"//conditions:default" : ["//third_party:genai" , ":llm_engine" ],
129
130
"//:not_genai_bin" : [":llm_engine" ],
Original file line number Diff line number Diff line change 29
29
30
30
#include " src/llm/io_processing/utils.hpp"
31
31
#include " src/logging.hpp"
32
+ #include " src/utils/rapidjson_utils.hpp"
32
33
#include " qwen3coder_tool_parser.hpp"
33
34
34
35
namespace ovms {
@@ -314,18 +315,6 @@ std::optional<std::string> Qwen3CoderToolParserImpl::getCurrentFunctionName() co
314
315
}
315
316
return this ->currentFunction .name ;
316
317
}
317
- // Example from OpenAI API. Keep in mind that for Qwen3Coder we will send only function name, and then second message with all arguments
318
-
319
- // for Qwen3Coder we will send first response with function call name and id
320
- // then we will send only one delta with all arguments
321
-
322
- static std::string documentToString (const rapidjson::Document& doc) {
323
- rapidjson::StringBuffer buffer;
324
- rapidjson::Writer<rapidjson::StringBuffer> writer (buffer);
325
- doc.Accept (writer);
326
- return buffer.GetString ();
327
- }
328
-
329
318
std::optional<rapidjson::Document> Qwen3CoderToolParser::sendFullDelta (std::optional<ToolCalls>& toolCallsOpt) {
330
319
auto & toolCalls = toolCallsOpt.value ();
331
320
if (toolCalls.size () != 1 ) {
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) 2025 Intel Corporation
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ load ("//:common_settings.bzl" , "ovms_cc_library" )
17
+
18
+ ovms_cc_library (
19
+ name = "rapidjson_utils" ,
20
+ hdrs = ["rapidjson_utils.hpp" ],
21
+ srcs = ["rapidjson_utils.cpp" ],
22
+ deps = [
23
+ "@com_github_tencent_rapidjson//:rapidjson" ,
24
+ ],
25
+ visibility = ["//visibility:public" ,],
26
+ )
Original file line number Diff line number Diff line change
1
+ // *****************************************************************************
2
+ // Copyright 2025 Intel Corporation
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ // *****************************************************************************
16
+ #include " rapidjson_utils.hpp"
17
+
18
+ #include < string>
19
+
20
+ #pragma warning(push)
21
+ #pragma warning(disable : 6313)
22
+ #include < rapidjson/document.h>
23
+ #include < rapidjson/stringbuffer.h>
24
+ #include < rapidjson/writer.h>
25
+ #pragma warning(pop)
26
+
27
+ namespace ovms {
28
+ std::string documentToString (const rapidjson::Document& doc) {
29
+ rapidjson::StringBuffer buffer;
30
+ rapidjson::Writer<rapidjson::StringBuffer> writer (buffer);
31
+ doc.Accept (writer);
32
+ return buffer.GetString ();
33
+ }
34
+ } // namespace ovms
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+ // *****************************************************************************
3
+ // Copyright 2025 Intel Corporation
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+ // *****************************************************************************
17
+ #include < string>
18
+
19
+ #pragma warning(push)
20
+ #pragma warning(disable : 6313)
21
+ #include < rapidjson/document.h>
22
+ #pragma warning(pop)
23
+
24
+ namespace ovms {
25
+ std::string documentToString (const rapidjson::Document& doc);
26
+ } // namespace ovms
You can’t perform that action at this time.
0 commit comments