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 OpenAI 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.dev6.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: gradientai-1.0.0.dev6.tar.gz
  • Upload date:
  • Size: 27.8 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.dev6.tar.gz
Algorithm Hash digest
SHA256 23c5a36a9af1975bc95ef078c3fe66c2f923bc8420e6d6b1c3e5d73b04d7c6ce
MD5 4027e46e304665c3866cc860b0ab0ca5
BLAKE2b-256 7d400d4628ab64410385c54bd3e6dd1baa2fe6e76719ade63d2a76b579b5becb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gradientai-1.0.0.dev6-py3-none-any.whl
Algorithm Hash digest
SHA256 1c90673f4d40d53b1c0d60db44aca586013029440e8ced35acb4907d47507493
MD5 f0dbdbebdd664eb79e0942ab4c8093e7
BLAKE2b-256 7d750f6ec589f8fc49e423c0e2c16fbcb474a67b07352bbf3755c1c2d176dd01

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page