Skip to main content

A Python client for NeuralCore AI APIs

Project description

NeuralCore Python SDK

The NeuralCore Python SDK provides an easy-to-use interface for interacting with the NeuralCore AI APIs, including chat, vision, and text-to-speech (TTS) capabilities. This module enables seamless integration of NeuralCore’s powerful AI features into your applications.

Features

  • Chat API: Send messages and interact with NeuralCore's language models.
  • Vision API: Analyze images with advanced vision models.
  • Text-to-Speech (TTS) API: Convert text into speech using various voice options.
  • Custom Configuration: Set default parameters like temperature and tokens to customize responses.
  • System Messages: Utilize system messages for providing context or instructions to models.
  • Custom FineTuned Model Chat API: FineTune our Model with your data and use its in API.

Installation

Clone or download this repository and ensure you have Python 3.7+ installed. Install the required dependencies:

pip install NeuralCore

Usage

Initialization

To use the NeuralCore Python SDK, initialize the client with your API key:

from neuralcore import NeuralCore

api_key = "your_api_key_here"
client = NeuralCore(api_key)

Chat API

Send a chat request to NeuralCore. You can include system messages to provide specific instructions or context to the model:

response = client.chat(
    messages=[
        {"role": "system", "content": "You are an assistant that provides concise answers."},
        {"role": "user", "content": "What is the capital of France?"}
    ],
    model="neura-3.5-aala",
    temperature=0.8,
    tokens=150
)
print(response)

Note: System messages are optional but useful for guiding the model's behavior. Messages should follow the format:

  • role: "system", "user", or "assistant"
  • content: Text content for the respective role

Vision API

Send an image analysis request to NeuralCore. This feature allows models to interpret visual content based on a provided prompt:

response = client.vision(
    image_url="https://example.com/image.jpg",
    prompt="Describe the objects in the image.",
    model="neura-vision-3.5",
    temperature=0.7,
    tokens=200
)
print(response)

Text-to-Speech (TTS) API

Generate speech from text using NeuralCore's TTS API. Specify the desired voice to customize the output:

response = client.speak(
    text="Hello, how can I assist you?",
    voice="luna"  # Options: asteria, luna, stella, athena, hera, orion, arcas, perseus, angus, orpheus, helios, zeus
)
print(response)

Custom FineTuned Models API

Use your Custom FineTuned models using API

response = client.finetune_chat(
    "What is the capital of France?",
    model="YOUR_FINETUNED_MODEL_ID" #you can find your ModelID in https://neuralcore.org/dashboard/finetune
)
print(response)

Or using a message list

messages = [
    {"role": "system", "content": "You are a helpful AI assistant"},
    {"role": "user", "content": "What is the capital of France?"}
]
response = client.finetune_chat(
    messages=messages,
    model="YOUR_FINETUNED_MODEL_ID", #you can find your ModelID in https://neuralcore.org/dashboard/finetune
    temperature=0.7,
    tokens=200
)
print(response)

Models Overview

Chat Models

NeuralCore offers several models for language processing tasks:

  • neura-1.0: Base model for general language tasks.
  • neura-2.0: Enhanced version with improved context handling.
  • neura-3.5-aala: Latest release with advanced capabilities.
  • neura-4.0-think: Latest Realease for reasoning.
  • llama3-70b-8192: External model powered by Meta.

Vision Models

NeuralCore also provides specialized models for image analysis:

  • neura-vision-1.0: Stable release for basic image analysis.
  • neura-vision-2.0: Enhanced version with improved detail recognition.
  • neura-vision-3.5: Latest release with advanced capabilities.

Text-to-Speech Voices

NeuralCore's TTS API supports the following voices:

  • Female Voices: asteria, luna, stella, athena, hera
  • Male Voices: orion, arcas, perseus, angus, orpheus, helios, zeus

Configuration

You can customize the default settings during initialization:

from neuralcore import NeuralCoreConfig, NeuralCore

config = NeuralCoreConfig(
    api_key="your_api_key_here",
    base_url="https://neuralcore.org/api/n",
    tts_url="https://neuralcore.org/api/v1/tts",
    default_temperature=0.6,
    default_tokens=250,
    default_voice="luna"
)
client = NeuralCore(api_key=config.api_key)

Error Handling

The SDK raises a NeuralCoreError for any issues with API requests. Example:

try:
    response = client.chat("What's the weather?")
except NeuralCoreError as e:
    print(f"Error: {e}")

Requirements

  • Python 3.7+
  • requests library

License

This project is licensed under the MIT License.


Support

For support, contact NeuralCore Support or open an issue in this repository.

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

neuralcore-1.0.8.tar.gz (4.5 kB view details)

Uploaded Source

Built Distributions

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

neuralcore-1.0.8-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

NeuralCore-1.0.8-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file neuralcore-1.0.8.tar.gz.

File metadata

  • Download URL: neuralcore-1.0.8.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for neuralcore-1.0.8.tar.gz
Algorithm Hash digest
SHA256 7621cccdcb2330172201a40f7b5ef972a5a27166c474de18f6cffcfbf588a5ed
MD5 0d1fca5db07a033f857e8ed4f68e1110
BLAKE2b-256 c6f5e2e696a91992af733e25ab4efe41f091f15b38068486398f3a96b204dd56

See more details on using hashes here.

File details

Details for the file neuralcore-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: neuralcore-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for neuralcore-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d2a9d2909e79be8ada97875ed12cb80d6292b9f15dda5bf651b50bfc4299296a
MD5 0470d065b81c6b07ee0d719b24f2230e
BLAKE2b-256 8440e8c81e5e1a7f9a523c2b69458b973e1fa610d728bd299be138ec7e4b5205

See more details on using hashes here.

File details

Details for the file NeuralCore-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: NeuralCore-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for NeuralCore-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6559b0d202301e21f8f837d9469ac6923ed6f16d26fa015ee959b50e0fac3e38
MD5 141ed4cc559427e8d9e9f9cb737472ab
BLAKE2b-256 2419dafc3727fccbcba03da39d480351fb0bfc40446abc5af0ac6ce61393a499

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