Skip to main content

IvyCheck Python Client SDK

Project description

IvyCheck-SDK

SDK Installation

pip install ivycheck

SDK Example Usage

Example

import ivycheck

ivy = ivycheck.Ivycheck(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)


res = ivy.prompts.complete(
    project_id='d4c3d02b-0b2b-40ab-bae4-c267f5109d00',
    prompt_version=1,
    stream=False,
    request_body={"your_input_field_1": "some_value", ...})

Available Resources and Operations

prompts

tests

evaluations

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.

Error Object Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4x-5xx /

Example

import ivycheck

s = ivycheck.Ivycheck(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)


res = None
try:
    res = s.prompts.complete(project_id='d4c3d02b-0b2b-40ab-bae4-c267f5109d00', prompt_version=77884, stream=False, request_body=ivycheck.CompleteFieldValues())
except models.HTTPValidationError as e:
    print(e)  # handle exception
    raise(e)
except models.SDKError as e:
    print(e)  # handle exception
    raise(e)

if res.completion_response is not None:
    # handle response
    pass

Server Selection

Select Server by Name

You can override the default server globally by passing a server name to the server: str optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

Name Server Variables
prod https://ivycheck-backend.onrender.com None
sandbox http://localhost:8000 None

Example

import ivycheck

s = ivycheck.Ivycheck(
    server="sandbox",
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.prompts.complete(project_id='d4c3d02b-0b2b-40ab-bae4-c267f5109d00', prompt_version=77884, stream=False, request_body=ivycheck.CompleteFieldValues())

if res.completion_response is not None:
    # handle response
    pass

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:

import ivycheck

s = ivycheck.Ivycheck(
    server_url="https://ivycheck-backend.onrender.com",
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.prompts.complete(project_id='d4c3d02b-0b2b-40ab-bae4-c267f5109d00', prompt_version=77884, stream=False, request_body=ivycheck.CompleteFieldValues())

if res.completion_response is not None:
    # handle response
    pass

Custom HTTP Client

The Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session object.

For example, you could specify a header for every request that this sdk makes as follows:

import ivycheck
import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = ivycheck.Ivycheck(client: http_client)

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
api_key http HTTP Bearer

To authenticate with the API the api_key parameter must be set when initializing the SDK client instance. For example:

import ivycheck

s = ivycheck.Ivycheck(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.prompts.complete(project_id='d4c3d02b-0b2b-40ab-bae4-c267f5109d00', prompt_version=77884, stream=False, request_body=ivycheck.CompleteFieldValues())

if res.completion_response is not None:
    # handle response
    pass

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ivycheck-0.4.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ivycheck-0.4.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file ivycheck-0.4.1.tar.gz.

File metadata

  • Download URL: ivycheck-0.4.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for ivycheck-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a91611a3d2c4f361a31ddf10f43200ad48d20df786e0b19e6cf5f478669efb2a
MD5 0d0a778a6af49d9c8016ed8fc12b8653
BLAKE2b-256 44f8208a75e9c8a8f20f344b133544fb5b99365c98862bc6b5c9ba83e38d66e7

See more details on using hashes here.

File details

Details for the file ivycheck-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ivycheck-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for ivycheck-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87081a3ba72dee2ced2de23e62415eecca3b47d8a417019c32ae5c8162758ccb
MD5 4bf30f3a64102f72e19183a12f470f49
BLAKE2b-256 517e91b5fe73fb79bd2090698391648d558ed133c800b69bdf2e11310010af95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page