Skip to main content

HCX API

Project description

pyhcx

The HCX REST API. Please see https://api.ncloud-docs.com/docs/ai-naver-clovastudio-summary for more details.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 24.1.5
  • Package version: 1.0.0
  • Generator version: 7.5.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.ncloud.com/support/overview

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import pyhcx

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pyhcx

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import pyhcx
from pyhcx.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = pyhcx.Configuration(
    host = "http://localhost"
)

# 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 API key authorization: ApigwApiKey
configuration.api_key['ApigwApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApigwApiKey'] = 'Bearer'

# Configure API key authorization: ClovastudioApiKey
configuration.api_key['ClovastudioApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ClovastudioApiKey'] = 'Bearer'


# Enter a context with an instance of the API client
with pyhcx.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyhcx.ChatApi(api_client)
    app_name = 'app_name_example' # str | app Name
    model_name = 'model_name_example' # str | model Name
    x_ncp_clovastudio_request_id = 'x_ncp_clovastudio_request_id_example' # str | request id
    create_chat_completion_request = pyhcx.CreateChatCompletionRequest() # CreateChatCompletionRequest | 

    try:
        api_response = api_instance.create_chat_completion(app_name, model_name, x_ncp_clovastudio_request_id, create_chat_completion_request)
        print("The response of ChatApi->create_chat_completion:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ChatApi->create_chat_completion: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
ChatApi create_chat_completion POST /{appName}/v1/chat-completions/{modelName}
ChatApi create_training_chat_completion POST /{appName}/v1/tasks/{taskId}/chat-completions
CompletionsApi create_completion POST /{appName}/v1/completions/{model}
EmbeddingsApi create_embedding POST /{appName}/v1/api-tools/embedding/{modelName}/{appId}
FineTuningApi create_training_task POST /tuning/v2/tasks
FineTuningApi delete_training_task DELETE /tuning/v2/tasks/{taskId}
FineTuningApi get_training_task_list GET /tuning/v2/tasks
FineTuningApi get_training_task_status GET /tuning/v2/tasks/{taskId}
SegmentationApi create_segmentation POST /{appName}/v1/api-tools/segmentation/{appId}

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ClovastudioApiKey

  • Type: API key
  • API key parameter name: X-NCP-CLOVASTUDIO-API-KEY
  • Location: HTTP header

ApigwApiKey

  • Type: API key
  • API key parameter name: X-NCP-APIGW-API-KEY
  • Location: HTTP header

IamAccessKey

  • Type: API key
  • API key parameter name: X-NCP-IAM-ACCESS-KEY
  • Location: HTTP header

ApigwSignatureKey

  • Type: API key
  • API key parameter name: X-NCP-APIGW-SIGNATURE-V2
  • Location: HTTP header

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

pyhcx-0.9.8.tar.gz (31.5 kB view hashes)

Uploaded Source

Built Distribution

pyhcx-0.9.8-py3-none-any.whl (67.3 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