{"id":19684775,"url":"https://github.com/terilios/docgen","last_synced_at":"2026-03-16T08:35:50.553Z","repository":{"id":255758518,"uuid":"853552789","full_name":"terilios/DocGen","owner":"terilios","description":"A Python application that automates the generation of documents using multiple AI agents. Integrates with OpenAI and Anthropic APIs, enabling flexible workflows and customizable outputs for diverse business needs.","archived":false,"fork":false,"pushed_at":"2024-09-06T22:35:53.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T23:31:04.316Z","etag":null,"topics":["ai","anthropic","api-integration","automation","content-creation","customizable-output","document-generation","machine-learning","multi-agent","natural-language-processing","openai","python","text-generation"],"latest_commit_sha":null,"homepage":"http://www.terilios.com/docgen/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terilios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-06T22:29:11.000Z","updated_at":"2025-01-13T12:31:43.000Z","dependencies_parsed_at":"2024-09-07T02:26:12.850Z","dependency_job_id":null,"html_url":"https://github.com/terilios/DocGen","commit_stats":null,"previous_names":["terilios/docgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terilios/DocGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terilios%2FDocGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terilios%2FDocGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terilios%2FDocGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terilios%2FDocGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terilios","download_url":"https://codeload.github.com/terilios/DocGen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terilios%2FDocGen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403106,"owners_count":23923404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","api-integration","automation","content-creation","customizable-output","document-generation","machine-learning","multi-agent","natural-language-processing","openai","python","text-generation"],"created_at":"2024-11-11T18:18:56.241Z","updated_at":"2026-03-16T08:35:45.516Z","avatar_url":"https://github.com/terilios.png","language":"Python","readme":"# DocGen\n\n## Multi-Agent AI Document Generator\n\nA Python-based application that automates the creation of tailored documents using a multi-agent architecture integrated with AI models. This tool leverages OpenAI (GPT-4o) and Anthropic (Claude) APIs to deliver high-quality content, designed to meet diverse business documentation needs. It supports configurable workflows, flexible output formats, and robust error handling to ensure seamless document generation.\n\n## Table of Contents\n\n- [Features](#features)\n- [Architecture](#architecture)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n- [Usage](#usage)\n  - [Running the Application](#running-the-application)\n  - [Customizing Document Generation](#customizing-document-generation)\n  - [Output](#output)\n- [Examples](#examples)\n- [Error Handling and Logging](#error-handling-and-logging)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n- [Acknowledgments](#acknowledgments)\n\n## Features\n\n- **Multi-Agent Architecture**: Supports concurrent execution of multiple agents to handle various document generation tasks, improving efficiency and scalability.\n- **API Integration**: Seamlessly integrates with OpenAI GPT-4o and Anthropic Claude models for state-of-the-art content generation.\n- **Configurable Outputs**: Provides users with the ability to customize output formats, tones, and structures to suit different business requirements.\n- **Dynamic Workflows**: Enables flexible agent workflows tailored to specific document generation needs, ensuring a versatile solution for diverse use cases.\n- **Robust Error Handling**: Implements retry logic and error management to handle API call failures and connectivity issues.\n- **Logging and Monitoring**: Detailed logging for monitoring application performance and debugging.\n\n## Architecture\n\nThe application is built using a modular architecture:\n\n- **`main.py`**: The main entry point that orchestrates the document generation process.\n- **`agents.py`**: Contains definitions for various agents responsible for handling different parts of the document generation workflow.\n- **`api_handlers.py`**: Manages interactions with external APIs (OpenAI and Anthropic), including sending requests and handling responses.\n- **`document_utils.py`**: Provides utility functions for document formatting, saving, and other operations.\n- **`config.json`**: A user-editable configuration file to specify document parameters, output preferences, and API settings.\n- **`requirements.txt`**: Lists all dependencies required to run the application.\n\n## Getting Started\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- Python 3.7 or later\n- API keys for OpenAI and Anthropic\n- Access to a terminal or command line interface\n\n### Installation\n\n1. **Clone the Repository**:\n\n   ```bash\n   git clone https://github.com/terilios/DocGen.git\n   cd DocGen\n   ```\n\n2. **Install Dependencies**:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Environment Variables**:\n\n   Create a `.env` file in the root directory of the project and add your API keys:\n\n   ```bash\n   OPENAI_API_KEY=your_openai_api_key\n   ANTHROPIC_API_KEY=your_anthropic_api_key\n   ```\n\n### Configuration\n\nEdit the `config.json` file to define your document requirements:\n\n```json\n{\n  \"document\": {\n    \"title\": \"Your Document Title\",\n    \"description\": \"A brief description of the content you need.\"\n  },\n  \"output\": {\n    \"format\": \"brief or detailed\",\n    \"tone\": \"business or casual\",\n    \"filename\": \"your_output_filename.md\"\n  },\n  \"api_config\": {\n    \"delay_between_calls\": 20,\n    \"openai\": {\n      \"model\": \"gpt-4o\",\n      \"max_tokens\": 4000\n    },\n    \"anthropic\": {\n      \"model\": \"claude-3-5-sonnet-20240620\",\n      \"max_tokens\": 4000\n    }\n  }\n}\n```\n\n## Usage\n\n### Running the Application\n\nTo generate a document, run:\n\n```bash\npython main.py\n```\n\n### Customizing Document Generation\n\n- **Title and Description**: Set the `title` and `description` in `config.json` to specify the topic and scope of your document.\n- **Output Settings**: Adjust the `format` (e.g., \"brief\", \"detailed\") and `tone` (e.g., \"business\", \"casual\") to match the desired style.\n- **API Configuration**: Modify the `api_config` section to change models, token limits, or delays between API calls.\n\n### Output\n\nGenerated documents will be saved to the specified `filename` in `config.json`. The application supports various formats such as Markdown (`.md`), plain text (`.txt`), and more.\n\n## Examples\n\n1. **Generate a Brief Business Report**:\n\n   Configure `config.json`:\n\n   ```json\n   {\n     \"document\": {\n       \"title\": \"Market Trends Analysis\",\n       \"description\": \"An overview of the latest trends in the AI market.\"\n     },\n     \"output\": {\n       \"format\": \"brief\",\n       \"tone\": \"business\",\n       \"filename\": \"market_trends_analysis.md\"\n     }\n   }\n   ```\n\n   Run the application:\n\n   ```bash\n   python main.py\n   ```\n\n   Output: `market_trends_analysis.md` with a brief, business-oriented report.\n\n2. **Generate a Detailed Casual Report**:\n\n   Configure `config.json`:\n\n   ```json\n   {\n     \"document\": {\n       \"title\": \"AI in Everyday Life\",\n       \"description\": \"Exploring the impact of AI on daily activities.\"\n     },\n     \"output\": {\n       \"format\": \"detailed\",\n       \"tone\": \"casual\",\n       \"filename\": \"ai_everyday_life.txt\"\n     }\n   }\n   ```\n\n   Run the application:\n\n   ```bash\n   python main.py\n   ```\n\n   Output: `ai_everyday_life.txt` with a detailed, casual report.\n\n## Error Handling and Logging\n\n- The application uses the `tenacity` library for retrying failed API calls due to network issues or rate limits.\n- Logs are generated for each run and stored in the `logs/` directory, providing insights into the execution flow and error occurrences.\n\n## Contributing\n\nWe welcome contributions to improve this project! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch (`feature/your-feature-name`).\n3. Make your changes and commit them (`git commit -m \"Add new feature\"`).\n4. Push the changes to your fork (`git push origin feature/your-feature-name`).\n5. Open a pull request to the main branch.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contact\n\nFor any questions, suggestions, or feedback, please reach out to the project maintainer at [tdriscoll@terilios.com].\n\n## Acknowledgments\n\n- Special thanks to OpenAI for providing the GPT-4o model and Anthropic for the Claude model.\n- Appreciation to all contributors and the open-source community for their support and feedback.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterilios%2Fdocgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterilios%2Fdocgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterilios%2Fdocgen/lists"}