wyn-agent-x


Namewyn-agent-x JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
SummaryThis package is an updated WYN-Agent package.
upload_time2024-10-26 17:42:57
maintainerNone
docs_urlNone
authorYiqiao Yin
requires_python<4.0,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐ŸŒŸ WYN-Agent-X

WYN-Agent-X is a dynamic and extendable chatbot that integrates with OpenAI and Twilio, allowing you to seamlessly handle user intents and trigger APIs (like sending SMS) based on natural language input. Plus, itโ€™s super friendly and conversational! ๐Ÿค–๐Ÿ’ฌ

### Features:
- **AI-Powered Conversations**: Uses OpenAIโ€™s GPT models for general chit-chat. Just type away!
- **Trigger-Based API Calls**: Automatically detects when users want to perform specific tasks (like sending a message), and triggers the corresponding API call.
- **Easy to Extend**: Add more APIs by simply updating the `metadata.json` file. No need to dig into the core logic! ๐ŸŒฑ

---

## ๐Ÿš€ Installation

You can easily install the package via `pip`:

```bash
pip install wyn-agent-x
```

---

## ๐Ÿ“‚ Directory Structure

```bash
wyn-agent-x/
โ”‚
โ”œโ”€โ”€ requirements.txt     # List of dependencies to install
โ”œโ”€โ”€ wyn_agent_x/
โ”‚   โ”œโ”€โ”€ __init__.py      # Initializes the package
โ”‚   โ”œโ”€โ”€ main.py          # Main entry point for the chatbot
โ”‚   โ”œโ”€โ”€ helper.py        # Helper functions and processing logic
โ”‚   โ”œโ”€โ”€ list_of_apis.py  # All API functions registered here
โ”‚   โ”œโ”€โ”€ metadata.json    # Dynamic metadata for API calls and trigger words
โ”‚โ”€โ”€ pyproject.toml       # Optional config if packaging the project
โ””โ”€โ”€ README.md            # You're reading this!
```

---

## ๐ŸŽฎ Sample Usage

Want to try it out? Just import the `AgentX` class, provide your API keys, and start chatting with your agent!

```python
from google.colab import userdata

# Fetch API credentials
OPENAI_API_KEY = userdata.get('OPENAI_API_KEY')
TWILIO_ACCOUNT_SID = userdata.get("YOUR_TWILIO_ACCOUNT_SID")
TWILIO_AUTH_TOKEN = userdata.get("YOUR_TWILIO_AUTH_TOKEN")

# Import the agent
from wyn_agent_x.main import AgentX

# Initialize and start the chat!
agent = AgentX(api_key=OPENAI_API_KEY, account_sid=TWILIO_ACCOUNT_SID, auth_token=TWILIO_AUTH_TOKEN)
agent.start_chat()
```

Once started, you'll see this friendly message:
```
๐Ÿ‘‹ Welcome! Press 'EXIT' to quit the chat at any time.
```

Feel free to chat with the bot, ask it to send messages, or perform any task you've configured in the metadata. When you're done, simply type `EXIT` to end the session with a friendly goodbye! ๐Ÿ‘‹

---

## ๐Ÿ“– How it Works

1. **Intent Detection**: The agent listens for specific trigger words (like "send a message" or "set a demo") from user input and matches them against the triggers defined in `metadata.json`.
   
