Upload folder using huggingface_hub
Browse files- .gitignore +4 -0
- main_rag.ipynb +227 -182
- pipeline.yml +47 -49
.gitignore
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Byte-compiled / optimized / DLL files
|
| 2 |
__pycache__/
|
| 3 |
*.py[cod]
|
|
|
|
| 1 |
+
# Additional
|
| 2 |
+
.DS_Store
|
| 3 |
+
.DS_Store/
|
| 4 |
+
|
| 5 |
# Byte-compiled / optimized / DLL files
|
| 6 |
__pycache__/
|
| 7 |
*.py[cod]
|
main_rag.ipynb
CHANGED
|
@@ -369,8 +369,8 @@
|
|
| 369 |
{
|
| 370 |
"metadata": {
|
| 371 |
"ExecuteTime": {
|
| 372 |
-
"end_time": "2024-10-
|
| 373 |
-
"start_time": "2024-10-
|
| 374 |
}
|
| 375 |
},
|
| 376 |
"cell_type": "code",
|
|
@@ -386,37 +386,49 @@
|
|
| 386 |
"from dotenv import load_dotenv\n",
|
| 387 |
"\n",
|
| 388 |
"\n",
|
| 389 |
-
"system_prompt = \"\"\"
|
|
|
|
| 390 |
"\n",
|
| 391 |
-
"Requirements:\n",
|
| 392 |
"\n",
|
| 393 |
-
"
|
|
|
|
| 394 |
"\n",
|
| 395 |
-
"
|
| 396 |
-
" - Title Page: Include a title that reflects the main theme of the documents.\n",
|
| 397 |
-
" - Introduction: Provide a complete and thorough overview of the content, purpose, and scope of the documentation.\n",
|
| 398 |
-
" - Main Sections: Divide the documentation into logical sections and subsections based on the themes and topics found in the documents. Each section should include:\n",
|
| 399 |
-
" - A clear, descriptive heading that reflects the content within the section.\n",
|
| 400 |
-
" - Detailed explanations of key concepts and ideas. Expand on each idea or concept with thorough descriptions, definitions, and context. Ensure the reader fully understands the material.\n",
|
| 401 |
-
" - Code fragments: Where applicable, include relevant code snippets from the documents. These should be properly formatted and explained in detail. For each code snippet, provide a clear explanation of its purpose, functionality, and how it fits into the overall system or process described in the document.\n",
|
| 402 |
-
" - Examples: Provide relevant examples where applicable, explaining them fully to ensure understanding.\n",
|
| 403 |
-
" - Conflict Resolution: If there are contradictory pieces of information across different documents, resolve them using the date provided at the beginning of each document, prioritizing the most recent information. If a document’s date is unknown and conflicts cannot be resolved, explicitly indicate which parts contradict one another, then clearly explain the contradiction. Mention all unresolved conflicts at the end of each section.\n",
|
| 404 |
"\n",
|
| 405 |
-
"
|
| 406 |
-
" - Ensure that all information from the documents is included and accurately represented.\n",
|
| 407 |
-
" - The content should not just list bullet points but should be expanded into full sentences and paragraphs where necessary, with elaboration and explanations for all points.\n",
|
| 408 |
-
" - Use clear and logical transitions between sections to maintain the flow and coherence of the document.\n",
|
| 409 |
-
" - Use bullet points, tables, code fragments, or diagrams where appropriate to enhance understanding and readability, but always accompany these elements with in-depth explanations.\n",
|
| 410 |
"\n",
|
| 411 |
-
"
|
| 412 |
"\n",
|
| 413 |
-
"
|
| 414 |
"\n",
|
| 415 |
-
"
|
| 416 |
-
"\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
"\n",
|
| 418 |
"\n",
|
| 419 |
-
"template = \"\"\"\n",
|
| 420 |
"User Question: {{question}}\n",
|
| 421 |
"Documents to Analyze:\n",
|
| 422 |
"{% for doc in documents %}\n",
|
|
@@ -476,7 +488,7 @@
|
|
| 476 |
],
|
| 477 |
"id": "d57a03567a4c79a8",
|
| 478 |
"outputs": [],
|
| 479 |
-
"execution_count":
|
| 480 |
},
|
| 481 |
{
|
| 482 |
"metadata": {},
|
|
@@ -487,13 +499,13 @@
|
|
| 487 |
{
|
| 488 |
"metadata": {
|
| 489 |
"ExecuteTime": {
|
| 490 |
-
"end_time": "2024-10-
|
| 491 |
-
"start_time": "2024-10-
|
| 492 |
}
|
| 493 |
},
|
| 494 |
"cell_type": "code",
|
| 495 |
"source": [
|
| 496 |
-
"query = \"
|
| 497 |
"result = rag_pipeline.run({\n",
|
| 498 |
" \"text_embedder\": {\"text\": query},\n",
|
| 499 |
" \"prompt_builder\": {\"question\": query},\n",
|
|
@@ -512,7 +524,7 @@
|
|
| 512 |
"name": "stderr",
|
| 513 |
"output_type": "stream",
|
| 514 |
"text": [
|
| 515 |
-
"/
|
| 516 |
" warnings.warn(\n"
|
| 517 |
]
|
| 518 |
},
|
|
@@ -524,7 +536,7 @@
|
|
| 524 |
"application/vnd.jupyter.widget-view+json": {
|
| 525 |
"version_major": 2,
|
| 526 |
"version_minor": 0,
|
| 527 |
-
"model_id": "
|
| 528 |
}
|
| 529 |
},
|
| 530 |
"metadata": {},
|
|
@@ -534,88 +546,121 @@
|
|
| 534 |
"name": "stdout",
|
| 535 |
"output_type": "stream",
|
| 536 |
"text": [
|
| 537 |
-
"
|
| 538 |
-
"#
|
| 539 |
"\n",
|
| 540 |
"## Introduction\n",
|
| 541 |
"\n",
|
| 542 |
-
"This documentation
|
| 543 |
"\n",
|
| 544 |
-
"
|
| 545 |
-
"- Describe the maximum user limits within teams and conversations.\n",
|
| 546 |
-
"- Explain configurations needed for handling larger teams in Brigade (Brig).\n",
|
| 547 |
-
"- Provide guidance on file descriptor management for active connections.\n",
|
| 548 |
-
"- Offer troubleshooting tips and strategies for effective server management.\n",
|
| 549 |
"\n",
|
| 550 |
-
"##
|
| 551 |
-
"1. [Maximum Team Sizes](#maximum-team-sizes)\n",
|
| 552 |
-
"2. [Managing Large Teams](#managing-large-teams)\n",
|
| 553 |
-
" - 2.1 [Configuring Team Size](#configuring-team-size)\n",
|
| 554 |
-
" - 2.2 [Team Updates and WebSocket Notifications](#team-updates-and-websocket-notifications)\n",
|
| 555 |
-
"3. [Conversation Membership Limits](#conversation-membership-limits)\n",
|
| 556 |
-
"4. [File Descriptor Management](#file-descriptor-management)\n",
|
| 557 |
-
"5. [Recap and Conclusions](#recap-and-conclusions)\n",
|
| 558 |
"\n",
|
| 559 |
-
"##
|
| 560 |
"\n",
|
| 561 |
-
"
|
| 562 |
"\n",
|
| 563 |
-
"
|
| 564 |
-
"
|
| 565 |
-
"
|
| 566 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 567 |
"\n",
|
| 568 |
-
"
|
| 569 |
"\n",
|
| 570 |
-
"
|
| 571 |
-
"- If your team surpasses **2000 members**, some real-time team update events, such as notifications regarding new members joining, will not be delivered via WebSocket connections. However, this limitation does not significantly obstruct the overall functioning of the application.\n",
|
| 572 |
-
"- Individual conversations, regardless of team size, maintain a strict upper limit of **2000** members. This cannot be overridden due to backend constraints that only support fan-out messaging to a maximum of 2000 recipients, which is an ongoing area for enhancement in future updates.\n",
|
| 573 |
"\n",
|
| 574 |
-
"##
|
| 575 |
"\n",
|
| 576 |
-
"
|
| 577 |
-
"To modify the maximum size of teams within your Wire infrastructure, follow these steps:\n",
|
| 578 |
-
"1. Access the Brig configuration file.\n",
|
| 579 |
-
"2. Locate the `optSettings` section.\n",
|
| 580 |
-
"3. Insert or edit the `setMaxTeamSize` option as shown previously.\n",
|
| 581 |
"\n",
|
| 582 |
-
"
|
| 583 |
-
"When handling a team that exceeds **2000** members, you should be aware:\n",
|
| 584 |
-
"- Clients will not receive live websocket notifications for certain updates.\n",
|
| 585 |
-
"- Despite this, regular functionality should remain intact for most applications.\n",
|
| 586 |
"\n",
|
| 587 |
-
"##
|
| 588 |
"\n",
|
| 589 |
-
"
|
|
|
|
|
|
|
| 590 |
"\n",
|
| 591 |
-
"
|
| 592 |
"\n",
|
| 593 |
-
"
|
| 594 |
"\n",
|
| 595 |
-
"
|
| 596 |
-
"
|
| 597 |
-
"
|
|
|
|
| 598 |
"\n",
|
| 599 |
-
"##
|
| 600 |
"\n",
|
| 601 |
-
"
|
| 602 |
"\n",
|
| 603 |
-
"
|
| 604 |
-
"
|
| 605 |
-
"-
|
| 606 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 607 |
"\n",
|
| 608 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
]
|
| 610 |
}
|
| 611 |
],
|
| 612 |
-
"execution_count":
|
| 613 |
},
|
| 614 |
{
|
| 615 |
"metadata": {
|
| 616 |
"ExecuteTime": {
|
| 617 |
-
"end_time": "2024-10-
|
| 618 |
-
"start_time": "2024-10-
|
| 619 |
}
|
| 620 |
},
|
| 621 |
"cell_type": "code",
|
|
@@ -633,113 +678,113 @@
|
|
| 633 |
"output_type": "stream",
|
| 634 |
"text": [
|
| 635 |
"Finish Reason: stop\n",
|
| 636 |
-
"Output Tokens:
|
| 637 |
-
"Input Tokens:
|
| 638 |
-
"\n",
|
| 639 |
-
"1. 0.
|
| 640 |
-
" https://docs.wire.com/
|
| 641 |
-
"2. 0.
|
| 642 |
-
" https://docs.wire.com/
|
| 643 |
-
"3. 0.
|
| 644 |
-
" https://docs.wire.com/
|
| 645 |
-
"4. 0.
|
| 646 |
-
" https://docs.wire.com/
|
| 647 |
-
"5. 0.
|
| 648 |
-
" https://docs.wire.com/
|
| 649 |
-
"6. 0.
|
| 650 |
-
" https://docs.wire.com/
|
| 651 |
-
"7. 0.
|
| 652 |
-
" https://docs.wire.com/
|
| 653 |
-
"8. 0.
|
| 654 |
-
" https://docs.wire.com/
|
| 655 |
-
"9. 0.
|
| 656 |
-
" https://docs.wire.com/
|
| 657 |
-
"10. 0.
|
| 658 |
-
" https://docs.wire.com/
|
| 659 |
-
"11. 0.
|
| 660 |
-
" https://docs.wire.com/
|
| 661 |
-
"12. 0.
|
| 662 |
-
" https://docs.wire.com/
|
| 663 |
-
"13. 0.
|
| 664 |
-
" https://
|
| 665 |
-
"14. 0.
|
| 666 |
-
" https://docs.wire.com/
|
| 667 |
-
"15. 0.
|
| 668 |
-
" https://
|
| 669 |
-
"16. 0.
|
| 670 |
-
" https://
|
| 671 |
-
"17. 0.
|
| 672 |
-
" https://docs.wire.com/how-to/install/infrastructure-configuration.html#controlling-the-speed-of-websocket-draining-during-cannon-pod-replacement\n",
|
| 673 |
-
"18. 0.578950703 Infrastructure configuration options — Wire 0.0.4 documentation I have a team larger than 500 users\n",
|
| 674 |
-
" https://docs.wire.com/how-to/install/infrastructure-configuration.html#smtp-server\n",
|
| 675 |
-
"19. 0.578950703 Infrastructure configuration options — Wire 0.0.4 documentation I have a team larger than 500 users\n",
|
| 676 |
-
" https://docs.wire.com/how-to/install/infrastructure-configuration.html#i-have-a-team-larger-than-500-users\n",
|
| 677 |
-
"20. 0.578950703 Infrastructure configuration options — Wire 0.0.4 documentation I have a team larger than 500 users\n",
|
| 678 |
-
" https://docs.wire.com/how-to/install/infrastructure-configuration.html#configuring-authentication-cookie-throttling\n",
|
| 679 |
-
"21. 0.392603099 Restund (TURN) servers — Wire 0.0.4 documentation Amount of users and file descriptors\n",
|
| 680 |
-
" https://docs.wire.com/understand/restund.html#amount-of-users-and-file-descriptors\n",
|
| 681 |
-
"22. 0.392603099 Restund (TURN) servers — Wire 0.0.4 documentation Amount of users and file descriptors\n",
|
| 682 |
-
" https://docs.wire.com/understand/restund.html\n",
|
| 683 |
-
"23. 0.392603099 Restund (TURN) servers — Wire 0.0.4 documentation Amount of users and file descriptors\n",
|
| 684 |
-
" https://docs.wire.com/understand/restund.html#dns\n",
|
| 685 |
-
"24. 0.392603099 Restund (TURN) servers — Wire 0.0.4 documentation Amount of users and file descriptors\n",
|
| 686 |
-
" https://docs.wire.com/understand/restund.html#what-is-it-used-for\n",
|
| 687 |
-
"25. 0.392603099 Restund (TURN) servers — Wire 0.0.4 documentation Amount of users and file descriptors\n",
|
| 688 |
-
" https://docs.wire.com/understand/restund.html#discovery-and-establishing-a-call\n",
|
| 689 |
-
"26. 0.369646847 github-action-wire-messenger/node_modules/readable-stream/GOVERNANCE.md \n",
|
| 690 |
-
" https://github.com/wireapp/github-action-wire-messenger/blob/main/node_modules/readable-stream/GOVERNANCE.md\n",
|
| 691 |
-
"27. 0.361026824 openmls/book/src/performance.md \n",
|
| 692 |
-
" https://github.com/wireapp/openmls/blob/wire/stable/book/src/performance.md\n",
|
| 693 |
-
"28. 0.344685107 wire-server/CHANGELOG.md \n",
|
| 694 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 695 |
-
"
|
| 696 |
-
" https://
|
| 697 |
-
"
|
| 698 |
-
" https://
|
| 699 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 700 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 701 |
-
"
|
| 702 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/single-sign-on/trouble-shooting.md\n",
|
| 703 |
-
"33. 0.321500659 wire-server/docs/src/understand/block-user-creation.md \n",
|
| 704 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/block-user-creation.md\n",
|
| 705 |
-
"34. 0.320721209 dependency-track/docs/_docs/getting-started/openidconnect-configuration.md \n",
|
| 706 |
-
" https://github.com/wireapp/dependency-track/blob/master/docs/_docs/getting-started/openidconnect-configuration.md\n",
|
| 707 |
-
"35. 0.320463151 wire-server/docs/src/understand/restund.md \n",
|
| 708 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/restund.md\n",
|
| 709 |
-
"36. 0.318782 wire-server/docs/src/understand/searchability.md \n",
|
| 710 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/searchability.md\n",
|
| 711 |
-
"37. 0.306419581 wire-server/docs/src/understand/searchability.md \n",
|
| 712 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/searchability.md\n",
|
| 713 |
-
"38. 0.304954112 wire-server/docs/src/how-to/install/prod-intro.md \n",
|
| 714 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/how-to/install/prod-intro.md\n",
|
| 715 |
-
"39. 0.303582937 wire-server/CHANGELOG.md \n",
|
| 716 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 717 |
-
"
|
| 718 |
-
" https://github.com/wireapp/wire-server/blob/develop/
|
| 719 |
-
"
|
| 720 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/
|
| 721 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 722 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 723 |
-
"
|
| 724 |
-
" https://github.com/wireapp/
|
| 725 |
-
"
|
| 726 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/
|
| 727 |
-
"
|
| 728 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/
|
| 729 |
-
"
|
| 730 |
-
" https://github.com/wireapp/uniffi-rs/blob/main/docs/adr/0001-mvp-webidl.md\n",
|
| 731 |
-
"47. 0.277904153 wire-server/docs/src/developer/reference/config-options.md \n",
|
| 732 |
" https://github.com/wireapp/wire-server/blob/develop/docs/src/developer/reference/config-options.md\n",
|
| 733 |
-
"
|
| 734 |
-
" https://github.com/wireapp/
|
| 735 |
-
"
|
| 736 |
-
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/
|
| 737 |
-
"50. 0.269872129 wire-server/CHANGELOG.md \n",
|
| 738 |
-
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n"
|
| 739 |
]
|
| 740 |
}
|
| 741 |
],
|
| 742 |
-
"execution_count":
|
| 743 |
},
|
| 744 |
{
|
| 745 |
"metadata": {},
|
|
|
|
| 369 |
{
|
| 370 |
"metadata": {
|
| 371 |
"ExecuteTime": {
|
| 372 |
+
"end_time": "2024-10-02T14:30:10.388569Z",
|
| 373 |
+
"start_time": "2024-10-02T14:30:10.348317Z"
|
| 374 |
}
|
| 375 |
},
|
| 376 |
"cell_type": "code",
|
|
|
|
| 386 |
"from dotenv import load_dotenv\n",
|
| 387 |
"\n",
|
| 388 |
"\n",
|
| 389 |
+
"system_prompt = \"\"\"You are an expert assistant skilled in generating structured, comprehensive documentation. Your role is to create thorough, accurate documentation based strictly on the provided context, without using external knowledge or general information. The content must be divided into two main sections: one for non-technical users and one for technical users, with each section tailored to their needs. The output should be clear, detailed, and organized, including code snippets, examples, and conflict resolution where applicable. Your final output should be ready in Markdown format.\n",
|
| 390 |
+
"\"\"\"\n",
|
| 391 |
"\n",
|
|
|
|
| 392 |
"\n",
|
| 393 |
+
"template = \"\"\"**Task:** \n",
|
| 394 |
+
"Generate comprehensive documentation based solely on the provided documents. **Do not use any external knowledge** or information outside of the provided context. Divide the documentation into two main sections:\n",
|
| 395 |
"\n",
|
| 396 |
+
"- **Non-Technical User:** Focus on explanations that are accessible to non-technical stakeholders (e.g., **business decision-makers or managers**). Highlight the purpose, value, and practical outcomes, avoiding technical jargon. Use examples and high-level explanations to ensure understanding.\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
"\n",
|
| 398 |
+
"- **Technical User:** Provide in-depth technical content for an audience of **developers, engineers, or system architects**. Include detailed explanations of key technical concepts, code snippets with thorough descriptions, and examples where applicable. Explain the functionality and purpose of each code fragment, along with any potential issues or caveats.\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
"\n",
|
| 400 |
+
"**Requirements:**\n",
|
| 401 |
"\n",
|
| 402 |
+
"1. **Length:** The documentation should be detailed and cover all aspects of the provided content.\n",
|
| 403 |
"\n",
|
| 404 |
+
"2. **Structure:** \n",
|
| 405 |
+
" - **Title Page:** Include a title reflecting the main theme of the documents. \n",
|
| 406 |
+
" - **Introduction:** Provide a clear overview of the content, purpose, and scope of the documentation. \n",
|
| 407 |
+
" - **Non-Technical User Section:** \n",
|
| 408 |
+
" - Clear, high-level explanations that avoid technical depth. \n",
|
| 409 |
+
" - Emphasize the **purpose, benefits, and outcomes** for non-technical users. \n",
|
| 410 |
+
" - Include examples and **highlight key points** with bold text where necessary. \n",
|
| 411 |
+
" - **Technical User Section:** \n",
|
| 412 |
+
" - Detailed explanations of key technical concepts. \n",
|
| 413 |
+
" - Include well-explained code snippets, with a focus on their **practical application** and any **potential pitfalls**. \n",
|
| 414 |
+
" - **Conflict Resolution:** If conflicting information is present, resolve it using the document date or highlight unresolved contradictions **inline** within the relevant sections.\n",
|
| 415 |
+
"\n",
|
| 416 |
+
"3. **Content Guidelines:** \n",
|
| 417 |
+
" - Represent all information accurately from the documents. \n",
|
| 418 |
+
" - Expand bullet points into full sentences and paragraphs. \n",
|
| 419 |
+
" - Use bullet points, tables, or code fragments where necessary, with in-depth explanations. \n",
|
| 420 |
+
" - Ensure smooth transitions between sections.\n",
|
| 421 |
+
"\n",
|
| 422 |
+
"4. **Style:** \n",
|
| 423 |
+
" - The non-technical section should be accessible and easy to understand. \n",
|
| 424 |
+
" - The technical section should be professional and formal, with precise technical language.\n",
|
| 425 |
+
"\n",
|
| 426 |
+
"5. **Specifics:** \n",
|
| 427 |
+
" - Highlight any critical findings, data, or statistics from the documents. \n",
|
| 428 |
+
" - Emphasize unique aspects with full reasoning and analysis. \n",
|
| 429 |
+
" - If any sections lack sufficient detail, indicate **gaps or missing information** rather than assuming or fabricating content.\n",
|
| 430 |
"\n",
|
| 431 |
"\n",
|
|
|
|
| 432 |
"User Question: {{question}}\n",
|
| 433 |
"Documents to Analyze:\n",
|
| 434 |
"{% for doc in documents %}\n",
|
|
|
|
| 488 |
],
|
| 489 |
"id": "d57a03567a4c79a8",
|
| 490 |
"outputs": [],
|
| 491 |
+
"execution_count": 9
|
| 492 |
},
|
| 493 |
{
|
| 494 |
"metadata": {},
|
|
|
|
| 499 |
{
|
| 500 |
"metadata": {
|
| 501 |
"ExecuteTime": {
|
| 502 |
+
"end_time": "2024-10-02T14:39:37.670209Z",
|
| 503 |
+
"start_time": "2024-10-02T14:39:06.402337Z"
|
| 504 |
}
|
| 505 |
},
|
| 506 |
"cell_type": "code",
|
| 507 |
"source": [
|
| 508 |
+
"query = \"Federations\"\n",
|
| 509 |
"result = rag_pipeline.run({\n",
|
| 510 |
" \"text_embedder\": {\"text\": query},\n",
|
| 511 |
" \"prompt_builder\": {\"question\": query},\n",
|
|
|
|
| 524 |
"name": "stderr",
|
| 525 |
"output_type": "stream",
|
| 526 |
"text": [
|
| 527 |
+
"/Users/filipkozlowski/Documents/venvs/ragenv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884\n",
|
| 528 |
" warnings.warn(\n"
|
| 529 |
]
|
| 530 |
},
|
|
|
|
| 536 |
"application/vnd.jupyter.widget-view+json": {
|
| 537 |
"version_major": 2,
|
| 538 |
"version_minor": 0,
|
| 539 |
+
"model_id": "ec05685f955e41b9aa1f84bb51e7fdaf"
|
| 540 |
}
|
| 541 |
},
|
| 542 |
"metadata": {},
|
|
|
|
| 546 |
"name": "stdout",
|
| 547 |
"output_type": "stream",
|
| 548 |
"text": [
|
| 549 |
+
"Federations\n",
|
| 550 |
+
"# Wire Federation Documentation\n",
|
| 551 |
"\n",
|
| 552 |
"## Introduction\n",
|
| 553 |
"\n",
|
| 554 |
+
"This documentation provides a comprehensive overview of the Wire Federation system, detailing its architecture, components, and the API interactions it facilitates between multiple backends. The documentation is structured in two distinct sections: one geared towards non-technical users, explaining the purpose and benefits of Wire Federation, and the other focused on technical users, providing in-depth information, code snippets, and practical guidance for implementation and troubleshooting.\n",
|
| 555 |
"\n",
|
| 556 |
+
"---\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
"\n",
|
| 558 |
+
"## Non-Technical User Section\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 559 |
"\n",
|
| 560 |
+
"### Overview of Wire Federation\n",
|
| 561 |
"\n",
|
| 562 |
+
"**Wire Federation** allows separate Wire backend installations to communicate with each other seamlessly, enabling users on different backends to interact just as they would if they were on the same backend. This is particularly valuable for organizations that have multiple client installations or those that require an isolated on-premises deployment but still want to communicate with others.\n",
|
| 563 |
"\n",
|
| 564 |
+
"### Purpose and Benefits\n",
|
| 565 |
+
"\n",
|
| 566 |
+
"- **Enhanced Communication:** Wire Federation allows different teams and organizations to collaborate without the need for a single centralized system. Users from different installations can send messages, share files, and make calls just as if they were part of a single system.\n",
|
| 567 |
+
"\n",
|
| 568 |
+
"- **Flexibility in Deployment:** Organizations can choose to deploy either in the cloud or on an on-prem backend based on their security and compliance needs, while still being able to interact with users on other installations.\n",
|
| 569 |
+
"\n",
|
| 570 |
+
"- **Controlled Interaction:** Administrators have the option to specifically list which backends can communicate with their server, providing an added layer of security and control over who interacts with whom.\n",
|
| 571 |
+
"\n",
|
| 572 |
+
"### Practical Outcomes\n",
|
| 573 |
+
"\n",
|
| 574 |
+
"- **Interconnected Teams:** Your teams can work together across different installations, increasing productivity and collaboration.\n",
|
| 575 |
+
" \n",
|
| 576 |
+
"- **Decentralized Infrastructure:** Organizations can maintain their independence while still allowing for necessary communication channels, which is critical for companies maintaining sensitive data.\n",
|
| 577 |
+
"\n",
|
| 578 |
+
"- **Configuration Options:** Administrators have multiple configurations at their disposal, allowing adaptability as business needs change.\n",
|
| 579 |
+
"\n",
|
| 580 |
+
"**Example:** If Team A is deployed on a cloud-based Wire server and Team B is using an on-prem infrastructure, Wire Federation enables both teams to send messages and collaborate without the need for both to be on the same system.\n",
|
| 581 |
+
"\n",
|
| 582 |
+
"---\n",
|
| 583 |
+
"\n",
|
| 584 |
+
"## Technical User Section\n",
|
| 585 |
"\n",
|
| 586 |
+
"### Technical Architecture of Wire Federation\n",
|
| 587 |
"\n",
|
| 588 |
+
"**Wire Federation** consists of various components, primarily: **Federation Ingress** and **Federator**. Each backend includes these components to manage communications, ensuring secure and authorized exchanges between different systems.\n",
|
|
|
|
|
|
|
| 589 |
"\n",
|
| 590 |
+
"#### Key Components\n",
|
| 591 |
"\n",
|
| 592 |
+
"- **Federation Ingress:** Acts as the entry point for incoming requests from other backends and ensures they are directed to the appropriate Federator component.\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
"\n",
|
| 594 |
+
"- **Federator:** Responsible for processing federated requests received from the Federation Ingress, performing necessary authorization checks, and facilitating outbound requests to other federated components.\n",
|
|
|
|
|
|
|
|
|
|
| 595 |
"\n",
|
| 596 |
+
"#### Backend Domains\n",
|
| 597 |
"\n",
|
| 598 |
+
"Each Wire installation has two domains:\n",
|
| 599 |
+
"- **Infrastructure Domain:** The network-accessible domain for the backend (e.g., `wire.infra.example.com`).\n",
|
| 600 |
+
"- **Backend Domain:** The domain used for identifying users within that backend (e.g., `example.com`).\n",
|
| 601 |
"\n",
|
| 602 |
+
"This differentiation enables users from different backends to maintain unique identifiers while facilitating federated communication.\n",
|
| 603 |
"\n",
|
| 604 |
+
"#### Communication Process\n",
|
| 605 |
"\n",
|
| 606 |
+
"Communication between backends involves mutual authentication and authorization, primarily facilitated through TLS. Key steps include:\n",
|
| 607 |
+
"1. **Authentication:** Verify the identity of the connecting backend.\n",
|
| 608 |
+
"2. **Discovery:** Determine the infrastructure domain associated with a backend domain.\n",
|
| 609 |
+
"3. **Authorization:** Confirm that both backends permit federated communication.\n",
|
| 610 |
"\n",
|
| 611 |
+
"### Code Snippet Example\n",
|
| 612 |
"\n",
|
| 613 |
+
"Here's an example of a configuration for setting up an SRV record necessary for discovery:\n",
|
| 614 |
"\n",
|
| 615 |
+
"```bash\n",
|
| 616 |
+
"# Set up SRV record for backend discovery\n",
|
| 617 |
+
"_wire-server-federator._tcp.example.com. 600 IN SRV 0 10 443 federator.wire.example.org.\n",
|
| 618 |
+
"```\n",
|
| 619 |
+
"\n",
|
| 620 |
+
"**Explanation:** This SRV record allows other wire-server installations to discover your backend. The parameters include:\n",
|
| 621 |
+
"- **Service and Protocol:** Defined as `wire-server-federator` and `tcp`.\n",
|
| 622 |
+
"- **Port:** Typically set to `443` for secure communications.\n",
|
| 623 |
+
"\n",
|
| 624 |
+
"### Federation API Conventions\n",
|
| 625 |
+
"\n",
|
| 626 |
+
"All API calls related to federation should begin with the `/federation/` prefix. Each path should be structured in kebab-case format, facilitating clear and consistent interaction between federated components.\n",
|
| 627 |
+
"\n",
|
| 628 |
+
"Example of an API call to send a message across federated backends:\n",
|
| 629 |
+
"\n",
|
| 630 |
+
"```http\n",
|
| 631 |
+
"POST /federation/send-message\n",
|
| 632 |
+
"Content-Type: application/json\n",
|
| 633 |
+
"\n",
|
| 634 |
+
"{\n",
|
| 635 |
+
" \"from\": \"user1@example.com\",\n",
|
| 636 |
+
" \"to\": \"user2@otherbackend.com\",\n",
|
| 637 |
+
" \"message\": \"Hello from federated backend!\"\n",
|
| 638 |
+
"}\n",
|
| 639 |
+
"```\n",
|
| 640 |
"\n",
|
| 641 |
+
"### Conflict Resolution & Caveats\n",
|
| 642 |
+
"- Note that the **Federation development is currently a work in progress**. Features are being continually added and refined.\n",
|
| 643 |
+
"- **Important:** Changing the backend domain after user interaction can cause undefined behavior, potentially leading to data loss or client crashes. It is critical to lock down your domain configurations after they are set.\n",
|
| 644 |
+
"\n",
|
| 645 |
+
"**Example Conflicts:**\n",
|
| 646 |
+
"- Changing backend identifiers post-federation setup may lead to issues in user identification across systems.\n",
|
| 647 |
+
"\n",
|
| 648 |
+
"### Conclusion\n",
|
| 649 |
+
"Wire Federation represents a robust approach to cross-backend communications, facilitating better collaboration while prioritizing security and control. With active development, users should remain informed about updates to features and best practices of deployment.\n",
|
| 650 |
+
"\n",
|
| 651 |
+
"---\n",
|
| 652 |
+
"\n",
|
| 653 |
+
"This documentation serves as a reference for both non-technical stakeholders seeking to understand the benefits of Wire Federation and technical users implementing or managing the federation system. For further questions or clarifications, please refer to the appropriate sections or reach out with specific queries.\n"
|
| 654 |
]
|
| 655 |
}
|
| 656 |
],
|
| 657 |
+
"execution_count": 10
|
| 658 |
},
|
| 659 |
{
|
| 660 |
"metadata": {
|
| 661 |
"ExecuteTime": {
|
| 662 |
+
"end_time": "2024-10-02T14:39:37.687390Z",
|
| 663 |
+
"start_time": "2024-10-02T14:39:37.681544Z"
|
| 664 |
}
|
| 665 |
},
|
| 666 |
"cell_type": "code",
|
|
|
|
| 678 |
"output_type": "stream",
|
| 679 |
"text": [
|
| 680 |
"Finish Reason: stop\n",
|
| 681 |
+
"Output Tokens: 1106\n",
|
| 682 |
+
"Input Tokens: 14202\n",
|
| 683 |
+
"\n",
|
| 684 |
+
"1. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 685 |
+
" https://docs.wire.com/understand/configure-federation.html#generate-and-configure-tls-server-and-client-certificates\n",
|
| 686 |
+
"2. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 687 |
+
" https://docs.wire.com/understand/configure-federation.html#configure-helm-charts-federator-and-ingress-and-webapp-subcharts\n",
|
| 688 |
+
"3. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 689 |
+
" https://docs.wire.com/understand/configure-federation.html\n",
|
| 690 |
+
"4. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 691 |
+
" https://docs.wire.com/understand/configure-federation.html#choose-a-backend-domain\n",
|
| 692 |
+
"5. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 693 |
+
" https://docs.wire.com/understand/configure-federation.html#summary-of-necessary-steps-to-configure-federation\n",
|
| 694 |
+
"6. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 695 |
+
" https://docs.wire.com/understand/configure-federation.html#manually-test-that-your-configurations-work-as-expected\n",
|
| 696 |
+
"7. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 697 |
+
" https://docs.wire.com/understand/configure-federation.html#dns-setup-for-federation\n",
|
| 698 |
+
"8. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 699 |
+
" https://docs.wire.com/understand/configure-federation.html#consequences-of-the-choice-of-a-backend-domain\n",
|
| 700 |
+
"9. 0.614980042 Federation — Wire 0.0.4 documentation Federation\n",
|
| 701 |
+
" https://docs.wire.com/understand/configure-federation.html#applying-all-configuration-changes\n",
|
| 702 |
+
"10. 0.55589819 Federation API — Wire 0.0.4 documentation Example End-to-End Flows\n",
|
| 703 |
+
" https://docs.wire.com/understand/federation/api.html\n",
|
| 704 |
+
"11. 0.554861844 Config Options — Wire 0.0.4 documentation Federation allow list\n",
|
| 705 |
+
" https://docs.wire.com/developer/reference/config-options.html\n",
|
| 706 |
+
"12. 0.554861844 Config Options — Wire 0.0.4 documentation Restrict user search\n",
|
| 707 |
+
" https://docs.wire.com/developer/reference/config-options.html\n",
|
| 708 |
+
"13. 0.538971603 wire-server/docs/src/understand/federation/architecture.md \n",
|
| 709 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/architecture.md\n",
|
| 710 |
+
"14. 0.512375832 Wire Federation — Wire 0.0.4 documentation Wire Federation\n",
|
| 711 |
+
" https://docs.wire.com/understand/federation/index.html\n",
|
| 712 |
+
"15. 0.506851077 wire-server/docs/src/how-to/install/sft.md \n",
|
| 713 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/how-to/install/sft.md\n",
|
| 714 |
+
"16. 0.506233096 wire-ios/WireDomain/Project/WireDomain.docc/federation.md \n",
|
| 715 |
+
" https://github.com/wireapp/wire-ios/blob/develop/WireDomain/Project/WireDomain.docc/federation.md\n",
|
| 716 |
+
"17. 0.496853769 wire-server/CHANGELOG.md \n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 717 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 718 |
+
"18. 0.491552591 Federation Achitecture — Wire 0.0.4 documentation Backends\n",
|
| 719 |
+
" https://docs.wire.com/understand/federation/architecture.html\n",
|
| 720 |
+
"19. 0.490198672 Federation Achitecture — Wire 0.0.4 documentation Service components\n",
|
| 721 |
+
" https://docs.wire.com/understand/federation/architecture.html\n",
|
| 722 |
+
"20. 0.490190685 wire-server/docs/src/understand/federation/index.md \n",
|
| 723 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/index.md\n",
|
| 724 |
+
"21. 0.490172774 Backend to backend communication — Wire 0.0.4 documentation Backend to backend communication\n",
|
| 725 |
+
" https://docs.wire.com/understand/federation/backend-communication.html\n",
|
| 726 |
+
"22. 0.48189187 Federation Achitecture — Wire 0.0.4 documentation Backend domains\n",
|
| 727 |
+
" https://docs.wire.com/understand/federation/architecture.html\n",
|
| 728 |
+
"23. 0.477519423 Swagger API documentation — Wire 0.0.4 documentation Federation API\n",
|
| 729 |
+
" https://docs.wire.com/understand/api-client-perspective/swagger.html\n",
|
| 730 |
+
"24. 0.464122623 wire-server/docs/src/developer/developer/federation-api-conventions.md \n",
|
| 731 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/developer/developer/federation-api-conventions.md\n",
|
| 732 |
+
"25. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 733 |
+
" https://docs.wire.com/understand/configure-federation.html#summary-of-necessary-steps-to-configure-federation\n",
|
| 734 |
+
"26. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 735 |
+
" https://docs.wire.com/understand/configure-federation.html#consequences-of-the-choice-of-a-backend-domain\n",
|
| 736 |
+
"27. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 737 |
+
" https://docs.wire.com/understand/configure-federation.html#dns-setup-for-federation\n",
|
| 738 |
+
"28. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 739 |
+
" https://docs.wire.com/understand/configure-federation.html#choose-a-backend-domain\n",
|
| 740 |
+
"29. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 741 |
+
" https://docs.wire.com/understand/configure-federation.html#configure-helm-charts-federator-and-ingress-and-webapp-subcharts\n",
|
| 742 |
+
"30. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 743 |
+
" https://docs.wire.com/understand/configure-federation.html#manually-test-that-your-configurations-work-as-expected\n",
|
| 744 |
+
"31. 0.463976592 Federation — Wire 0.0.4 documentation SRV record\n",
|
| 745 |
+
" https://docs.wire.com/understand/configure-federation.html#applying-all-configuration-changes\n",
|
| 746 |
+
"32. 0.462774605 wire-server/docs/src/understand/federation/architecture.md \n",
|
| 747 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/architecture.md\n",
|
| 748 |
+
"33. 0.457686335 wire-server/docs/src/developer/developer/federation-api-conventions.md \n",
|
| 749 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/developer/developer/federation-api-conventions.md\n",
|
| 750 |
+
"34. 0.457345426 wire-server/docs/src/understand/federation/backend-communication.md \n",
|
| 751 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/backend-communication.md\n",
|
| 752 |
+
"35. 0.456024379 wire-server/CHANGELOG.md \n",
|
| 753 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 754 |
+
"36. 0.454764307 wire-server/CHANGELOG.md \n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 755 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 756 |
+
"37. 0.44467172 wire-server/services/brig/docs/swagger.md \n",
|
| 757 |
+
" https://github.com/wireapp/wire-server/blob/develop/services/brig/docs/swagger.md\n",
|
| 758 |
+
"38. 0.444358 wire-server/docs/src/understand/configure-federation.md \n",
|
| 759 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/configure-federation.md\n",
|
| 760 |
+
"39. 0.442574441 wire-server/services/brig/docs/swagger.md \n",
|
| 761 |
+
" https://github.com/wireapp/wire-server/blob/develop/services/brig/docs/swagger.md\n",
|
| 762 |
+
"40. 0.434415787 wire-server/docs/src/understand/federation/api.md \n",
|
| 763 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/api.md\n",
|
| 764 |
+
"41. 0.426637262 wire-server/docs/src/understand/configure-federation.md \n",
|
| 765 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/configure-federation.md\n",
|
| 766 |
+
"42. 0.416953623 wire-server/docs/src/understand/federation/api.md \n",
|
| 767 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/api.md\n",
|
| 768 |
+
"43. 0.416618854 wire-server/docs/src/understand/configure-federation.md \n",
|
| 769 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/configure-federation.md\n",
|
| 770 |
+
"44. 0.409066141 wire-server/CHANGELOG.md \n",
|
| 771 |
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 772 |
+
"45. 0.407607 wire-server/services/brig/docs/swagger.md \n",
|
| 773 |
+
" https://github.com/wireapp/wire-server/blob/develop/services/brig/docs/swagger.md\n",
|
| 774 |
+
"46. 0.4062154 wire-server/docs/src/understand/federation/backend-communication.md \n",
|
| 775 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/backend-communication.md\n",
|
| 776 |
+
"47. 0.395716488 wire-server/docs/src/understand/federation/architecture.md \n",
|
| 777 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/federation/architecture.md\n",
|
| 778 |
+
"48. 0.394247204 wire-server/docs/src/developer/reference/config-options.md \n",
|
|
|
|
|
|
|
| 779 |
" https://github.com/wireapp/wire-server/blob/develop/docs/src/developer/reference/config-options.md\n",
|
| 780 |
+
"49. 0.389835417 wire-server/CHANGELOG.md \n",
|
| 781 |
+
" https://github.com/wireapp/wire-server/blob/develop/CHANGELOG.md\n",
|
| 782 |
+
"50. 0.386147588 wire-server/docs/src/understand/sft.md \n",
|
| 783 |
+
" https://github.com/wireapp/wire-server/blob/develop/docs/src/understand/sft.md\n"
|
|
|
|
|
|
|
| 784 |
]
|
| 785 |
}
|
| 786 |
],
|
| 787 |
+
"execution_count": 11
|
| 788 |
},
|
| 789 |
{
|
| 790 |
"metadata": {},
|
pipeline.yml
CHANGED
|
@@ -16,52 +16,14 @@ components:
|
|
| 16 |
model: gpt-4o-mini
|
| 17 |
organization: null
|
| 18 |
streaming_callback: null
|
| 19 |
-
system_prompt:
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
\ of the content provided in the documents.\n\n2. Structure:\n - Title Page:\
|
| 28 |
-
\ Include a title that reflects the main theme of the documents.\n - Introduction:\
|
| 29 |
-
\ Provide a complete and thorough overview of the content, purpose, and scope\
|
| 30 |
-
\ of the documentation.\n - Main Sections: Divide the documentation into\
|
| 31 |
-
\ logical sections and subsections based on the themes and topics found in\
|
| 32 |
-
\ the documents. Each section should include:\n - A clear, descriptive\
|
| 33 |
-
\ heading that reflects the content within the section.\n - Detailed explanations\
|
| 34 |
-
\ of key concepts and ideas. Expand on each idea or concept with thorough\
|
| 35 |
-
\ descriptions, definitions, and context. Ensure the reader fully understands\
|
| 36 |
-
\ the material.\n - Code fragments: Where applicable, include relevant\
|
| 37 |
-
\ code snippets from the documents. These should be properly formatted and\
|
| 38 |
-
\ explained in detail. For each code snippet, provide a clear explanation\
|
| 39 |
-
\ of its purpose, functionality, and how it fits into the overall system or\
|
| 40 |
-
\ process described in the document.\n - Examples: Provide relevant examples\
|
| 41 |
-
\ where applicable, explaining them fully to ensure understanding.\n -\
|
| 42 |
-
\ Conflict Resolution: If there are contradictory pieces of information across\
|
| 43 |
-
\ different documents, resolve them using the date provided at the beginning\
|
| 44 |
-
\ of each document, prioritizing the most recent information. If a document\u2019\
|
| 45 |
-
s date is unknown and conflicts cannot be resolved, explicitly indicate which\
|
| 46 |
-
\ parts contradict one another, then clearly explain the contradiction. Mention\
|
| 47 |
-
\ all unresolved conflicts at the end of each section.\n\n3. Content Guidelines:\n\
|
| 48 |
-
\ - Ensure that all information from the documents is included and accurately\
|
| 49 |
-
\ represented.\n - The content should not just list bullet points but should\
|
| 50 |
-
\ be expanded into full sentences and paragraphs where necessary, with elaboration\
|
| 51 |
-
\ and explanations for all points.\n - Use clear and logical transitions\
|
| 52 |
-
\ between sections to maintain the flow and coherence of the document.\n \
|
| 53 |
-
\ - Use bullet points, tables, code fragments, or diagrams where appropriate\
|
| 54 |
-
\ to enhance understanding and readability, but always accompany these elements\
|
| 55 |
-
\ with in-depth explanations.\n\n4. Style: The writing style should be professional,\
|
| 56 |
-
\ formal, and suitable for an audience that may include technical experts,\
|
| 57 |
-
\ stakeholders, or general readers interested in the topic. Avoid jargon unless\
|
| 58 |
-
\ it is explained in detail.\n\n5. Specifics: Highlight any critical findings,\
|
| 59 |
-
\ data, or statistics that are present in the documents. For each significant\
|
| 60 |
-
\ point, explain its relevance and implications. Emphasize any unique or innovative\
|
| 61 |
-
\ aspects that stand out, and provide complete reasoning or analysis where\
|
| 62 |
-
\ needed.\n\nOutput Format: Ensure that the entire documentation is generated\
|
| 63 |
-
\ in Markdown format without any additional text or formatting. The output\
|
| 64 |
-
\ should be ready to be saved directly into a markdown file.\n"
|
| 65 |
type: haystack.components.generators.openai.OpenAIGenerator
|
| 66 |
joiner:
|
| 67 |
init_parameters:
|
|
@@ -73,9 +35,45 @@ components:
|
|
| 73 |
prompt_builder:
|
| 74 |
init_parameters:
|
| 75 |
required_variables: null
|
| 76 |
-
template: "
|
| 77 |
-
\
|
| 78 |
-
\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
variables: null
|
| 80 |
type: haystack.components.builders.prompt_builder.PromptBuilder
|
| 81 |
retriever_docs_wire:
|
|
|
|
| 16 |
model: gpt-4o-mini
|
| 17 |
organization: null
|
| 18 |
streaming_callback: null
|
| 19 |
+
system_prompt: 'You are an expert assistant skilled in generating structured,
|
| 20 |
+
comprehensive documentation. Your role is to create thorough, accurate documentation
|
| 21 |
+
based strictly on the provided context, without using external knowledge or
|
| 22 |
+
general information. The content must be divided into two main sections: one
|
| 23 |
+
for non-technical users and one for technical users, with each section tailored
|
| 24 |
+
to their needs. The output should be clear, detailed, and organized, including
|
| 25 |
+
code snippets, examples, and conflict resolution where applicable. Your final
|
| 26 |
+
output should be ready in Markdown format.'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
type: haystack.components.generators.openai.OpenAIGenerator
|
| 28 |
joiner:
|
| 29 |
init_parameters:
|
|
|
|
| 35 |
prompt_builder:
|
| 36 |
init_parameters:
|
| 37 |
required_variables: null
|
| 38 |
+
template: "**Task:** \nGenerate comprehensive documentation based solely on\
|
| 39 |
+
\ the provided documents. **Do not use any external knowledge** or information\
|
| 40 |
+
\ outside of the provided context. Divide the documentation into two main\
|
| 41 |
+
\ sections:\n\n- **Non-Technical User:** Focus on explanations that are accessible\
|
| 42 |
+
\ to non-technical stakeholders (e.g., **business decision-makers or managers**).\
|
| 43 |
+
\ Highlight the purpose, value, and practical outcomes, avoiding technical\
|
| 44 |
+
\ jargon. Use examples and high-level explanations to ensure understanding.\n\
|
| 45 |
+
\n- **Technical User:** Provide in-depth technical content for an audience\
|
| 46 |
+
\ of **developers, engineers, or system architects**. Include detailed explanations\
|
| 47 |
+
\ of key technical concepts, code snippets with thorough descriptions, and\
|
| 48 |
+
\ examples where applicable. Explain the functionality and purpose of each\
|
| 49 |
+
\ code fragment, along with any potential issues or caveats.\n\n**Requirements:**\n\
|
| 50 |
+
\n1. **Length:** The documentation should be detailed and cover all aspects\
|
| 51 |
+
\ of the provided content.\n\n2. **Structure:** \n - **Title Page:** Include\
|
| 52 |
+
\ a title reflecting the main theme of the documents. \n - **Introduction:**\
|
| 53 |
+
\ Provide a clear overview of the content, purpose, and scope of the documentation.\
|
| 54 |
+
\ \n - **Non-Technical User Section:** \n - Clear, high-level explanations\
|
| 55 |
+
\ that avoid technical depth. \n - Emphasize the **purpose, benefits,\
|
| 56 |
+
\ and outcomes** for non-technical users. \n - Include examples and **highlight\
|
| 57 |
+
\ key points** with bold text where necessary. \n - **Technical User Section:**\
|
| 58 |
+
\ \n - Detailed explanations of key technical concepts. \n - Include\
|
| 59 |
+
\ well-explained code snippets, with a focus on their **practical application**\
|
| 60 |
+
\ and any **potential pitfalls**. \n - **Conflict Resolution:** If conflicting\
|
| 61 |
+
\ information is present, resolve it using the document date or highlight\
|
| 62 |
+
\ unresolved contradictions **inline** within the relevant sections.\n\n3.\
|
| 63 |
+
\ **Content Guidelines:** \n - Represent all information accurately from\
|
| 64 |
+
\ the documents. \n - Expand bullet points into full sentences and paragraphs.\
|
| 65 |
+
\ \n - Use bullet points, tables, or code fragments where necessary, with\
|
| 66 |
+
\ in-depth explanations. \n - Ensure smooth transitions between sections.\n\
|
| 67 |
+
\n4. **Style:** \n - The non-technical section should be accessible and\
|
| 68 |
+
\ easy to understand. \n - The technical section should be professional\
|
| 69 |
+
\ and formal, with precise technical language.\n\n5. **Specifics:** \n \
|
| 70 |
+
\ - Highlight any critical findings, data, or statistics from the documents.\
|
| 71 |
+
\ \n - Emphasize unique aspects with full reasoning and analysis. \n \
|
| 72 |
+
\ - If any sections lack sufficient detail, indicate **gaps or missing information**\
|
| 73 |
+
\ rather than assuming or fabricating content.\n\n\nUser Question: {{question}}\n\
|
| 74 |
+
Documents to Analyze:\n{% for doc in documents %}\nDate: {{doc.meta['date']}}\n\
|
| 75 |
+
Title: {{doc.meta['title']}} - {{doc.meta['headline']}}\nContent: \n{{doc.content}}\n\
|
| 76 |
+
{% endfor %}"
|
| 77 |
variables: null
|
| 78 |
type: haystack.components.builders.prompt_builder.PromptBuilder
|
| 79 |
retriever_docs_wire:
|