Skip to main content

A Python client for NeuralCore AI API

Project description

NeuralCore Python SDK

The NeuralCore Python SDK provides an easy-to-use interface for interacting with the NeuralCore AI APIs, including chat and vision 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.
  • Custom Configuration: Set default parameters like temperature and tokens to customize responses.

Installation

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

pip install requests

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:

response = client.chat(
    messages="Hello, NeuralCore!",
    model="neura-3.5-aala",
    temperature=0.8,
    tokens=150
)
print(response)

Vision API

Send an image analysis request to NeuralCore:

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)

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",
    default_temperature=0.6,
    default_tokens=250
)
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.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

NeuralCore-1.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neuralcore-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 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.1.tar.gz
Algorithm Hash digest
SHA256 7df6b88bc7cca1343b9749f10ba503717e81b94914ba418d08ef4a625c61d1d9
MD5 bd787a06ca6e1edff5de3ebee2157a9e
BLAKE2b-256 35f639d7b92e8401c040a9cf43c1ab97b72bff2807b46007013ab7ca10fe994c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: NeuralCore-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38649b0b37d120ae61ee02c8ec800b459ff0986c5c6bec280a81f91416fddd1b
MD5 f6315bfd0d6eea9c4352bc9945bcae35
BLAKE2b-256 19a0ca48f79bccf2562777bf9a97389040e81874516b6c7cfa15297311af8f22

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