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
8
#include <
entropic/types/content.h
>
9
10
namespace
entropic
{
11
20
std::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
41
bool
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
content.h
Multimodal content types for messages.
entropic
Activate model on GPU (WARM → ACTIVE).
Definition
bundled_models.h:20
entropic::ContentPartType::IMAGE
@ IMAGE
Image content (local path or data URI)
entropic::ContentPartType::TEXT
@ TEXT
Plain text content.
entropic::has_images
bool has_images(const std::vector< ContentPart > &parts)
Check if content parts contain any image parts.
Definition
content.cpp:41
entropic::extract_text
std::string extract_text(const std::vector< ContentPart > &parts)
Extract concatenated text from content parts.
Definition
content.cpp:20
types
content.cpp
Generated by
1.9.8