log10py


Namelog10py JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/log10-io/log10py.git
SummaryPython Client SDK Generated by Speakeasy
upload_time2024-07-17 18:48:02
maintainerNone
docs_urlNone
authorSpeakeasy
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # log10py

<div align="left">
    <a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
    <a href="https://opensource.org/licenses/MIT">
        <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
    </a>
</div>


## 🏗 **Welcome to your new SDK!** 🏗

It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)
- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)
- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/advanced-setup/publish-sdks)
- [ ] ✨ When ready to productionize, delete this section from the README

<!-- Start SDK Installation [installation] -->
## SDK Installation

```bash
pip install log10py
```
<!-- End SDK Installation [installation] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
import log10

s = log10.Log10(
    log10_token="<YOUR_API_KEY_HERE>",
)


res = s.sessions.create(x_log10_organization='<value>')

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

```
<!-- End SDK Example Usage [usage] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

### [completions](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md)

* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#create) - Create a completion
* [update](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#update) - Update completion by id.
* [list_ungraded](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#list_ungraded) - List ungraded completions i.e. completions that have not been associated with feedback but matches task selector.

### [sessions](https://github.com/log10-io/log10py/blob/master/docs/sdks/sessions/README.md)

* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/sessions/README.md#create) - Create a session

### [feedback](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md)

* [get](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#get) - Fetch feedback by id.
* [list](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#list) - List feedback
* [upload](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#upload) - Upload a piece of feedback

### [feedback_tasks](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md)

* [list](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#list) - List feedback tasks.
* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#create) - Create a new task.
* [get](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#get) - Retrieves feedback task `taskId`.
<!-- End Available Resources and Operations [operations] -->

<!-- Start Global Parameters [global-parameters] -->
## Global Parameters

A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.

For example, you can set `X-Log10-Organization` to `'<value>'` at SDK initialization and then you do not have to pass the same value on calls to operations like `update`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.


### Available Globals

The following global parameter is available.

| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| x_log10_organization | str |  | The x_log10_organization parameter. |


### Example

```python
import log10
from log10.models import components

s = log10.Log10(
    log10_token="<YOUR_API_KEY_HERE>",
)


res = s.completions.update(completion_id='<value>', completion=components.Completion(
    organization_id='<value>',
    request=components.CreateChatCompletionRequest(
        messages=[
            components.ChatCompletionRequestFunctionMessage(
                role=components.ChatCompletionRole.SYSTEM,
                content='<value>',
                name='<value>',
            ),
        ],
        model='gpt-4-turbo',
        n=1,
        response_format=components.ResponseFormat(
            type=components.CreateChatCompletionRequestType.JSON_OBJECT,
        ),
        temperature=1,
        top_p=1,
        user='user-1234',
    ),
    response=components.CreateChatCompletionResponse(
        id='<id>',
        choices=[
            components.Choices(
                finish_reason=components.FinishReason.TOOL_CALLS,
                index=15652,
                message=components.ChatCompletionResponseMessage(
                    content='<value>',
                    role=components.ChatCompletionRole.USER,
                ),
                logprobs=components.Logprobs(
                    content=[
                        components.ChatCompletionTokenLogprob(
                            token='<value>',
                            logprob=7084.55,
                            bytes=[
                                991464,
                            ],
                            top_logprobs=[
                                components.TopLogprobs(
                                    token='<value>',
                                    logprob=2703.24,
                                    bytes=[
                                        627690,
                                    ],
                                ),
                            ],
                        ),
                    ],
                ),
            ),
        ],
        created=684199,
        model='gpt-4-turbo',
        object=components.Object.CHAT_COMPLETION,
    ),
), x_log10_organization='<value>')

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

```
<!-- End Global Parameters [global-parameters] -->

<!-- Start Error Handling [errors] -->
## 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    |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx         | */*             |

### Example

```python
import log10
from log10.models import components, errors

s = log10.Log10(
    log10_token="<YOUR_API_KEY_HERE>",
)

