Entropic 2.9.4
Local-first agentic inference engine
Loading...
Searching...
No Matches
manager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
12#pragma once
13
16
17#include <filesystem>
18#include <optional>
19#include <string>
20#include <unordered_map>
21#include <vector>
22
23namespace entropic::prompts {
24
28
33enum class PromptType {
36 IDENTITY,
37};
38
44 std::string prompt;
45 std::vector<std::string> checks_yaml;
46};
47
53 std::vector<BenchmarkPrompt> prompts;
54};
55
66 PromptType type = PromptType::IDENTITY;
67 int version = 1;
68
69 std::string name;
70 std::vector<std::string> focus;
71 std::vector<std::string> examples;
72 std::optional<std::string> grammar;
73 std::optional<std::string> auto_chain;
74 std::optional<std::vector<std::string>> allowed_tools;
75 std::optional<std::vector<std::string>> bash_commands;
76 std::optional<int> max_output_tokens;
77 std::optional<float> temperature;
78 std::optional<float> top_p;
79 std::optional<int> top_k;
80 std::optional<float> min_p;
81 std::optional<float> presence_penalty;
82 std::optional<float> frequency_penalty;
83 std::optional<float> repeat_penalty;
84 std::optional<bool> enable_thinking;
85 bool interstitial = false;
86 bool routable = true;
87 bool explicit_completion = false;
88 std::vector<std::string> validation_rules;
89 bool relay_single_delegate = false;
90 int max_iterations = -1;
92 std::optional<std::unordered_map<std::string, PhaseConfig>> phases;
93 std::optional<BenchmarkSpec> benchmark;
94};
95
102 int version = 1;
103 std::string body;
104};
105
114
121ENTROPIC_EXPORT const char* prompt_type_to_string(PromptType type);
122
135ENTROPIC_EXPORT std::string parse_prompt_file(
136 const std::filesystem::path& path,
137 PromptType expected_type,
138 ParsedPrompt& result);
139
151ENTROPIC_EXPORT std::string load_identity(
152 const std::filesystem::path& path,
153 ParsedIdentity& identity);
154
165ENTROPIC_EXPORT std::string load_constitution(
166 const std::optional<std::filesystem::path>& constitution_path,
167 bool disabled,
168 const std::filesystem::path& data_dir,
169 std::string& body);
170
187ENTROPIC_EXPORT std::string load_app_context(
188 const std::optional<std::filesystem::path>& app_context_path,
189 bool disabled,
190 const std::filesystem::path& data_dir,
191 std::string& body);
192
207ENTROPIC_EXPORT std::string resolve_tier_identity(
208 const entropic::TierConfig& tier_config,
209 const std::string& tier_name,
210 const std::filesystem::path& data_dir);
211
228 const entropic::TierConfig& tier_config,
229 const std::string& tier_name,
230 const std::filesystem::path& data_dir);
231
243ENTROPIC_EXPORT std::string assemble(
244 const entropic::ParsedConfig& config,
245 const std::filesystem::path& data_dir);
246
247} // namespace entropic::prompts
Configuration structs with defaults.
Symbol visibility macro for all exported symbols.
ENTROPIC_EXPORT std::string load_app_context(const std::optional< std::filesystem::path > &app_context_path, bool disabled, const std::filesystem::path &data_dir, std::string &body)
Load app_context prompt with tri-state resolution.
Definition manager.cpp:434
ENTROPIC_EXPORT const char * prompt_type_to_string(PromptType type)
Convert PromptType to string.
Definition manager.cpp:92
ENTROPIC_EXPORT ParsedIdentity resolve_tier_identity_full(const entropic::TierConfig &tier_config, const std::string &tier_name, const std::filesystem::path &data_dir)
Resolve full parsed identity (body + frontmatter) for a tier.
Definition manager.cpp:486
ENTROPIC_EXPORT std::string load_constitution(const std::optional< std::filesystem::path > &constitution_path, bool disabled, const std::filesystem::path &data_dir, std::string &body)
Load constitution prompt with tri-state resolution.
Definition manager.cpp:390
ENTROPIC_EXPORT std::string load_identity(const std::filesystem::path &path, ParsedIdentity &identity)
Load an identity file: parse frontmatter + body.
Definition manager.cpp:336
ENTROPIC_EXPORT std::string resolve_tier_identity(const entropic::TierConfig &tier_config, const std::string &tier_name, const std::filesystem::path &data_dir)
Resolve the system prompt body for a named tier.
Definition manager.cpp:522
PromptType
Prompt file type (frontmatter "type" field).
Definition manager.h:33
@ APP_CONTEXT
Application context prompt.
@ IDENTITY
Tier identity prompt.
@ CONSTITUTION
Constitution prompt.
ENTROPIC_EXPORT std::string assemble(const entropic::ParsedConfig &config, const std::filesystem::path &data_dir)
Assemble the full system prompt from config.
Definition manager.cpp:543
ENTROPIC_EXPORT std::string parse_prompt_file(const std::filesystem::path &path, PromptType expected_type, ParsedPrompt &result)
Parse a prompt file: validate frontmatter, return body.
Definition manager.cpp:134
Full parsed configuration.
Definition config.h:929
Inference parameters for a single identity phase.
Definition config.h:997
Tier-specific model configuration.
Definition config.h:425
A single benchmark prompt with quality checks.
Definition manager.h:43
std::vector< std::string > checks_yaml
Check defs as YAML strings.
Definition manager.h:45
std::string prompt
Prompt text.
Definition manager.h:44
Benchmark definition for an identity.
Definition manager.h:52
std::vector< BenchmarkPrompt > prompts
Benchmark prompts.
Definition manager.h:53
Identity frontmatter — full tier identity metadata.
Definition manager.h:65
std::vector< std::string > validation_rules
Per-identity constitutional rules (v2.0.6)
Definition manager.h:88
std::optional< std::vector< std::string > > allowed_tools
Tool filter.
Definition manager.h:74
std::optional< float > top_p
Per-tier top_p (gh#85); nullopt = use param default.
Definition manager.h:78
std::optional< float > repeat_penalty
Per-tier repeat_penalty (gh#86); nullopt = use param default.
Definition manager.h:83
std::optional< std::string > auto_chain
Auto-chain target tier.
Definition manager.h:73
int max_iterations
Per-identity loop iteration cap; -1 = use global (E6)
Definition manager.h:90
std::optional< float > min_p
Per-tier min_p (gh#85); nullopt = use param default.
Definition manager.h:80
std::vector< std::string > focus
Focus areas (min 1)
Definition manager.h:70
std::optional< float > presence_penalty
Per-tier presence_penalty (gh#85); nullopt = use param default.
Definition manager.h:81
PromptType type
Always IDENTITY.
Definition manager.h:66
bool explicit_completion
Requires explicit completion.
Definition manager.h:87
std::optional< bool > enable_thinking
Per-tier thinking mode (gh#86); nullopt = use param default.
Definition manager.h:84
std::optional< int > max_output_tokens
Per-tier max output tokens (gh#82); nullopt = use param default.
Definition manager.h:76
std::string name
Tier name (e.g., "lead")
Definition manager.h:69
bool routable
Visible to router.
Definition manager.h:86
std::optional< int > top_k
Per-tier top_k (gh#85); nullopt = use param default.
Definition manager.h:79
bool relay_single_delegate
Skip re-synthesis when single delegate returns (v2.0.11)
Definition manager.h:89
std::optional< std::vector< std::string > > bash_commands
Allowed bash commands.
Definition manager.h:75
std::optional< float > frequency_penalty
Per-tier frequency_penalty (gh#85); nullopt = use param default.
Definition manager.h:82
int max_tool_calls_per_turn
Per-identity tool call cap; -1 = use global (E6)
Definition manager.h:91
bool interstitial
Interstitial role.
Definition manager.h:85
std::optional< std::unordered_map< std::string, PhaseConfig > > phases
Named phases.
Definition manager.h:92
std::vector< std::string > examples
Few-shot examples.
Definition manager.h:71
std::optional< BenchmarkSpec > benchmark
Benchmark definition.
Definition manager.h:93
std::optional< std::string > grammar
Grammar file reference.
Definition manager.h:72
std::optional< float > temperature
Per-tier sampling temperature (gh#82); nullopt = use param default.
Definition manager.h:77
Parsed identity file: frontmatter + body.
Definition manager.h:110
IdentityFrontmatter frontmatter
Full identity metadata.
Definition manager.h:111
std::string body
Markdown system prompt body.
Definition manager.h:112
Parsed prompt file result: type + version + body.
Definition manager.h:100
PromptType type
Prompt type.
Definition manager.h:101
std::string body
Markdown body after frontmatter.
Definition manager.h:103
int version
Schema version.
Definition manager.h:102