### Run Python Example from Examples Directory Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Execute a Python example script after navigating into the 'examples' directory. This is an alternative to running from the project root. ```bash cd examples python basic_usage.py ``` -------------------------------- ### Run Basic Usage Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Execute the basic usage script to demonstrate fundamental MEGA-Bot operations like initializing the bot, performing simple queries, research, status checks, and getting capabilities. ```bash python examples/basic_usage.py ``` -------------------------------- ### Verify Example Scripts Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Run various example scripts to ensure they function correctly. These examples cover basic usage, advanced research, workflow automation, and validation. ```bash # Verify examples python examples/basic_usage.py python examples/advanced_research.py python examples/workflow_automation.py python examples/validation_example.py ``` -------------------------------- ### Custom Example Template Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md A template for creating your own custom examples using the MegaBot class. Includes setup for asynchronous operations and basic bot interaction. ```python import asyncio import sys import os # Add parent directory to path sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from megabot import MegaBot async def my_example(): """Your custom example""" bot = MegaBot() await bot.start() # Your code here result = await bot.query("Your query") print(result) await bot.stop() if __name__ == "__main__": asyncio.run(my_example()) ``` -------------------------------- ### Install Dependencies Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Install project dependencies using pip by referencing the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Sync Documents and Get Updates Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This example demonstrates how to manually trigger a document synchronization and then retrieve the latest updates from integrated platforms. The `get_updates` method can be limited by a specified number of results. ```python async def auto_update_example(): bot = MegaBot() await bot.start() # Sync documents manually await bot.sync_documents() # Get latest updates updates = bot.get_updates(limit=10) for update in updates: print(f"{update['platform']}: {update['title']}") await bot.stop() ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Copy the example environment file and edit it with your specific API keys and configurations. ```bash cp .env.example .env # Edit .env with your API keys ``` -------------------------------- ### Execute Advanced Examples Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Runs advanced example scripts for research and workflow automation from the project root. ```bash python examples/advanced_research.py ``` ```bash python examples/workflow_automation.py ``` -------------------------------- ### Execute Validation Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Runs the validation example script, new in v1.1.0. ```bash python examples/validation_example.py # New in v1.1.0 ``` -------------------------------- ### MegaBot.start() Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md Starts all the necessary services for MEGA-Bot to operate. ```APIDOC ## MegaBot.start() ### Description Starts MEGA-Bot services. ### Method `start()` ### Parameters None ### Request Example ```python megabot.start() ``` ### Response None explicitly documented. ``` -------------------------------- ### Run Validation Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Execute the validation example script to demonstrate input validation, query sanitization, topic validation, automatic security checks, logging configuration, and error handling. ```bash python examples/validation_example.py ``` -------------------------------- ### Copy Environment File Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Create a local environment file by copying the example environment file. This file will store your API keys and other sensitive configurations. ```bash cp .env.example .env ``` -------------------------------- ### Install LangChain Dependencies Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Install the necessary LangChain packages for integration. This is optional. ```bash pip install langchain langchain-community langchain-openai ``` -------------------------------- ### Status Monitoring Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Retrieves and prints the current status of active platforms and user permissions. ```python status = bot.get_status() print(f"Active platforms: {status['integrations']['active']}") print(f"Permissions: {status['permissions']}") ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Installs project dependencies using pip and runs tests with pytest. Ensure requirements.txt is up-to-date before running. ```bash pip install -r requirements.txt pytest ``` -------------------------------- ### Initialize MegaBot for Different Subscription Tiers Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Provides examples for initializing the MegaBot with different configurations, corresponding to free and pro subscription tiers. It also shows how to retrieve tier-specific information. ```python from megabot import MegaBot, Config # Free tier (default) bot_free = MegaBot() # Pro tier (unlimited usage) config = Config() config.set("monetization.tier", "pro") bot_pro = MegaBot(config) # Check tier info tier_info = bot_pro.get_tier_info() print(f"Tier: {tier_info['tier']}") print(f"Queries today: {tier_info['usage']['queries_today']}") ``` -------------------------------- ### Copy Configuration File Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Create a local configuration file by copying the example JSON configuration file. This file allows for detailed customization of OctoGen's settings. ```bash cp config.example.json config.json ``` -------------------------------- ### Sequential Chain Example Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Illustrates a multi-step processing pipeline using MegaBot's sequential chain. ```python async def sequential_chain_example(): config = Config() config.set("langchain.enabled", True) bot = MegaBot(config) await bot.start() # Multi-step processing context = {'chain_type': 'sequential_chain'} result = await bot.query("Analyze and summarize this topic", context=context) print("Result:", result['response']) await bot.stop() ``` -------------------------------- ### LLM Chain Example Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Demonstrates a simple LLM query using the MegaBot's LLM chain. ```python from megabot import MegaBot, Config import asyncio async def llm_chain_example(): config = Config() config.set("langchain.enabled", True) bot = MegaBot(config) await bot.start() # Simple LLM query result = await bot.query("Explain neural networks") print("Response:", result['response']) await bot.stop() ``` -------------------------------- ### Multi-Platform Query Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Queries multiple platforms for information on a given topic and prints the responses from each platform. ```python result = await bot.query("Explain quantum computing") for platform, response in result['responses'].items(): print(f"{platform}: {response['response']}") ``` -------------------------------- ### Configuration File Example Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This JSON file defines the core settings for MEGA-Bot, including API keys, database preferences, workflow parameters, and feature flags. Ensure sensitive information like API keys is managed securely. ```json { "api_keys": { "copilot": "your-api-key", "gemini": "your-api-key", "chatgpt": "your-api-key", "grok": "your-api-key" }, "database": { "type": "sqlite", "path": "megabot.db", "research_cache_enabled": true }, "workflow": { "max_concurrent_tasks": 10, "auto_update_interval": 3600, "permission_level": "full" }, "features": { "deep_research": true, "multi_tasking": true, "auto_update": true, "document_sync": true } } ``` -------------------------------- ### Install OctoGen as a Python Package Source: https://github.com/elmourabea/octogen/blob/main/coll/MARKETPLACE.md Install the OctoGen Python package directly from its GitHub repository using pip. ```bash pip install git+https://github.com/ELMOURABEA/OctoGen.git ``` -------------------------------- ### Run Workflow Automation Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Execute the workflow automation script to demonstrate pre-built and custom workflow creation, document synchronization, and update management features. ```bash python examples/workflow_automation.py ``` -------------------------------- ### Python Code Style Example Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Example of a Python function demonstrating type hints, docstrings, and adherence to PEP 8 guidelines. ```python def validate_query(query: str, max_length: int = 10000) -> tuple[bool, Optional[str]]: """ Validate user query for safety and correctness Args: query: The query string to validate max_length: Maximum allowed length for queries Returns: Tuple of (is_valid, error_message) """ # Implementation here ``` -------------------------------- ### Install Java Bridge Dependency Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Install the py4j package to enable the Java bridge. This is optional. ```bash pip install py4j ``` -------------------------------- ### Agent with Tools Example Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Illustrates agent-based reasoning with tool usage enabled in MegaBot. ```python async def agent_example(): config = Config() config.set("langchain.enabled", True) config.set("langchain.enable_tools", True) bot = MegaBot(config) await bot.start() context = {'chain_type': 'agent_executor'} result = await bot.query("Research and calculate ROI", context=context) print("Response:", result['response']) print("Reasoning Steps:", result['intermediate_steps']) await bot.stop() ``` -------------------------------- ### Java Client for Python Bridge Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Example Java client code to connect to a Python bridge server started with py4j. This allows calling Python functions from Java. ```java import py4j.GatewayServer; public class MegaBotClient { public static void main(String[] args) { GatewayServer server = new GatewayServer(new PythonBridge()); server.start(); // Call Python functions String result = pythonBridge.query("What is AI?"); System.out.println(result); } } ``` -------------------------------- ### Workflow Execution Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Executes a predefined workflow with a specific topic and prints the final analysis result. ```python result = await bot.execute_workflow( "comprehensive_analysis", topic="artificial intelligence" ) print(result['final_analysis']) ``` -------------------------------- ### Environment Variables Setup Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This bash script demonstrates how to set up environment variables for MEGA-Bot, including API keys and configuration file paths. These variables are used to configure the bot's behavior and access external services. ```bash COPILOT_API_KEY=your-key GEMINI_API_KEY=your-key CHATGPT_API_KEY=your-key GROK_API_KEY=your-key MEGABOT_CONFIG=config.json ``` -------------------------------- ### Install Node.js Bridge Dependency Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Install the python-shell package for Node.js integration. This is optional. ```bash npm install python-shell ``` -------------------------------- ### Example Usage of Version Tags Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Illustrates how users can reference specific versions or the latest within a major version using tags in their workflow. ```yaml - uses: ELMOURABEA/MEGAGENT@v1 # Always latest 1.x.x - uses: ELMOURABEA/MEGAGENT@v1.2 # Latest 1.2.x - uses: ELMOURABEA/MEGAGENT@v1.2.0 # Specific version ``` -------------------------------- ### Query Multiple AI Platforms Simultaneously Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This example shows how to query all integrated AI platforms at once and retrieve aggregated responses. The results are iterated through, printing the response from each platform. ```python async def query_example(): bot = MegaBot() await bot.start() result = await bot.query("What are the latest AI trends?") for platform, response in result['responses'].items(): print(f"{platform}: {response['response']}") await bot.stop() ``` -------------------------------- ### Update Synchronization Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Synchronizes documents and retrieves a list of recent updates, printing the platform and title for each update. ```python await bot.sync_documents() updates = bot.get_updates(limit=10) for update in updates: print(f"[{update['platform']}] {update['title']}") ``` -------------------------------- ### Install OctoGen as Editable Python Package Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Install OctoGen as a Python package in editable mode, allowing for direct code changes to be reflected without reinstallation. ```bash pip install -e . ``` -------------------------------- ### Install OctoGen as a GitHub Action Source: https://github.com/elmourabea/octogen/blob/main/coll/MARKETPLACE.md Add OctoGen to your GitHub workflow by specifying its repository and version. ```yaml name: Run OctoGen Query uses: ELMOURABEA/OctoGen@v1.2.0 with: mode: 'query' prompt: 'What are the latest AI trends?' tier: 'free' ``` -------------------------------- ### Retrieval QA Example Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Demonstrates document-based question answering using MegaBot's retrieval QA chain. ```python async def retrieval_qa_example(): config = Config() config.set("langchain.enabled", True) bot = MegaBot(config) await bot.start() context = {'chain_type': 'retrieval_qa'} result = await bot.query("What is machine learning?", context=context) print("Answer:", result['response']) print("Sources:", result['sources']) await bot.stop() ``` -------------------------------- ### Basic Python API Usage Source: https://github.com/elmourabea/octogen/blob/main/coll/PROJECT_SUMMARY.md Demonstrates how to initialize MegaBot, start it, perform a general query, conduct a deep research query, and then stop the bot. Requires asyncio. ```python from megabot import MegaBot import asyncio async def main(): bot = MegaBot() await bot.start() # Query all platforms result = await bot.query("What is AI?") # Deep research research = await bot.research("machine learning", depth="deep") await bot.stop() asyncio.run(main()) ``` -------------------------------- ### Command Line Interface (CLI) Usage Source: https://github.com/elmourabea/octogen/blob/main/coll/PROJECT_SUMMARY.md Shows various commands to run the Octogen project from the command line, including demo mode, interactive mode, running examples, and executing tests. ```bash python main.py # Demo mode python main.py --interactive # Interactive mode python examples/basic_usage.py # Run examples pytest tests/ # Run tests ``` -------------------------------- ### Check Python Version Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Verify that your Python installation is version 3.8 or higher, which is required to avoid potential async event loop warnings. ```bash python --version # Should be 3.8 or higher ``` -------------------------------- ### Deep Research Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Initiates a deep research query on a specified topic and prints the number of findings and aggregated sources. ```python research = await bot.research("machine learning", depth="deep") print(f"Findings: {len(research['findings'])}") print(f"Sources: {research['aggregated_sources']}") ``` -------------------------------- ### Install OctoGen as GitHub Action Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Add this snippet to your GitHub workflow file to integrate OctoGen. Ensure you replace 'Your AI query here' with your actual query and set the desired tier. ```yaml - name: Run OctoGen uses: ELMOURABEA/OctoGen@v2.0.0 with: mode: 'query' prompt: 'Your AI query here' tier: 'free' ``` -------------------------------- ### Test MEGAGENT Action in Workflow Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Example GitHub Actions workflow to test the MEGAGENT action with specific inputs. ```yaml # .github/workflows/test-megagent.yml name: Test MEGAGENT on: [push] jobs: test: runs-on: ubuntu-latest steps: - name: Test MEGAGENT Action uses: ELMOURABEA/MEGAGENT@v1.2.0 with: mode: 'query' prompt: 'What is artificial intelligence?' tier: 'free' ``` -------------------------------- ### Conversational Chain with Memory Example Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Shows how to maintain context across interactions using MegaBot's conversational chain with memory enabled. ```python async def conversation_example(): config = Config() config.set("langchain.enabled", True) config.set("langchain.enable_memory", True) bot = MegaBot(config) await bot.start() context = {'chain_type': 'conversation_chain'} # First message result1 = await bot.query("Tell me about Python", context=context) print("Response 1:", result1['response']) # Follow-up (memory preserved) result2 = await bot.query("What are its main features?", context=context) print("Response 2:", result2['response']) await bot.stop() ``` -------------------------------- ### Run Advanced Research Example Source: https://github.com/elmourabea/octogen/blob/main/coll/examples/README.md Execute the advanced research script to showcase deep research on multiple topics, comprehensive analysis workflows, result synthesis, and platform-specific insights. ```bash python examples/advanced_research.py ``` -------------------------------- ### JavaScript Integration using python-shell Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Integrates MEGA-Bot with Node.js using the python-shell library. Requires installing the library via npm. ```bash npm install python-shell ``` ```javascript const { PythonShell } = require('python-shell'); let options = { mode: 'json', pythonPath: 'python3', scriptPath: './megabot', args: ['--query', 'What is AI?'] }; PythonShell.run('main.py', options, (err, results) => { if (err) throw err; console.log(results); }); ``` -------------------------------- ### Execute Complex Workflows with MEGA-Bot Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This snippet illustrates how to execute a predefined workflow, such as 'comprehensive_analysis', with specific parameters. The MegaBot must be started before executing any workflow. ```python async def workflow_example(): bot = MegaBot() await bot.start() # Comprehensive analysis workflow result = await bot.execute_workflow( "comprehensive_analysis", topic="machine learning" ) await bot.stop() ``` -------------------------------- ### Python Bridge Server for Java Interoperability Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Sets up a Python bridge server using py4j to allow Java applications to interact with MEGA-Bot. Ensure py4j is installed. ```bash pip install py4j ``` ```python from py4j.java_gateway import JavaGateway, GatewayParameters class PythonBridge: def __init__(self): self.bot = MegaBot(Config()) def query(self, prompt): return asyncio.run(self.bot.query(prompt)) gateway = JavaGateway(gateway_parameters=GatewayParameters(port=25333)) python_bridge = PythonBridge() gateway.entry_point = python_bridge gateway.start() ``` -------------------------------- ### Basic Copilot Search Query Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Perform a hybrid search using the MegaBot to get an AI answer, web results, and sources for a given query. Ensure the Copilot Search is enabled in the configuration. ```python from megabot import MegaBot, Config import asyncio async def search_example(): config = Config() config.set("copilot_search.enabled", True) bot = MegaBot(config) await bot.start() # Perform hybrid search result = await bot.query("What are the latest AI trends?") print("AI Answer:", result['answer']) print("Web Results:", result['web_results']) print("Sources:", result['sources']) await bot.stop() asyncio.run(search_example()) ``` -------------------------------- ### Perform Deep Research with MEGA-Bot Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md This snippet demonstrates how to initiate a deep research query on a given topic using the MegaBot class. Ensure MegaBot is imported and started before making research calls. The result includes platforms used and a synthesis of findings. ```python from megabot import MegaBot import asyncio async def research_example(): bot = MegaBot() await bot.start() # Deep research result = await bot.research("quantum computing", depth="deep") print(f"Platforms used: {result['platforms_used']}") print(f"Total findings: {result['synthesis']['total_findings']}") await bot.stop() asyncio.run(research_example()) ``` -------------------------------- ### Configure Logging for Debugging and Monitoring Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Shows how to set up logging for the OctoGen system using the `setup_logging` function. This allows developers to control the verbosity of logs for debugging and monitoring purposes. ```python from megabot import setup_logging # Configure logging level setup_logging("INFO") # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL ``` -------------------------------- ### Configure API Keys in .env Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Edit the .env file to add your API keys for GitHub Copilot, Gemini, ChatGPT, and Grok. Optional AdMob IDs can also be configured here. ```bash COPILOT_API_KEY=your-copilot-api-key GEMINI_API_KEY=your-gemini-api-key CHATGPT_API_KEY=your-chatgpt-api-key GROK_API_KEY=your-grok-api-key # Optional: AdMob IDs for advertising integration ADMOB_APP_ID=your-admob-app-id ADMOB_BANNER_ID=your-admob-banner-id ADMOB_INTERSTITIAL_ID=your-admob-interstitial-id ADMOB_REWARDED_ID=your-admob-rewarded-id ``` -------------------------------- ### Verify action.yml Configuration Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Load and parse the action.yml file to ensure it is valid YAML. ```bash python -c "import yaml; yaml.safe_load(open('action.yml'))" ``` -------------------------------- ### Automated Documentation Generation with OctoGen Source: https://github.com/elmourabea/octogen/blob/main/coll/MARKETPLACE.md Generate project documentation automatically on push to the main branch. Requires Copilot API key. ```yaml name: Generate Docs on: push: branches: [main] jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Generate Documentation uses: ELMOURABEA/OctoGen@v1.2.0 with: mode: 'workflow' workflow-name: 'comprehensive_analysis' prompt: 'Generate comprehensive documentation for this project' copilot-api-key: ${{ secrets.COPILOT_API_KEY }} ``` -------------------------------- ### Verify Package Build and Distribution Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Build the package and check its distribution files for integrity. ```bash python -m build ``` ```bash twine check dist/* ``` -------------------------------- ### Run OctoGen Demo Mode Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Execute the main script to run OctoGen in demo mode and observe its functionality. ```bash python main.py ``` -------------------------------- ### Configure LLM API Key Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Add your LLM API key to the .env file for authentication. ```bash LANGCHAIN_API_KEY=your-llm-api-key-here ``` -------------------------------- ### Integrate Advertising for Monetization Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Demonstrates how to integrate Google AdMob for monetization within OctoGen, including showing banner ads and rewarded ads to offer bonus features. ```python # Show banner ad result = bot.show_banner_ad("bottom") # Show rewarded ad for bonus features result = bot.show_rewarded_ad("bonus_queries") print(f"Reward: {result['reward']['description']}") ``` -------------------------------- ### Configure LangChain Settings Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Set up LangChain integration parameters in the config.json file. ```json { "langchain": { "enabled": true, "llm_provider": "openai", "temperature": 0.7, "max_tokens": 2000, "enable_memory": true, "enable_tools": true } } ``` -------------------------------- ### Clone Repository Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Clone your forked repository to your local machine and navigate into the project directory. ```bash git clone https://github.com/YOUR_USERNAME/OctoGen.git cd OctoGen ``` -------------------------------- ### Combined Usage of Copilot Search and LangChain Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Use Copilot Search to gather information and LangChain to synthesize it. Ensure both integrations are enabled in the configuration. ```python async def combined_example(): config = Config() config.set("copilot_search.enabled", True) config.set("langchain.enabled", True) config.set("langchain.enable_tools", True) bot = MegaBot(config) await bot.start() # Step 1: Gather information with Copilot Search search_result = await bot.query("Latest AI trends") # Step 2: Synthesize with LangChain agent context = {'chain_type': 'agent_executor'} synthesis = await bot.query( f"Analyze these findings: {search_result['synthesis']}", context=context ) print("Web Results:", search_result['web_results']) print("AI Synthesis:", synthesis['response']) print("Reasoning:", synthesis['intermediate_steps']) await bot.stop() ``` -------------------------------- ### MegaBot.query(prompt, context) Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md Queries all integrated platforms with a given prompt and context. ```APIDOC ## MegaBot.query(prompt, context) ### Description Queries all platforms with the provided prompt and context. ### Method `query(prompt, context)` ### Parameters - **prompt** (string) - Required - The query to be sent to the platforms. - **context** (any) - Required - Additional context for the query. ### Request Example ```python response = megabot.query("What is the capital of France?", {"source": "web"}) ``` ### Response Returns results from queried platforms. Specific format not detailed. ``` -------------------------------- ### Configure Copilot Search API Key Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Add your Bing Search API key to the .env file for Copilot Search integration. ```bash BING_SEARCH_API_KEY=your-bing-search-api-key-here ``` -------------------------------- ### Build Package Locally Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Command to build the Python package locally before uploading artifacts. ```bash python -m build ``` -------------------------------- ### Test CLI Modes Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Verify the command-line interface functionality in both interactive and non-interactive modes. Ensure the main script and its CLI options work as expected. ```bash # Test CLI modes python main.py python main.py --interactive ``` -------------------------------- ### Run OctoGen Interactive Mode Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Launch OctoGen using the interactive command-line interface for direct interaction. ```bash python main.py --interactive ``` -------------------------------- ### Create and Push Git Tag Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Create an annotated Git tag for the new release version and push it to the origin. This is a crucial step for version control and release management. ```bash # Create and push tag git tag -a v1.2.0 -m "Release version 1.2.0" git push origin v1.2.0 ``` -------------------------------- ### Create and Push Release Tag Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Commands to create a new annotated tag for a release and push it to the remote repository. ```bash git checkout main git pull origin main git merge git tag -a v1.2.0 -m "Release version 1.2.0 - Monetization and GitHub Marketplace" git push origin v1.2.0 ``` -------------------------------- ### Stage and Commit Changes Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Stage all modified files and commit them with a descriptive message summarizing your changes. ```bash git add . git commit -m "Description of your changes" ``` -------------------------------- ### Aggregate and Synthesize Research Results Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Illustrates how to obtain a unified synthesis of insights from multiple AI platforms after performing a research query. The 'synthesis' key in the result dictionary contains the aggregated information. ```python result = await bot.research("topic") synthesis = result['synthesis'] # Contains unified insights from all platforms ``` -------------------------------- ### Verify Project Version Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Use this command to check the current version of the megabot package. ```bash python -c "from megabot import __version__; print(__version__)" ``` -------------------------------- ### Configure Action Branding Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Define the icon and color for your action's branding in the action.yml file. This is used in the GitHub Marketplace. ```yaml branding: icon: 'zap' color: 'blue' ``` -------------------------------- ### Add Marketplace Badge to README Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Markdown snippet for adding a GitHub Marketplace badge to a README file. ```markdown [![Marketplace](https://img.shields.io/badge/GitHub%20Marketplace-Published-orange.svg)](https://github.com/marketplace/actions/megagent-ai-multi-platform-integration) ``` -------------------------------- ### Create and Push Git Tag for Version Update Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Tag a specific version and push it to the remote repository to mark a release. This is part of the version update process. ```bash git tag -a v1.2.1 -m "Release version 1.2.1" git push origin v1.2.1 ``` -------------------------------- ### Multi-Platform Queries with OctoGen Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Query all available AI platforms simultaneously for a given topic and aggregate their responses. ```python result = await bot.query("Explain transformer architecture") # Aggregates responses with confidence scores ``` -------------------------------- ### Weekly AI Digest using Multi-Platform Query Source: https://github.com/elmourabea/octogen/blob/main/coll/MARKETPLACE.md Schedule a weekly digest of AI developments by querying multiple platforms. Requires API keys for Copilot, Gemini, ChatGPT, and Grok. Results are posted as a GitHub issue. ```yaml name: Weekly AI Digest on: schedule: - cron: '0 9 * * 1' # Every Monday at 9 AM jobs: digest: runs-on: ubuntu-latest steps: - name: Query All AI Platforms uses: ELMOURABEA/OctoGen@v1.2.0 id: digest with: mode: 'query' prompt: 'What are the most important AI developments this week?' copilot-api-key: ${{ secrets.COPILOT_API_KEY }} gemini-api-key: ${{ secrets.GEMINI_API_KEY }} chatgpt-api-key: ${{ secrets.CHATGPT_API_KEY }} grok-api-key: ${{ secrets.GROK_API_KEY }} tier: 'pro' - name: Create Issue with Digest uses: actions/github-script@v7 with: script: | const result = ${{ steps.digest.outputs.result }}; await github.rest.issues.create({ owner: context.repo.owner, repo: context.repo.repo, title: 'Weekly AI Digest', body: `# AI Digest\n\n${JSON.stringify(result, null, 2)}` }); ``` -------------------------------- ### Validate User Queries and Topics Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Demonstrates the use of `validate_query` and `validate_topic` functions for sanitizing and validating user inputs before they are processed by the system. This enhances security and prevents errors. ```python from megabot import validate_query, validate_topic # Validate queries before processing is_valid, error = validate_query("Your query here") # Validate research topics is_valid, error = validate_topic("Your topic here") ``` -------------------------------- ### Run Specific Integration Tests Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Execute only integration tests from a specific file. Useful for targeted testing. ```bash pytest tests/test_new_integrations.py -v ``` -------------------------------- ### Verify Project Tests Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Run pytest to verify that all tests are passing with a concise output. ```bash pytest -v --tb=short ``` -------------------------------- ### Execute Multiple Research Queries Concurrently Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Demonstrates how to initiate multiple research queries in parallel using the MegaBot class. This is useful for speeding up data gathering when multiple topics need to be explored simultaneously. ```python bot = MegaBot() # Executes multiple research queries in parallel ``` -------------------------------- ### Force Push Major Version Tag Source: https://github.com/elmourabea/octogen/blob/main/coll/PUBLISHING_GUIDE.md Create or update a major version tag (e.g., v1) to point to the latest release within that major version. Use with caution due to the force push. ```bash # v1 tag points to latest v1.x.x git tag -fa v1 -m "Version 1 (latest: 1.2.0)" git push origin v1 --force ``` -------------------------------- ### Create New Feature Branch Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Create a new branch for your feature development, following the 'feature/your-feature-name' convention. ```bash git checkout -b feature/your-feature-name ``` -------------------------------- ### Run All Tests Source: https://github.com/elmourabea/octogen/blob/main/coll/CONTRIBUTING.md Execute all tests in the project using pytest to ensure code quality and functionality. ```bash pytest ``` -------------------------------- ### MegaBot.get_capabilities() Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md Retrieves all capabilities of the MEGA-Bot. ```APIDOC ## MegaBot.get_capabilities() ### Description Gets all capabilities of the bot. ### Method `get_capabilities()` ### Parameters None ### Request Example ```python capabilities = megabot.get_capabilities() ``` ### Response Returns a list of all bot capabilities. Specific format not detailed. ``` -------------------------------- ### Workflow Automation with OctoGen Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Execute predefined multi-step workflows for complex tasks, specifying the workflow name and relevant topic. ```python result = await bot.execute_workflow( "comprehensive_analysis", topic="neural networks" ) ``` -------------------------------- ### Clone OctoGen Repository Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Use this command to clone the OctoGen repository from GitHub to your local machine. ```bash git clone https://github.com/ELMOURABEA/OctoGen.git ``` -------------------------------- ### Auto-Update System with OctoGen Source: https://github.com/elmourabea/octogen/blob/main/coll/README.md Automatically synchronize the latest platform updates and retrieve recent updates. ```python await bot.sync_documents() updates = bot.get_updates(limit=10) ``` -------------------------------- ### JavaScript Integration using child_process Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Integrates MEGA-Bot with Node.js by spawning a Python process using the child_process module. This method allows direct execution of Python scripts. ```javascript const { spawn } = require('child_process'); const python = spawn('python3', [ 'main.py', '--query', 'What is AI?' ]); python.stdout.on('data', (data) => { console.log(`Result: ${data}`); }); python.stderr.on('data', (data) => { console.error(`Error: ${data}`); }); ``` -------------------------------- ### Verify Git Status and History Source: https://github.com/elmourabea/octogen/blob/main/coll/RELEASE_CHECKLIST.md Check the current Git status and review the last five commits. ```bash git status ``` ```bash git log --oneline -5 ``` -------------------------------- ### Configure Copilot Search Settings Source: https://github.com/elmourabea/octogen/blob/main/coll/INTEGRATION_GUIDE.md Configure Copilot Search settings in the config.json file, including enabling the feature, setting the API endpoint, maximum results, and safe search level. ```json { "copilot_search": { "enabled": true, "endpoint": "https://api.bing.microsoft.com/v7.0/search", "max_results": 10, "safe_search": "Moderate" } } ``` -------------------------------- ### AI-Powered Code Review with OctoGen Source: https://github.com/elmourabea/octogen/blob/main/coll/MARKETPLACE.md Automate code reviews within a GitHub Actions workflow. Requires API keys for Gemini and ChatGPT for 'pro' tier. ```yaml name: AI Code Review on: [pull_request] jobs: review: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Analyze PR with OctoGen uses: ELMOURABEA/OctoGen@v1.2.0 with: mode: 'query' prompt: 'Review this code for best practices and potential issues' gemini-api-key: ${{ secrets.GEMINI_API_KEY }} chatgpt-api-key: ${{ secrets.CHATGPT_API_KEY }} tier: 'pro' ``` -------------------------------- ### MegaBot.execute_workflow(name, **kwargs) Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md Executes a specified workflow with given arguments. ```APIDOC ## MegaBot.execute_workflow(name, **kwargs) ### Description Executes a workflow by its name with additional keyword arguments. ### Method `execute_workflow(name, **kwargs)` ### Parameters - **name** (string) - Required - The name of the workflow to execute. - **kwargs** (dict) - Optional - Additional parameters for the workflow. ### Request Example ```python megabot.execute_workflow("data_processing", input_file="data.csv", output_format="json") ``` ### Response None explicitly documented. Execution status or results may be returned. ``` -------------------------------- ### MegaBot.get_updates(platform, limit) Source: https://github.com/elmourabea/octogen/blob/main/coll/DOCUMENTATION.md Fetches the latest updates from a specified platform. ```APIDOC ## MegaBot.get_updates(platform, limit) ### Description Gets the latest updates from a specified platform. ### Method `get_updates(platform, limit)` ### Parameters - **platform** (string) - Required - The platform to get updates from. - **limit** (integer) - Optional - The maximum number of updates to retrieve. ### Request Example ```python updates = megabot.get_updates("github", 10) ``` ### Response Returns a list of updates from the specified platform. Specific format not detailed. ```