Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
content.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
9
10namespace entropic {
11
20std::string extract_text(const std::vector<ContentPart>& parts) {
21 std::string result;
22 for (const auto& part : parts) {
23 if (part.type != ContentPartType::TEXT) {
24 continue;
25 }
26 if (!result.empty()) {
27 result += ' ';
28 }
29 result += part.text;
30 }
31 return result;
32}
33
41bool has_images(const std::vector<ContentPart>& parts) {
42 for (const auto& part : parts) {
43 if (part.type == ContentPartType::IMAGE) {
44 return true;
45 }
46 }
47 return false;
48}
49
50} // namespace entropic
Multimodal content types for messages.
Activate model on GPU (WARM → ACTIVE).
@ IMAGE
Image content (local path or data URI)
@ TEXT
Plain text content.
bool has_images(const std::vector< ContentPart > &parts)
Check if content parts contain any image parts.
Definition content.cpp:41
std::string extract_text(const std::vector< ContentPart > &parts)
Extract concatenated text from content parts.
Definition content.cpp:20