feat: regenerate client with usage info in conversation response
Some checks failed
ai_core_api_client Python package / build (3.10) (push) Failing after 1m16s
ai_core_api_client Python package / build (3.11) (push) Failing after 1m14s
ai_core_api_client Python package / build (3.12) (push) Failing after 5s
ai_core_api_client Python package / build (3.13) (push) Failing after 5s
ai_core_api_client Python package / build (3.9) (push) Failing after 5s
Some checks failed
ai_core_api_client Python package / build (3.10) (push) Failing after 1m16s
ai_core_api_client Python package / build (3.11) (push) Failing after 1m14s
ai_core_api_client Python package / build (3.12) (push) Failing after 5s
ai_core_api_client Python package / build (3.13) (push) Failing after 5s
ai_core_api_client Python package / build (3.9) (push) Failing after 5s
This commit is contained in:
parent
4f1fcde0ce
commit
f39e6865be
22
.github/workflows/python.yml
vendored
22
.github/workflows/python.yml
vendored
@ -3,20 +3,23 @@
|
||||
#
|
||||
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: openapi_client Python package
|
||||
name: ai_core_api_client Python package
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
@ -24,15 +27,8 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
pip install -r requirements.txt
|
||||
pip install -r test-requirements.txt
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
pytest --cov=ai_core_api_client
|
||||
|
||||
@ -14,12 +14,6 @@ stages:
|
||||
- pip install -r test-requirements.txt
|
||||
- pytest --cov=ai_core_api_client
|
||||
|
||||
pytest-3.7:
|
||||
extends: .pytest
|
||||
image: python:3.7-alpine
|
||||
pytest-3.8:
|
||||
extends: .pytest
|
||||
image: python:3.8-alpine
|
||||
pytest-3.9:
|
||||
extends: .pytest
|
||||
image: python:3.9-alpine
|
||||
@ -29,3 +23,9 @@ pytest-3.10:
|
||||
pytest-3.11:
|
||||
extends: .pytest
|
||||
image: python:3.11-alpine
|
||||
pytest-3.12:
|
||||
extends: .pytest
|
||||
image: python:3.12-alpine
|
||||
pytest-3.13:
|
||||
extends: .pytest
|
||||
image: python:3.13-alpine
|
||||
|
||||
@ -3,6 +3,43 @@
|
||||
.gitlab-ci.yml
|
||||
.travis.yml
|
||||
README.md
|
||||
ai_core_api_client/__init__.py
|
||||
ai_core_api_client/api/__init__.py
|
||||
ai_core_api_client/api/ai_api.py
|
||||
ai_core_api_client/api/chats_api.py
|
||||
ai_core_api_client/api/company_api.py
|
||||
ai_core_api_client/api/get_me_api.py
|
||||
ai_core_api_client/api/metrics_api.py
|
||||
ai_core_api_client/api_client.py
|
||||
ai_core_api_client/api_response.py
|
||||
ai_core_api_client/configuration.py
|
||||
ai_core_api_client/exceptions.py
|
||||
ai_core_api_client/models/__init__.py
|
||||
ai_core_api_client/models/domain_ai_function.py
|
||||
ai_core_api_client/models/domain_ai_function_call.py
|
||||
ai_core_api_client/models/domain_ai_function_parameter_property.py
|
||||
ai_core_api_client/models/domain_ai_function_parameters.py
|
||||
ai_core_api_client/models/domain_ai_message.py
|
||||
ai_core_api_client/models/domain_ai_tool.py
|
||||
ai_core_api_client/models/domain_client_chat.py
|
||||
ai_core_api_client/models/domain_client_message.py
|
||||
ai_core_api_client/models/domain_company.py
|
||||
ai_core_api_client/models/domain_company_create_request.py
|
||||
ai_core_api_client/models/domain_company_function.py
|
||||
ai_core_api_client/models/domain_company_update_request.py
|
||||
ai_core_api_client/models/domain_conversation_request.py
|
||||
ai_core_api_client/models/domain_conversation_response.py
|
||||
ai_core_api_client/models/domain_error_response.py
|
||||
ai_core_api_client/models/domain_get_chats_response.py
|
||||
ai_core_api_client/models/domain_get_me_response.py
|
||||
ai_core_api_client/models/domain_metrics_response.py
|
||||
ai_core_api_client/models/domain_prompt.py
|
||||
ai_core_api_client/models/domain_prompt_block.py
|
||||
ai_core_api_client/models/domain_success_response.py
|
||||
ai_core_api_client/models/domain_update_prompt_response.py
|
||||
ai_core_api_client/models/domain_usage_info.py
|
||||
ai_core_api_client/py.typed
|
||||
ai_core_api_client/rest.py
|
||||
docs/AiApi.md
|
||||
docs/ChatsApi.md
|
||||
docs/CompanyApi.md
|
||||
@ -24,49 +61,21 @@ docs/DomainErrorResponse.md
|
||||
docs/DomainGetChatsResponse.md
|
||||
docs/DomainGetMeResponse.md
|
||||
docs/DomainMetricsResponse.md
|
||||
docs/DomainPrompt.md
|
||||
docs/DomainPromptBlock.md
|
||||
docs/DomainSuccessResponse.md
|
||||
docs/DomainUpdatePromptResponse.md
|
||||
docs/DomainUsageInfo.md
|
||||
docs/GetMeApi.md
|
||||
docs/MetricsApi.md
|
||||
git_push.sh
|
||||
openapi_client/__init__.py
|
||||
openapi_client/api/__init__.py
|
||||
openapi_client/api/ai_api.py
|
||||
openapi_client/api/chats_api.py
|
||||
openapi_client/api/company_api.py
|
||||
openapi_client/api/get_me_api.py
|
||||
openapi_client/api/metrics_api.py
|
||||
openapi_client/api_client.py
|
||||
openapi_client/api_response.py
|
||||
openapi_client/configuration.py
|
||||
openapi_client/exceptions.py
|
||||
openapi_client/models/__init__.py
|
||||
openapi_client/models/domain_ai_function.py
|
||||
openapi_client/models/domain_ai_function_call.py
|
||||
openapi_client/models/domain_ai_function_parameter_property.py
|
||||
openapi_client/models/domain_ai_function_parameters.py
|
||||
openapi_client/models/domain_ai_message.py
|
||||
openapi_client/models/domain_ai_tool.py
|
||||
openapi_client/models/domain_client_chat.py
|
||||
openapi_client/models/domain_client_message.py
|
||||
openapi_client/models/domain_company.py
|
||||
openapi_client/models/domain_company_create_request.py
|
||||
openapi_client/models/domain_company_function.py
|
||||
openapi_client/models/domain_company_update_request.py
|
||||
openapi_client/models/domain_conversation_request.py
|
||||
openapi_client/models/domain_conversation_response.py
|
||||
openapi_client/models/domain_error_response.py
|
||||
openapi_client/models/domain_get_chats_response.py
|
||||
openapi_client/models/domain_get_me_response.py
|
||||
openapi_client/models/domain_metrics_response.py
|
||||
openapi_client/models/domain_prompt_block.py
|
||||
openapi_client/models/domain_success_response.py
|
||||
openapi_client/py.typed
|
||||
openapi_client/rest.py
|
||||
pyproject.toml
|
||||
requirements.txt
|
||||
setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
test/test_domain_prompt.py
|
||||
test/test_domain_update_prompt_response.py
|
||||
test/test_domain_usage_info.py
|
||||
tox.ini
|
||||
|
||||
@ -1 +1 @@
|
||||
7.8.0
|
||||
7.17.0
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
# ref: https://docs.travis-ci.com/user/languages/python
|
||||
language: python
|
||||
python:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
- "3.13"
|
||||
# uncomment the following if needed
|
||||
#- "3.11-dev" # 3.11 development branch
|
||||
#- "3.13-dev" # 3.13 development branch
|
||||
#- "nightly" # nightly build
|
||||
# command to install dependencies
|
||||
install:
|
||||
|
||||
10
README.md
10
README.md
@ -1,16 +1,16 @@
|
||||
# openapi-client
|
||||
# ai-core-api-client
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 1.0
|
||||
- Package version: 1.0.0
|
||||
- Generator version: 7.8.0
|
||||
- Generator version: 7.17.0
|
||||
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
||||
|
||||
## Requirements.
|
||||
|
||||
Python 3.7+
|
||||
Python 3.9+
|
||||
|
||||
## Installation & Usage
|
||||
### pip install
|
||||
@ -102,6 +102,7 @@ Class | Method | HTTP request | Description
|
||||
*CompanyApi* | [**company_id_get**](docs/CompanyApi.md#company_id_get) | **GET** /company/{id} | Get company details
|
||||
*CompanyApi* | [**company_patch**](docs/CompanyApi.md#company_patch) | **PATCH** /company | Update a company in the database
|
||||
*CompanyApi* | [**company_post**](docs/CompanyApi.md#company_post) | **POST** /company | Adds a company to the database
|
||||
*CompanyApi* | [**update_prompt_post**](docs/CompanyApi.md#update_prompt_post) | **POST** /update-prompt | Update company prompt
|
||||
*GetMeApi* | [**get_me_get**](docs/GetMeApi.md#get_me_get) | **GET** /get-me | Get company details
|
||||
*MetricsApi* | [**metrics_get**](docs/MetricsApi.md#metrics_get) | **GET** /metrics | Get company metrics
|
||||
|
||||
@ -126,8 +127,11 @@ Class | Method | HTTP request | Description
|
||||
- [DomainGetChatsResponse](docs/DomainGetChatsResponse.md)
|
||||
- [DomainGetMeResponse](docs/DomainGetMeResponse.md)
|
||||
- [DomainMetricsResponse](docs/DomainMetricsResponse.md)
|
||||
- [DomainPrompt](docs/DomainPrompt.md)
|
||||
- [DomainPromptBlock](docs/DomainPromptBlock.md)
|
||||
- [DomainSuccessResponse](docs/DomainSuccessResponse.md)
|
||||
- [DomainUpdatePromptResponse](docs/DomainUpdatePromptResponse.md)
|
||||
- [DomainUsageInfo](docs/DomainUsageInfo.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
||||
@ -16,42 +16,87 @@
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# Define package exports
|
||||
__all__ = [
|
||||
"AiApi",
|
||||
"ChatsApi",
|
||||
"CompanyApi",
|
||||
"GetMeApi",
|
||||
"MetricsApi",
|
||||
"ApiResponse",
|
||||
"ApiClient",
|
||||
"Configuration",
|
||||
"OpenApiException",
|
||||
"ApiTypeError",
|
||||
"ApiValueError",
|
||||
"ApiKeyError",
|
||||
"ApiAttributeError",
|
||||
"ApiException",
|
||||
"DomainAIFunction",
|
||||
"DomainAIFunctionCall",
|
||||
"DomainAIFunctionParameterProperty",
|
||||
"DomainAIFunctionParameters",
|
||||
"DomainAIMessage",
|
||||
"DomainAITool",
|
||||
"DomainClientChat",
|
||||
"DomainClientMessage",
|
||||
"DomainCompany",
|
||||
"DomainCompanyCreateRequest",
|
||||
"DomainCompanyFunction",
|
||||
"DomainCompanyUpdateRequest",
|
||||
"DomainConversationRequest",
|
||||
"DomainConversationResponse",
|
||||
"DomainErrorResponse",
|
||||
"DomainGetChatsResponse",
|
||||
"DomainGetMeResponse",
|
||||
"DomainMetricsResponse",
|
||||
"DomainPrompt",
|
||||
"DomainPromptBlock",
|
||||
"DomainSuccessResponse",
|
||||
"DomainUpdatePromptResponse",
|
||||
"DomainUsageInfo",
|
||||
]
|
||||
|
||||
# import apis into sdk package
|
||||
from ai_core_api_client.api.ai_api import AiApi
|
||||
from ai_core_api_client.api.chats_api import ChatsApi
|
||||
from ai_core_api_client.api.company_api import CompanyApi
|
||||
from ai_core_api_client.api.get_me_api import GetMeApi
|
||||
from ai_core_api_client.api.metrics_api import MetricsApi
|
||||
from ai_core_api_client.api.ai_api import AiApi as AiApi
|
||||
from ai_core_api_client.api.chats_api import ChatsApi as ChatsApi
|
||||
from ai_core_api_client.api.company_api import CompanyApi as CompanyApi
|
||||
from ai_core_api_client.api.get_me_api import GetMeApi as GetMeApi
|
||||
from ai_core_api_client.api.metrics_api import MetricsApi as MetricsApi
|
||||
|
||||
# import ApiClient
|
||||
from ai_core_api_client.api_response import ApiResponse
|
||||
from ai_core_api_client.api_client import ApiClient
|
||||
from ai_core_api_client.configuration import Configuration
|
||||
from ai_core_api_client.exceptions import OpenApiException
|
||||
from ai_core_api_client.exceptions import ApiTypeError
|
||||
from ai_core_api_client.exceptions import ApiValueError
|
||||
from ai_core_api_client.exceptions import ApiKeyError
|
||||
from ai_core_api_client.exceptions import ApiAttributeError
|
||||
from ai_core_api_client.exceptions import ApiException
|
||||
from ai_core_api_client.api_response import ApiResponse as ApiResponse
|
||||
from ai_core_api_client.api_client import ApiClient as ApiClient
|
||||
from ai_core_api_client.configuration import Configuration as Configuration
|
||||
from ai_core_api_client.exceptions import OpenApiException as OpenApiException
|
||||
from ai_core_api_client.exceptions import ApiTypeError as ApiTypeError
|
||||
from ai_core_api_client.exceptions import ApiValueError as ApiValueError
|
||||
from ai_core_api_client.exceptions import ApiKeyError as ApiKeyError
|
||||
from ai_core_api_client.exceptions import ApiAttributeError as ApiAttributeError
|
||||
from ai_core_api_client.exceptions import ApiException as ApiException
|
||||
|
||||
# import models into sdk package
|
||||
from ai_core_api_client.models.domain_ai_function import DomainAIFunction
|
||||
from ai_core_api_client.models.domain_ai_function_call import DomainAIFunctionCall
|
||||
from ai_core_api_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty
|
||||
from ai_core_api_client.models.domain_ai_function_parameters import DomainAIFunctionParameters
|
||||
from ai_core_api_client.models.domain_ai_message import DomainAIMessage
|
||||
from ai_core_api_client.models.domain_ai_tool import DomainAITool
|
||||
from ai_core_api_client.models.domain_client_chat import DomainClientChat
|
||||
from ai_core_api_client.models.domain_client_message import DomainClientMessage
|
||||
from ai_core_api_client.models.domain_company import DomainCompany
|
||||
from ai_core_api_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
from ai_core_api_client.models.domain_company_function import DomainCompanyFunction
|
||||
from ai_core_api_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
from ai_core_api_client.models.domain_conversation_request import DomainConversationRequest
|
||||
from ai_core_api_client.models.domain_conversation_response import DomainConversationResponse
|
||||
from ai_core_api_client.models.domain_error_response import DomainErrorResponse
|
||||
from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.models.domain_ai_function import DomainAIFunction as DomainAIFunction
|
||||
from ai_core_api_client.models.domain_ai_function_call import DomainAIFunctionCall as DomainAIFunctionCall
|
||||
from ai_core_api_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty as DomainAIFunctionParameterProperty
|
||||
from ai_core_api_client.models.domain_ai_function_parameters import DomainAIFunctionParameters as DomainAIFunctionParameters
|
||||
from ai_core_api_client.models.domain_ai_message import DomainAIMessage as DomainAIMessage
|
||||
from ai_core_api_client.models.domain_ai_tool import DomainAITool as DomainAITool
|
||||
from ai_core_api_client.models.domain_client_chat import DomainClientChat as DomainClientChat
|
||||
from ai_core_api_client.models.domain_client_message import DomainClientMessage as DomainClientMessage
|
||||
from ai_core_api_client.models.domain_company import DomainCompany as DomainCompany
|
||||
from ai_core_api_client.models.domain_company_create_request import DomainCompanyCreateRequest as DomainCompanyCreateRequest
|
||||
from ai_core_api_client.models.domain_company_function import DomainCompanyFunction as DomainCompanyFunction
|
||||
from ai_core_api_client.models.domain_company_update_request import DomainCompanyUpdateRequest as DomainCompanyUpdateRequest
|
||||
from ai_core_api_client.models.domain_conversation_request import DomainConversationRequest as DomainConversationRequest
|
||||
from ai_core_api_client.models.domain_conversation_response import DomainConversationResponse as DomainConversationResponse
|
||||
from ai_core_api_client.models.domain_error_response import DomainErrorResponse as DomainErrorResponse
|
||||
from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse as DomainGetChatsResponse
|
||||
from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse as DomainGetMeResponse
|
||||
from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse as DomainMetricsResponse
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt as DomainPrompt
|
||||
from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock as DomainPromptBlock
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse as DomainSuccessResponse
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse as DomainUpdatePromptResponse
|
||||
from ai_core_api_client.models.domain_usage_info import DomainUsageInfo as DomainUsageInfo
|
||||
|
||||
|
||||
@ -263,7 +263,9 @@ class AiApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
|
||||
@ -273,7 +273,9 @@ class ChatsApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
|
||||
@ -22,7 +22,9 @@ from typing_extensions import Annotated
|
||||
from ai_core_api_client.models.domain_company import DomainCompany
|
||||
from ai_core_api_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
from ai_core_api_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse
|
||||
|
||||
from ai_core_api_client.api_client import ApiClient, RequestSerialized
|
||||
from ai_core_api_client.api_response import ApiResponse
|
||||
@ -250,7 +252,9 @@ class CompanyApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@ -513,7 +517,9 @@ class CompanyApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@ -778,7 +784,9 @@ class CompanyApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@ -1046,7 +1054,9 @@ class CompanyApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@ -1327,7 +1337,9 @@ class CompanyApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
@ -1382,3 +1394,286 @@ class CompanyApi:
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def update_prompt_post(
|
||||
self,
|
||||
request: Annotated[DomainPrompt, Field(description="Update Prompt Request")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> DomainUpdatePromptResponse:
|
||||
"""Update company prompt
|
||||
|
||||
This endpoint update company prompt in the vectorstore.
|
||||
|
||||
:param request: Update Prompt Request (required)
|
||||
:type request: DomainPrompt
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._update_prompt_post_serialize(
|
||||
request=request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "DomainUpdatePromptResponse",
|
||||
'400': "DomainErrorResponse",
|
||||
'401': "DomainErrorResponse",
|
||||
'500': "DomainErrorResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def update_prompt_post_with_http_info(
|
||||
self,
|
||||
request: Annotated[DomainPrompt, Field(description="Update Prompt Request")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[DomainUpdatePromptResponse]:
|
||||
"""Update company prompt
|
||||
|
||||
This endpoint update company prompt in the vectorstore.
|
||||
|
||||
:param request: Update Prompt Request (required)
|
||||
:type request: DomainPrompt
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._update_prompt_post_serialize(
|
||||
request=request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "DomainUpdatePromptResponse",
|
||||
'400': "DomainErrorResponse",
|
||||
'401': "DomainErrorResponse",
|
||||
'500': "DomainErrorResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def update_prompt_post_without_preload_content(
|
||||
self,
|
||||
request: Annotated[DomainPrompt, Field(description="Update Prompt Request")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Update company prompt
|
||||
|
||||
This endpoint update company prompt in the vectorstore.
|
||||
|
||||
:param request: Update Prompt Request (required)
|
||||
:type request: DomainPrompt
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._update_prompt_post_serialize(
|
||||
request=request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "DomainUpdatePromptResponse",
|
||||
'400': "DomainErrorResponse",
|
||||
'401': "DomainErrorResponse",
|
||||
'500': "DomainErrorResponse",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _update_prompt_post_serialize(
|
||||
self,
|
||||
request,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
if request is not None:
|
||||
_body_params = request
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'BearerAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/update-prompt',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -244,7 +244,9 @@ class GetMeApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
|
||||
@ -244,7 +244,9 @@ class MetricsApi:
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[str, Union[str, bytes]] = {}
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
|
||||
@ -21,6 +21,7 @@ import mimetypes
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
import uuid
|
||||
|
||||
from urllib.parse import quote
|
||||
from typing import Tuple, Optional, List, Dict, Union
|
||||
@ -356,6 +357,8 @@ class ApiClient:
|
||||
return obj.get_secret_value()
|
||||
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
||||
return obj
|
||||
elif isinstance(obj, uuid.UUID):
|
||||
return str(obj)
|
||||
elif isinstance(obj, list):
|
||||
return [
|
||||
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
||||
@ -382,6 +385,10 @@ class ApiClient:
|
||||
else:
|
||||
obj_dict = obj.__dict__
|
||||
|
||||
if isinstance(obj_dict, list):
|
||||
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
|
||||
return self.sanitize_for_serialization(obj_dict)
|
||||
|
||||
return {
|
||||
key: self.sanitize_for_serialization(val)
|
||||
for key, val in obj_dict.items()
|
||||
@ -404,12 +411,12 @@ class ApiClient:
|
||||
data = json.loads(response_text)
|
||||
except ValueError:
|
||||
data = response_text
|
||||
elif content_type.startswith("application/json"):
|
||||
elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
||||
if response_text == "":
|
||||
data = ""
|
||||
else:
|
||||
data = json.loads(response_text)
|
||||
elif content_type.startswith("text/plain"):
|
||||
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
||||
data = response_text
|
||||
else:
|
||||
raise ApiException(
|
||||
@ -453,13 +460,13 @@ class ApiClient:
|
||||
|
||||
if klass in self.PRIMITIVE_TYPES:
|
||||
return self.__deserialize_primitive(data, klass)
|
||||
elif klass == object:
|
||||
elif klass is object:
|
||||
return self.__deserialize_object(data)
|
||||
elif klass == datetime.date:
|
||||
elif klass is datetime.date:
|
||||
return self.__deserialize_date(data)
|
||||
elif klass == datetime.datetime:
|
||||
elif klass is datetime.datetime:
|
||||
return self.__deserialize_datetime(data)
|
||||
elif klass == decimal.Decimal:
|
||||
elif klass is decimal.Decimal:
|
||||
return decimal.Decimal(data)
|
||||
elif issubclass(klass, Enum):
|
||||
return self.__deserialize_enum(data, klass)
|
||||
@ -517,7 +524,7 @@ class ApiClient:
|
||||
if k in collection_formats:
|
||||
collection_format = collection_formats[k]
|
||||
if collection_format == 'multi':
|
||||
new_params.extend((k, str(value)) for value in v)
|
||||
new_params.extend((k, quote(str(value))) for value in v)
|
||||
else:
|
||||
if collection_format == 'ssv':
|
||||
delimiter = ' '
|
||||
@ -535,7 +542,10 @@ class ApiClient:
|
||||
|
||||
return "&".join(["=".join(map(str, item)) for item in new_params])
|
||||
|
||||
def files_parameters(self, files: Dict[str, Union[str, bytes]]):
|
||||
def files_parameters(
|
||||
self,
|
||||
files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
|
||||
):
|
||||
"""Builds form parameters.
|
||||
|
||||
:param files: File parameters.
|
||||
@ -550,6 +560,12 @@ class ApiClient:
|
||||
elif isinstance(v, bytes):
|
||||
filename = k
|
||||
filedata = v
|
||||
elif isinstance(v, tuple):
|
||||
filename, filedata = v
|
||||
elif isinstance(v, list):
|
||||
for file_param in v:
|
||||
params.extend(self.files_parameters({k: file_param}))
|
||||
continue
|
||||
else:
|
||||
raise ValueError("Unsupported file value")
|
||||
mimetype = (
|
||||
|
||||
@ -13,14 +13,16 @@
|
||||
|
||||
|
||||
import copy
|
||||
import http.client as httplib
|
||||
import logging
|
||||
from logging import FileHandler
|
||||
import multiprocessing
|
||||
import sys
|
||||
from typing import Optional
|
||||
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
|
||||
from typing_extensions import NotRequired, Self
|
||||
|
||||
import urllib3
|
||||
|
||||
import http.client as httplib
|
||||
|
||||
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
||||
'multipleOf', 'maximum', 'exclusiveMaximum',
|
||||
@ -28,6 +30,107 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
||||
'minLength', 'pattern', 'maxItems', 'minItems'
|
||||
}
|
||||
|
||||
ServerVariablesT = Dict[str, str]
|
||||
|
||||
GenericAuthSetting = TypedDict(
|
||||
"GenericAuthSetting",
|
||||
{
|
||||
"type": str,
|
||||
"in": str,
|
||||
"key": str,
|
||||
"value": str,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
OAuth2AuthSetting = TypedDict(
|
||||
"OAuth2AuthSetting",
|
||||
{
|
||||
"type": Literal["oauth2"],
|
||||
"in": Literal["header"],
|
||||
"key": Literal["Authorization"],
|
||||
"value": str,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
APIKeyAuthSetting = TypedDict(
|
||||
"APIKeyAuthSetting",
|
||||
{
|
||||
"type": Literal["api_key"],
|
||||
"in": str,
|
||||
"key": str,
|
||||
"value": Optional[str],
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
BasicAuthSetting = TypedDict(
|
||||
"BasicAuthSetting",
|
||||
{
|
||||
"type": Literal["basic"],
|
||||
"in": Literal["header"],
|
||||
"key": Literal["Authorization"],
|
||||
"value": Optional[str],
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
BearerFormatAuthSetting = TypedDict(
|
||||
"BearerFormatAuthSetting",
|
||||
{
|
||||
"type": Literal["bearer"],
|
||||
"in": Literal["header"],
|
||||
"format": Literal["JWT"],
|
||||
"key": Literal["Authorization"],
|
||||
"value": str,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
BearerAuthSetting = TypedDict(
|
||||
"BearerAuthSetting",
|
||||
{
|
||||
"type": Literal["bearer"],
|
||||
"in": Literal["header"],
|
||||
"key": Literal["Authorization"],
|
||||
"value": str,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
HTTPSignatureAuthSetting = TypedDict(
|
||||
"HTTPSignatureAuthSetting",
|
||||
{
|
||||
"type": Literal["http-signature"],
|
||||
"in": Literal["header"],
|
||||
"key": Literal["Authorization"],
|
||||
"value": None,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
AuthSettings = TypedDict(
|
||||
"AuthSettings",
|
||||
{
|
||||
"BearerAuth": APIKeyAuthSetting,
|
||||
},
|
||||
total=False,
|
||||
)
|
||||
|
||||
|
||||
class HostSettingVariable(TypedDict):
|
||||
description: str
|
||||
default_value: str
|
||||
enum_values: List[str]
|
||||
|
||||
|
||||
class HostSetting(TypedDict):
|
||||
url: str
|
||||
description: str
|
||||
variables: NotRequired[Dict[str, HostSettingVariable]]
|
||||
|
||||
|
||||
class Configuration:
|
||||
"""This class contains various settings of the API client.
|
||||
|
||||
@ -58,6 +161,10 @@ class Configuration:
|
||||
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||
in PEM format.
|
||||
:param retries: Number of retries for API requests.
|
||||
:param ca_cert_data: verify the peer using concatenated CA certificate data
|
||||
in PEM (str) or DER (bytes) format.
|
||||
:param cert_file: the path to a client certificate file, for mTLS.
|
||||
:param key_file: the path to a client key file, for mTLS.
|
||||
|
||||
:Example:
|
||||
|
||||
@ -72,7 +179,7 @@ class Configuration:
|
||||
|
||||
You can programmatically set the cookie:
|
||||
|
||||
conf = openapi_client.Configuration(
|
||||
conf = ai_core_api_client.Configuration(
|
||||
api_key={'cookieAuth': 'abc123'}
|
||||
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
||||
)
|
||||
@ -81,19 +188,28 @@ conf = openapi_client.Configuration(
|
||||
Cookie: JSESSIONID abc123
|
||||
"""
|
||||
|
||||
_default = None
|
||||
_default: ClassVar[Optional[Self]] = None
|
||||
|
||||
def __init__(self, host=None,
|
||||
api_key=None, api_key_prefix=None,
|
||||
username=None, password=None,
|
||||
access_token=None,
|
||||
server_index=None, server_variables=None,
|
||||
server_operation_index=None, server_operation_variables=None,
|
||||
ignore_operation_servers=False,
|
||||
ssl_ca_cert=None,
|
||||
retries=None,
|
||||
def __init__(
|
||||
self,
|
||||
host: Optional[str]=None,
|
||||
api_key: Optional[Dict[str, str]]=None,
|
||||
api_key_prefix: Optional[Dict[str, str]]=None,
|
||||
username: Optional[str]=None,
|
||||
password: Optional[str]=None,
|
||||
access_token: Optional[str]=None,
|
||||
server_index: Optional[int]=None,
|
||||
server_variables: Optional[ServerVariablesT]=None,
|
||||
server_operation_index: Optional[Dict[int, int]]=None,
|
||||
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
||||
ignore_operation_servers: bool=False,
|
||||
ssl_ca_cert: Optional[str]=None,
|
||||
retries: Optional[int] = None,
|
||||
ca_cert_data: Optional[Union[str, bytes]] = None,
|
||||
cert_file: Optional[str]=None,
|
||||
key_file: Optional[str]=None,
|
||||
*,
|
||||
debug: Optional[bool] = None
|
||||
debug: Optional[bool] = None,
|
||||
) -> None:
|
||||
"""Constructor
|
||||
"""
|
||||
@ -140,7 +256,7 @@ conf = openapi_client.Configuration(
|
||||
self.logger = {}
|
||||
"""Logging Settings
|
||||
"""
|
||||
self.logger["package_logger"] = logging.getLogger("openapi_client")
|
||||
self.logger["package_logger"] = logging.getLogger("ai_core_api_client")
|
||||
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
||||
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
||||
"""Log format
|
||||
@ -169,10 +285,14 @@ conf = openapi_client.Configuration(
|
||||
self.ssl_ca_cert = ssl_ca_cert
|
||||
"""Set this to customize the certificate file to verify the peer.
|
||||
"""
|
||||
self.cert_file = None
|
||||
self.ca_cert_data = ca_cert_data
|
||||
"""Set this to verify the peer using PEM (str) or DER (bytes)
|
||||
certificate data.
|
||||
"""
|
||||
self.cert_file = cert_file
|
||||
"""client certificate file
|
||||
"""
|
||||
self.key_file = None
|
||||
self.key_file = key_file
|
||||
"""client key file
|
||||
"""
|
||||
self.assert_hostname = None
|
||||
@ -218,7 +338,7 @@ conf = openapi_client.Configuration(
|
||||
"""date format
|
||||
"""
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
||||
cls = self.__class__
|
||||
result = cls.__new__(cls)
|
||||
memo[id(self)] = result
|
||||
@ -232,11 +352,11 @@ conf = openapi_client.Configuration(
|
||||
result.debug = self.debug
|
||||
return result
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
def __setattr__(self, name: str, value: Any) -> None:
|
||||
object.__setattr__(self, name, value)
|
||||
|
||||
@classmethod
|
||||
def set_default(cls, default):
|
||||
def set_default(cls, default: Optional[Self]) -> None:
|
||||
"""Set default instance of configuration.
|
||||
|
||||
It stores default configuration, which can be
|
||||
@ -247,7 +367,7 @@ conf = openapi_client.Configuration(
|
||||
cls._default = default
|
||||
|
||||
@classmethod
|
||||
def get_default_copy(cls):
|
||||
def get_default_copy(cls) -> Self:
|
||||
"""Deprecated. Please use `get_default` instead.
|
||||
|
||||
Deprecated. Please use `get_default` instead.
|
||||
@ -257,7 +377,7 @@ conf = openapi_client.Configuration(
|
||||
return cls.get_default()
|
||||
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
def get_default(cls) -> Self:
|
||||
"""Return the default configuration.
|
||||
|
||||
This method returns newly created, based on default constructor,
|
||||
@ -267,11 +387,11 @@ conf = openapi_client.Configuration(
|
||||
:return: The configuration object.
|
||||
"""
|
||||
if cls._default is None:
|
||||
cls._default = Configuration()
|
||||
cls._default = cls()
|
||||
return cls._default
|
||||
|
||||
@property
|
||||
def logger_file(self):
|
||||
def logger_file(self) -> Optional[str]:
|
||||
"""The logger file.
|
||||
|
||||
If the logger_file is None, then add stream handler and remove file
|
||||
@ -283,7 +403,7 @@ conf = openapi_client.Configuration(
|
||||
return self.__logger_file
|
||||
|
||||
@logger_file.setter
|
||||
def logger_file(self, value):
|
||||
def logger_file(self, value: Optional[str]) -> None:
|
||||
"""The logger file.
|
||||
|
||||
If the logger_file is None, then add stream handler and remove file
|
||||
@ -302,7 +422,7 @@ conf = openapi_client.Configuration(
|
||||
logger.addHandler(self.logger_file_handler)
|
||||
|
||||
@property
|
||||
def debug(self):
|
||||
def debug(self) -> bool:
|
||||
"""Debug status
|
||||
|
||||
:param value: The debug status, True or False.
|
||||
@ -311,7 +431,7 @@ conf = openapi_client.Configuration(
|
||||
return self.__debug
|
||||
|
||||
@debug.setter
|
||||
def debug(self, value):
|
||||
def debug(self, value: bool) -> None:
|
||||
"""Debug status
|
||||
|
||||
:param value: The debug status, True or False.
|
||||
@ -333,7 +453,7 @@ conf = openapi_client.Configuration(
|
||||
httplib.HTTPConnection.debuglevel = 0
|
||||
|
||||
@property
|
||||
def logger_format(self):
|
||||
def logger_format(self) -> str:
|
||||
"""The logger format.
|
||||
|
||||
The logger_formatter will be updated when sets logger_format.
|
||||
@ -344,7 +464,7 @@ conf = openapi_client.Configuration(
|
||||
return self.__logger_format
|
||||
|
||||
@logger_format.setter
|
||||
def logger_format(self, value):
|
||||
def logger_format(self, value: str) -> None:
|
||||
"""The logger format.
|
||||
|
||||
The logger_formatter will be updated when sets logger_format.
|
||||
@ -355,7 +475,7 @@ conf = openapi_client.Configuration(
|
||||
self.__logger_format = value
|
||||
self.logger_formatter = logging.Formatter(self.__logger_format)
|
||||
|
||||
def get_api_key_with_prefix(self, identifier, alias=None):
|
||||
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
|
||||
"""Gets API key (with prefix if set).
|
||||
|
||||
:param identifier: The identifier of apiKey.
|
||||
@ -372,7 +492,9 @@ conf = openapi_client.Configuration(
|
||||
else:
|
||||
return key
|
||||
|
||||
def get_basic_auth_token(self):
|
||||
return None
|
||||
|
||||
def get_basic_auth_token(self) -> Optional[str]:
|
||||
"""Gets HTTP basic authentication header (string).
|
||||
|
||||
:return: The token for basic HTTP authentication.
|
||||
@ -387,12 +509,12 @@ conf = openapi_client.Configuration(
|
||||
basic_auth=username + ':' + password
|
||||
).get('authorization')
|
||||
|
||||
def auth_settings(self):
|
||||
def auth_settings(self)-> AuthSettings:
|
||||
"""Gets Auth Settings dict for api client.
|
||||
|
||||
:return: The Auth Settings information dict.
|
||||
"""
|
||||
auth = {}
|
||||
auth: AuthSettings = {}
|
||||
if 'BearerAuth' in self.api_key:
|
||||
auth['BearerAuth'] = {
|
||||
'type': 'api_key',
|
||||
@ -404,7 +526,7 @@ conf = openapi_client.Configuration(
|
||||
}
|
||||
return auth
|
||||
|
||||
def to_debug_report(self):
|
||||
def to_debug_report(self) -> str:
|
||||
"""Gets the essential information for debugging.
|
||||
|
||||
:return: The report for debugging.
|
||||
@ -416,7 +538,7 @@ conf = openapi_client.Configuration(
|
||||
"SDK Package Version: 1.0.0".\
|
||||
format(env=sys.platform, pyversion=sys.version)
|
||||
|
||||
def get_host_settings(self):
|
||||
def get_host_settings(self) -> List[HostSetting]:
|
||||
"""Gets an array of host settings
|
||||
|
||||
:return: An array of host settings
|
||||
@ -428,7 +550,12 @@ conf = openapi_client.Configuration(
|
||||
}
|
||||
]
|
||||
|
||||
def get_host_from_settings(self, index, variables=None, servers=None):
|
||||
def get_host_from_settings(
|
||||
self,
|
||||
index: Optional[int],
|
||||
variables: Optional[ServerVariablesT]=None,
|
||||
servers: Optional[List[HostSetting]]=None,
|
||||
) -> str:
|
||||
"""Gets host URL based on the index and variables
|
||||
:param index: array index of the host settings
|
||||
:param variables: hash of variable and the corresponding value
|
||||
@ -468,12 +595,12 @@ conf = openapi_client.Configuration(
|
||||
return url
|
||||
|
||||
@property
|
||||
def host(self):
|
||||
def host(self) -> str:
|
||||
"""Return generated host."""
|
||||
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
||||
|
||||
@host.setter
|
||||
def host(self, value):
|
||||
def host(self, value: str) -> None:
|
||||
"""Fix base path."""
|
||||
self._base_path = value
|
||||
self.server_index = None
|
||||
|
||||
@ -150,6 +150,13 @@ class ApiException(OpenApiException):
|
||||
if http_resp.status == 404:
|
||||
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
||||
|
||||
# Added new conditions for 409 and 422
|
||||
if http_resp.status == 409:
|
||||
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
||||
|
||||
if http_resp.status == 422:
|
||||
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
||||
|
||||
if 500 <= http_resp.status <= 599:
|
||||
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
||||
raise ApiException(http_resp=http_resp, body=body, data=data)
|
||||
@ -188,6 +195,16 @@ class ServiceException(ApiException):
|
||||
pass
|
||||
|
||||
|
||||
class ConflictException(ApiException):
|
||||
"""Exception for HTTP 409 Conflict."""
|
||||
pass
|
||||
|
||||
|
||||
class UnprocessableEntityException(ApiException):
|
||||
"""Exception for HTTP 422 Unprocessable Entity."""
|
||||
pass
|
||||
|
||||
|
||||
def render_path(path_to_item):
|
||||
"""Returns a string representation of a path"""
|
||||
result = ""
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
# import models into model package
|
||||
from ai_core_api_client.models.domain_ai_function import DomainAIFunction
|
||||
from ai_core_api_client.models.domain_ai_function_call import DomainAIFunctionCall
|
||||
@ -32,5 +31,9 @@ from ai_core_api_client.models.domain_error_response import DomainErrorResponse
|
||||
from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt
|
||||
from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse
|
||||
from ai_core_api_client.models.domain_usage_info import DomainUsageInfo
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import json
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from ai_core_api_client.models.domain_ai_tool import DomainAITool
|
||||
from ai_core_api_client.models.domain_usage_info import DomainUsageInfo
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@ -29,7 +30,8 @@ class DomainConversationResponse(BaseModel):
|
||||
""" # noqa: E501
|
||||
content: Optional[StrictStr] = None
|
||||
tools: Optional[List[DomainAITool]] = None
|
||||
__properties: ClassVar[List[str]] = ["content", "tools"]
|
||||
usage: Optional[DomainUsageInfo] = None
|
||||
__properties: ClassVar[List[str]] = ["content", "tools", "usage"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@ -77,6 +79,9 @@ class DomainConversationResponse(BaseModel):
|
||||
if _item_tools:
|
||||
_items.append(_item_tools.to_dict())
|
||||
_dict['tools'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of usage
|
||||
if self.usage:
|
||||
_dict['usage'] = self.usage.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@ -90,7 +95,8 @@ class DomainConversationResponse(BaseModel):
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"content": obj.get("content"),
|
||||
"tools": [DomainAITool.from_dict(_item) for _item in obj["tools"]] if obj.get("tools") is not None else None
|
||||
"tools": [DomainAITool.from_dict(_item) for _item in obj["tools"]] if obj.get("tools") is not None else None,
|
||||
"usage": DomainUsageInfo.from_dict(obj["usage"]) if obj.get("usage") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@ -26,10 +26,16 @@ class DomainMetricsResponse(BaseModel):
|
||||
"""
|
||||
DomainMetricsResponse
|
||||
""" # noqa: E501
|
||||
change_tariff_count: Optional[StrictInt] = None
|
||||
closed_dialogs_count: Optional[StrictInt] = None
|
||||
dialog_count: Optional[StrictInt] = None
|
||||
message_count_per_day: Optional[StrictInt] = None
|
||||
messsage_count_per_month: Optional[StrictInt] = None
|
||||
__properties: ClassVar[List[str]] = ["dialog_count", "message_count_per_day", "messsage_count_per_month"]
|
||||
promised_payment_count: Optional[StrictInt] = None
|
||||
service_engineer_call_count: Optional[StrictInt] = None
|
||||
service_suspensions_count: Optional[StrictInt] = None
|
||||
unfinished_dialogs_count: Optional[StrictInt] = None
|
||||
__properties: ClassVar[List[str]] = ["change_tariff_count", "closed_dialogs_count", "dialog_count", "message_count_per_day", "messsage_count_per_month", "promised_payment_count", "service_engineer_call_count", "service_suspensions_count", "unfinished_dialogs_count"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@ -82,9 +88,15 @@ class DomainMetricsResponse(BaseModel):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"change_tariff_count": obj.get("change_tariff_count"),
|
||||
"closed_dialogs_count": obj.get("closed_dialogs_count"),
|
||||
"dialog_count": obj.get("dialog_count"),
|
||||
"message_count_per_day": obj.get("message_count_per_day"),
|
||||
"messsage_count_per_month": obj.get("messsage_count_per_month")
|
||||
"messsage_count_per_month": obj.get("messsage_count_per_month"),
|
||||
"promised_payment_count": obj.get("promised_payment_count"),
|
||||
"service_engineer_call_count": obj.get("service_engineer_call_count"),
|
||||
"service_suspensions_count": obj.get("service_suspensions_count"),
|
||||
"unfinished_dialogs_count": obj.get("unfinished_dialogs_count")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
87
ai_core_api_client/models/domain_prompt.py
Normal file
87
ai_core_api_client/models/domain_prompt.py
Normal file
@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class DomainPrompt(BaseModel):
|
||||
"""
|
||||
DomainPrompt
|
||||
""" # noqa: E501
|
||||
prompt: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["prompt"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DomainPrompt from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DomainPrompt from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"prompt": obj.get("prompt")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
87
ai_core_api_client/models/domain_update_prompt_response.py
Normal file
87
ai_core_api_client/models/domain_update_prompt_response.py
Normal file
@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class DomainUpdatePromptResponse(BaseModel):
|
||||
"""
|
||||
DomainUpdatePromptResponse
|
||||
""" # noqa: E501
|
||||
status: Optional[StrictBool] = None
|
||||
__properties: ClassVar[List[str]] = ["status"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DomainUpdatePromptResponse from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DomainUpdatePromptResponse from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"status": obj.get("status")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
95
ai_core_api_client/models/domain_usage_info.py
Normal file
95
ai_core_api_client/models/domain_usage_info.py
Normal file
@ -0,0 +1,95 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class DomainUsageInfo(BaseModel):
|
||||
"""
|
||||
DomainUsageInfo
|
||||
""" # noqa: E501
|
||||
cached_tokens: Optional[StrictInt] = None
|
||||
completion_tokens: Optional[StrictInt] = None
|
||||
model: Optional[StrictStr] = None
|
||||
prompt_tokens: Optional[StrictInt] = None
|
||||
total_tokens: Optional[StrictInt] = None
|
||||
__properties: ClassVar[List[str]] = ["cached_tokens", "completion_tokens", "model", "prompt_tokens", "total_tokens"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DomainUsageInfo from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DomainUsageInfo from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"cached_tokens": obj.get("cached_tokens"),
|
||||
"completion_tokens": obj.get("completion_tokens"),
|
||||
"model": obj.get("model"),
|
||||
"prompt_tokens": obj.get("prompt_tokens"),
|
||||
"total_tokens": obj.get("total_tokens")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@ -76,6 +76,7 @@ class RESTClientObject:
|
||||
"ca_certs": configuration.ssl_ca_cert,
|
||||
"cert_file": configuration.cert_file,
|
||||
"key_file": configuration.key_file,
|
||||
"ca_cert_data": configuration.ca_cert_data,
|
||||
}
|
||||
if configuration.assert_hostname is not None:
|
||||
pool_args['assert_hostname'] = (
|
||||
@ -225,7 +226,7 @@ class RESTClientObject:
|
||||
headers=headers,
|
||||
preload_content=False
|
||||
)
|
||||
elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool):
|
||||
elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
|
||||
request_body = "true" if body else "false"
|
||||
r = self.pool_manager.request(
|
||||
method,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# openapi_client.AiApi
|
||||
# ai_core_api_client.AiApi
|
||||
|
||||
All URIs are relative to */api/v1*
|
||||
|
||||
@ -19,15 +19,15 @@ This endpoint generates a response from an AI model based on the provided conver
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_conversation_request import DomainConversationRequest
|
||||
from openapi_client.models.domain_conversation_response import DomainConversationResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_conversation_request import DomainConversationRequest
|
||||
from ai_core_api_client.models.domain_conversation_response import DomainConversationResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -43,10 +43,10 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.AiApi(api_client)
|
||||
request = openapi_client.DomainConversationRequest() # DomainConversationRequest | Conversation Request
|
||||
api_instance = ai_core_api_client.AiApi(api_client)
|
||||
request = ai_core_api_client.DomainConversationRequest() # DomainConversationRequest | Conversation Request
|
||||
|
||||
try:
|
||||
# Generate response from AI model
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# openapi_client.ChatsApi
|
||||
# ai_core_api_client.ChatsApi
|
||||
|
||||
All URIs are relative to */api/v1*
|
||||
|
||||
@ -19,14 +19,14 @@ This endpoint returns all client chats of company.
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -42,9 +42,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.ChatsApi(api_client)
|
||||
api_instance = ai_core_api_client.ChatsApi(api_client)
|
||||
page = 56 # int | Page number (optional)
|
||||
limit = 56 # int | Limit of chats per page (optional)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# openapi_client.CompanyApi
|
||||
# ai_core_api_client.CompanyApi
|
||||
|
||||
All URIs are relative to */api/v1*
|
||||
|
||||
@ -9,6 +9,7 @@ Method | HTTP request | Description
|
||||
[**company_id_get**](CompanyApi.md#company_id_get) | **GET** /company/{id} | Get company details
|
||||
[**company_patch**](CompanyApi.md#company_patch) | **PATCH** /company | Update a company in the database
|
||||
[**company_post**](CompanyApi.md#company_post) | **POST** /company | Adds a company to the database
|
||||
[**update_prompt_post**](CompanyApi.md#update_prompt_post) | **POST** /update-prompt | Update company prompt
|
||||
|
||||
|
||||
# **company_get**
|
||||
@ -23,14 +24,14 @@ This endpoint returns a list of all companies in the database
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_company import DomainCompany
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_company import DomainCompany
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -46,9 +47,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.CompanyApi(api_client)
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
|
||||
try:
|
||||
# Returns a list of companies
|
||||
@ -100,14 +101,14 @@ This endpoint removes the company from the database.
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_success_response import DomainSuccessResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -123,9 +124,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.CompanyApi(api_client)
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
id = 'id_example' # str | Company ID
|
||||
|
||||
try:
|
||||
@ -181,14 +182,14 @@ This endpoint returns details of a specific company by its ID in the database.
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_company import DomainCompany
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_company import DomainCompany
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -204,9 +205,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.CompanyApi(api_client)
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
id = 'id_example' # str | Company ID
|
||||
|
||||
try:
|
||||
@ -262,15 +263,15 @@ This endpoint update a company record in the database.
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
from openapi_client.models.domain_success_response import DomainSuccessResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -286,10 +287,10 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.CompanyApi(api_client)
|
||||
request = openapi_client.DomainCompanyUpdateRequest() # DomainCompanyUpdateRequest | Company Update Request
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
request = ai_core_api_client.DomainCompanyUpdateRequest() # DomainCompanyUpdateRequest | Company Update Request
|
||||
|
||||
try:
|
||||
# Update a company in the database
|
||||
@ -345,15 +346,15 @@ This endpoint creates a new company record in the database.
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
from openapi_client.models.domain_success_response import DomainSuccessResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -369,10 +370,10 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.CompanyApi(api_client)
|
||||
request = openapi_client.DomainCompanyCreateRequest() # DomainCompanyCreateRequest | Company Create Request
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
request = ai_core_api_client.DomainCompanyCreateRequest() # DomainCompanyCreateRequest | Company Create Request
|
||||
|
||||
try:
|
||||
# Adds a company to the database
|
||||
@ -416,3 +417,86 @@ Name | Type | Description | Notes
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **update_prompt_post**
|
||||
> DomainUpdatePromptResponse update_prompt_post(request)
|
||||
|
||||
Update company prompt
|
||||
|
||||
This endpoint update company prompt in the vectorstore.
|
||||
|
||||
### Example
|
||||
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
# 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: BearerAuth
|
||||
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = ai_core_api_client.CompanyApi(api_client)
|
||||
request = ai_core_api_client.DomainPrompt() # DomainPrompt | Update Prompt Request
|
||||
|
||||
try:
|
||||
# Update company prompt
|
||||
api_response = api_instance.update_prompt_post(request)
|
||||
print("The response of CompanyApi->update_prompt_post:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling CompanyApi->update_prompt_post: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**request** | [**DomainPrompt**](DomainPrompt.md)| Update Prompt Request |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DomainUpdatePromptResponse**](DomainUpdatePromptResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[BearerAuth](../README.md#BearerAuth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | OK | - |
|
||||
**400** | Bad Request | - |
|
||||
**401** | Unauthorized | - |
|
||||
**500** | Internal Server Error | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_function import DomainAIFunction
|
||||
from ai_core_api_client.models.domain_ai_function import DomainAIFunction
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_function_call import DomainAIFunctionCall
|
||||
from ai_core_api_client.models.domain_ai_function_call import DomainAIFunctionCall
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty
|
||||
from ai_core_api_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -12,7 +12,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_function_parameters import DomainAIFunctionParameters
|
||||
from ai_core_api_client.models.domain_ai_function_parameters import DomainAIFunctionParameters
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_message import DomainAIMessage
|
||||
from ai_core_api_client.models.domain_ai_message import DomainAIMessage
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_ai_tool import DomainAITool
|
||||
from ai_core_api_client.models.domain_ai_tool import DomainAITool
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_client_chat import DomainClientChat
|
||||
from ai_core_api_client.models.domain_client_chat import DomainClientChat
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -14,7 +14,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_client_message import DomainClientMessage
|
||||
from ai_core_api_client.models.domain_client_message import DomainClientMessage
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -15,7 +15,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_company import DomainCompany
|
||||
from ai_core_api_client.models.domain_company import DomainCompany
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -14,7 +14,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
from ai_core_api_client.models.domain_company_create_request import DomainCompanyCreateRequest
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -12,7 +12,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_company_function import DomainCompanyFunction
|
||||
from ai_core_api_client.models.domain_company_function import DomainCompanyFunction
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -15,7 +15,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
from ai_core_api_client.models.domain_company_update_request import DomainCompanyUpdateRequest
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -12,7 +12,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_conversation_request import DomainConversationRequest
|
||||
from ai_core_api_client.models.domain_conversation_request import DomainConversationRequest
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -7,11 +7,12 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**content** | **str** | | [optional]
|
||||
**tools** | [**List[DomainAITool]**](DomainAITool.md) | | [optional]
|
||||
**usage** | [**DomainUsageInfo**](DomainUsageInfo.md) | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_conversation_response import DomainConversationResponse
|
||||
from ai_core_api_client.models.domain_conversation_response import DomainConversationResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_error_response import DomainErrorResponse
|
||||
from ai_core_api_client.models.domain_error_response import DomainErrorResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -14,7 +14,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -5,14 +5,20 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**change_tariff_count** | **int** | | [optional]
|
||||
**closed_dialogs_count** | **int** | | [optional]
|
||||
**dialog_count** | **int** | | [optional]
|
||||
**message_count_per_day** | **int** | | [optional]
|
||||
**messsage_count_per_month** | **int** | | [optional]
|
||||
**promised_payment_count** | **int** | | [optional]
|
||||
**service_engineer_call_count** | **int** | | [optional]
|
||||
**service_suspensions_count** | **int** | | [optional]
|
||||
**unfinished_dialogs_count** | **int** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
29
docs/DomainPrompt.md
Normal file
29
docs/DomainPrompt.md
Normal file
@ -0,0 +1,29 @@
|
||||
# DomainPrompt
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**prompt** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DomainPrompt from a JSON string
|
||||
domain_prompt_instance = DomainPrompt.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DomainPrompt.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
domain_prompt_dict = domain_prompt_instance.to_dict()
|
||||
# create an instance of DomainPrompt from a dict
|
||||
domain_prompt_from_dict = DomainPrompt.from_dict(domain_prompt_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_prompt_block import DomainPromptBlock
|
||||
from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from openapi_client.models.domain_success_response import DomainSuccessResponse
|
||||
from ai_core_api_client.models.domain_success_response import DomainSuccessResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
|
||||
29
docs/DomainUpdatePromptResponse.md
Normal file
29
docs/DomainUpdatePromptResponse.md
Normal file
@ -0,0 +1,29 @@
|
||||
# DomainUpdatePromptResponse
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**status** | **bool** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DomainUpdatePromptResponse from a JSON string
|
||||
domain_update_prompt_response_instance = DomainUpdatePromptResponse.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DomainUpdatePromptResponse.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
domain_update_prompt_response_dict = domain_update_prompt_response_instance.to_dict()
|
||||
# create an instance of DomainUpdatePromptResponse from a dict
|
||||
domain_update_prompt_response_from_dict = DomainUpdatePromptResponse.from_dict(domain_update_prompt_response_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
33
docs/DomainUsageInfo.md
Normal file
33
docs/DomainUsageInfo.md
Normal file
@ -0,0 +1,33 @@
|
||||
# DomainUsageInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**cached_tokens** | **int** | | [optional]
|
||||
**completion_tokens** | **int** | | [optional]
|
||||
**model** | **str** | | [optional]
|
||||
**prompt_tokens** | **int** | | [optional]
|
||||
**total_tokens** | **int** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from ai_core_api_client.models.domain_usage_info import DomainUsageInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DomainUsageInfo from a JSON string
|
||||
domain_usage_info_instance = DomainUsageInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DomainUsageInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
domain_usage_info_dict = domain_usage_info_instance.to_dict()
|
||||
# create an instance of DomainUsageInfo from a dict
|
||||
domain_usage_info_from_dict = DomainUsageInfo.from_dict(domain_usage_info_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# openapi_client.GetMeApi
|
||||
# ai_core_api_client.GetMeApi
|
||||
|
||||
All URIs are relative to */api/v1*
|
||||
|
||||
@ -19,14 +19,14 @@ This endpoint returns details of a specific company by its tokeb in the database
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -42,9 +42,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.GetMeApi(api_client)
|
||||
api_instance = ai_core_api_client.GetMeApi(api_client)
|
||||
|
||||
try:
|
||||
# Get company details
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# openapi_client.MetricsApi
|
||||
# ai_core_api_client.MetricsApi
|
||||
|
||||
All URIs are relative to */api/v1*
|
||||
|
||||
@ -19,14 +19,14 @@ This endpoint returns metrics of a specific company by its token in the database
|
||||
* Api Key Authentication (BearerAuth):
|
||||
|
||||
```python
|
||||
import openapi_client
|
||||
from openapi_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
from openapi_client.rest import ApiException
|
||||
import ai_core_api_client
|
||||
from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse
|
||||
from ai_core_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to /api/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = openapi_client.Configuration(
|
||||
configuration = ai_core_api_client.Configuration(
|
||||
host = "/api/v1"
|
||||
)
|
||||
|
||||
@ -42,9 +42,9 @@ configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
|
||||
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
with ai_core_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.MetricsApi(api_client)
|
||||
api_instance = ai_core_api_client.MetricsApi(api_client)
|
||||
|
||||
try:
|
||||
# Get company metrics
|
||||
|
||||
@ -1,28 +1,34 @@
|
||||
[tool.poetry]
|
||||
[project]
|
||||
name = "ai_core_api_client"
|
||||
version = "1.0.0"
|
||||
description = "AISF API"
|
||||
authors = ["OpenAPI Generator Community <team@openapitools.org>"]
|
||||
license = "NoLicense"
|
||||
authors = [
|
||||
{name = "OpenAPI Generator Community",email = "team@openapitools.org"},
|
||||
]
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||
keywords = ["OpenAPI", "OpenAPI-Generator", "AISF API"]
|
||||
include = ["ai_core_api_client/py.typed"]
|
||||
requires-python = ">=3.9"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.7"
|
||||
dependencies = [
|
||||
"urllib3 (>=2.1.0,<3.0.0)",
|
||||
"python-dateutil (>=2.8.2)",
|
||||
"pydantic (>=2)",
|
||||
"typing-extensions (>=4.7.1)",
|
||||
]
|
||||
|
||||
urllib3 = ">= 1.25.3"
|
||||
python-dateutil = ">=2.8.2"
|
||||
pydantic = ">=2"
|
||||
typing-extensions = ">=4.7.1"
|
||||
[project.urls]
|
||||
Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
[tool.poetry]
|
||||
requires-poetry = ">=2.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest = ">= 7.2.1"
|
||||
pytest-cov = ">= 2.8.1"
|
||||
tox = ">= 3.9.0"
|
||||
flake8 = ">= 4.0.0"
|
||||
types-python-dateutil = ">= 2.8.19.14"
|
||||
mypy = "1.4.1"
|
||||
mypy = ">= 1.5"
|
||||
|
||||
|
||||
[build-system]
|
||||
@ -48,7 +54,7 @@ warn_unused_ignores = true
|
||||
|
||||
## Getting these passing should be easy
|
||||
strict_equality = true
|
||||
strict_concatenate = true
|
||||
extra_checks = true
|
||||
|
||||
## Strongly recommend enabling this one as soon as you can
|
||||
check_untyped_defs = true
|
||||
@ -69,3 +75,20 @@ disallow_any_generics = true
|
||||
#
|
||||
### This one can be tricky to get passing if you use a lot of untyped libraries
|
||||
#warn_return_any = true
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
"ai_core_api_client.configuration",
|
||||
]
|
||||
warn_unused_ignores = true
|
||||
strict_equality = true
|
||||
extra_checks = true
|
||||
check_untyped_defs = true
|
||||
disallow_subclassing_any = true
|
||||
disallow_untyped_decorators = true
|
||||
disallow_any_generics = true
|
||||
disallow_untyped_calls = true
|
||||
disallow_incomplete_defs = true
|
||||
disallow_untyped_defs = true
|
||||
no_implicit_reexport = true
|
||||
warn_return_any = true
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
python_dateutil >= 2.5.3
|
||||
setuptools >= 21.0.0
|
||||
urllib3 >= 1.25.3, < 2.1.0
|
||||
urllib3 >= 2.1.0, < 3.0.0
|
||||
python_dateutil >= 2.8.2
|
||||
pydantic >= 2
|
||||
typing-extensions >= 4.7.1
|
||||
|
||||
10
setup.py
10
setup.py
@ -20,12 +20,12 @@ from setuptools import setup, find_packages # noqa: H301
|
||||
#
|
||||
# prerequisite: setuptools
|
||||
# http://pypi.python.org/pypi/setuptools
|
||||
NAME = "openapi-client"
|
||||
VERSION = "1.4.0"
|
||||
PYTHON_REQUIRES = ">=3.7"
|
||||
NAME = "ai-core-api-client"
|
||||
VERSION = "1.0.0"
|
||||
PYTHON_REQUIRES = ">= 3.9"
|
||||
REQUIRES = [
|
||||
"urllib3 >= 1.25.3, < 2.1.0",
|
||||
"python-dateutil",
|
||||
"urllib3 >= 2.1.0, < 3.0.0",
|
||||
"python-dateutil >= 2.8.2",
|
||||
"pydantic >= 2",
|
||||
"typing-extensions >= 4.7.1",
|
||||
]
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
pytest~=7.1.3
|
||||
pytest >= 7.2.1
|
||||
pytest-cov >= 2.8.1
|
||||
pytest-randomly>=3.12.0
|
||||
mypy>=1.4.1
|
||||
types-python-dateutil>=2.8.19
|
||||
tox >= 3.9.0
|
||||
flake8 >= 4.0.0
|
||||
types-python-dateutil >= 2.8.19.14
|
||||
mypy >= 1.5
|
||||
|
||||
51
test/test_domain_prompt.py
Normal file
51
test/test_domain_prompt.py
Normal file
@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from ai_core_api_client.models.domain_prompt import DomainPrompt
|
||||
|
||||
class TestDomainPrompt(unittest.TestCase):
|
||||
"""DomainPrompt unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DomainPrompt:
|
||||
"""Test DomainPrompt
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `DomainPrompt`
|
||||
"""
|
||||
model = DomainPrompt()
|
||||
if include_optional:
|
||||
return DomainPrompt(
|
||||
prompt = ''
|
||||
)
|
||||
else:
|
||||
return DomainPrompt(
|
||||
)
|
||||
"""
|
||||
|
||||
def testDomainPrompt(self):
|
||||
"""Test DomainPrompt"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
51
test/test_domain_update_prompt_response.py
Normal file
51
test/test_domain_update_prompt_response.py
Normal file
@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from ai_core_api_client.models.domain_update_prompt_response import DomainUpdatePromptResponse
|
||||
|
||||
class TestDomainUpdatePromptResponse(unittest.TestCase):
|
||||
"""DomainUpdatePromptResponse unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DomainUpdatePromptResponse:
|
||||
"""Test DomainUpdatePromptResponse
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `DomainUpdatePromptResponse`
|
||||
"""
|
||||
model = DomainUpdatePromptResponse()
|
||||
if include_optional:
|
||||
return DomainUpdatePromptResponse(
|
||||
status = True
|
||||
)
|
||||
else:
|
||||
return DomainUpdatePromptResponse(
|
||||
)
|
||||
"""
|
||||
|
||||
def testDomainUpdatePromptResponse(self):
|
||||
"""Test DomainUpdatePromptResponse"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
55
test/test_domain_usage_info.py
Normal file
55
test/test_domain_usage_info.py
Normal file
@ -0,0 +1,55 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
AISF API
|
||||
|
||||
This API gives you the ability to interact with AISF's neural networks
|
||||
|
||||
The version of the OpenAPI document: 1.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from ai_core_api_client.models.domain_usage_info import DomainUsageInfo
|
||||
|
||||
class TestDomainUsageInfo(unittest.TestCase):
|
||||
"""DomainUsageInfo unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DomainUsageInfo:
|
||||
"""Test DomainUsageInfo
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `DomainUsageInfo`
|
||||
"""
|
||||
model = DomainUsageInfo()
|
||||
if include_optional:
|
||||
return DomainUsageInfo(
|
||||
cached_tokens = 56,
|
||||
completion_tokens = 56,
|
||||
model = '',
|
||||
prompt_tokens = 56,
|
||||
total_tokens = 56
|
||||
)
|
||||
else:
|
||||
return DomainUsageInfo(
|
||||
)
|
||||
"""
|
||||
|
||||
def testDomainUsageInfo(self):
|
||||
"""Test DomainUsageInfo"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
x
Reference in New Issue
Block a user