Skip to main content

A Python library for interacting with the Neyro API

Project description

NeyroAPI Python Library

This library provides a Python interface to interact with the Neyro API, supporting text, image, and audio functionalities.

Installation

To install the library, use pip:

pip install -U neyro-api

Or from github repository

pip install -U https://github.com/NeyroTeam/NeyroAPI-Library-PY

Usage

Sync API

from neyro_api import NeyroAPI

api_key = "YOUR_API_KEY"
captcha_key = "Captcha key"
neyro_api = NeyroAPI(api_key, captcha_key)

# Text API
text_response = neyro_api.text_gpt_new(messages=[{"role": "user", "content": "Hello, how are you?"}], model="gpt-3.5-turbo", max_tokens=512, temperature=0.9, plugins=[], id="b62f4cc5-0a7b-4044-9267-065c63c24469")
print("Text API Response:", text_response)

# Image API
image_response = neyro_api.image_sh(prompt="A beautiful landscape", width=512, height=512, steps=50, number=1, sampler="k_lms", model="stable_cascade", stream=True)
print("Image API Response:", image_response)

# Audio API
audio_response = neyro_api.audio_tts(model="google", voice="adam", text="Hello, this is a test.", language="en")
print("Audio API Response:", audio_response)

Async API

import asyncio
from neyro_api import AsyncNeyroAPI

api_key = "YOUR_API_KEY"
captcha_key = "Captcha key"
async_neyro_api = AsyncNeyroAPI(api_key, captcha_key)

async def main():
    text_response = await async_neyro_api.text_gpt_new(messages=[{"role": "user", "content": "Hello, how are you?"}], model="gpt-3.5-turbo", max_tokens=512, temperature=0.9, plugins=[], id="b62f4cc5-0a7b-4044-9267-065c63c24469")
    print("Async Text API Response:", text_response)

    image_response = await async_neyro_api.image_sh(prompt="A beautiful landscape", width=512, height=512, steps=50, number=1, sampler="k_lms", model="stable_cascade", stream=True)
    print("Async Image API Response:", image_response)

    audio_response = await async_neyro_api.audio_tts(model="google", voice="adam", text="Hello, this is a test.", language="en")
    print("Async Audio API Response:", audio_response)

asyncio.run(main())

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2024 NeyroTeam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

neyro_api-0.1.8.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

neyro_api-0.1.8-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file neyro_api-0.1.8.tar.gz.

File metadata

  • Download URL: neyro_api-0.1.8.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for neyro_api-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e0eb76c087224f3c17fa7f2f5658e12c1edca2d03bbbb641c54e887da698976d
MD5 0d9d47c680080ccd7eaf93959baf15e7
BLAKE2b-256 fae3d9003cbebae3552c40886abfcd9b9be6734b3a15d8a310a4bf68a2298da7

See more details on using hashes here.

File details

Details for the file neyro_api-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: neyro_api-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for neyro_api-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9da584725156f43ef4714db41959e443f7b2e5dd5b10b7c1e52e95ae6cd57952
MD5 cd17146f761a10153522d11f2f59b4fc
BLAKE2b-256 5bf308c0e44700af74efc78dab788b4497f6b359fc955c27a9ed8d5dbc83562c

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