Entropic 2.3.8
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 int max_output_tokens = 1024;
77 float temperature = 0.7f;
78 float repeat_penalty = 1.1f;
79 bool enable_thinking = false;
80 bool interstitial = false;
81 bool routable = true;
82 bool explicit_completion = false;
83 std::vector<std::string> validation_rules;
84 bool relay_single_delegate = false;
85 int max_iterations = -1;
87 std::optional<std::unordered_map<std::string, PhaseConfig>> phases;
88 std::optional<BenchmarkSpec> benchmark;
89};
90
97 int version = 1;
98 std::string body;
99};
100
109
116ENTROPIC_EXPORT const char* prompt_type_to_string(PromptType type);
117
130ENTROPIC_EXPORT std::string parse_prompt_file(
131 const std::filesystem::path& path,
132 PromptType expected_type,
133 ParsedPrompt& result);
134
146ENTROPIC_EXPORT std::string load_identity(
147 const std::filesystem::path& path,
148 ParsedIdentity& identity);
149
160ENTROPIC_EXPORT std::string load_constitution(
161 const std::optional<std::filesystem::path>& constitution_path,
162 bool disabled,
163 const std::filesystem::path& data_dir,
164 std::string& body);
165
182ENTROPIC_EXPORT std::string load_app_context(
183 const std::optional<std::filesystem::path>& app_context_path,
184 bool disabled,
185 const std::filesystem::path& data_dir,
186 std::string& body);
187
202ENTROPIC_EXPORT std::string resolve_tier_identity(
203 const entropic::TierConfig& tier_config,
204 const std::string& tier_name,
205 const std::filesystem::path& data_dir);
206
223 const entropic::TierConfig& tier_config,
224 const std::string& tier_name,
225 const std::filesystem::path& data_dir);
226
238ENTROPIC_EXPORT std::string assemble(
239 const entropic::ParsedConfig& config,
240 const std::filesystem::path& data_dir);
241
242} // 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:406
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:458
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:362
ENTROPIC_EXPORT std::string load_identity(const std::filesystem::path &path, ParsedIdentity &identity)
Load an identity file: parse frontmatter + body.
Definition manager.cpp:308
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:494
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:515
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:714
Inference parameters for a single identity phase.
Definition config.h:772
Tier-specific model configuration.
Definition config.h:286
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:83
std::optional< std::vector< std::string > > allowed_tools
Tool filter.
Definition manager.h:74
std::optional< std::string > auto_chain
Auto-chain target tier.
Definition manager.h:73
int max_output_tokens
Default max output tokens.
Definition manager.h:76
int max_iterations
Per-identity loop iteration cap; -1 = use global (E6)
Definition manager.h:85
std::vector< std::string > focus
Focus areas (min 1)
Definition manager.h:70
PromptType type
Always IDENTITY.
Definition manager.h:66
bool explicit_completion
Requires explicit completion.
Definition manager.h:82
std::string name
Tier name (e.g., "lead")
Definition manager.h:69
bool routable
Visible to router.
Definition manager.h:81
bool relay_single_delegate
Skip re-synthesis when single delegate returns (v2.0.11)
Definition manager.h:84
bool enable_thinking
Default thinking mode.
Definition manager.h:79
float repeat_penalty
Default repetition penalty.
Definition manager.h:78
std::optional< std::vector< std::string > > bash_commands
Allowed bash commands.
Definition manager.h:75
int max_tool_calls_per_turn
Per-identity tool call cap; -1 = use global (E6)
Definition manager.h:86
bool interstitial
Interstitial role.
Definition manager.h:80
float temperature
Default temperature.
Definition manager.h:77
std::optional< std::unordered_map< std::string, PhaseConfig > > phases
Named phases.
Definition manager.h:87
std::vector< std::string > examples
Few-shot examples.
Definition manager.h:71
std::optional< BenchmarkSpec > benchmark
Benchmark definition.
Definition manager.h:88
std::optional< std::string > grammar
Grammar file reference.
Definition manager.h:72
Parsed identity file: frontmatter + body.
Definition manager.h:105
IdentityFrontmatter frontmatter
Full identity metadata.
Definition manager.h:106
std::string body
Markdown system prompt body.
Definition manager.h:107
Parsed prompt file result: type + version + body.
Definition manager.h:95
PromptType type
Prompt type.
Definition manager.h:96
std::string body
Markdown body after frontmatter.
Definition manager.h:98
int version
Schema version.
Definition manager.h:97