res = None
try:
    res = s.completions.create(completion=components.Completion(
    organization_id='<value>',
    request=components.CreateChatCompletionRequest(
        messages=[
            components.ChatCompletionRequestAssistantMessage(
                role=components.ChatCompletionRole.ASSISTANT,
            ),
        ],
        model='gpt-4-turbo',
        n=1,
        response_format=components.ResponseFormat(
            type=components.CreateChatCompletionRequestType.JSON_OBJECT,
        ),
        temperature=1,
        top_p=1,
        user='user-1234',
    ),
    response=components.CreateChatCompletionResponse(
        id='<id>',
        choices=[
            components.Choices(
                finish_reason=components.FinishReason.CONTENT_FILTER,
                index=859213,
                message=components.ChatCompletionResponseMessage(
                    content='<value>',
                    role=components.ChatCompletionRole.ASSISTANT,
                ),
                logprobs=components.Logprobs(
                    content=[
                        components.ChatCompletionTokenLogprob(
                            token='<value>',
                            logprob=2884.08,
                            bytes=[
                                134365,
                            ],
                            top_logprobs=[
                                components.TopLogprobs(
                                    token='<value>',
                                    logprob=7865.46,
                                    bytes=[
                                        69025,
                                    ],
                                ),
                            ],
                        ),
                    ],
                ),
            ),
        ],
        created=996706,
        model='gpt-4-turbo',
        object=components.Object.CHAT_COMPLETION,
    ),
), x_log10_organization='<value>')

except errors.SDKError as e:
    # handle exception
    raise(e)

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

```
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `server_idx: int` 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 indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://log10.io` | None |

#### Example

```python
import log10
from log10.models import components

s = log10.Log10(
    server_idx=0,
    log10_token="<YOUR_API_KEY_HERE>",
)


res = s.completions.create(completion=components.Completion(
    organization_id='<value>',
    request=components.CreateChatCompletionRequest(
        messages=[
            components.ChatCompletionRequestAssistantMessage(
                role=components.ChatCompletionRole.ASSISTANT,
            ),
        ],
        model='gpt-4-turbo',
        n=1,
        response_format=components.ResponseFormat(
            type=components.CreateChatCompletionRequestType.JSON_OBJECT,
        ),
        temperature=1,
        top_p=1,
        user='user-1234',
    ),
    response=components.CreateChatCompletionResponse(
        id='<id>',
        choices=[
            components.Choices(
                finish_reason=components.FinishReason.CONTENT_FILTER,
                index=859213,
                message=components.ChatCompletionResponseMessage(
                    content='<value>',
                    role=components.ChatCompletionRole.ASSISTANT,
                ),
                logprobs=components.Logprobs(
                    content=[
                        components.ChatCompletionTokenLogprob(
                            token='<value>',
                            logprob=2884.08,
                            bytes=[
                                134365,
                            ],
                            top_logprobs=[
                                components.TopLogprobs(
                                    token='<value>',
                                    logprob=7865.46,
                                    bytes=[
                                        69025,
                                    ],
                                ),
                            ],
                        ),
                    ],
                ),
            ),
        ],
        created=996706,
        model='gpt-4-turbo',
        object=components.Object.CHAT_COMPLETION,
    ),
), x_log10_organization='<value>')

if res.any 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:
```python
import log10
from log10.models import components

s = log10.Log10(
    server_url="https://log10.io",
    log10_token="<YOUR_API_KEY_HERE>",
)


