#include <prompt_builder.h>

Public Member Functions | |
| PromptBuilder () | |
| void | SetRom (Rom *rom) |
| absl::Status | LoadResourceCatalogue (const std::string &yaml_path) |
| std::string | BuildSystemInstruction () |
| std::string | BuildSystemInstructionWithExamples () |
| std::string | BuildContextualPrompt (const std::string &user_prompt, const RomContext &context) |
| std::string | BuildPromptFromHistory (const std::vector< agent::ChatMessage > &history) |
| void | AddFewShotExample (const FewShotExample &example) |
| std::vector< FewShotExample > | GetExamplesForCategory (const std::string &category) |
| std::string | LookupTileId (const std::string &alias) const |
| const std::map< std::string, std::string > & | tile_reference () const |
| const std::vector< ToolSpecification > & | tool_specs () const |
| std::string | BuildFunctionCallSchemas () const |
| void | SetVerbosity (int level) |
Private Member Functions | |
| std::string | BuildCommandReference () const |
| std::string | BuildFewShotExamplesSection () const |
| std::string | BuildToolReference () const |
| std::string | BuildContextSection (const RomContext &context) |
| std::string | BuildConstraintsSection () const |
| std::string | BuildTileReferenceSection () const |
| absl::StatusOr< std::string > | ResolveCataloguePath (const std::string &yaml_path) const |
| void | ClearCatalogData () |
| absl::Status | ParseCommands (const nlohmann::json &commands) |
| absl::Status | ParseTools (const nlohmann::json &tools) |
| absl::Status | ParseExamples (const nlohmann::json &examples) |
| void | ParseTileReference (const nlohmann::json &tile_reference) |
Private Attributes | |
| Rom * | rom_ = nullptr |
| std::unique_ptr< ResourceContextBuilder > | resource_context_builder_ |
| std::map< std::string, std::string > | command_docs_ |
| std::vector< FewShotExample > | examples_ |
| std::vector< ToolSpecification > | tool_specs_ |
| std::map< std::string, std::string > | tile_reference_ |
| int | verbosity_ = 1 |
| bool | catalogue_loaded_ = false |
Definition at line 67 of file prompt_builder.h.
|
default |
|
inline |
Definition at line 71 of file prompt_builder.h.
References rom_.
| absl::Status yaze::cli::PromptBuilder::LoadResourceCatalogue | ( | const std::string & | yaml_path | ) |
Definition at line 118 of file prompt_builder.cc.
References catalogue_loaded_, ClearCatalogData(), ParseCommands(), ParseExamples(), ParseTileReference(), ParseTools(), and ResolveCataloguePath().
| std::string yaze::cli::PromptBuilder::BuildSystemInstruction | ( | ) |
Definition at line 594 of file prompt_builder.cc.
| std::string yaze::cli::PromptBuilder::BuildSystemInstructionWithExamples | ( | ) |
Definition at line 649 of file prompt_builder.cc.
| std::string yaze::cli::PromptBuilder::BuildContextualPrompt | ( | const std::string & | user_prompt, |
| const RomContext & | context ) |
Definition at line 659 of file prompt_builder.cc.
| std::string yaze::cli::PromptBuilder::BuildPromptFromHistory | ( | const std::vector< agent::ChatMessage > & | history | ) |
Definition at line 674 of file prompt_builder.cc.
| void yaze::cli::PromptBuilder::AddFewShotExample | ( | const FewShotExample & | example | ) |
Definition at line 693 of file prompt_builder.cc.
| std::vector< FewShotExample > yaze::cli::PromptBuilder::GetExamplesForCategory | ( | const std::string & | category | ) |
Definition at line 697 of file prompt_builder.cc.
References BuildCommandReference(), BuildToolReference(), command_docs_, and tool_specs_.

