insight-chat: code-review polish on the system-prompt split
- Use Option::map instead of manual match-on-Option (drops clippy::manual_map). - Drop redundant `max_iterations = max_iterations` from the format! call. - Use captured identifiers consistently in the user_content format!. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2980,7 +2980,6 @@ Return ONLY the summary, nothing else."#,
|
|||||||
- Use recall_facts_for_photo + recall_entities to load any prior knowledge about subjects in the photo.\n\
|
- Use recall_facts_for_photo + recall_entities to load any prior knowledge about subjects in the photo.\n\
|
||||||
- When you identify people / places / events / things, use store_entity + store_fact to grow the persistent memory.\n\
|
- When you identify people / places / events / things, use store_entity + store_fact to grow the persistent memory.\n\
|
||||||
- A tool returning no results is informative; continue with the others.",
|
- A tool returning no results is informative; continue with the others.",
|
||||||
max_iterations = max_iterations
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut out = identity;
|
let mut out = identity;
|
||||||
@@ -3344,8 +3343,8 @@ Return ONLY the summary, nothing else."#,
|
|||||||
// (when supplied) is the authoritative identity — the framework
|
// (when supplied) is the authoritative identity — the framework
|
||||||
// never appends a competing "you are a personal photo memory
|
// never appends a competing "you are a personal photo memory
|
||||||
// assistant" line. The procedural block stays identity-free.
|
// assistant" line. The procedural block stays identity-free.
|
||||||
let owner_id_note = match owner_entity_id {
|
let owner_id_note = owner_entity_id.map(|id| {
|
||||||
Some(id) => Some(format!(
|
format!(
|
||||||
"\n\nYour identity in the knowledge store: {name} (entity ID: {id}). \
|
"\n\nYour identity in the knowledge store: {name} (entity ID: {id}). \
|
||||||
When storing facts where you ({name}) are the object — for example, someone is your friend, \
|
When storing facts where you ({name}) are the object — for example, someone is your friend, \
|
||||||
sibling, or colleague — use subject_entity_id for the other person and set object_value to \
|
sibling, or colleague — use subject_entity_id for the other person and set object_value to \
|
||||||
@@ -3353,9 +3352,8 @@ Return ONLY the summary, nothing else."#,
|
|||||||
{name} directly, use {id} as the subject_entity_id.",
|
{name} directly, use {id} as the subject_entity_id.",
|
||||||
name = owner_name,
|
name = owner_name,
|
||||||
id = id
|
id = id
|
||||||
)),
|
)
|
||||||
None => None,
|
});
|
||||||
};
|
|
||||||
let fewshot_block = Self::render_fewshot_examples(&fewshot_examples);
|
let fewshot_block = Self::render_fewshot_examples(&fewshot_examples);
|
||||||
let system_content = Self::build_system_content(
|
let system_content = Self::build_system_content(
|
||||||
custom_system_prompt.as_deref(),
|
custom_system_prompt.as_deref(),
|
||||||
@@ -3397,18 +3395,13 @@ Return ONLY the summary, nothing else."#,
|
|||||||
// and summary" claim that used to live here was unused (the title is
|
// and summary" claim that used to live here was unused (the title is
|
||||||
// regenerated post-hoc from the summary by generate_photo_title).
|
// regenerated post-hoc from the summary by generate_photo_title).
|
||||||
let user_content = format!(
|
let user_content = format!(
|
||||||
"{visual_block}Photo file path: {}\n\
|
"{visual_block}Photo file path: {file_path}\n\
|
||||||
Date taken: {}\n\
|
Date taken: {date}\n\
|
||||||
{}\n\
|
{contact_info}\n\
|
||||||
{}\n\
|
{gps_info}\n\
|
||||||
{}\n\n\
|
{tags_info}\n\n\
|
||||||
Gather context with the available tools, then respond.",
|
Gather context with the available tools, then respond.",
|
||||||
file_path,
|
date = date_taken.format("%B %d, %Y"),
|
||||||
date_taken.format("%B %d, %Y"),
|
|
||||||
contact_info,
|
|
||||||
gps_info,
|
|
||||||
tags_info,
|
|
||||||
visual_block = visual_block,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// 10. Define tools. Hybrid mode omits `describe_photo` since the
|
// 10. Define tools. Hybrid mode omits `describe_photo` since the
|
||||||
|
|||||||
Reference in New Issue
Block a user