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
- ChatCompletionMessage
- ChatCompletionResult
- CompletionAIFilter
- CompletionResult
- CreateChatCompletionRequest
- CreateChatCompletionResponse
- CreateCompletionRequest
- CreateCompletionResponse
- CreateEmbeddingRequest
- CreateEmbeddingResponse
- CreateEmbeddingResult
- CreateSegmentationRequest
- CreateSegmentationResponse
- CreateSegmentationResult
- DeleteTrainingTask200Response
- GetTrainingTaskListResponse
- GetTrainingTaskListResult
- GetTrainingTaskListResultContentInner
- Status
- TrainingTaskResponse
- TrainingTaskResult
- TrainingTaskResultStatusInfo
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
Metadata
Release files for pyhcx 0.9.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyhcx-0.9.8.tar.gz | 31.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhcx-0.9.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 98.8 kB
Release files / pyhcx-0.9.8.tar.gz
| Download URL | pyhcx-0.9.8.tar.gz |
|---|---|
| Size | 31.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d82d3917831415d87f67a54ddeb83ff10a941a306c3a0bdd4f50b58de5f51c8
|
|
BLAKE2b-256 checksum How to use checksums |
23f9da991da919a6bc5b4299340a6bbd2fe3a009116cc97c6dc22265669b3a38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0
|
Release files / pyhcx-0.9.8-py3-none-any.whl
| Download URL | pyhcx-0.9.8-py3-none-any.whl |
|---|---|
| Size | 67.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10c94379181aac22038c3f1fea0841fb82b3918ed4cd9b89f21096965a2b42d4
|
|
BLAKE2b-256 checksum How to use checksums |
f5e3998735344557fb73089ca94a4e7c67599269cbcd2a3d77ec7dd906766c84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.9 Darwin/23.6.0
|