Welcome to the **WYN-Agent** package! This Python package provides a simple yet powerful interface to create AI chatbots using the Mistral AI platform.
Project description
🧠 WYN-Agent
Welcome to the WYN-Agent package! This Python package provides a simple yet powerful interface to create AI chatbots using the Mistral AI platform. It includes functionalities to handle conversation history, isolate and execute Python code from chatbot responses, and seamlessly interact with Mistral's AI agents.
💻 Github: https://github.com/yiqiao-yin/wyn-agent
📦 Installation
Before using the package, make sure you have Python installed. You can install the package via pip
:
pip install wyn-agent
🛠️ Features
- ChatBot Class: Easily create a chatbot that interacts with Mistral AI services.
- Conversation History: Track the entire conversation history with ease.
- Python Code Extraction: Automatically extract and save Python code from chatbot responses.
- Script Execution: Execute Python scripts directly from the extracted code.
- Interactive Agent: Run a Mistral AI agent chatbot with simple commands.
🚀 Quick Start
To get started, simply initialize the ChatBot
class with your Mistral API key and call the run_mistral_agent()
method.
from wyn_agent.mistral_agent import ChatBot
bot = ChatBot(
api_key=YOUR_MISTRAL_API_KEY,
agent_id=YOUR_MISTRAL_AGENT_API_ID
)
bot.run_mistral_agent()
This will start an interactive chatbot session where you can converse with the AI, extract Python code snippets, and even execute them on your local machine.
📚 Mistral AI Agent Bot Tutorial
In this section, we'll walk through using the Mistral AI Agent Bot to build a simple interactive chatbot.
1. Initialization
Start by creating a ChatBot
instance with your API key:
from wyn_agent.mistral_agent import ChatBot
bot = ChatBot(
api_key=YOUR_MISTRAL_API_KEY,
agent_id=YOUR_MISTRAL_AGENT_API_ID
)
2. Running the Agent
Call the run_mistral_agent()
method to begin interacting with the Mistral AI agent:
bot.run_mistral_agent()
3. Interacting with the Bot
You'll be prompted to enter your messages. The bot will respond and, if the response contains Python code enclosed in triple backticks (```), you'll have the option to save and execute the code.
4. Saving and Executing Python Code
If the bot generates Python code, you'll be asked if you want to save and execute the code. The code will be saved as a .py
file, and you can choose to run it immediately.
5. Exiting the Program
Type EXIT
to end the conversation.
📧 Contact
Developed by Yiqiao Yin. For any questions or feedback, feel free to reach out at eagle0504@gmail.com.
🎉 Contributions
We welcome contributions! If you'd like to contribute, please fork the repository and submit a pull request.
Enjoy building your AI agents with Mistral! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wyn_agent-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25e839eaaecfd6794f4d52a944ec3755e5364e21f6f4007d69e483640b9c7ac |
|
MD5 | 2f81af65926e575dd93b5ea991716138 |
|
BLAKE2b-256 | 962dc24fbf4ae434c4a66c0088713b924f51449b020b5801dab07c4f213c2fec |