Gradient AI API
Project description
gradientai-python-sdk
Interface for interacting with Gradient AI.
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
- BaseModel
- CompleteModelBodyParams
- CompleteModelError
- CompleteModelSuccess
- CreateModelError
- CreateModelRequestBody
- CreateModelRequestBodyInitialHyperparameters
- CreateModelRequestBodyInitialHyperparametersLoraHyperparameters
- CreateModelRequestBodyInitialHyperparametersTrainingArguments
- CreateModelRequestBodyModel
- CreateModelSuccess
- DeleteModelError
- GetModelError
- GetModelSuccess
- ListModelsError
- ListModelsSuccess
- ListModelsSuccessModelsInner
- ModelAdapter
- TrainModelError
- TrainModelRequestBody
- TrainModelRequestBodySamplesInner
- TrainModelRequestBodySamplesInnerFineTuningParameters
- TrainModelSuccess
Documentation For Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: Bearer authentication
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gradientai-1.0.0.dev5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4939a4e10fa41f720710c2fb945f9a9882c47bf5262143cfa1daebb3e7f9e2a7 |
|
MD5 | 988d1658df0a5b2745551bae64c4d68f |
|
BLAKE2b-256 | d09d1bd8ed0209ca224d750cc08d37bdca3c0ec129b58dff135e26e65c131f85 |