Skip to main content

A Python wrapper for the SplitticAPI

Project description

The SplitticAPI Library provides a convenient Python interface for interacting with the Splittic API, enabling users to seamlessly integrate Splittic’s AI functionality into their applications. The library is designed to be user-friendly and versatile, supporting both asynchronous and synchronous programming.

Installation

To install the SplitticAPI Library, use the following command:

pip install SplitticAPI

Getting Started

  1. Obtain API Key:

  2. Initialize ChatModule:

    • Import the ChatModule class from SplitticAPI.meowgpt.

    • Set the global API key using ChatModule.initialize(api_key).

  3. Create a Chat Instance:

    • Create a new chat instance using ChatModule.create_chat(api_key).

    • Each instance automatically generates a unique chat ID.

  4. Send Messages:

    • Use the reply(message) method to send a synchronous message and receive a reply.

    • Optionally, use the async_reply(message) method for asynchronous interactions.

  5. Generate Images with DiffusionModule:

    • Import the DiffusionModule class from SplitticAPI.interdiffusion.

    • Initialize DiffusionModule with your API key.

    • Use the generate() method for synchronous image generation.

    • Alternatively, use async_generate() for asynchronous image generation.

    • The generated image is saved as “output.png” by default.

Example

from SplitticAPI.meowgpt import ChatModule
from SplitticAPI.interdiffusion import DiffusionModule

# Set the global API key
api_key = "your_api_key_here"
ChatModule.initialize(api_key)

# Create a ChatModule instance with a unique chat ID
chat_instance = ChatModule.create_chat(api_key)

# Send a synchronous message and get a reply
def main():
    reply = chat_instance.reply("Hi")
    print(reply)

    # Generate an image synchronously
    diffusion_module = DiffusionModule(api_key)
    diffusion_module.generate()

# Run the program
if __name__ == "__main__":
    main()

For more detailed information, refer to the official Splittic API documentation.

License

This library is released under the MIT License. Feel free to use, modify, and distribute it according to your needs.

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

SplitticAPI-1.4.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

SplitticAPI-1.4.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file SplitticAPI-1.4.1.tar.gz.

File metadata

  • Download URL: SplitticAPI-1.4.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for SplitticAPI-1.4.1.tar.gz
Algorithm Hash digest
SHA256 8fa44528bfae1de735b3a5fc6b25f0df10e88d0bdbbd48482f587abfe2cd96c2
MD5 ba5f8d2b89c9439ec5c5e9f9b30be71d
BLAKE2b-256 7b6383290a037503b2d3d40f5d759c52f75102a1776714dc609c746571ffe30a

See more details on using hashes here.

File details

Details for the file SplitticAPI-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: SplitticAPI-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for SplitticAPI-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72b1db965335e4ccb38a291cbe08dbb10ccd57d30bd79930a2b83a2c4bb76df9
MD5 3b4c801be4d532503dc427383f49427b
BLAKE2b-256 a80e565cda743f7e77d9c6389448d402b452ec107ec5ba8e5f109fbfda55a667

See more details on using hashes here.

Supported by

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