commit eb55cdb6476cdee6562d02570cffcff43e091559 Author: NikitolProject Date: Tue Aug 27 18:43:29 2024 +0300 Large update client diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..f128ba2 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: openapi_client Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - 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 + - name: Test with pytest + run: | + pytest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43995bd --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..66b58ba --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - 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 +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..ca32090 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,84 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AiApi.md +docs/ChatsApi.md +docs/CompanyApi.md +docs/DomainAIFunction.md +docs/DomainAIFunctionCall.md +docs/DomainAIFunctionParameterProperty.md +docs/DomainAIFunctionParameters.md +docs/DomainAIMessage.md +docs/DomainAITool.md +docs/DomainClientChat.md +docs/DomainClientMessage.md +docs/DomainCompany.md +docs/DomainCompanyCreateRequest.md +docs/DomainCompanyFunction.md +docs/DomainCompanyUpdateRequest.md +docs/DomainConversationRequest.md +docs/DomainConversationResponse.md +docs/DomainErrorResponse.md +docs/DomainGetChatsResponse.md +docs/DomainGetMeResponse.md +docs/DomainMetricsResponse.md +docs/DomainPromptBlock.md +docs/DomainSuccessResponse.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_chats_api.py +test/test_domain_client_chat.py +test/test_domain_client_message.py +test/test_domain_company_create_request.py +test/test_domain_company_function.py +test/test_domain_company_update_request.py +test/test_domain_get_chats_response.py +test/test_domain_get_me_response.py +test/test_domain_metrics_response.py +test/test_domain_prompt_block.py +test/test_get_me_api.py +test/test_metrics_api.py +tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..09a6d30 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6f3b27b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=ai_core_api_client diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..3eb326a --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,26 @@ +# Each line represents a rule, followed by a list of members. +# These members are the default owners for all files that match the specified pattern. +# The pattern generally follows the same syntax used for .gitignore files. +# The last matching rule always wins; those that appear lower in the file take precedence over rules that appear higher up. +# Specify owners by their username, email, or role assignment in the project. + +# Examples: + +# Member with username "john.smith" and member with email "alex@mycompany.com" +# own any JavaScript file in repository +# *.js john.smith alex@mycompany.com + +# Bob owns all files under "subdir" directory at the repository root and all its subdirectories +# /subdir/ Bob + +# All members from team named "Product Team" file under root "Product Documentation" directory +# "/Product Documentation" "Product Team" + +# All members who are assigned the Project Collaborator role own any file under docs/ directory +# anywhere in the repository, but not further nested files +# docs/* "Project Collaborator" + +# This file itself is owned by members who are assigned the Project Admin role in this project. +* n.tolstov tolnikita556@gmail.com + +CODEOWNERS "Project Admin" diff --git a/README.md b/README.md new file mode 100644 index 0000000..92bbcbb --- /dev/null +++ b/README.md @@ -0,0 +1,150 @@ +# openapi-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 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.7+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import ai_core_api_client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import ai_core_api_client +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import ai_core_api_client +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.AiApi(api_client) + request = ai_core_api_client.DomainConversationRequest() # DomainConversationRequest | Conversation Request + + try: + # Generate response from AI model + api_response = api_instance.conversation_post(request) + print("The response of AiApi->conversation_post:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AiApi->conversation_post: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to */api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AiApi* | [**conversation_post**](docs/AiApi.md#conversation_post) | **POST** /conversation | Generate response from AI model +*ChatsApi* | [**chats_get**](docs/ChatsApi.md#chats_get) | **GET** /chats | Get all client chats of company +*CompanyApi* | [**company_get**](docs/CompanyApi.md#company_get) | **GET** /company | Returns a list of companies +*CompanyApi* | [**company_id_delete**](docs/CompanyApi.md#company_id_delete) | **DELETE** /company/{id} | Delete company from the database +*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 +*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 + + +## Documentation For Models + + - [DomainAIFunction](docs/DomainAIFunction.md) + - [DomainAIFunctionCall](docs/DomainAIFunctionCall.md) + - [DomainAIFunctionParameterProperty](docs/DomainAIFunctionParameterProperty.md) + - [DomainAIFunctionParameters](docs/DomainAIFunctionParameters.md) + - [DomainAIMessage](docs/DomainAIMessage.md) + - [DomainAITool](docs/DomainAITool.md) + - [DomainClientChat](docs/DomainClientChat.md) + - [DomainClientMessage](docs/DomainClientMessage.md) + - [DomainCompany](docs/DomainCompany.md) + - [DomainCompanyCreateRequest](docs/DomainCompanyCreateRequest.md) + - [DomainCompanyFunction](docs/DomainCompanyFunction.md) + - [DomainCompanyUpdateRequest](docs/DomainCompanyUpdateRequest.md) + - [DomainConversationRequest](docs/DomainConversationRequest.md) + - [DomainConversationResponse](docs/DomainConversationResponse.md) + - [DomainErrorResponse](docs/DomainErrorResponse.md) + - [DomainGetChatsResponse](docs/DomainGetChatsResponse.md) + - [DomainGetMeResponse](docs/DomainGetMeResponse.md) + - [DomainMetricsResponse](docs/DomainMetricsResponse.md) + - [DomainPromptBlock](docs/DomainPromptBlock.md) + - [DomainSuccessResponse](docs/DomainSuccessResponse.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + + +## Author + + + + diff --git a/ai_core_api_client/__init__.py b/ai_core_api_client/__init__.py new file mode 100644 index 0000000..72f937c --- /dev/null +++ b/ai_core_api_client/__init__.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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 + + +__version__ = "1.0.0" + +# 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 + +# 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 + +# 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 diff --git a/ai_core_api_client/api/__init__.py b/ai_core_api_client/api/__init__.py new file mode 100644 index 0000000..729a939 --- /dev/null +++ b/ai_core_api_client/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api 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 + diff --git a/ai_core_api_client/api/ai_api.py b/ai_core_api_client/api/ai_api.py new file mode 100644 index 0000000..bdde1fe --- /dev/null +++ b/ai_core_api_client/api/ai_api.py @@ -0,0 +1,320 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +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.api_client import ApiClient, RequestSerialized +from ai_core_api_client.api_response import ApiResponse +from ai_core_api_client.rest import RESTResponseType + + +class AiApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def conversation_post( + self, + request: Annotated[DomainConversationRequest, Field(description="Conversation 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, + ) -> DomainConversationResponse: + """Generate response from AI model + + This endpoint generates a response from an AI model based on the provided conversation. + + :param request: Conversation Request (required) + :type request: DomainConversationRequest + :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._conversation_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': "DomainConversationResponse", + '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 conversation_post_with_http_info( + self, + request: Annotated[DomainConversationRequest, Field(description="Conversation 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[DomainConversationResponse]: + """Generate response from AI model + + This endpoint generates a response from an AI model based on the provided conversation. + + :param request: Conversation Request (required) + :type request: DomainConversationRequest + :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._conversation_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': "DomainConversationResponse", + '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 conversation_post_without_preload_content( + self, + request: Annotated[DomainConversationRequest, Field(description="Conversation 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: + """Generate response from AI model + + This endpoint generates a response from an AI model based on the provided conversation. + + :param request: Conversation Request (required) + :type request: DomainConversationRequest + :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._conversation_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': "DomainConversationResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + '500': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _conversation_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]] = {} + _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='/conversation', + 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 + ) + + diff --git a/ai_core_api_client/api/chats_api.py b/ai_core_api_client/api/chats_api.py new file mode 100644 index 0000000..da782e2 --- /dev/null +++ b/ai_core_api_client/api/chats_api.py @@ -0,0 +1,323 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from ai_core_api_client.models.domain_get_chats_response import DomainGetChatsResponse + +from ai_core_api_client.api_client import ApiClient, RequestSerialized +from ai_core_api_client.api_response import ApiResponse +from ai_core_api_client.rest import RESTResponseType + + +class ChatsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def chats_get( + self, + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + limit: Annotated[Optional[StrictInt], Field(description="Limit of chats per page")] = None, + _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, + ) -> DomainGetChatsResponse: + """Get all client chats of company + + This endpoint returns all client chats of company. + + :param page: Page number + :type page: int + :param limit: Limit of chats per page + :type limit: int + :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._chats_get_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetChatsResponse", + '400': "DomainErrorResponse", + '401': "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 chats_get_with_http_info( + self, + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + limit: Annotated[Optional[StrictInt], Field(description="Limit of chats per page")] = None, + _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[DomainGetChatsResponse]: + """Get all client chats of company + + This endpoint returns all client chats of company. + + :param page: Page number + :type page: int + :param limit: Limit of chats per page + :type limit: int + :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._chats_get_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetChatsResponse", + '400': "DomainErrorResponse", + '401': "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 chats_get_without_preload_content( + self, + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + limit: Annotated[Optional[StrictInt], Field(description="Limit of chats per page")] = None, + _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: + """Get all client chats of company + + This endpoint returns all client chats of company. + + :param page: Page number + :type page: int + :param limit: Limit of chats per page + :type limit: int + :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._chats_get_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetChatsResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _chats_get_serialize( + self, + page, + limit, + _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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/chats', + 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 + ) + + diff --git a/ai_core_api_client/api/company_api.py b/ai_core_api_client/api/company_api.py new file mode 100644 index 0000000..6e6223f --- /dev/null +++ b/ai_core_api_client/api/company_api.py @@ -0,0 +1,1384 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +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_success_response import DomainSuccessResponse + +from ai_core_api_client.api_client import ApiClient, RequestSerialized +from ai_core_api_client.api_response import ApiResponse +from ai_core_api_client.rest import RESTResponseType + + +class CompanyApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def company_get( + self, + _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, + ) -> List[DomainCompany]: + """Returns a list of companies + + This endpoint returns a list of all companies in the database + + :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._company_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DomainCompany]", + '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 company_get_with_http_info( + self, + _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[List[DomainCompany]]: + """Returns a list of companies + + This endpoint returns a list of all companies in the database + + :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._company_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DomainCompany]", + '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 company_get_without_preload_content( + self, + _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: + """Returns a list of companies + + This endpoint returns a list of all companies in the database + + :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._company_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DomainCompany]", + '401': "DomainErrorResponse", + '500': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _company_get_serialize( + self, + _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]] = {} + _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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/company', + 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 + ) + + + + + @validate_call + def company_id_delete( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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, + ) -> DomainSuccessResponse: + """Delete company from the database + + This endpoint removes the company from the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainSuccessResponse", + '400': "DomainErrorResponse", + '401': "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 company_id_delete_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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[DomainSuccessResponse]: + """Delete company from the database + + This endpoint removes the company from the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainSuccessResponse", + '400': "DomainErrorResponse", + '401': "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 company_id_delete_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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: + """Delete company from the database + + This endpoint removes the company from the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainSuccessResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _company_id_delete_serialize( + self, + id, + _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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/company/{id}', + 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 + ) + + + + + @validate_call + def company_id_get( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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, + ) -> DomainCompany: + """Get company details + + This endpoint returns details of a specific company by its ID in the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainCompany", + '400': "DomainErrorResponse", + '401': "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 company_id_get_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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[DomainCompany]: + """Get company details + + This endpoint returns details of a specific company by its ID in the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainCompany", + '400': "DomainErrorResponse", + '401': "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 company_id_get_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Company ID")], + _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: + """Get company details + + This endpoint returns details of a specific company by its ID in the database. + + :param id: Company ID (required) + :type id: str + :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._company_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainCompany", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _company_id_get_serialize( + self, + id, + _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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/company/{id}', + 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 + ) + + + + + @validate_call + def company_patch( + self, + request: Annotated[DomainCompanyUpdateRequest, Field(description="Company Update 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, + ) -> DomainSuccessResponse: + """Update a company in the database + + This endpoint update a company record in the database. + + :param request: Company Update Request (required) + :type request: DomainCompanyUpdateRequest + :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._company_patch_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': "DomainSuccessResponse", + '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 company_patch_with_http_info( + self, + request: Annotated[DomainCompanyUpdateRequest, Field(description="Company Update 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[DomainSuccessResponse]: + """Update a company in the database + + This endpoint update a company record in the database. + + :param request: Company Update Request (required) + :type request: DomainCompanyUpdateRequest + :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._company_patch_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': "DomainSuccessResponse", + '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 company_patch_without_preload_content( + self, + request: Annotated[DomainCompanyUpdateRequest, Field(description="Company Update 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 a company in the database + + This endpoint update a company record in the database. + + :param request: Company Update Request (required) + :type request: DomainCompanyUpdateRequest + :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._company_patch_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': "DomainSuccessResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + '500': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _company_patch_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]] = {} + _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='PATCH', + resource_path='/company', + 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 + ) + + + + + @validate_call + def company_post( + self, + request: Annotated[DomainCompanyCreateRequest, Field(description="Company Create 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, + ) -> DomainSuccessResponse: + """Adds a company to the database + + This endpoint creates a new company record in the database. + + :param request: Company Create Request (required) + :type request: DomainCompanyCreateRequest + :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._company_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': "DomainSuccessResponse", + '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 company_post_with_http_info( + self, + request: Annotated[DomainCompanyCreateRequest, Field(description="Company Create 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[DomainSuccessResponse]: + """Adds a company to the database + + This endpoint creates a new company record in the database. + + :param request: Company Create Request (required) + :type request: DomainCompanyCreateRequest + :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._company_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': "DomainSuccessResponse", + '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 company_post_without_preload_content( + self, + request: Annotated[DomainCompanyCreateRequest, Field(description="Company Create 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: + """Adds a company to the database + + This endpoint creates a new company record in the database. + + :param request: Company Create Request (required) + :type request: DomainCompanyCreateRequest + :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._company_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': "DomainSuccessResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + '500': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _company_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]] = {} + _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='/company', + 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 + ) + + diff --git a/ai_core_api_client/api/get_me_api.py b/ai_core_api_client/api/get_me_api.py new file mode 100644 index 0000000..b6d859b --- /dev/null +++ b/ai_core_api_client/api/get_me_api.py @@ -0,0 +1,286 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from ai_core_api_client.models.domain_get_me_response import DomainGetMeResponse + +from ai_core_api_client.api_client import ApiClient, RequestSerialized +from ai_core_api_client.api_response import ApiResponse +from ai_core_api_client.rest import RESTResponseType + + +class GetMeApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_me_get( + self, + _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, + ) -> DomainGetMeResponse: + """Get company details + + This endpoint returns details of a specific company by its tokeb in the database. + + :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._get_me_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetMeResponse", + '400': "DomainErrorResponse", + '401': "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 get_me_get_with_http_info( + self, + _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[DomainGetMeResponse]: + """Get company details + + This endpoint returns details of a specific company by its tokeb in the database. + + :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._get_me_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetMeResponse", + '400': "DomainErrorResponse", + '401': "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 get_me_get_without_preload_content( + self, + _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: + """Get company details + + This endpoint returns details of a specific company by its tokeb in the database. + + :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._get_me_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainGetMeResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_me_get_serialize( + self, + _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]] = {} + _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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/get-me', + 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 + ) + + diff --git a/ai_core_api_client/api/metrics_api.py b/ai_core_api_client/api/metrics_api.py new file mode 100644 index 0000000..f4114e1 --- /dev/null +++ b/ai_core_api_client/api/metrics_api.py @@ -0,0 +1,286 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from ai_core_api_client.models.domain_metrics_response import DomainMetricsResponse + +from ai_core_api_client.api_client import ApiClient, RequestSerialized +from ai_core_api_client.api_response import ApiResponse +from ai_core_api_client.rest import RESTResponseType + + +class MetricsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def metrics_get( + self, + _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, + ) -> DomainMetricsResponse: + """Get company metrics + + This endpoint returns metrics of a specific company by its token in the database. + + :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._metrics_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainMetricsResponse", + '400': "DomainErrorResponse", + '401': "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 metrics_get_with_http_info( + self, + _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[DomainMetricsResponse]: + """Get company metrics + + This endpoint returns metrics of a specific company by its token in the database. + + :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._metrics_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainMetricsResponse", + '400': "DomainErrorResponse", + '401': "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 metrics_get_without_preload_content( + self, + _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: + """Get company metrics + + This endpoint returns metrics of a specific company by its token in the database. + + :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._metrics_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DomainMetricsResponse", + '400': "DomainErrorResponse", + '401': "DomainErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _metrics_get_serialize( + self, + _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]] = {} + _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 + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/metrics', + 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 + ) + + diff --git a/ai_core_api_client/api_client.py b/ai_core_api_client/api_client.py new file mode 100644 index 0000000..04edee2 --- /dev/null +++ b/ai_core_api_client/api_client.py @@ -0,0 +1,788 @@ +# 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 datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from ai_core_api_client.configuration import Configuration +from ai_core_api_client.api_response import ApiResponse, T as ApiResponseT +import ai_core_api_client.models +from ai_core_api_client import rest +from ai_core_api_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(ai_core_api_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/ai_core_api_client/api_response.py b/ai_core_api_client/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/ai_core_api_client/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/ai_core_api_client/configuration.py b/ai_core_api_client/configuration.py new file mode 100644 index 0000000..aa26b44 --- /dev/null +++ b/ai_core_api_client/configuration.py @@ -0,0 +1,479 @@ +# 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 copy +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Optional +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :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. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = openapi_client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = 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, + *, + debug: Optional[bool] = None + ) -> None: + """Constructor + """ + self._base_path = "/api/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("openapi_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'BearerAuth' in self.api_key: + auth['BearerAuth'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'BearerAuth', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "/api/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """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 + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/ai_core_api_client/exceptions.py b/ai_core_api_client/exceptions.py new file mode 100644 index 0000000..c29e669 --- /dev/null +++ b/ai_core_api_client/exceptions.py @@ -0,0 +1,199 @@ +# 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 typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(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) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/ai_core_api_client/models/__init__.py b/ai_core_api_client/models/__init__.py new file mode 100644 index 0000000..7d2d695 --- /dev/null +++ b/ai_core_api_client/models/__init__.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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 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 +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 diff --git a/ai_core_api_client/models/domain_ai_function.py b/ai_core_api_client/models/domain_ai_function.py new file mode 100644 index 0000000..6ba5e53 --- /dev/null +++ b/ai_core_api_client/models/domain_ai_function.py @@ -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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from ai_core_api_client.models.domain_ai_function_parameters import DomainAIFunctionParameters +from typing import Optional, Set +from typing_extensions import Self + +class DomainAIFunction(BaseModel): + """ + DomainAIFunction + """ # noqa: E501 + description: Optional[StrictStr] = None + name: Optional[StrictStr] = None + parameters: Optional[DomainAIFunctionParameters] = None + __properties: ClassVar[List[str]] = ["description", "name", "parameters"] + + 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 DomainAIFunction 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, + ) + # override the default output from pydantic by calling `to_dict()` of parameters + if self.parameters: + _dict['parameters'] = self.parameters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainAIFunction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "name": obj.get("name"), + "parameters": DomainAIFunctionParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_ai_function_call.py b/ai_core_api_client/models/domain_ai_function_call.py new file mode 100644 index 0000000..11143a9 --- /dev/null +++ b/ai_core_api_client/models/domain_ai_function_call.py @@ -0,0 +1,89 @@ +# 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 DomainAIFunctionCall(BaseModel): + """ + DomainAIFunctionCall + """ # noqa: E501 + arguments: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["arguments", "name"] + + 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 DomainAIFunctionCall 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 DomainAIFunctionCall from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "arguments": obj.get("arguments"), + "name": obj.get("name") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_ai_function_parameter_property.py b/ai_core_api_client/models/domain_ai_function_parameter_property.py new file mode 100644 index 0000000..cd84bff --- /dev/null +++ b/ai_core_api_client/models/domain_ai_function_parameter_property.py @@ -0,0 +1,89 @@ +# 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 DomainAIFunctionParameterProperty(BaseModel): + """ + DomainAIFunctionParameterProperty + """ # noqa: E501 + description: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["description", "type"] + + 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 DomainAIFunctionParameterProperty 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 DomainAIFunctionParameterProperty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "type": obj.get("type") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_ai_function_parameters.py b/ai_core_api_client/models/domain_ai_function_parameters.py new file mode 100644 index 0000000..f436739 --- /dev/null +++ b/ai_core_api_client/models/domain_ai_function_parameters.py @@ -0,0 +1,104 @@ +# 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 ai_core_api_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty +from typing import Optional, Set +from typing_extensions import Self + +class DomainAIFunctionParameters(BaseModel): + """ + DomainAIFunctionParameters + """ # noqa: E501 + properties: Optional[Dict[str, DomainAIFunctionParameterProperty]] = None + required: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["properties", "required", "type"] + + 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 DomainAIFunctionParameters 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, + ) + # override the default output from pydantic by calling `to_dict()` of each value in properties (dict) + _field_dict = {} + if self.properties: + for _key_properties in self.properties: + if self.properties[_key_properties]: + _field_dict[_key_properties] = self.properties[_key_properties].to_dict() + _dict['properties'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainAIFunctionParameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": dict( + (_k, DomainAIFunctionParameterProperty.from_dict(_v)) + for _k, _v in obj["properties"].items() + ) + if obj.get("properties") is not None + else None, + "required": obj.get("required"), + "type": obj.get("type") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_ai_message.py b/ai_core_api_client/models/domain_ai_message.py new file mode 100644 index 0000000..47f9b19 --- /dev/null +++ b/ai_core_api_client/models/domain_ai_message.py @@ -0,0 +1,89 @@ +# 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 DomainAIMessage(BaseModel): + """ + DomainAIMessage + """ # noqa: E501 + content: Optional[StrictStr] = None + role: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["content", "role"] + + 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 DomainAIMessage 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 DomainAIMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "role": obj.get("role") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_ai_tool.py b/ai_core_api_client/models/domain_ai_tool.py new file mode 100644 index 0000000..6dc41d4 --- /dev/null +++ b/ai_core_api_client/models/domain_ai_tool.py @@ -0,0 +1,97 @@ +# 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 ai_core_api_client.models.domain_ai_function_call import DomainAIFunctionCall +from typing import Optional, Set +from typing_extensions import Self + +class DomainAITool(BaseModel): + """ + DomainAITool + """ # noqa: E501 + function: Optional[DomainAIFunctionCall] = None + id: Optional[StrictStr] = None + index: Optional[StrictInt] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["function", "id", "index", "type"] + + 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 DomainAITool 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, + ) + # override the default output from pydantic by calling `to_dict()` of function + if self.function: + _dict['function'] = self.function.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainAITool from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "function": DomainAIFunctionCall.from_dict(obj["function"]) if obj.get("function") is not None else None, + "id": obj.get("id"), + "index": obj.get("index"), + "type": obj.get("type") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_client_chat.py b/ai_core_api_client/models/domain_client_chat.py new file mode 100644 index 0000000..a100cf4 --- /dev/null +++ b/ai_core_api_client/models/domain_client_chat.py @@ -0,0 +1,97 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from ai_core_api_client.models.domain_client_message import DomainClientMessage +from typing import Optional, Set +from typing_extensions import Self + +class DomainClientChat(BaseModel): + """ + DomainClientChat + """ # noqa: E501 + client_id: Optional[StrictInt] = None + messages: Optional[List[DomainClientMessage]] = None + __properties: ClassVar[List[str]] = ["client_id", "messages"] + + 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 DomainClientChat 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainClientChat from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "messages": [DomainClientMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_client_message.py b/ai_core_api_client/models/domain_client_message.py new file mode 100644 index 0000000..b48ddb4 --- /dev/null +++ b/ai_core_api_client/models/domain_client_message.py @@ -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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DomainClientMessage(BaseModel): + """ + DomainClientMessage + """ # noqa: E501 + client_id: Optional[StrictInt] = None + content: Optional[StrictStr] = None + var_date: Optional[StrictStr] = Field(default=None, alias="date") + event_id: Optional[StrictInt] = None + message_id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["client_id", "content", "date", "event_id", "message_id"] + + 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 DomainClientMessage 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 DomainClientMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "content": obj.get("content"), + "date": obj.get("date"), + "event_id": obj.get("event_id"), + "message_id": obj.get("message_id") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_company.py b/ai_core_api_client/models/domain_company.py new file mode 100644 index 0000000..861d39d --- /dev/null +++ b/ai_core_api_client/models/domain_company.py @@ -0,0 +1,113 @@ +# 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 ai_core_api_client.models.domain_company_function import DomainCompanyFunction +from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock +from typing import Optional, Set +from typing_extensions import Self + +class DomainCompany(BaseModel): + """ + DomainCompany + """ # noqa: E501 + functions: Optional[List[DomainCompanyFunction]] = None + id: Optional[StrictStr] = None + integration_url: Optional[StrictStr] = None + name: Optional[StrictStr] = None + prompt_blocks: Optional[List[DomainPromptBlock]] = None + token: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["functions", "id", "integration_url", "name", "prompt_blocks", "token"] + + 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 DomainCompany 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in prompt_blocks (list) + _items = [] + if self.prompt_blocks: + for _item_prompt_blocks in self.prompt_blocks: + if _item_prompt_blocks: + _items.append(_item_prompt_blocks.to_dict()) + _dict['prompt_blocks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainCompany from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [DomainCompanyFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "id": obj.get("id"), + "integration_url": obj.get("integration_url"), + "name": obj.get("name"), + "prompt_blocks": [DomainPromptBlock.from_dict(_item) for _item in obj["prompt_blocks"]] if obj.get("prompt_blocks") is not None else None, + "token": obj.get("token") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_company_create_request.py b/ai_core_api_client/models/domain_company_create_request.py new file mode 100644 index 0000000..80f0503 --- /dev/null +++ b/ai_core_api_client/models/domain_company_create_request.py @@ -0,0 +1,111 @@ +# 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 ai_core_api_client.models.domain_company_function import DomainCompanyFunction +from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock +from typing import Optional, Set +from typing_extensions import Self + +class DomainCompanyCreateRequest(BaseModel): + """ + DomainCompanyCreateRequest + """ # noqa: E501 + functions: Optional[List[DomainCompanyFunction]] = None + integration_url: StrictStr + name: StrictStr + prompt_blocks: Optional[List[DomainPromptBlock]] = None + token: StrictStr + __properties: ClassVar[List[str]] = ["functions", "integration_url", "name", "prompt_blocks", "token"] + + 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 DomainCompanyCreateRequest 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in prompt_blocks (list) + _items = [] + if self.prompt_blocks: + for _item_prompt_blocks in self.prompt_blocks: + if _item_prompt_blocks: + _items.append(_item_prompt_blocks.to_dict()) + _dict['prompt_blocks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainCompanyCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [DomainCompanyFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "integration_url": obj.get("integration_url"), + "name": obj.get("name"), + "prompt_blocks": [DomainPromptBlock.from_dict(_item) for _item in obj["prompt_blocks"]] if obj.get("prompt_blocks") is not None else None, + "token": obj.get("token") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_company_function.py b/ai_core_api_client/models/domain_company_function.py new file mode 100644 index 0000000..502a0ab --- /dev/null +++ b/ai_core_api_client/models/domain_company_function.py @@ -0,0 +1,91 @@ +# 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 DomainCompanyFunction(BaseModel): + """ + DomainCompanyFunction + """ # noqa: E501 + description: Optional[StrictStr] = None + level: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["description", "level", "name"] + + 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 DomainCompanyFunction 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 DomainCompanyFunction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "level": obj.get("level"), + "name": obj.get("name") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_company_update_request.py b/ai_core_api_client/models/domain_company_update_request.py new file mode 100644 index 0000000..dbec7e9 --- /dev/null +++ b/ai_core_api_client/models/domain_company_update_request.py @@ -0,0 +1,113 @@ +# 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 ai_core_api_client.models.domain_company_function import DomainCompanyFunction +from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock +from typing import Optional, Set +from typing_extensions import Self + +class DomainCompanyUpdateRequest(BaseModel): + """ + DomainCompanyUpdateRequest + """ # noqa: E501 + functions: Optional[List[DomainCompanyFunction]] = None + id: StrictStr + integration_url: Optional[StrictStr] = None + name: Optional[StrictStr] = None + prompt_blocks: Optional[List[DomainPromptBlock]] = None + token: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["functions", "id", "integration_url", "name", "prompt_blocks", "token"] + + 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 DomainCompanyUpdateRequest 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in prompt_blocks (list) + _items = [] + if self.prompt_blocks: + for _item_prompt_blocks in self.prompt_blocks: + if _item_prompt_blocks: + _items.append(_item_prompt_blocks.to_dict()) + _dict['prompt_blocks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainCompanyUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [DomainCompanyFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "id": obj.get("id"), + "integration_url": obj.get("integration_url"), + "name": obj.get("name"), + "prompt_blocks": [DomainPromptBlock.from_dict(_item) for _item in obj["prompt_blocks"]] if obj.get("prompt_blocks") is not None else None, + "token": obj.get("token") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_conversation_request.py b/ai_core_api_client/models/domain_conversation_request.py new file mode 100644 index 0000000..af1a99a --- /dev/null +++ b/ai_core_api_client/models/domain_conversation_request.py @@ -0,0 +1,107 @@ +# 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 ai_core_api_client.models.domain_ai_function import DomainAIFunction +from ai_core_api_client.models.domain_ai_message import DomainAIMessage +from typing import Optional, Set +from typing_extensions import Self + +class DomainConversationRequest(BaseModel): + """ + DomainConversationRequest + """ # noqa: E501 + functions: Optional[List[DomainAIFunction]] = None + messages: List[DomainAIMessage] + model: StrictStr + __properties: ClassVar[List[str]] = ["functions", "messages", "model"] + + 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 DomainConversationRequest 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + _items = [] + if self.messages: + for _item_messages in self.messages: + if _item_messages: + _items.append(_item_messages.to_dict()) + _dict['messages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainConversationRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [DomainAIFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "messages": [DomainAIMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, + "model": obj.get("model") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_conversation_response.py b/ai_core_api_client/models/domain_conversation_response.py new file mode 100644 index 0000000..e9709f2 --- /dev/null +++ b/ai_core_api_client/models/domain_conversation_response.py @@ -0,0 +1,97 @@ +# 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 ai_core_api_client.models.domain_ai_tool import DomainAITool +from typing import Optional, Set +from typing_extensions import Self + +class DomainConversationResponse(BaseModel): + """ + DomainConversationResponse + """ # noqa: E501 + content: Optional[StrictStr] = None + tools: Optional[List[DomainAITool]] = None + __properties: ClassVar[List[str]] = ["content", "tools"] + + 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 DomainConversationResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tools (list) + _items = [] + if self.tools: + for _item_tools in self.tools: + if _item_tools: + _items.append(_item_tools.to_dict()) + _dict['tools'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainConversationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _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 + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_error_response.py b/ai_core_api_client/models/domain_error_response.py new file mode 100644 index 0000000..7e1cb53 --- /dev/null +++ b/ai_core_api_client/models/domain_error_response.py @@ -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 DomainErrorResponse(BaseModel): + """ + DomainErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["message"] + + 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 DomainErrorResponse 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 DomainErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_get_chats_response.py b/ai_core_api_client/models/domain_get_chats_response.py new file mode 100644 index 0000000..fd2a320 --- /dev/null +++ b/ai_core_api_client/models/domain_get_chats_response.py @@ -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 +from typing import Any, ClassVar, Dict, List, Optional +from ai_core_api_client.models.domain_client_chat import DomainClientChat +from typing import Optional, Set +from typing_extensions import Self + +class DomainGetChatsResponse(BaseModel): + """ + DomainGetChatsResponse + """ # noqa: E501 + chats: Optional[List[DomainClientChat]] = None + __properties: ClassVar[List[str]] = ["chats"] + + 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 DomainGetChatsResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in chats (list) + _items = [] + if self.chats: + for _item_chats in self.chats: + if _item_chats: + _items.append(_item_chats.to_dict()) + _dict['chats'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainGetChatsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "chats": [DomainClientChat.from_dict(_item) for _item in obj["chats"]] if obj.get("chats") is not None else None + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_get_me_response.py b/ai_core_api_client/models/domain_get_me_response.py new file mode 100644 index 0000000..0443347 --- /dev/null +++ b/ai_core_api_client/models/domain_get_me_response.py @@ -0,0 +1,111 @@ +# 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 ai_core_api_client.models.domain_company_function import DomainCompanyFunction +from ai_core_api_client.models.domain_prompt_block import DomainPromptBlock +from typing import Optional, Set +from typing_extensions import Self + +class DomainGetMeResponse(BaseModel): + """ + DomainGetMeResponse + """ # noqa: E501 + functions: Optional[List[DomainCompanyFunction]] = None + id: Optional[StrictStr] = None + level: Optional[StrictInt] = None + name: Optional[StrictStr] = None + prompt_blocks: Optional[List[DomainPromptBlock]] = None + __properties: ClassVar[List[str]] = ["functions", "id", "level", "name", "prompt_blocks"] + + 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 DomainGetMeResponse 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in prompt_blocks (list) + _items = [] + if self.prompt_blocks: + for _item_prompt_blocks in self.prompt_blocks: + if _item_prompt_blocks: + _items.append(_item_prompt_blocks.to_dict()) + _dict['prompt_blocks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DomainGetMeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "functions": [DomainCompanyFunction.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "id": obj.get("id"), + "level": obj.get("level"), + "name": obj.get("name"), + "prompt_blocks": [DomainPromptBlock.from_dict(_item) for _item in obj["prompt_blocks"]] if obj.get("prompt_blocks") is not None else None + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_metrics_response.py b/ai_core_api_client/models/domain_metrics_response.py new file mode 100644 index 0000000..9787cfe --- /dev/null +++ b/ai_core_api_client/models/domain_metrics_response.py @@ -0,0 +1,91 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DomainMetricsResponse(BaseModel): + """ + DomainMetricsResponse + """ # noqa: E501 + 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"] + + 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 DomainMetricsResponse 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 DomainMetricsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "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") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_prompt_block.py b/ai_core_api_client/models/domain_prompt_block.py new file mode 100644 index 0000000..bbae634 --- /dev/null +++ b/ai_core_api_client/models/domain_prompt_block.py @@ -0,0 +1,89 @@ +# 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 DomainPromptBlock(BaseModel): + """ + DomainPromptBlock + """ # noqa: E501 + content: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["content", "name"] + + 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 DomainPromptBlock 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 DomainPromptBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "name": obj.get("name") + }) + return _obj + + diff --git a/ai_core_api_client/models/domain_success_response.py b/ai_core_api_client/models/domain_success_response.py new file mode 100644 index 0000000..cc29ff4 --- /dev/null +++ b/ai_core_api_client/models/domain_success_response.py @@ -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 DomainSuccessResponse(BaseModel): + """ + DomainSuccessResponse + """ # noqa: E501 + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["message"] + + 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 DomainSuccessResponse 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 DomainSuccessResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") + }) + return _obj + + diff --git a/ai_core_api_client/py.typed b/ai_core_api_client/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/ai_core_api_client/rest.py b/ai_core_api_client/rest.py new file mode 100644 index 0000000..c9e52d4 --- /dev/null +++ b/ai_core_api_client/rest.py @@ -0,0 +1,257 @@ +# 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 io +import json +import re +import ssl + +import urllib3 + +from ai_core_api_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :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. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/docs/AiApi.md b/docs/AiApi.md new file mode 100644 index 0000000..d6985a4 --- /dev/null +++ b/docs/AiApi.md @@ -0,0 +1,92 @@ +# openapi_client.AiApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**conversation_post**](AiApi.md#conversation_post) | **POST** /conversation | Generate response from AI model + + +# **conversation_post** +> DomainConversationResponse conversation_post(request) + +Generate response from AI model + +This endpoint generates a response from an AI model based on the provided conversation. + +### Example + +* 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 +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( + 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 openapi_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 + + try: + # Generate response from AI model + api_response = api_instance.conversation_post(request) + print("The response of AiApi->conversation_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AiApi->conversation_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**DomainConversationRequest**](DomainConversationRequest.md)| Conversation Request | + +### Return type + +[**DomainConversationResponse**](DomainConversationResponse.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) + diff --git a/docs/ChatsApi.md b/docs/ChatsApi.md new file mode 100644 index 0000000..ab2d66b --- /dev/null +++ b/docs/ChatsApi.md @@ -0,0 +1,92 @@ +# openapi_client.ChatsApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**chats_get**](ChatsApi.md#chats_get) | **GET** /chats | Get all client chats of company + + +# **chats_get** +> DomainGetChatsResponse chats_get(page=page, limit=limit) + +Get all client chats of company + +This endpoint returns all client chats of company. + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_get_chats_response import DomainGetChatsResponse +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.ChatsApi(api_client) + page = 56 # int | Page number (optional) + limit = 56 # int | Limit of chats per page (optional) + + try: + # Get all client chats of company + api_response = api_instance.chats_get(page=page, limit=limit) + print("The response of ChatsApi->chats_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ChatsApi->chats_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Limit of chats per page | [optional] + +### Return type + +[**DomainGetChatsResponse**](DomainGetChatsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + diff --git a/docs/CompanyApi.md b/docs/CompanyApi.md new file mode 100644 index 0000000..78257ca --- /dev/null +++ b/docs/CompanyApi.md @@ -0,0 +1,418 @@ +# openapi_client.CompanyApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**company_get**](CompanyApi.md#company_get) | **GET** /company | Returns a list of companies +[**company_id_delete**](CompanyApi.md#company_id_delete) | **DELETE** /company/{id} | Delete company from the database +[**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 + + +# **company_get** +> List[DomainCompany] company_get() + +Returns a list of companies + +This endpoint returns a list of all companies in the database + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_company import DomainCompany +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.CompanyApi(api_client) + + try: + # Returns a list of companies + api_response = api_instance.company_get() + print("The response of CompanyApi->company_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CompanyApi->company_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[DomainCompany]**](DomainCompany.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**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) + +# **company_id_delete** +> DomainSuccessResponse company_id_delete(id) + +Delete company from the database + +This endpoint removes the company from the database. + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_success_response import DomainSuccessResponse +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.CompanyApi(api_client) + id = 'id_example' # str | Company ID + + try: + # Delete company from the database + api_response = api_instance.company_id_delete(id) + print("The response of CompanyApi->company_id_delete:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CompanyApi->company_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Company ID | + +### Return type + +[**DomainSuccessResponse**](DomainSuccessResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + +# **company_id_get** +> DomainCompany company_id_get(id) + +Get company details + +This endpoint returns details of a specific company by its ID in the database. + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_company import DomainCompany +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.CompanyApi(api_client) + id = 'id_example' # str | Company ID + + try: + # Get company details + api_response = api_instance.company_id_get(id) + print("The response of CompanyApi->company_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CompanyApi->company_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Company ID | + +### Return type + +[**DomainCompany**](DomainCompany.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + +# **company_patch** +> DomainSuccessResponse company_patch(request) + +Update a company in the database + +This endpoint update a company record in the database. + +### Example + +* 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 +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( + 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 openapi_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 + + try: + # Update a company in the database + api_response = api_instance.company_patch(request) + print("The response of CompanyApi->company_patch:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CompanyApi->company_patch: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**DomainCompanyUpdateRequest**](DomainCompanyUpdateRequest.md)| Company Update Request | + +### Return type + +[**DomainSuccessResponse**](DomainSuccessResponse.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) + +# **company_post** +> DomainSuccessResponse company_post(request) + +Adds a company to the database + +This endpoint creates a new company record in the database. + +### Example + +* 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 +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( + 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 openapi_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 + + try: + # Adds a company to the database + api_response = api_instance.company_post(request) + print("The response of CompanyApi->company_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CompanyApi->company_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**DomainCompanyCreateRequest**](DomainCompanyCreateRequest.md)| Company Create Request | + +### Return type + +[**DomainSuccessResponse**](DomainSuccessResponse.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) + diff --git a/docs/DomainAIFunction.md b/docs/DomainAIFunction.md new file mode 100644 index 0000000..36382fd --- /dev/null +++ b/docs/DomainAIFunction.md @@ -0,0 +1,31 @@ +# DomainAIFunction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**name** | **str** | | [optional] +**parameters** | [**DomainAIFunctionParameters**](DomainAIFunctionParameters.md) | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_function import DomainAIFunction + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAIFunction from a JSON string +domain_ai_function_instance = DomainAIFunction.from_json(json) +# print the JSON string representation of the object +print(DomainAIFunction.to_json()) + +# convert the object into a dict +domain_ai_function_dict = domain_ai_function_instance.to_dict() +# create an instance of DomainAIFunction from a dict +domain_ai_function_from_dict = DomainAIFunction.from_dict(domain_ai_function_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) + + diff --git a/docs/DomainAIFunctionCall.md b/docs/DomainAIFunctionCall.md new file mode 100644 index 0000000..a8d6b0d --- /dev/null +++ b/docs/DomainAIFunctionCall.md @@ -0,0 +1,30 @@ +# DomainAIFunctionCall + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arguments** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_function_call import DomainAIFunctionCall + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAIFunctionCall from a JSON string +domain_ai_function_call_instance = DomainAIFunctionCall.from_json(json) +# print the JSON string representation of the object +print(DomainAIFunctionCall.to_json()) + +# convert the object into a dict +domain_ai_function_call_dict = domain_ai_function_call_instance.to_dict() +# create an instance of DomainAIFunctionCall from a dict +domain_ai_function_call_from_dict = DomainAIFunctionCall.from_dict(domain_ai_function_call_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) + + diff --git a/docs/DomainAIFunctionParameterProperty.md b/docs/DomainAIFunctionParameterProperty.md new file mode 100644 index 0000000..2e77cff --- /dev/null +++ b/docs/DomainAIFunctionParameterProperty.md @@ -0,0 +1,30 @@ +# DomainAIFunctionParameterProperty + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_function_parameter_property import DomainAIFunctionParameterProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAIFunctionParameterProperty from a JSON string +domain_ai_function_parameter_property_instance = DomainAIFunctionParameterProperty.from_json(json) +# print the JSON string representation of the object +print(DomainAIFunctionParameterProperty.to_json()) + +# convert the object into a dict +domain_ai_function_parameter_property_dict = domain_ai_function_parameter_property_instance.to_dict() +# create an instance of DomainAIFunctionParameterProperty from a dict +domain_ai_function_parameter_property_from_dict = DomainAIFunctionParameterProperty.from_dict(domain_ai_function_parameter_property_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) + + diff --git a/docs/DomainAIFunctionParameters.md b/docs/DomainAIFunctionParameters.md new file mode 100644 index 0000000..18b2139 --- /dev/null +++ b/docs/DomainAIFunctionParameters.md @@ -0,0 +1,31 @@ +# DomainAIFunctionParameters + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | [**Dict[str, DomainAIFunctionParameterProperty]**](DomainAIFunctionParameterProperty.md) | | [optional] +**required** | **List[str]** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_function_parameters import DomainAIFunctionParameters + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAIFunctionParameters from a JSON string +domain_ai_function_parameters_instance = DomainAIFunctionParameters.from_json(json) +# print the JSON string representation of the object +print(DomainAIFunctionParameters.to_json()) + +# convert the object into a dict +domain_ai_function_parameters_dict = domain_ai_function_parameters_instance.to_dict() +# create an instance of DomainAIFunctionParameters from a dict +domain_ai_function_parameters_from_dict = DomainAIFunctionParameters.from_dict(domain_ai_function_parameters_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) + + diff --git a/docs/DomainAIMessage.md b/docs/DomainAIMessage.md new file mode 100644 index 0000000..577a808 --- /dev/null +++ b/docs/DomainAIMessage.md @@ -0,0 +1,30 @@ +# DomainAIMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **str** | | [optional] +**role** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_message import DomainAIMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAIMessage from a JSON string +domain_ai_message_instance = DomainAIMessage.from_json(json) +# print the JSON string representation of the object +print(DomainAIMessage.to_json()) + +# convert the object into a dict +domain_ai_message_dict = domain_ai_message_instance.to_dict() +# create an instance of DomainAIMessage from a dict +domain_ai_message_from_dict = DomainAIMessage.from_dict(domain_ai_message_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) + + diff --git a/docs/DomainAITool.md b/docs/DomainAITool.md new file mode 100644 index 0000000..bca12eb --- /dev/null +++ b/docs/DomainAITool.md @@ -0,0 +1,32 @@ +# DomainAITool + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function** | [**DomainAIFunctionCall**](DomainAIFunctionCall.md) | | [optional] +**id** | **str** | | [optional] +**index** | **int** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_ai_tool import DomainAITool + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainAITool from a JSON string +domain_ai_tool_instance = DomainAITool.from_json(json) +# print the JSON string representation of the object +print(DomainAITool.to_json()) + +# convert the object into a dict +domain_ai_tool_dict = domain_ai_tool_instance.to_dict() +# create an instance of DomainAITool from a dict +domain_ai_tool_from_dict = DomainAITool.from_dict(domain_ai_tool_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) + + diff --git a/docs/DomainClientChat.md b/docs/DomainClientChat.md new file mode 100644 index 0000000..9ac8def --- /dev/null +++ b/docs/DomainClientChat.md @@ -0,0 +1,30 @@ +# DomainClientChat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | **int** | | [optional] +**messages** | [**List[DomainClientMessage]**](DomainClientMessage.md) | | [optional] + +## Example + +```python +from openapi_client.models.domain_client_chat import DomainClientChat + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainClientChat from a JSON string +domain_client_chat_instance = DomainClientChat.from_json(json) +# print the JSON string representation of the object +print(DomainClientChat.to_json()) + +# convert the object into a dict +domain_client_chat_dict = domain_client_chat_instance.to_dict() +# create an instance of DomainClientChat from a dict +domain_client_chat_from_dict = DomainClientChat.from_dict(domain_client_chat_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) + + diff --git a/docs/DomainClientMessage.md b/docs/DomainClientMessage.md new file mode 100644 index 0000000..9eddff0 --- /dev/null +++ b/docs/DomainClientMessage.md @@ -0,0 +1,33 @@ +# DomainClientMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | **int** | | [optional] +**content** | **str** | | [optional] +**var_date** | **str** | | [optional] +**event_id** | **int** | | [optional] +**message_id** | **int** | | [optional] + +## Example + +```python +from openapi_client.models.domain_client_message import DomainClientMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainClientMessage from a JSON string +domain_client_message_instance = DomainClientMessage.from_json(json) +# print the JSON string representation of the object +print(DomainClientMessage.to_json()) + +# convert the object into a dict +domain_client_message_dict = domain_client_message_instance.to_dict() +# create an instance of DomainClientMessage from a dict +domain_client_message_from_dict = DomainClientMessage.from_dict(domain_client_message_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) + + diff --git a/docs/DomainCompany.md b/docs/DomainCompany.md new file mode 100644 index 0000000..900153c --- /dev/null +++ b/docs/DomainCompany.md @@ -0,0 +1,34 @@ +# DomainCompany + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[DomainCompanyFunction]**](DomainCompanyFunction.md) | | [optional] +**id** | **str** | | [optional] +**integration_url** | **str** | | [optional] +**name** | **str** | | [optional] +**prompt_blocks** | [**List[DomainPromptBlock]**](DomainPromptBlock.md) | | [optional] +**token** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_company import DomainCompany + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainCompany from a JSON string +domain_company_instance = DomainCompany.from_json(json) +# print the JSON string representation of the object +print(DomainCompany.to_json()) + +# convert the object into a dict +domain_company_dict = domain_company_instance.to_dict() +# create an instance of DomainCompany from a dict +domain_company_from_dict = DomainCompany.from_dict(domain_company_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) + + diff --git a/docs/DomainCompanyCreateRequest.md b/docs/DomainCompanyCreateRequest.md new file mode 100644 index 0000000..d8ff5ea --- /dev/null +++ b/docs/DomainCompanyCreateRequest.md @@ -0,0 +1,33 @@ +# DomainCompanyCreateRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[DomainCompanyFunction]**](DomainCompanyFunction.md) | | [optional] +**integration_url** | **str** | | +**name** | **str** | | +**prompt_blocks** | [**List[DomainPromptBlock]**](DomainPromptBlock.md) | | [optional] +**token** | **str** | | + +## Example + +```python +from openapi_client.models.domain_company_create_request import DomainCompanyCreateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainCompanyCreateRequest from a JSON string +domain_company_create_request_instance = DomainCompanyCreateRequest.from_json(json) +# print the JSON string representation of the object +print(DomainCompanyCreateRequest.to_json()) + +# convert the object into a dict +domain_company_create_request_dict = domain_company_create_request_instance.to_dict() +# create an instance of DomainCompanyCreateRequest from a dict +domain_company_create_request_from_dict = DomainCompanyCreateRequest.from_dict(domain_company_create_request_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) + + diff --git a/docs/DomainCompanyFunction.md b/docs/DomainCompanyFunction.md new file mode 100644 index 0000000..4a9afb8 --- /dev/null +++ b/docs/DomainCompanyFunction.md @@ -0,0 +1,31 @@ +# DomainCompanyFunction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**level** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_company_function import DomainCompanyFunction + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainCompanyFunction from a JSON string +domain_company_function_instance = DomainCompanyFunction.from_json(json) +# print the JSON string representation of the object +print(DomainCompanyFunction.to_json()) + +# convert the object into a dict +domain_company_function_dict = domain_company_function_instance.to_dict() +# create an instance of DomainCompanyFunction from a dict +domain_company_function_from_dict = DomainCompanyFunction.from_dict(domain_company_function_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) + + diff --git a/docs/DomainCompanyRequest.md b/docs/DomainCompanyRequest.md new file mode 100644 index 0000000..ba5e6a7 --- /dev/null +++ b/docs/DomainCompanyRequest.md @@ -0,0 +1,30 @@ +# DomainCompanyRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**token** | **str** | | + +## Example + +```python +from ai_core_api_client.models.domain_company_request import DomainCompanyRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainCompanyRequest from a JSON string +domain_company_request_instance = DomainCompanyRequest.from_json(json) +# print the JSON string representation of the object +print(DomainCompanyRequest.to_json()) + +# convert the object into a dict +domain_company_request_dict = domain_company_request_instance.to_dict() +# create an instance of DomainCompanyRequest from a dict +domain_company_request_from_dict = DomainCompanyRequest.from_dict(domain_company_request_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) + + diff --git a/docs/DomainCompanyUpdateRequest.md b/docs/DomainCompanyUpdateRequest.md new file mode 100644 index 0000000..a464d8b --- /dev/null +++ b/docs/DomainCompanyUpdateRequest.md @@ -0,0 +1,34 @@ +# DomainCompanyUpdateRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[DomainCompanyFunction]**](DomainCompanyFunction.md) | | [optional] +**id** | **str** | | +**integration_url** | **str** | | [optional] +**name** | **str** | | [optional] +**prompt_blocks** | [**List[DomainPromptBlock]**](DomainPromptBlock.md) | | [optional] +**token** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_company_update_request import DomainCompanyUpdateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainCompanyUpdateRequest from a JSON string +domain_company_update_request_instance = DomainCompanyUpdateRequest.from_json(json) +# print the JSON string representation of the object +print(DomainCompanyUpdateRequest.to_json()) + +# convert the object into a dict +domain_company_update_request_dict = domain_company_update_request_instance.to_dict() +# create an instance of DomainCompanyUpdateRequest from a dict +domain_company_update_request_from_dict = DomainCompanyUpdateRequest.from_dict(domain_company_update_request_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) + + diff --git a/docs/DomainConversationRequest.md b/docs/DomainConversationRequest.md new file mode 100644 index 0000000..948c41f --- /dev/null +++ b/docs/DomainConversationRequest.md @@ -0,0 +1,31 @@ +# DomainConversationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[DomainAIFunction]**](DomainAIFunction.md) | | [optional] +**messages** | [**List[DomainAIMessage]**](DomainAIMessage.md) | | +**model** | **str** | | + +## Example + +```python +from openapi_client.models.domain_conversation_request import DomainConversationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainConversationRequest from a JSON string +domain_conversation_request_instance = DomainConversationRequest.from_json(json) +# print the JSON string representation of the object +print(DomainConversationRequest.to_json()) + +# convert the object into a dict +domain_conversation_request_dict = domain_conversation_request_instance.to_dict() +# create an instance of DomainConversationRequest from a dict +domain_conversation_request_from_dict = DomainConversationRequest.from_dict(domain_conversation_request_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) + + diff --git a/docs/DomainConversationResponse.md b/docs/DomainConversationResponse.md new file mode 100644 index 0000000..5e5c3f7 --- /dev/null +++ b/docs/DomainConversationResponse.md @@ -0,0 +1,30 @@ +# DomainConversationResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **str** | | [optional] +**tools** | [**List[DomainAITool]**](DomainAITool.md) | | [optional] + +## Example + +```python +from openapi_client.models.domain_conversation_response import DomainConversationResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainConversationResponse from a JSON string +domain_conversation_response_instance = DomainConversationResponse.from_json(json) +# print the JSON string representation of the object +print(DomainConversationResponse.to_json()) + +# convert the object into a dict +domain_conversation_response_dict = domain_conversation_response_instance.to_dict() +# create an instance of DomainConversationResponse from a dict +domain_conversation_response_from_dict = DomainConversationResponse.from_dict(domain_conversation_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) + + diff --git a/docs/DomainErrorResponse.md b/docs/DomainErrorResponse.md new file mode 100644 index 0000000..58b5117 --- /dev/null +++ b/docs/DomainErrorResponse.md @@ -0,0 +1,29 @@ +# DomainErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_error_response import DomainErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainErrorResponse from a JSON string +domain_error_response_instance = DomainErrorResponse.from_json(json) +# print the JSON string representation of the object +print(DomainErrorResponse.to_json()) + +# convert the object into a dict +domain_error_response_dict = domain_error_response_instance.to_dict() +# create an instance of DomainErrorResponse from a dict +domain_error_response_from_dict = DomainErrorResponse.from_dict(domain_error_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) + + diff --git a/docs/DomainGetChatsResponse.md b/docs/DomainGetChatsResponse.md new file mode 100644 index 0000000..1e0416f --- /dev/null +++ b/docs/DomainGetChatsResponse.md @@ -0,0 +1,29 @@ +# DomainGetChatsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**chats** | [**List[DomainClientChat]**](DomainClientChat.md) | | [optional] + +## Example + +```python +from openapi_client.models.domain_get_chats_response import DomainGetChatsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainGetChatsResponse from a JSON string +domain_get_chats_response_instance = DomainGetChatsResponse.from_json(json) +# print the JSON string representation of the object +print(DomainGetChatsResponse.to_json()) + +# convert the object into a dict +domain_get_chats_response_dict = domain_get_chats_response_instance.to_dict() +# create an instance of DomainGetChatsResponse from a dict +domain_get_chats_response_from_dict = DomainGetChatsResponse.from_dict(domain_get_chats_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) + + diff --git a/docs/DomainGetMeResponse.md b/docs/DomainGetMeResponse.md new file mode 100644 index 0000000..fffdcfd --- /dev/null +++ b/docs/DomainGetMeResponse.md @@ -0,0 +1,33 @@ +# DomainGetMeResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**functions** | [**List[DomainCompanyFunction]**](DomainCompanyFunction.md) | | [optional] +**id** | **str** | | [optional] +**level** | **int** | | [optional] +**name** | **str** | | [optional] +**prompt_blocks** | [**List[DomainPromptBlock]**](DomainPromptBlock.md) | | [optional] + +## Example + +```python +from openapi_client.models.domain_get_me_response import DomainGetMeResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainGetMeResponse from a JSON string +domain_get_me_response_instance = DomainGetMeResponse.from_json(json) +# print the JSON string representation of the object +print(DomainGetMeResponse.to_json()) + +# convert the object into a dict +domain_get_me_response_dict = domain_get_me_response_instance.to_dict() +# create an instance of DomainGetMeResponse from a dict +domain_get_me_response_from_dict = DomainGetMeResponse.from_dict(domain_get_me_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) + + diff --git a/docs/DomainMetricsResponse.md b/docs/DomainMetricsResponse.md new file mode 100644 index 0000000..393d90b --- /dev/null +++ b/docs/DomainMetricsResponse.md @@ -0,0 +1,31 @@ +# DomainMetricsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dialog_count** | **int** | | [optional] +**message_count_per_day** | **int** | | [optional] +**messsage_count_per_month** | **int** | | [optional] + +## Example + +```python +from openapi_client.models.domain_metrics_response import DomainMetricsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainMetricsResponse from a JSON string +domain_metrics_response_instance = DomainMetricsResponse.from_json(json) +# print the JSON string representation of the object +print(DomainMetricsResponse.to_json()) + +# convert the object into a dict +domain_metrics_response_dict = domain_metrics_response_instance.to_dict() +# create an instance of DomainMetricsResponse from a dict +domain_metrics_response_from_dict = DomainMetricsResponse.from_dict(domain_metrics_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) + + diff --git a/docs/DomainPromptBlock.md b/docs/DomainPromptBlock.md new file mode 100644 index 0000000..ca04621 --- /dev/null +++ b/docs/DomainPromptBlock.md @@ -0,0 +1,30 @@ +# DomainPromptBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_prompt_block import DomainPromptBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainPromptBlock from a JSON string +domain_prompt_block_instance = DomainPromptBlock.from_json(json) +# print the JSON string representation of the object +print(DomainPromptBlock.to_json()) + +# convert the object into a dict +domain_prompt_block_dict = domain_prompt_block_instance.to_dict() +# create an instance of DomainPromptBlock from a dict +domain_prompt_block_from_dict = DomainPromptBlock.from_dict(domain_prompt_block_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) + + diff --git a/docs/DomainSuccessResponse.md b/docs/DomainSuccessResponse.md new file mode 100644 index 0000000..38eb491 --- /dev/null +++ b/docs/DomainSuccessResponse.md @@ -0,0 +1,29 @@ +# DomainSuccessResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] + +## Example + +```python +from openapi_client.models.domain_success_response import DomainSuccessResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DomainSuccessResponse from a JSON string +domain_success_response_instance = DomainSuccessResponse.from_json(json) +# print the JSON string representation of the object +print(DomainSuccessResponse.to_json()) + +# convert the object into a dict +domain_success_response_dict = domain_success_response_instance.to_dict() +# create an instance of DomainSuccessResponse from a dict +domain_success_response_from_dict = DomainSuccessResponse.from_dict(domain_success_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) + + diff --git a/docs/GetMeApi.md b/docs/GetMeApi.md new file mode 100644 index 0000000..b4c21dd --- /dev/null +++ b/docs/GetMeApi.md @@ -0,0 +1,86 @@ +# openapi_client.GetMeApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_me_get**](GetMeApi.md#get_me_get) | **GET** /get-me | Get company details + + +# **get_me_get** +> DomainGetMeResponse get_me_get() + +Get company details + +This endpoint returns details of a specific company by its tokeb in the database. + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_get_me_response import DomainGetMeResponse +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.GetMeApi(api_client) + + try: + # Get company details + api_response = api_instance.get_me_get() + print("The response of GetMeApi->get_me_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GetMeApi->get_me_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**DomainGetMeResponse**](DomainGetMeResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + diff --git a/docs/MetricsApi.md b/docs/MetricsApi.md new file mode 100644 index 0000000..c7088c3 --- /dev/null +++ b/docs/MetricsApi.md @@ -0,0 +1,86 @@ +# openapi_client.MetricsApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**metrics_get**](MetricsApi.md#metrics_get) | **GET** /metrics | Get company metrics + + +# **metrics_get** +> DomainMetricsResponse metrics_get() + +Get company metrics + +This endpoint returns metrics of a specific company by its token in the database. + +### Example + +* Api Key Authentication (BearerAuth): + +```python +import openapi_client +from openapi_client.models.domain_metrics_response import DomainMetricsResponse +from openapi_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( + 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 openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.MetricsApi(api_client) + + try: + # Get company metrics + api_response = api_instance.metrics_get() + print("The response of MetricsApi->metrics_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetricsApi->metrics_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**DomainMetricsResponse**](DomainMetricsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..769fa6b --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,803 @@ +{ + "schemes": [], + "swagger": "2.0", + "info": { + "description": "This API gives you the ability to interact with AISF's neural networks", + "title": "AISF API", + "contact": {}, + "version": "1.0" + }, + "host": "", + "basePath": "/api/v1", + "paths": { + "/chats": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all client chats of company.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chats" + ], + "summary": "Get all client chats of company", + "parameters": [ + { + "type": "integer", + "description": "Page number", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Limit of chats per page", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetChatsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + }, + "/company": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns a list of all companies in the database", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "company" + ], + "summary": "Returns a list of companies", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.Company" + } + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint creates a new company record in the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "company" + ], + "summary": "Adds a company to the database", + "parameters": [ + { + "description": "Company Create Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.CompanyCreateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.SuccessResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + }, + "patch": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint update a company record in the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "company" + ], + "summary": "Update a company in the database", + "parameters": [ + { + "description": "Company Update Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.CompanyUpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.SuccessResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + }, + "/company/{id}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns details of a specific company by its ID in the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "company" + ], + "summary": "Get company details", + "parameters": [ + { + "type": "string", + "description": "Company ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.Company" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint removes the company from the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "company" + ], + "summary": "Delete company from the database", + "parameters": [ + { + "type": "string", + "description": "Company ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.SuccessResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + }, + "/conversation": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint generates a response from an AI model based on the provided conversation.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ai" + ], + "summary": "Generate response from AI model", + "parameters": [ + { + "description": "Conversation Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/domain.ConversationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.ConversationResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + }, + "/get-me": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns details of a specific company by its tokeb in the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "get-me" + ], + "summary": "Get company details", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.GetMeResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + }, + "/metrics": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns metrics of a specific company by its token in the database.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "metrics" + ], + "summary": "Get company metrics", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/domain.MetricsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/domain.ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "domain.AIFunction": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/domain.AIFunctionParameters" + } + } + }, + "domain.AIFunctionCall": { + "type": "object", + "properties": { + "arguments": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "domain.AIFunctionParameterProperty": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "domain.AIFunctionParameters": { + "type": "object", + "properties": { + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/domain.AIFunctionParameterProperty" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + } + } + }, + "domain.AIMessage": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "domain.AITool": { + "type": "object", + "properties": { + "function": { + "$ref": "#/definitions/domain.AIFunctionCall" + }, + "id": { + "type": "string" + }, + "index": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "domain.ClientChat": { + "type": "object", + "properties": { + "client_id": { + "type": "integer" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ClientMessage" + } + } + } + }, + "domain.ClientMessage": { + "type": "object", + "properties": { + "client_id": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "date": { + "type": "string" + }, + "event_id": { + "type": "integer" + }, + "message_id": { + "type": "integer" + } + } + }, + "domain.Company": { + "type": "object", + "properties": { + "functions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.CompanyFunction" + } + }, + "id": { + "type": "string" + }, + "integration_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "prompt_blocks": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PromptBlock" + } + }, + "token": { + "type": "string" + } + } + }, + "domain.CompanyCreateRequest": { + "type": "object", + "required": [ + "integration_url", + "name", + "token" + ], + "properties": { + "functions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.CompanyFunction" + } + }, + "integration_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "prompt_blocks": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PromptBlock" + } + }, + "token": { + "type": "string" + } + } + }, + "domain.CompanyFunction": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "level": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "domain.CompanyUpdateRequest": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "functions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.CompanyFunction" + } + }, + "id": { + "type": "string" + }, + "integration_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "prompt_blocks": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PromptBlock" + } + }, + "token": { + "type": "string" + } + } + }, + "domain.ConversationRequest": { + "type": "object", + "required": [ + "messages", + "model" + ], + "properties": { + "functions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AIFunction" + } + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AIMessage" + } + }, + "model": { + "type": "string" + } + } + }, + "domain.ConversationResponse": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.AITool" + } + } + } + }, + "domain.ErrorResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "domain.GetChatsResponse": { + "type": "object", + "properties": { + "chats": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.ClientChat" + } + } + } + }, + "domain.GetMeResponse": { + "type": "object", + "properties": { + "functions": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.CompanyFunction" + } + }, + "id": { + "type": "string" + }, + "level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "prompt_blocks": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.PromptBlock" + } + } + } + }, + "domain.MetricsResponse": { + "type": "object", + "properties": { + "dialog_count": { + "type": "integer" + }, + "message_count_per_day": { + "type": "integer" + }, + "messsage_count_per_month": { + "type": "integer" + } + } + }, + "domain.PromptBlock": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "domain.SuccessResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "BearerAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..2f4612c --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.8.0" + } +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..784ef0b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "ai_core_api_client" +version = "1.0.0" +description = "AISF API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +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"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "ai_core_api_client", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cc85509 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..36abd94 --- /dev/null +++ b/setup.py @@ -0,0 +1,49 @@ +# 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 setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "openapi-client" +VERSION = "1.3.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="AISF API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "AISF API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + This API gives you the ability to interact with AISF's neural networks + """, # noqa: E501 + package_data={"ai_core_api_client": ["py.typed"]}, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..8e6d8cb --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,5 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_ai_api.py b/test/test_ai_api.py new file mode 100644 index 0000000..86f4a56 --- /dev/null +++ b/test/test_ai_api.py @@ -0,0 +1,38 @@ +# 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.api.ai_api import AiApi + + +class TestAiApi(unittest.TestCase): + """AiApi unit test stubs""" + + def setUp(self) -> None: + self.api = AiApi() + + def tearDown(self) -> None: + pass + + def test_conversation_post(self) -> None: + """Test case for conversation_post + + Generate response from AI model + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_chats_api.py b/test/test_chats_api.py new file mode 100644 index 0000000..423059b --- /dev/null +++ b/test/test_chats_api.py @@ -0,0 +1,38 @@ +# 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.api.chats_api import ChatsApi + + +class TestChatsApi(unittest.TestCase): + """ChatsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ChatsApi() + + def tearDown(self) -> None: + pass + + def test_chats_get(self) -> None: + """Test case for chats_get + + Get all client chats of company + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_company_api.py b/test/test_company_api.py new file mode 100644 index 0000000..f5065b3 --- /dev/null +++ b/test/test_company_api.py @@ -0,0 +1,59 @@ +# 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.api.company_api import CompanyApi + + +class TestCompanyApi(unittest.TestCase): + """CompanyApi unit test stubs""" + + def setUp(self) -> None: + self.api = CompanyApi() + + def tearDown(self) -> None: + pass + + def test_company_get(self) -> None: + """Test case for company_get + + Returns a list of companies + """ + pass + + def test_company_id_delete(self) -> None: + """Test case for company_id_delete + + Delete company from the database + """ + pass + + def test_company_id_get(self) -> None: + """Test case for company_id_get + + Get company details + """ + pass + + def test_company_post(self) -> None: + """Test case for company_post + + Adds a company to the database + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_function.py b/test/test_domain_ai_function.py new file mode 100644 index 0000000..7bc1fe1 --- /dev/null +++ b/test/test_domain_ai_function.py @@ -0,0 +1,62 @@ +# 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_ai_function import DomainAIFunction + +class TestDomainAIFunction(unittest.TestCase): + """DomainAIFunction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAIFunction: + """Test DomainAIFunction + 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 `DomainAIFunction` + """ + model = DomainAIFunction() + if include_optional: + return DomainAIFunction( + description = '', + name = '', + parameters = ai_core_api_client.models.domain/ai_function_parameters.domain.AIFunctionParameters( + properties = { + 'key' : ai_core_api_client.models.domain/ai_function_parameter_property.domain.AIFunctionParameterProperty( + description = '', + type = '', ) + }, + required = [ + '' + ], + type = '', ) + ) + else: + return DomainAIFunction( + ) + """ + + def testDomainAIFunction(self): + """Test DomainAIFunction""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_function_call.py b/test/test_domain_ai_function_call.py new file mode 100644 index 0000000..2f19cb5 --- /dev/null +++ b/test/test_domain_ai_function_call.py @@ -0,0 +1,52 @@ +# 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_ai_function_call import DomainAIFunctionCall + +class TestDomainAIFunctionCall(unittest.TestCase): + """DomainAIFunctionCall unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAIFunctionCall: + """Test DomainAIFunctionCall + 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 `DomainAIFunctionCall` + """ + model = DomainAIFunctionCall() + if include_optional: + return DomainAIFunctionCall( + arguments = '', + name = '' + ) + else: + return DomainAIFunctionCall( + ) + """ + + def testDomainAIFunctionCall(self): + """Test DomainAIFunctionCall""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_function_parameter_property.py b/test/test_domain_ai_function_parameter_property.py new file mode 100644 index 0000000..0b9fafa --- /dev/null +++ b/test/test_domain_ai_function_parameter_property.py @@ -0,0 +1,52 @@ +# 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_ai_function_parameter_property import DomainAIFunctionParameterProperty + +class TestDomainAIFunctionParameterProperty(unittest.TestCase): + """DomainAIFunctionParameterProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAIFunctionParameterProperty: + """Test DomainAIFunctionParameterProperty + 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 `DomainAIFunctionParameterProperty` + """ + model = DomainAIFunctionParameterProperty() + if include_optional: + return DomainAIFunctionParameterProperty( + description = '', + type = '' + ) + else: + return DomainAIFunctionParameterProperty( + ) + """ + + def testDomainAIFunctionParameterProperty(self): + """Test DomainAIFunctionParameterProperty""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_function_parameters.py b/test/test_domain_ai_function_parameters.py new file mode 100644 index 0000000..da2c3b3 --- /dev/null +++ b/test/test_domain_ai_function_parameters.py @@ -0,0 +1,59 @@ +# 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_ai_function_parameters import DomainAIFunctionParameters + +class TestDomainAIFunctionParameters(unittest.TestCase): + """DomainAIFunctionParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAIFunctionParameters: + """Test DomainAIFunctionParameters + 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 `DomainAIFunctionParameters` + """ + model = DomainAIFunctionParameters() + if include_optional: + return DomainAIFunctionParameters( + properties = { + 'key' : ai_core_api_client.models.domain/ai_function_parameter_property.domain.AIFunctionParameterProperty( + description = '', + type = '', ) + }, + required = [ + '' + ], + type = '' + ) + else: + return DomainAIFunctionParameters( + ) + """ + + def testDomainAIFunctionParameters(self): + """Test DomainAIFunctionParameters""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_message.py b/test/test_domain_ai_message.py new file mode 100644 index 0000000..cf9f17f --- /dev/null +++ b/test/test_domain_ai_message.py @@ -0,0 +1,52 @@ +# 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_ai_message import DomainAIMessage + +class TestDomainAIMessage(unittest.TestCase): + """DomainAIMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAIMessage: + """Test DomainAIMessage + 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 `DomainAIMessage` + """ + model = DomainAIMessage() + if include_optional: + return DomainAIMessage( + content = '', + role = '' + ) + else: + return DomainAIMessage( + ) + """ + + def testDomainAIMessage(self): + """Test DomainAIMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_ai_tool.py b/test/test_domain_ai_tool.py new file mode 100644 index 0000000..eb15d46 --- /dev/null +++ b/test/test_domain_ai_tool.py @@ -0,0 +1,56 @@ +# 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_ai_tool import DomainAITool + +class TestDomainAITool(unittest.TestCase): + """DomainAITool unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainAITool: + """Test DomainAITool + 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 `DomainAITool` + """ + model = DomainAITool() + if include_optional: + return DomainAITool( + function = ai_core_api_client.models.domain/ai_function_call.domain.AIFunctionCall( + arguments = '', + name = '', ), + id = '', + index = 56, + type = '' + ) + else: + return DomainAITool( + ) + """ + + def testDomainAITool(self): + """Test DomainAITool""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_client_chat.py b/test/test_domain_client_chat.py new file mode 100644 index 0000000..5ae054b --- /dev/null +++ b/test/test_domain_client_chat.py @@ -0,0 +1,59 @@ +# 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_client_chat import DomainClientChat + +class TestDomainClientChat(unittest.TestCase): + """DomainClientChat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainClientChat: + """Test DomainClientChat + 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 `DomainClientChat` + """ + model = DomainClientChat() + if include_optional: + return DomainClientChat( + client_id = 56, + messages = [ + openapi_client.models.domain/client_message.domain.ClientMessage( + client_id = 56, + content = '', + date = '', + event_id = 56, + message_id = 56, ) + ] + ) + else: + return DomainClientChat( + ) + """ + + def testDomainClientChat(self): + """Test DomainClientChat""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_client_message.py b/test/test_domain_client_message.py new file mode 100644 index 0000000..4d70c36 --- /dev/null +++ b/test/test_domain_client_message.py @@ -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_client_message import DomainClientMessage + +class TestDomainClientMessage(unittest.TestCase): + """DomainClientMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainClientMessage: + """Test DomainClientMessage + 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 `DomainClientMessage` + """ + model = DomainClientMessage() + if include_optional: + return DomainClientMessage( + client_id = 56, + content = '', + var_date = '', + event_id = 56, + message_id = 56 + ) + else: + return DomainClientMessage( + ) + """ + + def testDomainClientMessage(self): + """Test DomainClientMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_company.py b/test/test_domain_company.py new file mode 100644 index 0000000..0c55ad1 --- /dev/null +++ b/test/test_domain_company.py @@ -0,0 +1,53 @@ +# 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_company import DomainCompany + +class TestDomainCompany(unittest.TestCase): + """DomainCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainCompany: + """Test DomainCompany + 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 `DomainCompany` + """ + model = DomainCompany() + if include_optional: + return DomainCompany( + id = '', + name = '', + token = '' + ) + else: + return DomainCompany( + ) + """ + + def testDomainCompany(self): + """Test DomainCompany""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_company_create_request.py b/test/test_domain_company_create_request.py new file mode 100644 index 0000000..d25dfa2 --- /dev/null +++ b/test/test_domain_company_create_request.py @@ -0,0 +1,67 @@ +# 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_company_create_request import DomainCompanyCreateRequest + +class TestDomainCompanyCreateRequest(unittest.TestCase): + """DomainCompanyCreateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainCompanyCreateRequest: + """Test DomainCompanyCreateRequest + 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 `DomainCompanyCreateRequest` + """ + model = DomainCompanyCreateRequest() + if include_optional: + return DomainCompanyCreateRequest( + functions = [ + openapi_client.models.domain/company_function.domain.CompanyFunction( + description = '', + level = 56, + name = '', ) + ], + integration_url = '', + name = '', + prompt_blocks = [ + openapi_client.models.domain/prompt_block.domain.PromptBlock( + content = '', + name = '', ) + ], + token = '' + ) + else: + return DomainCompanyCreateRequest( + integration_url = '', + name = '', + token = '', + ) + """ + + def testDomainCompanyCreateRequest(self): + """Test DomainCompanyCreateRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_company_function.py b/test/test_domain_company_function.py new file mode 100644 index 0000000..e366612 --- /dev/null +++ b/test/test_domain_company_function.py @@ -0,0 +1,53 @@ +# 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_company_function import DomainCompanyFunction + +class TestDomainCompanyFunction(unittest.TestCase): + """DomainCompanyFunction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainCompanyFunction: + """Test DomainCompanyFunction + 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 `DomainCompanyFunction` + """ + model = DomainCompanyFunction() + if include_optional: + return DomainCompanyFunction( + description = '', + level = 56, + name = '' + ) + else: + return DomainCompanyFunction( + ) + """ + + def testDomainCompanyFunction(self): + """Test DomainCompanyFunction""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_company_request.py b/test/test_domain_company_request.py new file mode 100644 index 0000000..b7acba3 --- /dev/null +++ b/test/test_domain_company_request.py @@ -0,0 +1,54 @@ +# 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_company_request import DomainCompanyRequest + +class TestDomainCompanyRequest(unittest.TestCase): + """DomainCompanyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainCompanyRequest: + """Test DomainCompanyRequest + 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 `DomainCompanyRequest` + """ + model = DomainCompanyRequest() + if include_optional: + return DomainCompanyRequest( + name = '', + token = '' + ) + else: + return DomainCompanyRequest( + name = '', + token = '', + ) + """ + + def testDomainCompanyRequest(self): + """Test DomainCompanyRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_company_update_request.py b/test/test_domain_company_update_request.py new file mode 100644 index 0000000..8c5057c --- /dev/null +++ b/test/test_domain_company_update_request.py @@ -0,0 +1,66 @@ +# 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_company_update_request import DomainCompanyUpdateRequest + +class TestDomainCompanyUpdateRequest(unittest.TestCase): + """DomainCompanyUpdateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainCompanyUpdateRequest: + """Test DomainCompanyUpdateRequest + 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 `DomainCompanyUpdateRequest` + """ + model = DomainCompanyUpdateRequest() + if include_optional: + return DomainCompanyUpdateRequest( + functions = [ + openapi_client.models.domain/company_function.domain.CompanyFunction( + description = '', + level = 56, + name = '', ) + ], + id = '', + integration_url = '', + name = '', + prompt_blocks = [ + openapi_client.models.domain/prompt_block.domain.PromptBlock( + content = '', + name = '', ) + ], + token = '' + ) + else: + return DomainCompanyUpdateRequest( + id = '', + ) + """ + + def testDomainCompanyUpdateRequest(self): + """Test DomainCompanyUpdateRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_conversation_request.py b/test/test_domain_conversation_request.py new file mode 100644 index 0000000..db997a2 --- /dev/null +++ b/test/test_domain_conversation_request.py @@ -0,0 +1,77 @@ +# 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_conversation_request import DomainConversationRequest + +class TestDomainConversationRequest(unittest.TestCase): + """DomainConversationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainConversationRequest: + """Test DomainConversationRequest + 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 `DomainConversationRequest` + """ + model = DomainConversationRequest() + if include_optional: + return DomainConversationRequest( + functions = [ + ai_core_api_client.models.domain/ai_function.domain.AIFunction( + description = '', + name = '', + parameters = ai_core_api_client.models.domain/ai_function_parameters.domain.AIFunctionParameters( + properties = { + 'key' : ai_core_api_client.models.domain/ai_function_parameter_property.domain.AIFunctionParameterProperty( + description = '', + type = '', ) + }, + required = [ + '' + ], + type = '', ), ) + ], + messages = [ + ai_core_api_client.models.domain/ai_message.domain.AIMessage( + content = '', + role = '', ) + ], + model = '' + ) + else: + return DomainConversationRequest( + messages = [ + ai_core_api_client.models.domain/ai_message.domain.AIMessage( + content = '', + role = '', ) + ], + model = '', + ) + """ + + def testDomainConversationRequest(self): + """Test DomainConversationRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_conversation_response.py b/test/test_domain_conversation_response.py new file mode 100644 index 0000000..3a38daa --- /dev/null +++ b/test/test_domain_conversation_response.py @@ -0,0 +1,60 @@ +# 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_conversation_response import DomainConversationResponse + +class TestDomainConversationResponse(unittest.TestCase): + """DomainConversationResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainConversationResponse: + """Test DomainConversationResponse + 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 `DomainConversationResponse` + """ + model = DomainConversationResponse() + if include_optional: + return DomainConversationResponse( + content = '', + tools = [ + ai_core_api_client.models.domain/ai_tool.domain.AITool( + function = ai_core_api_client.models.domain/ai_function_call.domain.AIFunctionCall( + arguments = '', + name = '', ), + id = '', + index = 56, + type = '', ) + ] + ) + else: + return DomainConversationResponse( + ) + """ + + def testDomainConversationResponse(self): + """Test DomainConversationResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_error_response.py b/test/test_domain_error_response.py new file mode 100644 index 0000000..acd8e37 --- /dev/null +++ b/test/test_domain_error_response.py @@ -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_error_response import DomainErrorResponse + +class TestDomainErrorResponse(unittest.TestCase): + """DomainErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainErrorResponse: + """Test DomainErrorResponse + 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 `DomainErrorResponse` + """ + model = DomainErrorResponse() + if include_optional: + return DomainErrorResponse( + message = '' + ) + else: + return DomainErrorResponse( + ) + """ + + def testDomainErrorResponse(self): + """Test DomainErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_get_chats_response.py b/test/test_domain_get_chats_response.py new file mode 100644 index 0000000..d86e3e2 --- /dev/null +++ b/test/test_domain_get_chats_response.py @@ -0,0 +1,62 @@ +# 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_get_chats_response import DomainGetChatsResponse + +class TestDomainGetChatsResponse(unittest.TestCase): + """DomainGetChatsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainGetChatsResponse: + """Test DomainGetChatsResponse + 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 `DomainGetChatsResponse` + """ + model = DomainGetChatsResponse() + if include_optional: + return DomainGetChatsResponse( + chats = [ + openapi_client.models.domain/client_chat.domain.ClientChat( + client_id = 56, + messages = [ + openapi_client.models.domain/client_message.domain.ClientMessage( + client_id = 56, + content = '', + date = '', + event_id = 56, + message_id = 56, ) + ], ) + ] + ) + else: + return DomainGetChatsResponse( + ) + """ + + def testDomainGetChatsResponse(self): + """Test DomainGetChatsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_get_me_response.py b/test/test_domain_get_me_response.py new file mode 100644 index 0000000..e0a407b --- /dev/null +++ b/test/test_domain_get_me_response.py @@ -0,0 +1,64 @@ +# 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_get_me_response import DomainGetMeResponse + +class TestDomainGetMeResponse(unittest.TestCase): + """DomainGetMeResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainGetMeResponse: + """Test DomainGetMeResponse + 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 `DomainGetMeResponse` + """ + model = DomainGetMeResponse() + if include_optional: + return DomainGetMeResponse( + functions = [ + openapi_client.models.domain/company_function.domain.CompanyFunction( + description = '', + level = 56, + name = '', ) + ], + id = '', + level = 56, + name = '', + prompt_blocks = [ + openapi_client.models.domain/prompt_block.domain.PromptBlock( + content = '', + name = '', ) + ] + ) + else: + return DomainGetMeResponse( + ) + """ + + def testDomainGetMeResponse(self): + """Test DomainGetMeResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_metrics_response.py b/test/test_domain_metrics_response.py new file mode 100644 index 0000000..813bb07 --- /dev/null +++ b/test/test_domain_metrics_response.py @@ -0,0 +1,53 @@ +# 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_metrics_response import DomainMetricsResponse + +class TestDomainMetricsResponse(unittest.TestCase): + """DomainMetricsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainMetricsResponse: + """Test DomainMetricsResponse + 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 `DomainMetricsResponse` + """ + model = DomainMetricsResponse() + if include_optional: + return DomainMetricsResponse( + dialog_count = 56, + message_count_per_day = 56, + messsage_count_per_month = 56 + ) + else: + return DomainMetricsResponse( + ) + """ + + def testDomainMetricsResponse(self): + """Test DomainMetricsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_prompt_block.py b/test/test_domain_prompt_block.py new file mode 100644 index 0000000..2203129 --- /dev/null +++ b/test/test_domain_prompt_block.py @@ -0,0 +1,52 @@ +# 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_block import DomainPromptBlock + +class TestDomainPromptBlock(unittest.TestCase): + """DomainPromptBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainPromptBlock: + """Test DomainPromptBlock + 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 `DomainPromptBlock` + """ + model = DomainPromptBlock() + if include_optional: + return DomainPromptBlock( + content = '', + name = '' + ) + else: + return DomainPromptBlock( + ) + """ + + def testDomainPromptBlock(self): + """Test DomainPromptBlock""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_domain_success_response.py b/test/test_domain_success_response.py new file mode 100644 index 0000000..b6b8642 --- /dev/null +++ b/test/test_domain_success_response.py @@ -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_success_response import DomainSuccessResponse + +class TestDomainSuccessResponse(unittest.TestCase): + """DomainSuccessResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DomainSuccessResponse: + """Test DomainSuccessResponse + 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 `DomainSuccessResponse` + """ + model = DomainSuccessResponse() + if include_optional: + return DomainSuccessResponse( + message = '' + ) + else: + return DomainSuccessResponse( + ) + """ + + def testDomainSuccessResponse(self): + """Test DomainSuccessResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_me_api.py b/test/test_get_me_api.py new file mode 100644 index 0000000..1066d5a --- /dev/null +++ b/test/test_get_me_api.py @@ -0,0 +1,38 @@ +# 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.api.get_me_api import GetMeApi + + +class TestGetMeApi(unittest.TestCase): + """GetMeApi unit test stubs""" + + def setUp(self) -> None: + self.api = GetMeApi() + + def tearDown(self) -> None: + pass + + def test_get_me_get(self) -> None: + """Test case for get_me_get + + Get company details + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_metrics_api.py b/test/test_metrics_api.py new file mode 100644 index 0000000..3ee166f --- /dev/null +++ b/test/test_metrics_api.py @@ -0,0 +1,38 @@ +# 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.api.metrics_api import MetricsApi + + +class TestMetricsApi(unittest.TestCase): + """MetricsApi unit test stubs""" + + def setUp(self) -> None: + self.api = MetricsApi() + + def tearDown(self) -> None: + pass + + def test_metrics_get(self) -> None: + """Test case for metrics_get + + Get company metrics + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2dd1e5e --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=ai_core_api_client