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

Uploaded Source

Built Distribution

pyhcx-0.9.8-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

Details for the file pyhcx-0.9.8.tar.gz.

File metadata

  • Download URL: pyhcx-0.9.8.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0

File hashes

Hashes for pyhcx-0.9.8.tar.gz
Algorithm Hash digest
SHA256 7d82d3917831415d87f67a54ddeb83ff10a941a306c3a0bdd4f50b58de5f51c8
MD5 53f36921c5d116543c86f127f8315bd9
BLAKE2b-256 23f9da991da919a6bc5b4299340a6bbd2fe3a009116cc97c6dc22265669b3a38

See more details on using hashes here.

File details

Details for the file pyhcx-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: pyhcx-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 67.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0

File hashes

Hashes for pyhcx-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 10c94379181aac22038c3f1fea0841fb82b3918ed4cd9b89f21096965a2b42d4
MD5 484ead749d57b99c24542395d8549fa4
BLAKE2b-256 f5e3998735344557fb73089ca94a4e7c67599269cbcd2a3d77ec7dd906766c84

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