Writer Agent¶
writer ¶
Pydantic-AI powered writer agent.
This module implements the writer workflow using Pydantic-AI. It acts as the Composition Root for the agent, assembling core tools and capabilities before executing the conversation through a pydantic_ai.Agent.
JournalEntry dataclass ¶
JournalEntry(
entry_type: str,
content: str,
timestamp: datetime | None = None,
tool_name: str | None = None,
)
Represents a single entry in the intercalated journal log.
WriterJournalEntryParams dataclass ¶
WriterJournalEntryParams(
intercalated_log: list[JournalEntry],
window_label: str,
output_sink: OutputSink,
posts_published: int,
profiles_updated: int,
window_start: datetime,
window_end: datetime,
total_tokens: int = 0,
)
Parameters for saving a journal entry.
WriterFinalizationParams dataclass ¶
WriterFinalizationParams(
saved_posts: list[str],
saved_profiles: list[str],
resources: WriterResources,
deps: WriterDeps,
cache: PipelineCache,
signature: str,
)
Parameters for finalizing writer results.
write_posts_with_pydantic_agent ¶
write_posts_with_pydantic_agent(
*,
prompt: str,
config: EgregoraConfig,
context: WriterDeps,
test_model: AgentModel | None = None,
max_tokens_override: int | None = None,
api_key_override: str | None = None,
) -> tuple[list[str], list[str]]
Execute the writer flow using Pydantic-AI agent tooling.
Source code in src/egregora/agents/writer.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
write_posts_for_window ¶
Public entry point for the writer agent.
Source code in src/egregora/agents/writer.py
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | |
load_format_instructions ¶
load_format_instructions(
site_root: Path | None, *, registry: OutputSinkRegistry | None = None
) -> str
Load output format instructions for the writer agent.
Source code in src/egregora/agents/writer.py
get_top_authors ¶
Get top N active authors by message count.
Deprecated: Use Message DTOs filtering instead.