Skip to main content

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:

# Import
from aixnet_beta.fm import AzureFM

# 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aixnet_beta-0.2.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aixnet_beta-0.2.5-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file aixnet_beta-0.2.5.tar.gz.

File metadata

  • Download URL: aixnet_beta-0.2.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.1 Windows/10

File hashes

Hashes for aixnet_beta-0.2.5.tar.gz
Algorithm Hash digest
SHA256 dae43a6ac9069cff90c8ce2aa55fc5bc93901648a106aaf674bc6ab55e64fbd2
MD5 8ec99f0d5c27e9755c3783f6630f121a
BLAKE2b-256 9af30ba3b1c1afdf1acb10f5fb87e490d413c418b6ee9ca47f52babbb6a3def9

See more details on using hashes here.

File details

Details for the file aixnet_beta-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: aixnet_beta-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.1 Windows/10

File hashes

Hashes for aixnet_beta-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3b78834f9f9ea8a8167f28cb6b3433b5cfbf1058461c27cba0825f5fc46d4770
MD5 0b281d9d76a6dad57639aeefcd1b108f
BLAKE2b-256 2ba82ed77cd29871d7d4c0c823b4aeeeb44d35b873c6281b8f719a5e85f02290

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page