res = s.completions.create(completion=components.Completion(
    organization_id='<value>',
    request=components.CreateChatCompletionRequest(
        messages=[
            components.ChatCompletionRequestAssistantMessage(
                role=components.ChatCompletionRole.ASSISTANT,
            ),
        ],
        model='gpt-4-turbo',
        n=1,
        response_format=components.ResponseFormat(
            type=components.CreateChatCompletionRequestType.JSON_OBJECT,
        ),
        temperature=1,
        top_p=1,
        user='user-1234',
    ),
    response=components.CreateChatCompletionResponse(
        id='<id>',
        choices=[
            components.Choices(
                finish_reason=components.FinishReason.CONTENT_FILTER,
                index=859213,
                message=components.ChatCompletionResponseMessage(
                    content='<value>',
                    role=components.ChatCompletionRole.ASSISTANT,
                ),
                logprobs=components.Logprobs(
                    content=[
                        components.ChatCompletionTokenLogprob(
                            token='<value>',
                            logprob=2884.08,
                            bytes=[
                                134365,
                            ],
                            top_logprobs=[
                                components.TopLogprobs(
                                    token='<value>',
                                    logprob=7865.46,
                                    bytes=[
                                        69025,
                                    ],
                                ),
                            ],
                        ),
                    ],
                ),
            ),
        ],
        created=996706,
        model='gpt-4-turbo',
        object=components.Object.CHAT_COMPLETION,
    ),
), x_log10_organization='<value>')

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

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the [requests](https://pypi.org/project/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:
```python
import log10
import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = log10.Log10(client=http_client)
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name          | Type          | Scheme        |
| ------------- | ------------- | ------------- |
| `log10_token` | apiKey        | API key       |

To authenticate with the API the `log10_token` parameter must be set when initializing the SDK client instance. For example:
```python
import log10
from log10.models import components

s = log10.Log10(
    log10_token="<YOUR_API_KEY_HERE>",
)


res = s.completions.create(completion=components.Completion(
    organization_id='<value>',
    request=components.CreateChatCompletionRequest(
        messages=[
            components.ChatCompletionRequestAssistantMessage(
                role=components.ChatCompletionRole.ASSISTANT,
            ),
        ],
        model='gpt-4-turbo',
        n=1,
        response_format=components.ResponseFormat(
            type=components.CreateChatCompletionRequestType.JSON_OBJECT,
        ),
        temperature=1,
        top_p=1,
        user='user-1234',
    ),
    response=components.CreateChatCompletionResponse(
        id='<id>',
        choices=[
            components.Choices(
                finish_reason=components.FinishReason.CONTENT_FILTER,
                index=859213,
                message=components.ChatCompletionResponseMessage(
                    content='<value>',
                    role=components.ChatCompletionRole.ASSISTANT,
                ),
                logprobs=components.Logprobs(
                    content=[
                        components.ChatCompletionTokenLogprob(
                            token='<value>',
                            logprob=2884.08,
                            bytes=[
                                134365,
                            ],
                            top_logprobs=[
                                components.TopLogprobs(
                                    token='<value>',
                                    logprob=7865.46,
                                    bytes=[
                                        69025,
                                    ],
                                ),
                            ],
                        ),
                    ],
                ),
            ),
        ],
        created=996706,
        model='gpt-4-turbo',
        object=components.Object.CHAT_COMPLETION,
    ),
), x_log10_organization='<value>')

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

```
<!-- End Authentication [security] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# 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](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
# log10py



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/log10-io/log10py.git",
    "name": "log10py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Speakeasy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/21/03/05bb63a2d798511e6bf19ecebd92cb8b74b9c98f2b28eaadf99aa73f687a/log10py-0.1.0.tar.gz",
    "platform": null,
    "description": "# log10py\n\n<div align=\"left\">\n    <a href=\"https://speakeasyapi.dev/\"><img src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454\" /></a>\n    <a href=\"https://opensource.org/licenses/MIT\">\n        <img src=\"https://img.shields.io/badge/License-MIT-blue.svg\" style=\"width: 100px; height: 28px;\" />\n    </a>\n</div>\n\n\n## \ud83c\udfd7 **Welcome to your new SDK!** \ud83c\udfd7\n\nIt has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:\n- [ ] \ud83d\udee0 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)\n- [ ] \u267b\ufe0f Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)\n- [ ] \ud83c\udf81 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/advanced-setup/publish-sdks)\n- [ ] \u2728 When ready to productionize, delete this section from the README\n\n<!-- Start SDK Installation [installation] -->\n## SDK Installation\n\n```bash\npip install log10py\n```\n<!-- End SDK Installation [installation] -->\n\n<!-- Start SDK Example Usage [usage] -->\n## SDK Example Usage\n\n### Example\n\n```python\nimport log10\n\ns = log10.Log10(\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\n\nres = s.sessions.create(x_log10_organization='<value>')\n\nif res.object is not None:\n    # handle response\n    pass\n\n```\n<!-- End SDK Example Usage [usage] -->\n\n<!-- Start Available Resources and Operations [operations] -->\n## Available Resources and Operations\n\n### [completions](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md)\n\n* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#create) - Create a completion\n* [update](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#update) - Update completion by id.\n* [list_ungraded](https://github.com/log10-io/log10py/blob/master/docs/sdks/completions/README.md#list_ungraded) - List ungraded completions i.e. completions that have not been associated with feedback but matches task selector.\n\n### [sessions](https://github.com/log10-io/log10py/blob/master/docs/sdks/sessions/README.md)\n\n* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/sessions/README.md#create) - Create a session\n\n### [feedback](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md)\n\n* [get](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#get) - Fetch feedback by id.\n* [list](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#list) - List feedback\n* [upload](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedback/README.md#upload) - Upload a piece of feedback\n\n### [feedback_tasks](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md)\n\n* [list](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#list) - List feedback tasks.\n* [create](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#create) - Create a new task.\n* [get](https://github.com/log10-io/log10py/blob/master/docs/sdks/feedbacktasks/README.md#get) - Retrieves feedback task `taskId`.\n<!-- End Available Resources and Operations [operations] -->\n\n<!-- Start Global Parameters [global-parameters] -->\n## Global Parameters\n\nA parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.\n\nFor example, you can set `X-Log10-Organization` to `'<value>'` at SDK initialization and then you do not have to pass the same value on calls to operations like `update`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.\n\n\n### Available Globals\n\nThe following global parameter is available.\n\n| Name | Type | Required | Description |\n| ---- | ---- |:--------:| ----------- |\n| x_log10_organization | str |  | The x_log10_organization parameter. |\n\n\n### Example\n\n```python\nimport log10\nfrom log10.models import components\n\ns = log10.Log10(\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\n\nres = s.completions.update(completion_id='<value>', completion=components.Completion(\n    organization_id='<value>',\n    request=components.CreateChatCompletionRequest(\n        messages=[\n            components.ChatCompletionRequestFunctionMessage(\n                role=components.ChatCompletionRole.SYSTEM,\n                content='<value>',\n                name='<value>',\n            ),\n        ],\n        model='gpt-4-turbo',\n        n=1,\n        response_format=components.ResponseFormat(\n            type=components.CreateChatCompletionRequestType.JSON_OBJECT,\n        ),\n        temperature=1,\n        top_p=1,\n        user='user-1234',\n    ),\n    response=components.CreateChatCompletionResponse(\n        id='<id>',\n        choices=[\n            components.Choices(\n                finish_reason=components.FinishReason.TOOL_CALLS,\n                index=15652,\n                message=components.ChatCompletionResponseMessage(\n                    content='<value>',\n                    role=components.ChatCompletionRole.USER,\n                ),\n                logprobs=components.Logprobs(\n                    content=[\n                        components.ChatCompletionTokenLogprob(\n                            token='<value>',\n                            logprob=7084.55,\n                            bytes=[\n                                991464,\n                            ],\n                            top_logprobs=[\n                                components.TopLogprobs(\n                                    token='<value>',\n                                    logprob=2703.24,\n                                    bytes=[\n                                        627690,\n                                    ],\n                                ),\n                            ],\n                        ),\n                    ],\n                ),\n            ),\n        ],\n        created=684199,\n        model='gpt-4-turbo',\n        object=components.Object.CHAT_COMPLETION,\n    ),\n), x_log10_organization='<value>')\n\nif res.completion is not None:\n    # handle response\n    pass\n\n```\n<!-- End Global Parameters [global-parameters] -->\n\n<!-- Start Error Handling [errors] -->\n## Error Handling\n\nHandling 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.\n\n| Error Object    | Status Code     | Content Type    |\n| --------------- | --------------- | --------------- |\n| errors.SDKError | 4xx-5xx         | */*             |\n\n### Example\n\n```python\nimport log10\nfrom log10.models import components, errors\n\ns = log10.Log10(\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\nres = None\ntry:\n    res = s.completions.create(completion=components.Completion(\n    organization_id='<value>',\n    request=components.CreateChatCompletionRequest(\n        messages=[\n            components.ChatCompletionRequestAssistantMessage(\n                role=components.ChatCompletionRole.ASSISTANT,\n            ),\n        ],\n        model='gpt-4-turbo',\n        n=1,\n        response_format=components.ResponseFormat(\n            type=components.CreateChatCompletionRequestType.JSON_OBJECT,\n        ),\n        temperature=1,\n        top_p=1,\n        user='user-1234',\n    ),\n    response=components.CreateChatCompletionResponse(\n        id='<id>',\n        choices=[\n            components.Choices(\n                finish_reason=components.FinishReason.CONTENT_FILTER,\n                index=859213,\n                message=components.ChatCompletionResponseMessage(\n                    content='<value>',\n                    role=components.ChatCompletionRole.ASSISTANT,\n                ),\n                logprobs=components.Logprobs(\n                    content=[\n                        components.ChatCompletionTokenLogprob(\n                            token='<value>',\n                            logprob=2884.08,\n                            bytes=[\n                                134365,\n                            ],\n                            top_logprobs=[\n                                components.TopLogprobs(\n                                    token='<value>',\n                                    logprob=7865.46,\n                                    bytes=[\n                                        69025,\n                                    ],\n                                ),\n                            ],\n                        ),\n                    ],\n                ),\n            ),\n        ],\n        created=996706,\n        model='gpt-4-turbo',\n        object=components.Object.CHAT_COMPLETION,\n    ),\n), x_log10_organization='<value>')\n\nexcept errors.SDKError as e:\n    # handle exception\n    raise(e)\n\nif res.any is not None:\n    # handle response\n    pass\n\n```\n<!-- End Error Handling [errors] -->\n\n<!-- Start Server Selection [server] -->\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `server_idx: int` 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 indexes associated with the available servers:\n\n| # | Server | Variables |\n| - | ------ | --------- |\n| 0 | `https://log10.io` | None |\n\n#### Example\n\n```python\nimport log10\nfrom log10.models import components\n\ns = log10.Log10(\n    server_idx=0,\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\n\nres = s.completions.create(completion=components.Completion(\n    organization_id='<value>',\n    request=components.CreateChatCompletionRequest(\n        messages=[\n            components.ChatCompletionRequestAssistantMessage(\n                role=components.ChatCompletionRole.ASSISTANT,\n            ),\n        ],\n        model='gpt-4-turbo',\n        n=1,\n        response_format=components.ResponseFormat(\n            type=components.CreateChatCompletionRequestType.JSON_OBJECT,\n        ),\n        temperature=1,\n        top_p=1,\n        user='user-1234',\n    ),\n    response=components.CreateChatCompletionResponse(\n        id='<id>',\n        choices=[\n            components.Choices(\n                finish_reason=components.FinishReason.CONTENT_FILTER,\n                index=859213,\n                message=components.ChatCompletionResponseMessage(\n                    content='<value>',\n                    role=components.ChatCompletionRole.ASSISTANT,\n                ),\n                logprobs=components.Logprobs(\n                    content=[\n                        components.ChatCompletionTokenLogprob(\n                            token='<value>',\n                            logprob=2884.08,\n                            bytes=[\n                                134365,\n                            ],\n                            top_logprobs=[\n                                components.TopLogprobs(\n                                    token='<value>',\n                                    logprob=7865.46,\n                                    bytes=[\n                                        69025,\n                                    ],\n                                ),\n                            ],\n                        ),\n                    ],\n                ),\n            ),\n        ],\n        created=996706,\n        model='gpt-4-turbo',\n        object=components.Object.CHAT_COMPLETION,\n    ),\n), x_log10_organization='<value>')\n\nif res.any is not None:\n    # handle response\n    pass\n\n```\n\n\n### Override Server URL Per-Client\n\nThe 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:\n```python\nimport log10\nfrom log10.models import components\n\ns = log10.Log10(\n    server_url=\"https://log10.io\",\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\n\nres = s.completions.create(completion=components.Completion(\n    organization_id='<value>',\n    request=components.CreateChatCompletionRequest(\n        messages=[\n            components.ChatCompletionRequestAssistantMessage(\n                role=components.ChatCompletionRole.ASSISTANT,\n            ),\n        ],\n        model='gpt-4-turbo',\n        n=1,\n        response_format=components.ResponseFormat(\n            type=components.CreateChatCompletionRequestType.JSON_OBJECT,\n        ),\n        temperature=1,\n        top_p=1,\n        user='user-1234',\n    ),\n    response=components.CreateChatCompletionResponse(\n        id='<id>',\n        choices=[\n            components.Choices(\n                finish_reason=components.FinishReason.CONTENT_FILTER,\n                index=859213,\n                message=components.ChatCompletionResponseMessage(\n                    content='<value>',\n                    role=components.ChatCompletionRole.ASSISTANT,\n                ),\n                logprobs=components.Logprobs(\n                    content=[\n                        components.ChatCompletionTokenLogprob(\n                            token='<value>',\n                            logprob=2884.08,\n                            bytes=[\n                                134365,\n                            ],\n                            top_logprobs=[\n                                components.TopLogprobs(\n                                    token='<value>',\n                                    logprob=7865.46,\n                                    bytes=[\n                                        69025,\n                                    ],\n                                ),\n                            ],\n                        ),\n                    ],\n                ),\n            ),\n        ],\n        created=996706,\n        model='gpt-4-turbo',\n        object=components.Object.CHAT_COMPLETION,\n    ),\n), x_log10_organization='<value>')\n\nif res.any is not None:\n    # handle response\n    pass\n\n```\n<!-- End Server Selection [server] -->\n\n<!-- Start Custom HTTP Client [http-client] -->\n## Custom HTTP Client\n\nThe Python SDK makes API calls using the [requests](https://pypi.org/project/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.\n\nFor example, you could specify a header for every request that this sdk makes as follows:\n```python\nimport log10\nimport requests\n\nhttp_client = requests.Session()\nhttp_client.headers.update({'x-custom-header': 'someValue'})\ns = log10.Log10(client=http_client)\n```\n<!-- End Custom HTTP Client [http-client] -->\n\n<!-- Start Authentication [security] -->\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name          | Type          | Scheme        |\n| ------------- | ------------- | ------------- |\n| `log10_token` | apiKey        | API key       |\n\nTo authenticate with the API the `log10_token` parameter must be set when initializing the SDK client instance. For example:\n```python\nimport log10\nfrom log10.models import components\n\ns = log10.Log10(\n    log10_token=\"<YOUR_API_KEY_HERE>\",\n)\n\n\nres = s.completions.create(completion=components.Completion(\n    organization_id='<value>',\n    request=components.CreateChatCompletionRequest(\n        messages=[\n            components.ChatCompletionRequestAssistantMessage(\n                role=components.ChatCompletionRole.ASSISTANT,\n            ),\n        ],\n        model='gpt-4-turbo',\n        n=1,\n        response_format=components.ResponseFormat(\n            type=components.CreateChatCompletionRequestType.JSON_OBJECT,\n        ),\n        temperature=1,\n        top_p=1,\n        user='user-1234',\n    ),\n    response=components.CreateChatCompletionResponse(\n        id='<id>',\n        choices=[\n            components.Choices(\n                finish_reason=components.FinishReason.CONTENT_FILTER,\n                index=859213,\n                message=components.ChatCompletionResponseMessage(\n                    content='<value>',\n                    role=components.ChatCompletionRole.ASSISTANT,\n                ),\n                logprobs=components.Logprobs(\n                    content=[\n                        components.ChatCompletionTokenLogprob(\n                            token='<value>',\n                            logprob=2884.08,\n                            bytes=[\n                                134365,\n                            ],\n                            top_logprobs=[\n                                components.TopLogprobs(\n                                    token='<value>',\n                                    logprob=7865.46,\n                                    bytes=[\n                                        69025,\n                                    ],\n                                ),\n                            ],\n                        ),\n                    ],\n                ),\n            ),\n        ],\n        created=996706,\n        model='gpt-4-turbo',\n        object=components.Object.CHAT_COMPLETION,\n    ),\n), x_log10_organization='<value>')\n\nif res.any is not None:\n    # handle response\n    pass\n\n```\n<!-- End Authentication [security] -->\n\n<!-- Placeholder for Future Speakeasy SDK Sections -->\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel 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!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n# log10py\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python Client SDK Generated by Speakeasy",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/log10-io/log10py.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "873ca259eb51e8e6ed93e2507576283b2530101780f0a5a3e1e6486b95a02ddc",
                "md5": "d901b250bf9dc2d9cf5351388fb43f49",
                "sha256": "258d4ebeb2f057ceae5392e0269e5c2908a8eed976bac988a4f23a34d004a781"
            },
            "downloads": -1,
            "filename": "log10py-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d901b250bf9dc2d9cf5351388fb43f49",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 57284,
            "upload_time": "2024-07-17T18:48:00",
            "upload_time_iso_8601": "2024-07-17T18:48:00.767342Z",
            "url": "https://files.pythonhosted.org/packages/87/3c/a259eb51e8e6ed93e2507576283b2530101780f0a5a3e1e6486b95a02ddc/log10py-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "210305bb63a2d798511e6bf19ecebd92cb8b74b9c98f2b28eaadf99aa73f687a",
                "md5": "946b3f71d1918b1480dcbbcca3b8ab9e",
                "sha256": "c9b5eceaa1d212265d3c1cc859995590814dcae504d0caf5e2443a3f9f459f41"
            },
            "downloads": -1,
            "filename": "log10py-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "946b3f71d1918b1480dcbbcca3b8ab9e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 34313,
            "upload_time": "2024-07-17T18:48:02",
            "upload_time_iso_8601": "2024-07-17T18:48:02.405024Z",
            "url": "https://files.pythonhosted.org/packages/21/03/05bb63a2d798511e6bf19ecebd92cb8b74b9c98f2b28eaadf99aa73f687a/log10py-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-17 18:48:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "log10-io",
    "github_project": "log10py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "log10py"
}
        
Elapsed time: 0.27858s