Generalize from health-specific to universal personal assistant
The app manages multiple life areas (health, finance, personal, work), not just health. Updated all health-specific language throughout: Backend: - Default system prompt: general personal assistant (not health-only) - AI tool descriptions: generic (not health records/medications) - Memory categories: health, finance, personal, work, document_summary, other (replaces condition, medication, allergy, vital) - PDF template: "Prepared for" (not "Patient"), "Key Information" (not "Health Profile") - Renamed generate_health_pdf -> generate_pdf_report, health_report.html -> report.html - Renamed run_daily_health_review -> run_daily_review - Context assembly: "User Profile" (not "Health Profile") - OpenAPI: generic descriptions Frontend: - Dashboard subtitle: "Your personal AI assistant" - Memory categories: Health, Finance, Personal, Work - Document types: Report, Contract, Receipt, Certificate (not lab_result, etc.) - Updated en + ru translations throughout Documentation: - README: general personal assistant description - Removed health-only feature descriptions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,13 +24,13 @@ client = AsyncAnthropic(api_key=settings.ANTHROPIC_API_KEY)
|
||||
AI_TOOLS = [
|
||||
{
|
||||
"name": "save_memory",
|
||||
"description": "Save important health information to the user's memory. Use this when the user shares critical health data like conditions, medications, allergies, or important health facts.",
|
||||
"description": "Save important information to the user's memory. Use this when the user shares critical personal data, facts, preferences, or key details they want to remember across conversations.",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string",
|
||||
"enum": ["condition", "medication", "allergy", "vital", "document_summary", "other"],
|
||||
"enum": ["health", "finance", "personal", "work", "document_summary", "other"],
|
||||
"description": "Category of the memory entry",
|
||||
},
|
||||
"title": {"type": "string", "description": "Short title for the memory entry"},
|
||||
@@ -46,7 +46,7 @@ AI_TOOLS = [
|
||||
},
|
||||
{
|
||||
"name": "search_documents",
|
||||
"description": "Search the user's uploaded health documents for relevant information. Use this when you need to find specific health records, lab results, or consultation notes.",
|
||||
"description": "Search the user's uploaded documents for relevant information. Use this when you need to find specific records, files, or notes the user has uploaded.",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -57,13 +57,13 @@ AI_TOOLS = [
|
||||
},
|
||||
{
|
||||
"name": "get_memory",
|
||||
"description": "Retrieve the user's stored health memories filtered by category. Use this to recall previously saved health information.",
|
||||
"description": "Retrieve the user's stored memories filtered by category. Use this to recall previously saved information.",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string",
|
||||
"enum": ["condition", "medication", "allergy", "vital", "document_summary", "other"],
|
||||
"enum": ["health", "finance", "personal", "work", "document_summary", "other"],
|
||||
"description": "Optional category filter. Omit to get all memories.",
|
||||
},
|
||||
},
|
||||
@@ -94,7 +94,7 @@ AI_TOOLS = [
|
||||
},
|
||||
{
|
||||
"name": "generate_pdf",
|
||||
"description": "Generate a PDF health report compilation from the user's data. Use this when the user asks for a document or summary of their health information.",
|
||||
"description": "Generate a PDF report compilation from the user's data. Use this when the user asks for a document or summary of their stored information.",
|
||||
"input_schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -173,8 +173,8 @@ async def _execute_tool(
|
||||
})
|
||||
|
||||
elif tool_name == "generate_pdf":
|
||||
from app.services.pdf_service import generate_health_pdf
|
||||
pdf = await generate_health_pdf(db, user_id, title=tool_input["title"])
|
||||
from app.services.pdf_service import generate_pdf_report
|
||||
pdf = await generate_pdf_report(db, user_id, title=tool_input["title"])
|
||||
await db.commit()
|
||||
return json.dumps({
|
||||
"status": "generated",
|
||||
@@ -213,7 +213,7 @@ async def assemble_context(
|
||||
memories = await get_critical_memories(db, user_id)
|
||||
if memories:
|
||||
memory_lines = [f"- [{m.category}] {m.title}: {m.content}" for m in memories]
|
||||
system_parts.append(f"---\nUser Health Profile:\n" + "\n".join(memory_lines))
|
||||
system_parts.append(f"---\nUser Profile (Key Information):\n" + "\n".join(memory_lines))
|
||||
|
||||
# 5. Relevant document excerpts (based on user message keywords)
|
||||
if user_message.strip():
|
||||
|
||||
Reference in New Issue
Block a user