Commit graph

27 commits

Author SHA1 Message Date
eec1b34517 Refactor module structure and improve Docker configuration
Reorganized module directories under `phoenix_technologies` for better namespace clarity and maintainability. Updated the Dockerfile to use an environment variable for the application entry point, enhancing flexibility in deployment. Additionally, revamped the README to reflect the new structure and provide clearer project documentation.
2025-05-03 11:03:15 +02:00
6bab336883 Update function docstrings for clarity and focus
Simplified the descriptions in `deep_research` and `quick_search` docstrings to improve readability and eliminate redundant details. This ensures concise and focused explanations of each function's purpose.
2025-04-26 19:48:06 +02:00
51eecd2830 Add CustomLogsHandler for JSON logging in GPTResearcher
Introduced a CustomLogsHandler class to handle and log JSON data during research or search operations. Updated GPTResearcher initialization to include the CustomLogsHandler for improved logging and debugging.
2025-04-26 19:28:43 +02:00
0892ecdc8e Use "sse" mode in MCP run method
Updated the `mcp.run` call to include the "sse" mode, ensuring proper handling of server events. This change improves the server's event loop management and prepares it for SSE-specific operations.
2025-04-26 18:48:51 +02:00
7f7a6083f8 Add quick_search function and remove citation note in deep_research
Introduced the quick_search function for faster, snippet-based searches and adjusted mcp.run to remove the "sse" argument. Additionally, modified the deep_research docstring to remove the citation requirement note for simpler usage documentation.
2025-04-26 18:46:11 +02:00
7e5a6db0f6 Set research type dynamically via environment variable
Added `RESEARCH_TYPE` environment variable to configure the default research type for GPTResearcher. Updated the initialization of GPTResearcher to use this dynamic configuration, improving flexibility and adaptability.
2025-04-26 18:14:41 +02:00
626345b65e Add report_type parameter to GPTResearcher initialization
This update enables specifying the report type during researcher initialization. It introduces "deep" as the default report type, enhancing flexibility for future use cases.
2025-04-26 18:11:21 +02:00
44b91b9375 Refactor codebase to implement MCP server for GPT Researcher
Replaced FastAPI app with an MCP server implementation, enhancing flexibility and modularity for research operations. Deprecated `phoenix_technologies` package, updated server logic, added utility functions, and revised dependencies in `requirements.txt`. Updated Dockerfile and README to align with the new architecture.
2025-04-26 17:54:43 +02:00
73e929ca00 Refactor report generation with simplified log streaming
Replaced custom log handler and async report generation logic with a simplified fake data streamer for the StreamingResponse. Added uvicorn server startup code for direct script execution.
2025-04-26 08:38:02 +02:00
e2b4ba5a7d Refactor log streaming and report generation logic
Simplified the logic for log streaming by consolidating into a single async generator (`log_stream`). Removed redundant tasks and streamlined report generation to improve code readability and maintainability.
2025-04-25 22:11:19 +02:00
1472e277bc Refactor report generation with async streaming and logging
Enhanced report generation by integrating `CustomLogsHandler` and separating tasks for generating reports and streaming logs. Replaced the previous implementation with a unified async generator to handle concurrent execution and improve error handling. Updated module exports to include the new `CustomLogsHandler` component.
2025-04-25 22:07:25 +02:00
6ee47f02c0 Fix incorrect attribute access for generator completion check
Replaced `generator.researcher.complete` with the correct `generator.complete`. This resolves a potential logic error and ensures the completion condition is properly evaluated.
2025-04-25 19:57:01 +02:00
79be94afd2 Refactor generator completion checks for consistency.
Replaced `.is_complete()` method calls with direct `.complete` attribute access to streamline the code. Removed the redundant `is_complete()` method from `deepresearch.py` to reduce unnecessary indirection. This simplifies the logic and improves readability.
2025-04-25 19:53:59 +02:00
b16305e369 Fix missing parentheses in is_complete method call
The is_complete method was incorrectly referenced without parentheses, causing a potential runtime error. This fix ensures proper method invocation and prevents the loop from behaving incorrectly.
2025-04-25 19:51:38 +02:00
cb5fe35d24 Refactor report generation flow to include progress streaming
Modified the report generation process to stream logs incrementally during execution. Introduced new methods `init` and `is_complete` to enhance modularity and track completion status. Adjusted generator logic to better manage and yield logs in real-time.
2025-04-25 19:47:34 +02:00
ae4e81906e Add progress messages to report generation process
This change introduces status updates to indicate the start and successful completion of the report generation. These progress messages improve user feedback during the asynchronous operation.
2025-04-25 19:26:18 +02:00
ffeb2527b3 Refactor log handling in deepresearch module
Removed the unnecessary `logs` initialization and streamlined the `CustomLogsHandler` setup. This simplifies the code and avoids redundant log storage.
2025-04-25 18:58:40 +02:00
936eb6f394 Refactor report generation and logging handlers.
Introduced `CustomLogsHandler` to streamline log management and updated `ReportGenerator` to simplify report generation output. Removed unused asynchronous iterator methods, improving code clarity and reducing complexity.
2025-04-25 18:56:41 +02:00
1dbf774d55 Refactor async methods to adjust return types.
Changed `send_json` to return `None` instead of yielding and updated log retrieval to use `yield` in place of `return`. These modifications align function behavior with intended asynchronous use cases and improve consistency.
2025-04-25 18:46:48 +02:00
327758f00f Refactor async logging logic in report generation.
Removed unused log yielding in `main.py` to simplify the flow. Updated `send_json` in `deepresearch.py` to use an async generator for more flexible streaming of log data.
2025-04-25 18:42:40 +02:00
ade4511a87 Add report generation step to the main async process
The `generate_report` method is now explicitly called within the main process, ensuring the researcher's report generation is initiated properly. Updated its return type annotation for clarity in `deepresearch.py`.
2025-04-25 18:39:33 +02:00
14429fc6f7 Refactor logging and improve async iteration in report generation
Refactored `CustomLogsHandler` to accept an optional logs list and modified its method to append data instead of yielding. Enhanced `ReportGenerator` with proper asynchronous iterator implementation, enabling smooth log handling and retrieval. Simplified variable naming for better readability.
2025-04-25 18:35:30 +02:00
cd79fe99be Refactor ReportGenerator and integrate custom logs handler
Introduced `CustomLogsHandler` to manage log handling and WebSocket integration in `ReportGenerator`. Simplified and restructured report generation logic for improved maintainability. Removed obsolete methods and enhanced overall readability with cleaner code structure.
2025-04-25 18:20:51 +02:00
6993a52d47 Refactor and improve ReportGenerator for clarity and robustness
Enhanced docstrings for better clarity and consistency across methods. Added error handling for report generation and ensured default values for research details to avoid null errors. Improved comments and logic flow for readability and maintainability.
2025-04-25 10:03:21 +02:00
9f87253082 Make DeepResearch asynchronously iterable.
Added asynchronous iteration methods (`__aiter__` and `__anext__`) to the `DeepResearch` class to enable streaming of research report chunks. Introduced functionality to generate and split reports into smaller chunks for improved report handling.
2025-04-25 09:57:43 +02:00
43423732e2 Add environment variable placeholders to README
Included new environment variable placeholders for better configuration guidance. These updates clarify setup requirements and improve documentation completeness.
2025-04-25 08:42:32 +02:00
3d0d2b2770 Add FastAPI app for report generation with Docker support
Implement a modular FastAPI-based service for generating research reports using `GPTResearcher`. Includes secure API key authentication, a streaming response endpoint, and a Dockerized deployment setup. Also adds documentation, core dependencies, and project structure.
2025-04-25 08:34:18 +02:00