{"id":20932200,"url":"https://github.com/ashnkumar/theta-agents","last_synced_at":"2025-10-14T14:16:34.360Z","repository":{"id":251061367,"uuid":"835830373","full_name":"ashnkumar/theta-agents","owner":"ashnkumar","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-01T21:10:30.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T14:16:33.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ashnkumar.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-07-30T16:01:11.000Z","updated_at":"2024-12-17T20:49:18.000Z","dependencies_parsed_at":"2024-07-31T17:44:05.662Z","dependency_job_id":"8dd93e17-0b54-4aab-90b4-40597b74531c","html_url":"https://github.com/ashnkumar/theta-agents","commit_stats":null,"previous_names":["ashnkumar/theta-agents"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashnkumar/theta-agents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Ftheta-agents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Ftheta-agents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Ftheta-agents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Ftheta-agents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashnkumar","download_url":"https://codeload.github.com/ashnkumar/theta-agents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Ftheta-agents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019121,"owners_count":26086679,"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-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-11-18T21:47:26.244Z","updated_at":"2025-10-14T14:16:34.328Z","avatar_url":"https://github.com/ashnkumar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Theta Agents SDK\n\n![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![Build Status](https://img.shields.io/badge/build-passing-brightgreen)\n![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)\n\nThe **Theta Agents SDK** is a Python library designed to help developers quickly build AI agent frameworks on the Theta EdgeCloud network. The SDK provides a range of prebuilt capabilities based on EdgeCloud's off-the-shelf containers, such as generating images and videos (Stable Diffusion), using EdgeCloud-hosted LLMs for underlying agent reasoning (e.g. Llama, Mistral) and writing code (CodeLlama), and Theta-specific capabilities like deploying to EdgeStore and the Theta Video API.\n\n![alt](https://i.imgur.com/bBgAOYZ.png)\n\n## Features\n\n- **Create Images from Prompts**: Use EdgeCloud-hosted (or custom containers on EdgeCloud) image models like Stable Diffusion.\n- **Create Videos from Images**: Generate videos using Stable Diffusion (Video) from EdgeCloud.\n- **Generate Smart Contracts**: Easily create smart contracts based on user-defined prompts through CodeLlama hosted on EdgeCloud.\n- **Deploy Smart Contracts**: Use web3-based agent tools to deploy to the Theta Testnet.\n- **Upload files to Theta network's services**: Agents can upload files to EdgeCloud and videos to Theta's video services network.\n- _**Coming soon:**_ Support for multi-agent workflows (2+ agents collaborating autonomously to solve tasks).\n\n## Installation\n\nTo install the Theta Agents SDK, clone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/yourusername/theta-agents-sdk.git\ncd theta-agents-sdk\n\n# Create and activate a virtual environment\npython -m venv venv\nsource venv/bin/activate\n\n# Install dependencies\npip install -e .\n```\n\n## Setup\n\n### 1. Environment Variables\n\nCreate a `.env` file in the root directory of your project. This file should contain all sensitive information such as API keys and private keys. Here's an example `.env` and you can look at `.env.example` for more:\n\n```ini\n# .env\n\nHUGGING_FACE_TOKEN=your-hugging-face-token\nGRADIO_API_KEY=your-gradio-api-key\nBLOCKCHAIN_PRIVATE_KEY=your-blockchain-private-key # if deploying to Theta's chain.\n```\n\n### 2. Configuration File\n\nCopy `config_template.yaml` to `config.yaml` and edit the values to match your specific setup:\n\n```bash\ncp config_template.yaml config.yaml\n```\n\nEdit `config.yaml` to include your specific configuration details, such as endpoints, model names, and environment variable names.\n\n```yaml\nllm_endpoint: \"https://gemma2b....onthetaedgecloud.com/v1/chat/completions\"\nllm_model_name: \"google/gemma-2b\"\n\ncapabilities:\n  image_tools:\n    create_image_from_prompt:\n      edgecloud_endpoint: \"https://stablediffi...onthetaedgecloud.com\"\n      edgecloud_endpoint_type: \"gradio\"\n  video_tools:\n    create_video_from_image:\n      edgecloud_endpoint: \"https://stablediffi...onthetaedgecloud.com\"\n      edgecloud_endpoint_type: \"gradio\"\n  smart_contract_tools:\n    generate_smart_contract:\n      edgecloud_endpoint: \"...\"\n      edgecloud_endpoint_type: \"openai\"\n      model_name: \"...\"\n```\n\n## Usage\n\n### Running the Chat Interface\n\nTo interact with an AI agent using the terminal chat interface, you can use the following code snippet in your script:\n\n```python\nfrom theta_agents import ThetaAgent, create_image_from_prompt, create_video_from_image\n\n# Load environment variables\nload_dotenv()\n\n# Initialize the agent\nagent = ThetaAgent(\n    capabilities=[create_image_from_prompt, create_video_from_image],\n    show_planning=True,\n    persona=\"You are a social media marketing expert.\"\n)\n\ndef chat(agent: ThetaAgent):\n    \"\"\"\n    Function to interact with the ThetaAgent in a chat-like interface in the terminal.\n    \"\"\"\n    while True:\n        user_input = input(\"\\nYou: \")\n        if user_input.lower() in [\"quit\", \"exit\"]:\n            print(\"Exiting the chat.\")\n            break\n\n        # Get the response from the agent\n        response_data = agent(user_input)\n\n        # Extract and display the user-facing message and internal planning message\n        human_facing_text = response_data.get('user_facing_text', '')  # The text meant for the user\n        planning_text = response_data.get('planning_text', '')  # Internal planning details\n        error_message = response_data.get('error', '')  # Any error messages\n\n        if human_facing_text:\n            print(f\"\\033[96mAI:\\033[0m {human_facing_text}\")  # Cyan text for AI messages\n        if planning_text:\n            print(f\"\\033[93mInternal Plan:\\033[0m {planning_text}\")  # Yellow text for internal planning messages\n        if error_message:\n            print(f\"\\033[91mError:\\033[0m {error_message}\")  # Red text for errors\n\n# Start the chat\nchat(agent)\n```\n\n### Additional Capabilities\n\nTo add more capabilities (tools), update the `config.yaml` with the new tool configurations and ensure that the necessary environment variables are set.\n\n## Contributing\n\nWe welcome contributions! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch-name`).\n3. Make your changes and commit them (`git commit -m 'Add new feature'`).\n4. Push to the branch (`git push origin feature-branch-name`).\n5. Open a pull request.\n\nPlease ensure that your code adheres to our coding standards and passes all tests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\nSpecial thanks to the open-source community for providing the tools and libraries that make this project possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Ftheta-agents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashnkumar%2Ftheta-agents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Ftheta-agents/lists"}