Skip to main content

Gradient AI API

Project description

gradientai-python-sdk

Interface for interacting with Gradient AI.

PyPI version

The gradientai-python-sdk library provides convenient access to the Gradient AI from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

You can find usage examples for the Gradient AI Python library in our API reference and SDK quickstart. We also offer an example project in Python.

Requirements

Python 3.7+

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install gradientai

Then import the package:

import gradientai

Getting Started

Please follow the installation procedure and then run the following:

import time
import gradientai
from gradientai.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.gradient.ai/api
# See configuration.py for a list of all supported configuration parameters.
configuration = gradientai.Configuration(
    host = "https://api.gradient.ai/api"
)

# The client must configure the authentication parameter for being able to make the call. Gradient uses
# access tokens, which can be generated by going to https://auth.gradient.ai/select-workspace and selecting
# "Access tokens" under the profile drop-down.

# Configure Bearer authorization: AccessToken
configuration = gradientai.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with gradientai.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = gradientai.ModelsApi(api_client)
    id = 'id_example' # str | 
    x_gradient_workspace_id = 'x_gradient_workspace_id_example' # str | 
    complete_model_body_params = gradientai.CompleteModelBodyParams() # CompleteModelBodyParams | 

    try:
        # Complete model
        api_response = api_instance.complete_model(id, x_gradient_workspace_id, complete_model_body_params)
        print("The response of ModelsApi->complete_model:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ModelsApi->complete_model: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://github.com/Preemo-Inc/gradientai-python-sdk/blob/main/

Class Method HTTP request Description
ModelsApi complete_model POST /models/{id}/complete Complete model
ModelsApi create_model POST /models Create model
ModelsApi delete_model DELETE /models/{id} Delete model.
ModelsApi fine_tune_model POST /models/{id}/fine-tune Fine-tune model
ModelsApi get_model GET /models/{id} Describe model
ModelsApi list_models GET /models List available models

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

AccessToken

  • Type: Bearer authentication

Author

support@gradient.ai

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

gradientai-1.0.0.dev7.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

gradientai-1.0.0.dev7-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file gradientai-1.0.0.dev7.tar.gz.

File metadata

  • Download URL: gradientai-1.0.0.dev7.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for gradientai-1.0.0.dev7.tar.gz
Algorithm Hash digest
SHA256 6164d9caafcd2b62692a780de802bb68bcc09ccf1e4db4500df3efcdd0aba33b
MD5 4be2effefc22a2c009b90105c77f720e
BLAKE2b-256 03ae29fed9294f2e83da7c9370eccd9c7ddf98e85c0347dd0c54dcfb88d8e1ca

See more details on using hashes here.

Provenance

File details

Details for the file gradientai-1.0.0.dev7-py3-none-any.whl.

File metadata

File hashes

Hashes for gradientai-1.0.0.dev7-py3-none-any.whl
Algorithm Hash digest
SHA256 578c59f90bbb3d33e93b382bd7a0381dfcb866a39be86e6753e1ae5cc3c1cccd
MD5 4e66c41a21ff1e660b3bdf7cd709695b
BLAKE2b-256 17b10d16f8096bdef08504fe2bf90876fd7260030eddb3eba90ee1c586160d2c

See more details on using hashes here.

Provenance

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