feat(voice): specialize prompt for Isfahan Industrial Parks, emit source excerpts, and bound generation
- Specialize voice assistant identity and agent system prompt for «شرکت شهرکهای صنعتی اصفهان» (English instructions with Persian proper names) - Emit bounded chunk text excerpts (up to 2000 chars) and identify primary_source in realtime sources events - Bound OpenAI output generation via OPENAI_REALTIME_MAX_OUTPUT_TOKENS and add answer_limited event - Handle old-turn search cancellation safely on turn supersession - Add end-to-end search tracing pipeline and diagnostic CLI - Add database organization title and settings update script
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import sys
|
||||
from app.modules.documents.settings import IngestionSettings
|
||||
from app.infrastructure.database import create_database
|
||||
from sqlalchemy import text
|
||||
|
||||
def main():
|
||||
settings = IngestionSettings()
|
||||
engine = create_database(settings.database_url.get_secret_value())
|
||||
with engine.begin() as conn:
|
||||
conn.execute(text("UPDATE organizations SET name = :name"), {"name": "شرکت شهرکهای صنعتی اصفهان"})
|
||||
conn.execute(
|
||||
text("""
|
||||
UPDATE organization_settings
|
||||
SET assistant_name = :assistant_name,
|
||||
instruction = :instruction,
|
||||
revision = revision + 1
|
||||
"""),
|
||||
{
|
||||
"assistant_name": "دستیار صوتی شرکت شهرکهای صنعتی اصفهان",
|
||||
"instruction": "راهنمایی و پاسخگویی مستند بر اساس ضوابط و اسناد شرکت شهرکهای صنعتی اصفهان.",
|
||||
}
|
||||
)
|
||||
print("Database organization and assistant updated successfully!")
|
||||
engine.dispose()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user