The official package of AI-X-Net.
Project description
AIXNet Beta
Overview
AIXNet Beta is a powerful and user-friendly Python package designed to streamline interactions with the OpenAI and Together AI APIs. By offering an intuitive interface, AIXNet allows developers to quickly integrate advanced AI models like OpenAI's GPT and Meta LLaMA into their applications. Whether you're building conversational agents, automated assistants, or just experimenting with AI-driven solutions, AIXNet simplifies the process by requiring only your API key and a well-structured payload to get started.
AIXNet Beta is particularly useful for developers looking to work with cutting-edge AI models without the complexity of directly interfacing with APIs. With support for various models and interactive chat sessions, it's a great solution for anyone seeking to integrate AI seamlessly into their workflows.
Installation
To install the package, use:
pip install aixnet-beta
This will install the latest version of the AIXNet Beta package, making it easy to start using the features immediately.
Usage
Here's a sample usage to demonstrate how easy it is to get started with AIXNet Beta:
# Initialize the AzureFM object
azure_fm = AzureFM(
model="meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
api_key="REQUEST_FOR_API_KEY",
protocol="You are a helpful assistant.")
# Start chat
azure_fm.start_chat()
With the start_chat
method, AIXNet allows for a smooth and interactive chat session, where users can engage directly with AI models in a conversational format. The AI model listens to user prompts and responds accordingly. Here’s an example of how the chat session might unfold:
🤖 Start chatting with us! Enter 'EXIT' to quit. 🛑
🧑 Human: tell me a joke
🤖 Bot: A man walked into a library and asked the librarian, "Do you have any books on Pavlov's dogs and Schrödinger's cat?"
The librarian replied, "It rings a bell, but I'm not sure if it's here or not."
🧑 Human: EXIT
🙌 Thank you for using the chatbot! Have a great day! 🌟
Additional Features
AIXNet Beta comes with a number of helpful features for working with AI models. Here are a few of them:
List Models
You can easily list all available models using the list_models()
method. This is helpful for developers who need to quickly see what models are supported and choose the best one for their use case.
# List models
azure_fm.list_models()
Expected output:
Available models: ['gpt-3.5-turbo', 'meta-llama/Llama-3-8b-chat-hf', 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo']
Managing Conversation History
The AIXNet Beta package also allows for managing conversation history, enabling developers to track the interactions between the user and the model. You can clear, view, or add messages to the history for better control and customization.
Example:
# Add a message to the conversation history
azure_fm.add_message(role="user", content="What is AI?")
This feature can be useful in scenarios where conversation context needs to be preserved or reviewed.
Error Handling
The invoke_api
method has built-in error handling that ensures your application won't crash even if something goes wrong during the API request. AIXNet Beta is designed to gracefully manage exceptions and provide informative error messages to help developers quickly debug and resolve issues.
Benefits
- Simplicity: AIXNet Beta abstracts away the complexities of API requests and payload construction, letting developers focus on building the actual functionality of their applications.
- Flexibility: Supports multiple AI models, allowing you to experiment with different configurations for various use cases.
- Interactive Chat: Provides an easy way to start AI-powered conversations, perfect for building chatbots, virtual assistants, or interactive tools.
- Error-Resilient: With built-in error handling, your application stays robust even when unexpected issues arise.
License
This project is licensed under the MIT License, making it free and open to modification and redistribution. You can freely use it in your own projects, including commercial applications, with minimal restrictions.
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 aixnet_beta-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7dacbb7a04cb5335a6d6d52ae6bebe934e5dd0c8f393da5c9560b62681a4c29 |
|
MD5 | 46fa307b3ffc689e5abfd5e1b41ef66c |
|
BLAKE2b-256 | bb18cc1feae8e884558965a0e796dd11b7fa7a3b2717e29106dbb819fbea9ec4 |