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 and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
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}/completions Complete model
ModelsApi create_model POST /models Create model
ModelsApi delete_model DELETE /models/{id} Delete model.
ModelsApi get_model GET /models/{id} Describe model
ModelsApi list_models GET /models List available models
ModelsApi train_model PUT /models/{id} Train model

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication

Author

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.dev5.tar.gz (29.0 kB view hashes)

Uploaded Source

Built Distribution

gradientai-1.0.0.dev5-py3-none-any.whl (59.8 kB view hashes)

Uploaded Python 3

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