| std::string yaze::cli::PromptBuilder::LookupTileId | ( | const std::string & | alias | ) | const |
Definition at line 373 of file prompt_builder.cc.
References tile_reference_.
|
inline |
Definition at line 97 of file prompt_builder.h.
References tile_reference_.
Referenced by ParseTileReference().
|
inline |
Definition at line 100 of file prompt_builder.h.
References tool_specs_.
Referenced by yaze::cli::ToolSchemaBuilder::ResolveFunctionDeclarations().
| std::string yaze::cli::PromptBuilder::BuildFunctionCallSchemas | ( | ) | const |
Definition at line 427 of file prompt_builder.cc.
References yaze::cli::ToolSchemaBuilder::BuildFunctionDeclarations(), and tool_specs_.
Referenced by BuildConstraintsSection(), and BuildContextSection().

|
inline |
Definition at line 108 of file prompt_builder.h.
References verbosity_.
|
private |
Definition at line 381 of file prompt_builder.cc.
References command_docs_.
Referenced by GetExamplesForCategory().
|
private |
Definition at line 435 of file prompt_builder.cc.
References examples_.
|
private |
Definition at line 394 of file prompt_builder.cc.
References tool_specs_.
Referenced by GetExamplesForCategory().
|
private |
Definition at line 555 of file prompt_builder.cc.
References BuildFunctionCallSchemas().

|
private |
Definition at line 476 of file prompt_builder.cc.
References BuildFunctionCallSchemas(), BuildTileReferenceSection(), yaze::util::PlatformPaths::FindAsset(), tile_reference_, and tool_specs_.

|
private |
Definition at line 543 of file prompt_builder.cc.
Referenced by BuildConstraintsSection().
|
private |
Definition at line 85 of file prompt_builder.cc.
References yaze::util::PlatformPaths::FindAsset().
Referenced by LoadResourceCatalogue().

|
private |
Definition at line 77 of file prompt_builder.cc.
References catalogue_loaded_, command_docs_, examples_, tile_reference_, and tool_specs_.
Referenced by LoadResourceCatalogue().
|
private |
Definition at line 182 of file prompt_builder.cc.
References command_docs_.
Referenced by LoadResourceCatalogue().
|
private |
Definition at line 199 of file prompt_builder.cc.
References yaze::cli::ToolSpecification::arguments, yaze::cli::ToolArgument::description, yaze::cli::ToolSpecification::description, yaze::cli::ToolArgument::example, yaze::cli::ToolArgument::name, yaze::cli::ToolSpecification::name, yaze::cli::ToolArgument::required, tool_specs_, and yaze::cli::ToolSpecification::usage_notes.
Referenced by LoadResourceCatalogue().
|
private |
Definition at line 270 of file prompt_builder.cc.
References yaze::cli::ToolCall::args, examples_, yaze::cli::FewShotExample::expected_commands, yaze::cli::FewShotExample::explanation, yaze::cli::FewShotExample::text_response, yaze::cli::FewShotExample::tool_calls, yaze::cli::ToolCall::tool_name, and yaze::cli::FewShotExample::user_prompt.
Referenced by LoadResourceCatalogue().
|
private |
Definition at line 361 of file prompt_builder.cc.
References tile_reference(), and tile_reference_.
Referenced by LoadResourceCatalogue().

|
private |
Definition at line 125 of file prompt_builder.h.
Referenced by SetRom().
|
private |
Definition at line 126 of file prompt_builder.h.
|
private |
Definition at line 127 of file prompt_builder.h.
Referenced by BuildCommandReference(), ClearCatalogData(), GetExamplesForCategory(), and ParseCommands().
|
private |
Definition at line 128 of file prompt_builder.h.
Referenced by BuildFewShotExamplesSection(), ClearCatalogData(), and ParseExamples().
|
private |
Definition at line 129 of file prompt_builder.h.
Referenced by BuildConstraintsSection(), BuildFunctionCallSchemas(), BuildToolReference(), ClearCatalogData(), GetExamplesForCategory(), ParseTools(), and tool_specs().
|
private |
Definition at line 130 of file prompt_builder.h.
Referenced by BuildConstraintsSection(), ClearCatalogData(), LookupTileId(), ParseTileReference(), and tile_reference().
|
private |
Definition at line 131 of file prompt_builder.h.
Referenced by SetVerbosity().
|
private |
Definition at line 132 of file prompt_builder.h.
Referenced by ClearCatalogData(), and LoadResourceCatalogue().