From 5c14063737089e28dae0205f533e01e0c53ffb63 Mon Sep 17 00:00:00 2001 From: James E T Smith Date: Mon, 21 Apr 2025 17:03:03 -0400 Subject: [PATCH 1/8] Update README.md with new API request link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad33033..681ceb5 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The documentation for the API can be found at our [Read the Docs site here](http ## Getting API access -Access is currently in closed Beta. Please reach out to in order to request access to our system. +Access is currently in closed Beta. Please reach out to through [this link](https://www.qognitive.io/api-request) in order to request access to our system. ## Support From 521dcab755bcf5dd3cf53b2d1a6a7606dbae2526 Mon Sep 17 00:00:00 2001 From: James E T Smith Date: Mon, 21 Apr 2025 17:05:25 -0400 Subject: [PATCH 2/8] Update index.rst --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 5e0548a..eb0ea00 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -59,6 +59,6 @@ If you are interested in learning more about the algorithm then we'd suggest you How do I get access? -------------------- -Currently to get access you should contact us at support@qognitive.io and we can provision you with an account and an API key. +Currently to get access you should contact us via `our website `_ and we can provision you with an account and an API key. From d1048877216460abf544addd21e44722a652a7a3 Mon Sep 17 00:00:00 2001 From: James E T Smith Date: Mon, 21 Apr 2025 17:25:07 -0400 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 681ceb5..0ef8d86 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The documentation for the API can be found at our [Read the Docs site here](http ## Getting API access -Access is currently in closed Beta. Please reach out to through [this link](https://www.qognitive.io/api-request) in order to request access to our system. +Access is currently in closed Beta. Please reach out through [this link](https://www.qognitive.io/api-request) in order to request access to our system. ## Support From 4a621def95e1b7a3e4c7cdfe66a96b6fb7c06c14 Mon Sep 17 00:00:00 2001 From: Francesco Vertemati Date: Tue, 22 Apr 2025 08:15:26 -0400 Subject: [PATCH 4/8] fix wrong build name; --- qcog_python_client/schema/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcog_python_client/schema/__init__.py b/qcog_python_client/schema/__init__.py index 8b4164b..eb7d065 100644 --- a/qcog_python_client/schema/__init__.py +++ b/qcog_python_client/schema/__init__.py @@ -25,7 +25,7 @@ ModelGeneralParameters, ModelPauliParameters, NPEIGHStateParameters, - OptimizationMethodModel, + OptimizationMethod, PowerIterStateParameters, TrainingStatus, ) From 2d5200364413c50229aac7af3c33fcc508888aee Mon Sep 17 00:00:00 2001 From: Francesco Vertemati Date: Thu, 24 Jul 2025 11:37:41 -0400 Subject: [PATCH 5/8] skip validation --- qcog_python_client/qcog/_data_uploader.py | 10 ++++++++-- qcog_python_client/qcog/_httpclient.py | 5 +++++ qcog_python_client/qcog/qcogasync.py | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/qcog_python_client/qcog/_data_uploader.py b/qcog_python_client/qcog/_data_uploader.py index 960973b..b5fd831 100644 --- a/qcog_python_client/qcog/_data_uploader.py +++ b/qcog_python_client/qcog/_data_uploader.py @@ -18,8 +18,9 @@ class DataClient(IDataClient): Current implementation that relies on a classic http post request. """ - def __init__(self, http_client: IRequestClient) -> None: + def __init__(self, http_client: IRequestClient, *, ssl: bool = True) -> None: self.http_client = http_client + self.ssl = ssl async def upload_data(self, data: DataFrame) -> dict: data_payload = DatasetPayload( @@ -67,7 +68,12 @@ async def stream_data( try: async with aiohttp.ClientSession() as session: - async with session.post(url, headers=headers, data=form) as response: + async with session.post( + url, + headers=headers, + data=form, + ssl=self.ssl, + ) as response: response.raise_for_status() data_: dict = await response.json() return data_ diff --git a/qcog_python_client/qcog/_httpclient.py b/qcog_python_client/qcog/_httpclient.py index ecf6ea9..4d6a9d6 100644 --- a/qcog_python_client/qcog/_httpclient.py +++ b/qcog_python_client/qcog/_httpclient.py @@ -35,6 +35,7 @@ def __init__( port: int = 443, api_version: str = "v1", retries: int = 3, + ssl: bool = True, ): """HTTP client constructor. @@ -68,6 +69,7 @@ def __init__( base_url: str = f"{protocol}://{self.hostname}:{self.port}" self.url: str = f"{base_url}/api/{self.api_version}" self.retries: int = retries + self.ssl: bool = ssl class RequestClient(_HTTPClient, IRequestClient): @@ -138,6 +140,7 @@ async def _request_retry( method.value, uri, data=data, + ssl=self.ssl, ) elif is_json: @@ -145,12 +148,14 @@ async def _request_retry( method.value, uri, json=data, + ssl=self.ssl, ) elif data is None and method == HttpMethod.get: resp = await session.request( method.value, uri, + ssl=self.ssl, ) else: diff --git a/qcog_python_client/qcog/qcogasync.py b/qcog_python_client/qcog/qcogasync.py index 3f616a9..275ce83 100644 --- a/qcog_python_client/qcog/qcogasync.py +++ b/qcog_python_client/qcog/qcogasync.py @@ -41,6 +41,7 @@ async def create( version: str = DEFAULT_QCOG_VERSION, httpclient: IRequestClient | None = None, dataclient: IDataClient | None = None, + ssl: bool = True, ) -> AsyncQcogClient: """Instantiate a new Qcog client. @@ -77,9 +78,10 @@ async def create( hostname=hostname, port=port, api_version=api_version, + ssl=ssl, ) - client.data_client = dataclient or DataClient(client.http_client) + client.data_client = dataclient or DataClient(client.http_client, ssl=ssl) if safe_mode: await client.http_client.get("status") From 1ae21ee1eda621e1327aae6564a78129a943c5aa Mon Sep 17 00:00:00 2001 From: Francesco Vertemati Date: Thu, 24 Jul 2025 11:38:44 -0400 Subject: [PATCH 6/8] format --- qcog_python_client/qcog/_httpclient.py | 2 ++ qcog_python_client/qcog/qcogasync.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qcog_python_client/qcog/_httpclient.py b/qcog_python_client/qcog/_httpclient.py index 4d6a9d6..06b5c7c 100644 --- a/qcog_python_client/qcog/_httpclient.py +++ b/qcog_python_client/qcog/_httpclient.py @@ -54,6 +54,8 @@ def __init__( the "vX" part of the url for the api version retries: int number of attempts in cases of bad gateway + ssl : bool + if true uses ssl for the http client """ self.token: str = token if isinstance(token, str) else self.TOKEN diff --git a/qcog_python_client/qcog/qcogasync.py b/qcog_python_client/qcog/qcogasync.py index 275ce83..1f66309 100644 --- a/qcog_python_client/qcog/qcogasync.py +++ b/qcog_python_client/qcog/qcogasync.py @@ -69,6 +69,8 @@ async def create( an optional http client to use instead of the default dataclient : ABCDataClient | None an optional data client to use instead of the default + ssl : bool + if true uses ssl for the http client """ client = cls() From b7bd535bc9b263cbc5eccaffd9bf4cbbd8e6a230 Mon Sep 17 00:00:00 2001 From: Francesco Vertemati Date: Thu, 24 Jul 2025 11:44:41 -0400 Subject: [PATCH 7/8] update --- schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema.py b/schema.py index 3c171cf..5feb621 100644 --- a/schema.py +++ b/schema.py @@ -40,7 +40,7 @@ class Settings(BaseSettings): out_dir: str = Field("qcog_python_client/schema/generated_schema/", alias="OUT_DIR") module_name: str = Field("models", alias="MODULE_NAME") openapi_source: Url = Field( - "https://dev.qognitive.io/openapi.json", alias="OPENAPI_SOURCE" + "https://orchestrationapi-lb-204795732.us-east-2.elb.amazonaws.com/openapi.json", alias="OPENAPI_SOURCE" ) schema_name: str = Field("schema", alias="SCHEMA_NAME") delete_after: bool = Field(True, alias="DELETE_AFTER") @@ -51,7 +51,7 @@ def pull_openapi_schema(from_source: str, schemafile_name: str) -> str: Generate a new schema.json file from the source at the given address. """ - response = requests.get(from_source, timeout=10) + response = requests.get(from_source, timeout=10, verify=False) schema_path = os.path.join(os.getcwd(), schemafile_name) with open(schema_path, "w") as f: From c78cd31748b81a8bb7ac7a10c065a512d8aa69ca Mon Sep 17 00:00:00 2001 From: Francesco Vertemati Date: Thu, 24 Jul 2025 11:46:20 -0400 Subject: [PATCH 8/8] format --- schema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema.py b/schema.py index 5feb621..ba551e0 100644 --- a/schema.py +++ b/schema.py @@ -40,7 +40,8 @@ class Settings(BaseSettings): out_dir: str = Field("qcog_python_client/schema/generated_schema/", alias="OUT_DIR") module_name: str = Field("models", alias="MODULE_NAME") openapi_source: Url = Field( - "https://orchestrationapi-lb-204795732.us-east-2.elb.amazonaws.com/openapi.json", alias="OPENAPI_SOURCE" + "https://orchestrationapi-lb-204795732.us-east-2.elb.amazonaws.com/openapi.json", + alias="OPENAPI_SOURCE", ) schema_name: str = Field("schema", alias="SCHEMA_NAME") delete_after: bool = Field(True, alias="DELETE_AFTER")