2. **API Calls**: When an intent is detected (e.g., sending an SMS), it calls the corresponding API (like Twilio's SMS API) and logs the event in the `event_stream`.

3. **Dynamic Functions**: Adding a new API or intent is as simple as updating the `metadata.json` file and registering the new API in `list_of_apis.py`. No need to modify core logic! ๐Ÿš€

---

## ๐Ÿ› ๏ธ Extend and Customize

You can easily extend WYN-Agent-X by adding new API calls or intents:

1. **Update `metadata.json`** with new API information and trigger words:
   ```json
   {
       "send_email": {
           "trigger_word": ["send email", "notify via email"],
           "sample_payload": {"email": "string", "subject": "string"},
           "prerequisite": null
       }
   }
   ```

2. **Register your new API** in `list_of_apis.py` with a simple decorator:
   ```python
   @register_function("send_email")
   def send_email(payload: Dict[str, str], account_sid: str, auth_token: str, event_stream: list) -> Dict[str, Any]:
       # Code to send email goes here!
       pass
   ```

---

## ๐Ÿ“œ License

MIT License - Enjoy, use, and extend this project freely! ๐Ÿฅณ

---

## ๐Ÿ‘ค Author

**Yiqiao Yin**

๐Ÿ“ง Email: eagle0504@gmail.com

Feel free to reach out if you have any questions, suggestions, or just want to say hi! ๐Ÿ˜Š

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wyn-agent-x",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Yiqiao Yin",
    "author_email": "eagle0504@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/49/38/2fe6a10cc798d71799f31a94ae2bfd6fa5149412bd13088b1230183f45b1/wyn_agent_x-0.1.7.tar.gz",
    "platform": null,
    "description": "# \ud83c\udf1f WYN-Agent-X\n\nWYN-Agent-X is a dynamic and extendable chatbot that integrates with OpenAI and Twilio, allowing you to seamlessly handle user intents and trigger APIs (like sending SMS) based on natural language input. Plus, it\u2019s super friendly and conversational! \ud83e\udd16\ud83d\udcac\n\n### Features:\n- **AI-Powered Conversations**: Uses OpenAI\u2019s GPT models for general chit-chat. Just type away!\n- **Trigger-Based API Calls**: Automatically detects when users want to perform specific tasks (like sending a message), and triggers the corresponding API call.\n- **Easy to Extend**: Add more APIs by simply updating the `metadata.json` file. No need to dig into the core logic! \ud83c\udf31\n\n---\n\n## \ud83d\ude80 Installation\n\nYou can easily install the package via `pip`:\n\n```bash\npip install wyn-agent-x\n```\n\n---\n\n## \ud83d\udcc2 Directory Structure\n\n```bash\nwyn-agent-x/\n\u2502\n\u251c\u2500\u2500 requirements.txt     # List of dependencies to install\n\u251c\u2500\u2500 wyn_agent_x/\n\u2502   \u251c\u2500\u2500 __init__.py      # Initializes the package\n\u2502   \u251c\u2500\u2500 main.py          # Main entry point for the chatbot\n\u2502   \u251c\u2500\u2500 helper.py        # Helper functions and processing logic\n\u2502   \u251c\u2500\u2500 list_of_apis.py  # All API functions registered here\n\u2502   \u251c\u2500\u2500 metadata.json    # Dynamic metadata for API calls and trigger words\n\u2502\u2500\u2500 pyproject.toml       # Optional config if packaging the project\n\u2514\u2500\u2500 README.md            # You're reading this!\n```\n\n---\n\n## \ud83c\udfae Sample Usage\n\nWant to try it out? Just import the `AgentX` class, provide your API keys, and start chatting with your agent!\n\n```python\nfrom google.colab import userdata\n\n# Fetch API credentials\nOPENAI_API_KEY = userdata.get('OPENAI_API_KEY')\nTWILIO_ACCOUNT_SID = userdata.get(\"YOUR_TWILIO_ACCOUNT_SID\")\nTWILIO_AUTH_TOKEN = userdata.get(\"YOUR_TWILIO_AUTH_TOKEN\")\n\n# Import the agent\nfrom wyn_agent_x.main import AgentX\n\n# Initialize and start the chat!\nagent = AgentX(api_key=OPENAI_API_KEY, account_sid=TWILIO_ACCOUNT_SID, auth_token=TWILIO_AUTH_TOKEN)\nagent.start_chat()\n```\n\nOnce started, you'll see this friendly message:\n```\n\ud83d\udc4b Welcome! Press 'EXIT' to quit the chat at any time.\n```\n\nFeel free to chat with the bot, ask it to send messages, or perform any task you've configured in the metadata. When you're done, simply type `EXIT` to end the session with a friendly goodbye! \ud83d\udc4b\n\n---\n\n## \ud83d\udcd6 How it Works\n\n1. **Intent Detection**: The agent listens for specific trigger words (like \"send a message\" or \"set a demo\") from user input and matches them against the triggers defined in `metadata.json`.\n   \n2. **API Calls**: When an intent is detected (e.g., sending an SMS), it calls the corresponding API (like Twilio's SMS API) and logs the event in the `event_stream`.\n\n3. **Dynamic Functions**: Adding a new API or intent is as simple as updating the `metadata.json` file and registering the new API in `list_of_apis.py`. No need to modify core logic! \ud83d\ude80\n\n---\n\n## \ud83d\udee0\ufe0f Extend and Customize\n\nYou can easily extend WYN-Agent-X by adding new API calls or intents:\n\n1. **Update `metadata.json`** with new API information and trigger words:\n   ```json\n   {\n       \"send_email\": {\n           \"trigger_word\": [\"send email\", \"notify via email\"],\n           \"sample_payload\": {\"email\": \"string\", \"subject\": \"string\"},\n           \"prerequisite\": null\n       }\n   }\n   ```\n\n2. **Register your new API** in `list_of_apis.py` with a simple decorator:\n   ```python\n   @register_function(\"send_email\")\n   def send_email(payload: Dict[str, str], account_sid: str, auth_token: str, event_stream: list) -> Dict[str, Any]:\n       # Code to send email goes here!\n       pass\n   ```\n\n---\n\n## \ud83d\udcdc License\n\nMIT License - Enjoy, use, and extend this project freely! \ud83e\udd73\n\n---\n\n## \ud83d\udc64 Author\n\n**Yiqiao Yin**\n\n\ud83d\udce7 Email: eagle0504@gmail.com\n\nFeel free to reach out if you have any questions, suggestions, or just want to say hi! \ud83d\ude0a\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "This package is an updated WYN-Agent package.",
    "version": "0.1.7",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ad2a0be89a872dd25e2779300312d333a9f580649a8b53ab6d97e6868f9148e",
                "md5": "bcdcce22baf95d8c98bf3119758e64c3",
                "sha256": "309465dd973264338feff87e0d77c79986a0bcdf2215ae4f96e42b76022af490"
            },
            "downloads": -1,
            "filename": "wyn_agent_x-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bcdcce22baf95d8c98bf3119758e64c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 7657,
            "upload_time": "2024-10-26T17:42:55",
            "upload_time_iso_8601": "2024-10-26T17:42:55.453470Z",
            "url": "https://files.pythonhosted.org/packages/5a/d2/a0be89a872dd25e2779300312d333a9f580649a8b53ab6d97e6868f9148e/wyn_agent_x-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49382fe6a10cc798d71799f31a94ae2bfd6fa5149412bd13088b1230183f45b1",
                "md5": "10136b0d70f0b188956d9a357a0022fe",
                "sha256": "b1177b0e181e845a6462320a96ca35070fcc69d934526a4c05c75d0f9a3ccc96"
            },
            "downloads": -1,
            "filename": "wyn_agent_x-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "10136b0d70f0b188956d9a357a0022fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 6479,
            "upload_time": "2024-10-26T17:42:57",
            "upload_time_iso_8601": "2024-10-26T17:42:57.152534Z",
            "url": "https://files.pythonhosted.org/packages/49/38/2fe6a10cc798d71799f31a94ae2bfd6fa5149412bd13088b1230183f45b1/wyn_agent_x-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 17:42:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "wyn-agent-x"
}
        
Elapsed time: 0.39006s