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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gradientai-1.0.0.dev5.tar.gz
Algorithm Hash digest
SHA256 877597dae03b149aab421cf8aa44e7a77db3b1fea0e20350ad2f5888d5c331ee
MD5 556d5eb8c9524062cc553f8c07a9750c
BLAKE2b-256 668bd6ef9d6d8a88245eb9342fcaccf5625dc10432aa289ef7fb98ecf4ddb0a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gradientai-1.0.0.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 4939a4e10fa41f720710c2fb945f9a9882c47bf5262143cfa1daebb3e7f9e2a7
MD5 988d1658df0a5b2745551bae64c4d68f
BLAKE2b-256 d09d1bd8ed0209ca224d750cc08d37bdca3c0ec129b58dff135e26e65c131f85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page