diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
index 9a8f4f0..d6b1cb5 100644
--- a/.github/workflows/publish.yaml
+++ b/.github/workflows/publish.yaml
@@ -2,6 +2,8 @@ name: Publish to PyPI.org
on:
push:
tags: ["v*"]
+
+
jobs:
pypi:
runs-on: ubuntu-latest
@@ -12,8 +14,29 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- - run: python3 -m pip install --upgrade build && python3 -m build
- - name: Publish package
- uses: pypa/gh-action-pypi-publish@release/v1
- with:
- password: ${{ secrets.PYPI_TOKEN }}
+
+ - name: Build python package
+ run: |
+ python3 -m pip install --upgrade build
+ python3 -m build
+
+ - name: Check package version
+ env:
+ EXPECTED_VERSION: ${{ github.ref_name }}
+ run: |
+ VERSION=$(grep -e "version\s*=\s*" -m 1 pyproject.toml | awk -F '"' '{print $2}')
+
+ if [ -z "$VERSION" ]; then
+ echo "Version not found"
+ exit 1
+ fi
+
+ if [ "v$VERSION" != "$EXPECTED_VERSION" ]; then
+ echo "Version $VERSION matches the tag name $EXPECTED_VERSION ."
+ exit 1
+ fi
+
+# - name: Publish package to PyPI
+# uses: pypa/gh-action-pypi-publish@release/v1
+# with:
+# password: ${{ secrets.PYPI_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e042754..79a2c3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,23 @@
-*.py[cod]
__pycache__/
+build/
+dist/
+*.egg-info/
+.pytest_cache/
-# build
-/*.egg*/
-/prem/_dist_ver.py
-/build/
-/dist/
+# pyenv
+.python-version
-venv/
-docs/build
+# Environments
+.env
+.venv
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# JetBrains
+.idea/
+
+/coverage.xml
+/.coverage
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
deleted file mode 100644
index 64ad898..0000000
--- a/.pre-commit-config.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-default_stages: [commit]
-
-repos:
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.5.0
- hooks:
- - id: trailing-whitespace
- - id: end-of-file-fixer
- - id: check-yaml
- - id: end-of-file-fixer
- - id: check-toml
- - id: check-xml
- - id: debug-statements
- - id: check-builtin-literals
- - id: check-case-conflict
-
- - repo: https://github.com/psf/black
- rev: 23.12.0
- hooks:
- - id: black
-
- - repo: https://github.com/PyCQA/isort
- rev: 5.13.2
- hooks:
- - id: isort
-
- - repo: https://github.com/PyCQA/flake8
- rev: 6.1.0
- hooks:
- - id: flake8
- args: ["--config=setup.cfg"]
- additional_dependencies: [flake8-isort]
-
-ci:
- autoupdate_schedule: weekly
- skip: []
- submodules: false
diff --git a/CNAME b/CNAME
deleted file mode 100644
index d42a1d0..0000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-python.docs.premai.io
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8fc857b..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-SPDX-License-Identifier: Apache-2.0
-
-Apache License v. 2.0
----------------------
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this work except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/Manifest.in b/Manifest.in
deleted file mode 100644
index 2b5a2f0..0000000
--- a/Manifest.in
+++ /dev/null
@@ -1,3 +0,0 @@
-exclude test.py
-recursive-exclude docs *
-recursive-exclude .github *
diff --git a/README.md b/README.md
index 6d75f10..ee3299f 100644
--- a/README.md
+++ b/README.md
@@ -1,69 +1,40 @@
-
-
🚀 Prem Python SDK
-
The Prem Python SDK is a Python library for interacting with the Prem API
-
-[![PyPI version](https://img.shields.io/pypi/v/premai.svg)](https://pypi.org/project/premai/)
-[![GitHub contributors](https://img.shields.io/github/contributors/premAI-io/prem-python-sdk.svg)](https://github.com/premAI-io/prem-python-sdk/graphs/contributors)
-[![GitHub last commit](https://img.shields.io/github/last-commit/premAI-io/prem-python-sdk.svg)](https://github.com/premAI-io/prem-python-sdk/commits/master)
-[![GitHub top language](https://img.shields.io/github/languages/top/premAI-io/prem-python-sdk.svg)](https://github.com/premAI-io/prem-python-sdk)
-[![GitHub issues](https://img.shields.io/github/issues/premAI-io/prem-python-sdk.svg)](https://github.com/premAI-io/prem-python-sdk/issues)
-
-
-
-
- Table of Contents
-
- - Installation
- - Usage
-
- - Getting Started
- - Completions
- - Embeddings
- - DataPoints
-
-
-
-
-## Installation
-
-### From Source
-
-1. Clone the Prem Python SDK repository:
-
- ```bash
- git clone https://github.com/premAI-io/prem-python-sdk.git
- ``````
-
-2. Install the SDK
- ```bash
- cd prem-python-sdk
- python -m venv venv
- source venv/bin/activate
- pip install .
- ```
-### From PyPI
-You can also install the Prem Python SDK directly from PyPI.
+# Installation
+
+## From Source
+
+1\. Clone the Prem Python SDK repository:
+```bash
+git clone https://github.com/premAI-io/prem-python-sdk.git
+```
+2\. Install the SDK
```bash
+cd prem-python-sdk
python -m venv venv
source venv/bin/activate
+pip install .
+```
+
+## From PyPI
+You can also install the Prem Python SDK directly from PyPI.
+
+```bash
pip install premai
```
-## Usage
-### Getting Started
+
+# Usage
+## Getting Started
To use the Prem Python SDK, you need to obtain an API key from the Prem platform. You can then create a `Prem` instance to make requests to the API.
```python
-from prem import Prem
+from premai import Prem
api_key = "YOUR_API_KEY"
-base_url = "https://api.prem.com" # Update with the base URL of the Prem API
-
-client = Prem(api_key=api_key, base_url=base_url)
+client = Prem(api_key=api_key)
```
-### Completions
-The `completions` module allows you to generate completions based on user input. Here's an example:
+## Chat completion
+The `chat.completions` module allows you to generate completions based on user input. Here's an example:
```python
messages = [
@@ -71,47 +42,56 @@ messages = [
{"role": "user", "content": "Who won the world series in 2020?"},
]
model = "gpt-3.5-turbo"
+project_id = YOUR_PROJECT_ID
# Create completion
-response = client.completions.create(project_id=1, messages=messages, model=model, stream=False)
-print(response)
+response = client.chat.completions.create(
+ project_id=project_id,
+ messages=messages,
+ model=model
+)
+
+print(response.choices)
```
-### Embeddings
+## Embeddings
The `embeddings` module enables you to create embeddings for given input. Example:
```python
input_text = "What is a transformer?"
model = "text-embedding-ada-002"
+project_id = YOUR_PROJECT_ID
# Create embeddings
-response = client.embeddings.create(project_id=1, input=input_text, model=model)
-print(response)
+response = client.embeddings.create(project_id=project_id, input=input_text, model=model)
+
+print(response.data)
```
-### Data Points
+## Data Points
The `datapoints` module allows you to manage data points, including creating, updating, retrieving, and deleting. Example:
```python
input_text = "What is a transformer?"
output_text = "A transformer is a deep learning model that uses self-attention."
+project_id = YOUR_PROJECT_ID
# Create 10 data points
for _ in range(10):
- data_point = client.datapoints.create(project_id=1, input=input_text, output=output_text, positive=True)
+ data_point = client.datapoints.create(project=project_id, input=input_text, output=output_text, positive=True)
# Update the last data point
-patched_data_point = client.datapoints.update(datapoint_id=data_point.id, data={"positive": False})
+patched_data_point = client.datapoints.patch(id=data_point.id, positive=False)
# Retrieve the updated data point
-print(client.datapoints.retrieve(datapoint_id=data_point.id))
+print(client.datapoints.retrieve(id=data_point.id))
# Delete the updated data point
-client.datapoints.delete(datapoint_id=data_point.id)
+client.datapoints.delete(id=data_point.id)
# List all data points
-datapoints = client.datapoints.list(project_id=1)
+datapoints = client.datapoints.list(project=project_id)
print("Total number of datapoints:", len(datapoints))
for datapoint in datapoints:
print("Deleted data point with ID:", datapoint.id)
- client.datapoints.delete(datapoint_id=datapoint.id)
-```
+ client.datapoints.delete(id=datapoint.id)
+```
\ No newline at end of file
diff --git a/dev-requirements.txt b/dev-requirements.txt
deleted file mode 100644
index 8213302..0000000
--- a/dev-requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-sphinx
-sphinx_rtd_theme
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 100644
index d0c3cbf..0000000
--- a/docs/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Minimal makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line, and also
-# from the environment for the first two.
-SPHINXOPTS ?=
-SPHINXBUILD ?= sphinx-build
-SOURCEDIR = source
-BUILDDIR = build
-
-# Put it first so that "make" without argument is like "make help".
-help:
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-
-.PHONY: help Makefile
-
-# Catch-all target: route all unknown targets to Sphinx using the new
-# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/source/conf.py b/docs/source/conf.py
deleted file mode 100644
index 0499faa..0000000
--- a/docs/source/conf.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Configuration file for the Sphinx documentation builder.
-#
-# For the full list of built-in configuration values, see the documentation:
-# https://www.sphinx-doc.org/en/master/usage/configuration.html
-
-import os
-import sys
-
-sys.path.insert(0, os.path.abspath(".."))
-
-# -- Project information -----------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
-
-project = "prem-python-sdk"
-copyright = "2023, Prem Labs"
-author = "Prem Labs"
-
-# -- General configuration ---------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
-
-extensions = [
- "sphinx.ext.autodoc",
- "sphinx.ext.viewcode",
- "sphinx.ext.napoleon",
-]
-
-templates_path = ["_templates"]
-exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
-
-
-# -- Options for HTML output -------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
-
-html_theme = "sphinx_rtd_theme"
-html_static_path = ["_static"]
diff --git a/docs/source/index.rst b/docs/source/index.rst
deleted file mode 100644
index 1d45855..0000000
--- a/docs/source/index.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-.. prem-python-sdk documentation master file, created by
- sphinx-quickstart on Sat Dec 16 16:43:20 2023.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-Welcome to prem-python-sdk's documentation!
-===========================================
-
-.. toctree::
- :maxdepth: 3
- :caption: Contents:
-
- prem.client
- prem.resources
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
diff --git a/docs/source/prem.client.rst b/docs/source/prem.client.rst
deleted file mode 100644
index d6e3c0a..0000000
--- a/docs/source/prem.client.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Client
-======
-.. automodule:: prem.client
- :members: Prem
- :undoc-members:
- :show-inheritance:
diff --git a/docs/source/prem.resources.completions.rst b/docs/source/prem.resources.completions.rst
deleted file mode 100644
index cd846ed..0000000
--- a/docs/source/prem.resources.completions.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-completions
-===========
-
-.. automodule:: prem.resources.completions.resource
- :members: Completions
- :undoc-members:
- :show-inheritance:
-
-models
-------
-.. autoclass:: prem.resources.completions.models.ChatCompletionResponse
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.ChatCompletionChunk
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.Choices
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.Delta
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.Usage
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.Choice
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.completions.models.Message
- :members:
- :undoc-members:
diff --git a/docs/source/prem.resources.datapoints.rst b/docs/source/prem.resources.datapoints.rst
deleted file mode 100644
index bf783a3..0000000
--- a/docs/source/prem.resources.datapoints.rst
+++ /dev/null
@@ -1,17 +0,0 @@
-datapoints
-==========
-.. automodule:: prem.resources.datapoints.resource
- :members: DataPoints
- :undoc-members:
- :show-inheritance:
-
-models
-------
-
-.. autoclass:: prem.resources.datapoints.models.DataPoint
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.datapoints.models.PatchedDataPoint
- :members:
- :undoc-members:
diff --git a/docs/source/prem.resources.embeddings.rst b/docs/source/prem.resources.embeddings.rst
deleted file mode 100644
index dee4d26..0000000
--- a/docs/source/prem.resources.embeddings.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-embeddings
-===========
-
-.. automodule:: prem.resources.embeddings.resource
- :members: Embeddings
- :undoc-members:
- :show-inheritance:
-
-models
-------
-
-.. autoclass:: prem.resources.embeddings.models.EmbeddingsResponse
- :members:
- :undoc-members:
-
-.. autoclass:: prem.resources.embeddings.models.Usage
- :members:
- :undoc-members:
diff --git a/docs/source/prem.resources.rst b/docs/source/prem.resources.rst
deleted file mode 100644
index 17c2d50..0000000
--- a/docs/source/prem.resources.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-Resources
-==============
-
-.. toctree::
- :maxdepth: 4
-
- prem.resources.completions
- prem.resources.embeddings
- prem.resources.datapoints
-
-.. automodule:: prem.resources
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/prem/__init__.py b/prem/__init__.py
deleted file mode 100644
index 67d0608..0000000
--- a/prem/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .client import Prem # noqa
diff --git a/prem/client.py b/prem/client.py
deleted file mode 100644
index ab07ee7..0000000
--- a/prem/client.py
+++ /dev/null
@@ -1,152 +0,0 @@
-from __future__ import annotations
-
-import json
-from typing import Dict, List, Union
-
-import requests
-from sseclient import SSEClient
-
-from . import resources
-from .exceptions import error_to_exception
-
-
-class Prem:
- """
- Prem class for making API requests.
- """
-
- completions: resources.Completions
- embeddings: resources.Embeddings
- datapoints: resources.DataPoints
-
- def __init__(
- self,
- api_key: str,
- base_url: str = "https://app.premai.io",
- options: Dict = {},
- ) -> None:
- """
- Initialize Prem with the provided API key and base URL.
-
- :param api_key: The API key for authentication.
- :type api_key: str
- :param base_url: The base URL of the API.
- :type base_url: str
- :param options: Custom headers.
- :type options: dict
- """
- self.api_key = api_key
- self.base_url = base_url
- self.headers = (
- {"Authorization": f"Bearer {self.api_key}"} if self.api_key else {}
- )
- self.headers.update(options)
-
- self.completions = resources.Completions(self)
- self.embeddings = resources.Embeddings(self)
- self.datapoints = resources.DataPoints(self)
-
- def _get(self, endpoint: str, status_code: int = 200) -> Dict:
- """
- Make a GET request to the API.
-
- :param endpoint: The API endpoint.
- :type endpoint: str
- :param status_code: The expected status code of the response.
- :type status_code: int
-
- :return: The response object.
- :rtype: Dict
- """
- response = requests.get(f"{self.base_url}/{endpoint}", headers=self.headers)
- if response.status_code != status_code:
- error_to_exception(response)
- return response.json()
-
- def _post(
- self, endpoint: str, body: Dict, stream: bool = False, status_code: int = 200
- ) -> Union[Dict, List[Dict]]:
- """
- Make a POST request to the API.
-
- :param endpoint: The API endpoint.
- :type endpoint: str
- :param body: The JSON body of the request.
- :type body: Dict
- :param stream: If True, stream the response; otherwise, return the response as JSON.
- :type stream: bool
- :param status_code: The expected status code of the response.
- :type status_code: int
-
- :return: The response object.
- :rtype: Union[Dict, List[Dict]]
- """
- response = requests.post(
- f"{self.base_url}/{endpoint}", json=body, headers=self.headers
- )
- if response.status_code != status_code:
- error_to_exception(response)
- if not stream:
- return response.json()
- else:
- client = SSEClient(response)
- events = []
- for event in client.events():
- if event.data != "[DONE]":
- events.append(json.loads(event.data))
- return events
-
- def _put(self, endpoint: str, body: Dict, status_code: int = 201) -> Dict:
- """
- Make a PUT request to the API.
-
- :param endpoint: The API endpoint.
- :type endpoint: str
- :param body: The JSON body of the request.
- :type body: Dict
- :param status_code: The expected status code of the response.
- :type status_code: int
-
- :return: The response object.
- :rtype: Dict
- """
- response = requests.put(
- f"{self.base_url}/{endpoint}", json=body, headers=self.headers
- )
- if response.status_code != status_code:
- error_to_exception(response)
- return response.json()
-
- def _patch(self, endpoint: str, body: Dict, status_code: int = 200) -> Dict:
- """
- Make a PATCH request to the API.
-
- :param endpoint: The API endpoint.
- :type endpoint: str
- :param body: The JSON body of the request.
- :type body: Dict
- :param status_code: The expected status code of the response.
- :type status_code: int
-
- :return: The response object.
- :rtype: Dict
- """
- response = requests.patch(
- f"{self.base_url}/{endpoint}", json=body, headers=self.headers
- )
- if response.status_code != status_code:
- error_to_exception(response)
- return response.json()
-
- def _delete(self, endpoint: str, status_code: int = 204) -> None:
- """
- Make a DELETE request to the API.
-
- :param endpoint: The API endpoint.
- :type endpoint: str
- :param status_code: The expected status code of the response.
- :type status_code: int
- """
- response = requests.delete(f"{self.base_url}/{endpoint}", headers=self.headers)
- if response.status_code != status_code:
- error_to_exception(response)
diff --git a/prem/exceptions.py b/prem/exceptions.py
deleted file mode 100644
index 437e392..0000000
--- a/prem/exceptions.py
+++ /dev/null
@@ -1,128 +0,0 @@
-from typing import Optional
-
-from requests import Response
-
-
-class PremError(Exception):
- pass
-
-
-class PremProviderError(PremError):
- def __init__(
- self,
- message: str,
- provider: Optional[str],
- model: Optional[str],
- provider_message: Optional[str],
- ):
- super().__init__(message)
- self.provider = provider
- self.model = model
- self.provider_message = provider_message
-
-
-class PremProviderNotFoundError(PremProviderError):
- pass
-
-
-class PremProviderAPIError(PremProviderError):
- pass
-
-
-class PremProviderAuthenticationError(PremProviderError):
- pass
-
-
-class PremProviderConflictError(PremProviderError):
- pass
-
-
-class PremProviderAPIStatusError(PremProviderError):
- pass
-
-
-class PremProviderAPITimeoutError(PremProviderError):
- pass
-
-
-class PremProviderRateLimitError(PremProviderError):
- pass
-
-
-class PremProviderBadRequestError(PremProviderError):
- pass
-
-
-class PremProviderAPIConnectionError(PremProviderError):
- pass
-
-
-class PremProviderInternalServerError(PremProviderError):
- pass
-
-
-class PremProviderPermissionDeniedError(PremProviderError):
- pass
-
-
-class PremProviderUnprocessableEntityError(PremProviderError):
- pass
-
-
-class PremProviderAPIResponseValidationError(PremProviderError):
- pass
-
-
-class PremProviderResponseValidationError(PremProviderError):
- pass
-
-
-class ModelNotFoundError(PremError):
- def __init__(self, message):
- self.message = message
- super().__init__(self.message)
-
-
-class ValidationError(PremError):
- def __init__(self, message, details):
- self.message = message
- self.details = details
- super().__init__(self.message)
-
-
-def error_to_exception(error: Response) -> PremError:
- """
- Map an API response to the corresponding exception class.
-
- Args:
- error (dict): The API response containing error information.
-
- Returns:
- PremError: An instance of the corresponding exception class.
- """
- error = error.json()
- error_code = error.get("code", None)
- message = error.get("message", "Unknown Error")
- provider = error.get("provider", None)
- model = error.get("model", None)
- provider_message = error.get("provider_message", None)
-
- error_mapping = {
- "NotFound": PremProviderNotFoundError,
- "APIError": PremProviderAPIError,
- "AuthenticationError": PremProviderAuthenticationError,
- "ConflictError": PremProviderConflictError,
- "APIStatusError": PremProviderAPIStatusError,
- "APITimeoutError": PremProviderAPITimeoutError,
- "RateLimitError": PremProviderRateLimitError,
- "BadRequestError": PremProviderBadRequestError,
- "APIConnectionError": PremProviderAPIConnectionError,
- "InternalServerError": PremProviderInternalServerError,
- "PermissionDeniedError": PremProviderPermissionDeniedError,
- "UnprocessableEntityError": PremProviderUnprocessableEntityError,
- "APIResponseValidationError": PremProviderAPIResponseValidationError,
- "ResponseValidationError": PremProviderResponseValidationError,
- "ModelNotFoundError": PremProviderResponseValidationError,
- }
- exception_class = error_mapping.get(error_code, PremError)
- raise exception_class(message, provider, model, provider_message)
diff --git a/prem/resource.py b/prem/resource.py
deleted file mode 100644
index e95b74b..0000000
--- a/prem/resource.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from __future__ import annotations
-
-
-class SyncAPIResource:
- _client = None
-
- def __init__(self, client) -> None:
- self._client = client
- self._get = client._get
- self._post = client._post
- self._put = client._put
- self._patch = client._patch
- self._delete = client._delete
diff --git a/prem/resources/__init__.py b/prem/resources/__init__.py
deleted file mode 100644
index cf396af..0000000
--- a/prem/resources/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .completions.resource import Completions # noqa
-from .datapoints.resource import DataPoints # noqa
-from .embeddings.resource import Embeddings # noqa
diff --git a/prem/resources/completions/models.py b/prem/resources/completions/models.py
deleted file mode 100644
index 13cd5f0..0000000
--- a/prem/resources/completions/models.py
+++ /dev/null
@@ -1,120 +0,0 @@
-from typing import List, Optional
-
-from pydantic import BaseModel
-
-
-class Message(BaseModel):
- """
- Represents a message in a conversation.
-
- Attributes:
-
- - content (str): The content of the message.
- - role (str): The role of the message, e.g., 'user' or 'assistant'.
- """
-
- content: str
- role: str
-
-
-class Choice(BaseModel):
- """
- Represents a choice made during chat completion.
-
- Attributes:
-
- - finish_reason (str): The reason for finishing the completion.
- - index (int): The index of the choice.
- - message (Message): The message associated with the choice.
- """
-
- finish_reason: str
- index: int
- message: Message
-
-
-class Usage(BaseModel):
- """
- Represents the token usage information in a chat completion response.
-
- Attributes:
-
- - completion_tokens (int): The number of tokens used for the completion.
- - prompt_tokens (int): The number of tokens used in the prompt.
- - total_tokens (int): The total number of tokens used.
- """
-
- completion_tokens: int
- prompt_tokens: int
- total_tokens: int
-
-
-class ChatCompletionResponse(BaseModel):
- """
- Represents the response of a chat completion.
-
- Attributes:
-
- - id (str): The identifier of the completion.
- - choices (List[Choice]): List of choices made during the completion.
- - created (int): Timestamp indicating when the completion was created.
- - model (str): The model used for the completion.
- - provider_name (str): The name of the provider.
- - provider_id (str): The identifier of the provider.
- - usage (Optional[Usage]): Token usage information (optional).
- """
-
- id: str
- choices: List[Choice]
- created: int
- model: str
- provider_name: str
- provider_id: str
- usage: Optional[Usage]
-
-
-class Delta(BaseModel):
- """
- Represents a delta in the content or role during chat completion.
-
- Attributes:
-
- - content (Optional[str]): The updated content of the delta.
- - role (Optional[str]): The updated role of the delta.
- """
-
- content: Optional[str]
- role: Optional[str]
-
-
-class Choices(BaseModel):
- """
- Represents choices made during chat completion.
-
- Attributes:
-
- - delta (Delta): The delta representing changes in content or role.
- - finish_reason (Optional[str]): The reason for finishing the completion (optional).
- """
-
- delta: Delta
- finish_reason: Optional[str]
-
-
-class ChatCompletionChunk(BaseModel):
- """
- Represents a chunk of chat completion.
-
- Attributes:
- - id (str): The identifier of the completion chunk.
- - model (str): The model used for the completion.
- - object (str): The type of object.
- - created (int): Timestamp indicating when the completion chunk was created.
- - choices (List[Choices]): List of choices made during the completion chunk.
- """
-
- id: str
- model: str
- object: str
- created: int
- choices: List[Choices]
diff --git a/prem/resources/completions/resource.py b/prem/resources/completions/resource.py
deleted file mode 100644
index 0955ef4..0000000
--- a/prem/resources/completions/resource.py
+++ /dev/null
@@ -1,97 +0,0 @@
-from __future__ import annotations
-
-from typing import Dict, List, Optional, Union
-
-from ...resource import SyncAPIResource
-from ...utils import filter_none_values, required_args
-from .models import ChatCompletionChunk, ChatCompletionResponse
-
-
-class Completions(SyncAPIResource):
- def __init__(self, client) -> None:
- """
- Initializes the Completions resource.
-
- Parameters:
-
- - client (Prem): The client for making API requests.
- """
- super().__init__(client)
-
- @required_args(["project_id", "messages"])
- def create(
- self,
- project_id: int,
- messages: List[Dict[str, Union[str, int]]],
- model: Optional[str] = None,
- frequency_penalty: Optional[float] = None,
- logit_bias: Optional[Dict[str, int]] = {},
- max_tokens: Optional[int] = None,
- n: Optional[int] = None,
- presence_penalty: Optional[float] = None,
- response_format: Optional[Dict[str, Union[str, int]]] = None,
- seed: Optional[int] = None,
- stop: Union[Optional[str], List[str]] = None,
- temperature: Optional[float] = None,
- tool_choice: Optional[Dict[str, Union[str, int]]] = None,
- tools: Optional[List[Dict[str, Union[str, int]]]] = None,
- top_p: Optional[float] = None,
- user: Optional[str] = None,
- stream: Optional[bool] = False,
- ) -> Union[ChatCompletionResponse, List[ChatCompletionChunk]]:
- """
- Create chat completions based on the provided parameters.
-
- Parameters:
-
- - project_id (int): The ID of the project.
- - messages (List[Dict[str, Union[str, int]]]): A list of messages containing user and/or assistant inputs.
- - model (Optional[str]): The language model to use for generating completions.
- - frequency_penalty (Optional[float]): The frequency penalty to be applied during generation.
- - logit_bias (Optional[Dict[str, int]]): Logit bias to influence the model's behavior.
- - max_tokens (Optional[int]): The maximum number of tokens in the generated completions.
- - n (Optional[int]): The number of completions to generate.
- - presence_penalty (Optional[float]): The presence penalty to be applied during generation.
- - response_format (Optional[Dict[str, Union[str, int]]]): The format of the generated completion response.
- - seed (Optional[int]): The seed to control randomness during generation.
- - stop (Union[Optional[str], List[str]]): Stop criteria for generation.
- - temperature (Optional[float]): The temperature parameter to control randomness in generation.
- - tool_choice (Optional[Dict[str, Union[str, int]]]): The tool choice to be used during generation.
- - tools (Optional[List[Dict[str, Union[str, int]]]]): List of tools to be used during generation.
- - top_p (Optional[float]): Top-p sampling parameter for generation.
- - user (Optional[str]): The user identifier.
- - stream (Optional[bool]): If True, return results as a stream.
-
- Returns:
-
- - Union[ChatCompletionResponse, List[ChatCompletionChunk]]: The generated chat completion response
- or a list of chat completion chunks.
- """
- body = {
- "project_id": project_id,
- "messages": messages,
- "model": model,
- "frequency_penalty": frequency_penalty,
- "logit_bias": logit_bias,
- "max_tokens": max_tokens,
- "n": n,
- "presence_penalty": presence_penalty,
- "response_format": response_format,
- "seed": seed,
- "stop": stop,
- "temperature": temperature,
- "tool_choice": tool_choice,
- "tools": tools,
- "top_p": top_p,
- "user": user,
- "stream": stream,
- }
- response = self._post(
- "v1/chat/completions",
- body=filter_none_values(body),
- stream=stream,
- )
- if not stream:
- return ChatCompletionResponse(**response)
- else:
- return [ChatCompletionChunk(**event) for event in response]
diff --git a/prem/resources/datapoints/models.py b/prem/resources/datapoints/models.py
deleted file mode 100644
index 08d7220..0000000
--- a/prem/resources/datapoints/models.py
+++ /dev/null
@@ -1,74 +0,0 @@
-from typing import Optional
-
-from pydantic import BaseModel
-
-
-class InputDataPoint(BaseModel):
- """
- Represents an input data point with information about input, output, positivity,
- associated project, and an optional trace.
-
- Attributes:
-
- - input (Optional[str]): The input information for the data point.
- - output (Optional[str]): The output information for the data point.
- - positive (bool): A boolean indicating whether the data point is positive or not.
- - project (int): The ID of the project associated with the data point.
- - trace (Optional[str]): Additional trace information for the data point.
- """
-
- input: str = None
- output: str = None
- positive: bool
- project: int
- trace: Optional[str] = None
-
-
-class DataPoint(BaseModel):
- """
- Represents a data point with input and output information.
-
- Attributes:
-
- - id (int): The unique identifier of the data point.
- - created_at (Optional[str]): The timestamp when the data point was created.
- - updated_at (Optional[str]): The timestamp when the data point was last updated.
- - input (Optional[str]): The input information for the data point.
- - output (Optional[str]): The output information for the data point.
- - positive (bool): A boolean indicating whether the data point is positive or not.
- - project (Optional[int]): The ID of the project.
- - trace (Optional[str]): Additional trace information for the data point.
- """
-
- id: int
- created_at: Optional[str] = None
- updated_at: Optional[str] = None
- input: str = None
- output: str = None
- positive: bool
- project: Optional[int] = None
- trace: Optional[str] = None
-
-
-class PatchedDataPoint(BaseModel):
- """
- Represents a patched data point with optional attributes for updating.
-
- Attributes:
-
- - id (Optional[int]): The unique identifier of the data point (optional).
- - created_at (Optional[str]): The timestamp when the data point was created (optional).
- - updated_at (Optional[str]): The timestamp when the data point was last updated (optional).
- - input (Optional[str]): The updated input information for the data point (optional).
- - output (Optional[str]): The updated output information for the data point (optional).
- - positive (Optional[bool]): The updated boolean indicating whether the data point is positive or not (optional).
- - trace (Optional[str]): The updated additional trace information for the data point (optional).
- """
-
- id: Optional[int] = None
- created_at: Optional[str] = None
- updated_at: Optional[str] = None
- input: Optional[str] = None
- output: Optional[str] = None
- positive: Optional[bool] = None
- trace: Optional[str] = None
diff --git a/prem/resources/datapoints/resource.py b/prem/resources/datapoints/resource.py
deleted file mode 100644
index eeb3b45..0000000
--- a/prem/resources/datapoints/resource.py
+++ /dev/null
@@ -1,112 +0,0 @@
-from __future__ import annotations
-
-from typing import Dict, List, Optional
-
-from ...resource import SyncAPIResource
-from ...utils import required_args
-from .models import DataPoint, InputDataPoint, PatchedDataPoint
-
-
-class DataPoints(SyncAPIResource):
- """
- DataPoints class for handling the datapoint endpoint.
-
- Attributes:
- - client (Prem): The client for making API requests.
- """
-
- def __init__(self, client) -> None:
- """
- Initializes the DataPoints.
-
- Parameters:
- - client (Prem): The client for making API requests.
- """
- super().__init__(client)
-
- @required_args(["project_id", "input", "positive", "input", "output"])
- def create(
- self,
- project_id: int,
- input: str,
- positive: bool,
- output: Optional[str] = None,
- trace: Optional[str] = None,
- ) -> DataPoint:
- """
- Create a new data point using the provided parameters.
-
- Parameters:
- - project_id (int): The ID of the project.
- - input (str): The input data.
- - positive (bool): Boolean indicating whether the data point is positive.
- - output (Optional[str]): The output data (nullable).
- - trace (Optional[str]): The trace identifier (nullable).
-
- Returns:
- - DataPoint: The created data point.
- """
- body = {
- "project": project_id,
- "input": input,
- "output": output,
- "positive": positive,
- "trace": trace,
- }
- InputDataPoint(**body)
- response = self._post("api/projects/data-points/", body=body, status_code=201)
- print("create", response)
- return DataPoint(**response)
-
- @required_args(["datapoint_id"])
- def retrieve(self, datapoint_id: int) -> DataPoint:
- """
- Retrieve a data point by its ID.
-
- Parameters:
- - datapoint_id (int): The ID of the data point to retrieve.
-
- Returns:
- - DataPoint: The retrieved data point.
- """
- response = self._get(f"api/projects/data-points/{datapoint_id}/")
- print("retrieve", response)
- return DataPoint(**response)
-
- def list(self) -> List[DataPoint]:
- """
- Retrieve a list of data points.
-
- Returns:
- - List[DataPoint]: A list of data points.
- """
- response = self._get("api/projects/data-points/")
- print("list", response)
- return [DataPoint(**data_point) for data_point in response]
-
- @required_args(["datapoint_id", "data"])
- def update(self, datapoint_id: int, data: Dict) -> DataPoint:
- """
- Update a data point by its ID.
-
- Parameters:
- - datapoint_id (int): The ID of the data point to update.
- - data (Dict): The data to update.
-
- Returns:
- - DataPoint: The updated data point.
- """
- _ = PatchedDataPoint(**data)
- response = self._patch(f"api/projects/data-points/{datapoint_id}/", body=data)
- print("update", response)
- return DataPoint(**response)
-
- @required_args(["datapoint_id"])
- def delete(self, datapoint_id: int) -> None:
- """
- Delete a data point by its ID.
-
- Parameters:
- - datapoint_id (int): The ID of the data point to delete.
- """
- self._delete(f"api/projects/data-points/{datapoint_id}/")
diff --git a/prem/resources/embeddings/models.py b/prem/resources/embeddings/models.py
deleted file mode 100644
index f5588f2..0000000
--- a/prem/resources/embeddings/models.py
+++ /dev/null
@@ -1,37 +0,0 @@
-from typing import List, Optional
-
-from pydantic import BaseModel
-
-
-class Usage(BaseModel):
- """
- Represents token usage information in an embeddings response.
-
- Attributes:
-
- - prompt_tokens (int): The number of tokens used in the prompt.
- - total_tokens (int): The total number of tokens used.
- """
-
- prompt_tokens: int
- total_tokens: int
-
-
-class EmbeddingsResponse(BaseModel):
- """
- Represents the response of an embeddings request.
-
- Attributes:
-
- - data (List[List[float]]): The list of embeddings data.
- - model (str): The model used for generating embeddings.
- - usage (Optional[Usage]): Token usage information (optional).
- - provider_name (str): The name of the provider.
- - provider_id (str): The identifier of the provider.
- """
-
- data: List[List[float]]
- model: str
- usage: Optional[Usage]
- provider_name: str
- provider_id: str
diff --git a/prem/resources/embeddings/resource.py b/prem/resources/embeddings/resource.py
deleted file mode 100644
index f6bbf75..0000000
--- a/prem/resources/embeddings/resource.py
+++ /dev/null
@@ -1,61 +0,0 @@
-from __future__ import annotations
-
-from typing import List, Optional, Union
-
-from ...resource import SyncAPIResource
-from ...utils import filter_none_values, required_args
-from .models import EmbeddingsResponse
-
-
-class Embeddings(SyncAPIResource):
- """
- Embeddings class for making API requests related to embeddings.
-
- Attributes:
-
- - client (Prem): The client for making API requests.
- """
-
- def __init__(self, client) -> None:
- """
- Initializes the Embeddings resource.
-
- Parameters:
-
- - client (Prem): The client for making API requests.
- """
- super().__init__(client)
-
- @required_args(["project_id", "input"])
- def create(
- self,
- project_id: int,
- input: Union[str, List[str], List[int], List[List[int]]],
- model: Optional[str] = None,
- encoding_format: Optional[str] = "float",
- ) -> EmbeddingsResponse:
- """
- Create embeddings based on the provided parameters.
-
- Parameters:
-
- - project_id (int): The ID of the project.
- - input (Union[str, List[str], List[int], List[List[int]]]): The input data for which embeddings are requested.
- - model (Optional[str]): The language model to use for generating embeddings.
- - encoding_format (Optional[str]): The encoding format for the embeddings (default is "float").
-
- Returns:
-
- - EmbeddingsResponse: The response containing the generated embeddings.
- """
- body = {
- "project_id": project_id,
- "input": input,
- "model": model,
- "encoding_format": encoding_format,
- }
-
- response = self._post(
- "v1/embeddings", body=filter_none_values(body), stream=False
- )
- return EmbeddingsResponse(**response)
diff --git a/prem/utils.py b/prem/utils.py
deleted file mode 100644
index 819ef86..0000000
--- a/prem/utils.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from functools import wraps
-from typing import Any, Dict
-
-from .exceptions import PremError
-
-
-def required_args(mandatory_params):
- def decorator(func):
- @wraps(func)
- def wrapper(*args, **kwargs):
- missing_params = [
- param for param in mandatory_params if param not in kwargs
- ]
- if missing_params:
- raise PremError(
- f"Missing mandatory parameters: {', '.join(missing_params)}"
- )
- return func(*args, **kwargs)
-
- return wrapper
-
- return decorator
-
-
-def filter_none_values(body: Dict[str, Any]) -> Dict[str, Any]:
- """
- Filters out key-value pairs with None values from a dictionary.
-
- This function is useful for creating a proper request body by removing
- fields with None values, ensuring that only relevant and non-null data
- is included.
-
- Parameters:
- - body (dict): The input dictionary to filter.
-
- Returns:
- dict: A new dictionary containing only the key-value pairs where the
- values are not None.
- """
- return {key: value for key, value in body.items() if value is not None}
diff --git a/premai/__init__.py b/premai/__init__.py
new file mode 100644
index 0000000..d41e6ca
--- /dev/null
+++ b/premai/__init__.py
@@ -0,0 +1,41 @@
+from .client import AuthenticatedClient
+
+from .api import (
+ PlaygroundsModule,
+ DatapointsModule,
+ TracesModule,
+ ProvidersModule,
+ ApiModule,
+ EmbeddingsModule,
+ FinetuningModule,
+ AuthModuleWrapper,
+ ChatModuleWrapper,
+)
+
+class Prem:
+ playgrounds: PlaygroundsModule
+ datapoints: DatapointsModule
+ traces: TracesModule
+ providers: ProvidersModule
+ api: ApiModule
+ embeddings: EmbeddingsModule
+ finetuning: FinetuningModule
+ auth: AuthModuleWrapper
+ chat: ChatModuleWrapper
+
+ def __init__(self, api_key: str, base_url='https://app.premai.io'):
+ client = AuthenticatedClient(token=api_key, base_url=base_url)
+ # Init modules
+ self.playgrounds = PlaygroundsModule(client)
+ self.datapoints = DatapointsModule(client)
+ self.traces = TracesModule(client)
+ self.providers = ProvidersModule(client)
+ self.api = ApiModule(client)
+ self.embeddings = EmbeddingsModule(client)
+ self.finetuning = FinetuningModule(client)
+ self.auth = AuthModuleWrapper(client)
+ self.chat = ChatModuleWrapper(client)
+
+__all__ = [
+ "Prem"
+]
\ No newline at end of file
diff --git a/premai/api/__init__.py b/premai/api/__init__.py
new file mode 100644
index 0000000..5206420
--- /dev/null
+++ b/premai/api/__init__.py
@@ -0,0 +1,190 @@
+""" Contains methods for accessing the API """
+
+
+from typing_extensions import Unpack
+
+from ..models import (
+ ApiProjectsDataPointsCreateJsonBodyDict,
+ ApiProjectsDataPointsPartialUpdateJsonBodyDict,
+ ApiProjectsDataPointsUpdateJsonBodyDict,
+ ApiProjectsTracesCreateJsonBodyDict,
+ AuthTokenCreateDataBodyDict,
+ V1ChatCompletionsCreateJsonBodyDict,
+ V1EmbeddingsCreateJsonBodyDict,
+ V1FinetuningCreateJsonBodyDict,
+)
+from ..models.api_schema_retrieve_format import ApiSchemaRetrieveFormat
+from ..models.api_schema_retrieve_lang import ApiSchemaRetrieveLang
+from .api.api_schema_retrieve import api_schema_retrieve_wrapper
+from .auth_token.auth_token_create import auth_token_create_wrapper
+from .chat_completions.v1_chat_completions_create import v1_chat_completions_create_wrapper
+from .datapoints.api_projects_data_points_create import api_projects_data_points_create_wrapper
+from .datapoints.api_projects_data_points_destroy import api_projects_data_points_destroy_wrapper
+from .datapoints.api_projects_data_points_list import api_projects_data_points_list_wrapper
+from .datapoints.api_projects_data_points_partial_update import api_projects_data_points_partial_update_wrapper
+from .datapoints.api_projects_data_points_retrieve import api_projects_data_points_retrieve_wrapper
+from .datapoints.api_projects_data_points_update import api_projects_data_points_update_wrapper
+from .embeddings.v1_embeddings_create import v1_embeddings_create_wrapper
+from .finetuning.v1_finetuning_create import v1_finetuning_create_wrapper
+from .finetuning.v1_finetuning_retrieve import v1_finetuning_retrieve_wrapper
+from .playgrounds.api_playgrounds_image_retrieve import api_playgrounds_image_retrieve_wrapper
+from .playgrounds.api_playgrounds_ot_info_retrieve import api_playgrounds_ot_info_retrieve_wrapper
+from .providers.api_providers_leaderboard_retrieve import api_providers_leaderboard_retrieve_wrapper
+from .providers.api_providers_retrieve import api_providers_retrieve_wrapper
+from .traces.api_projects_traces_create import api_projects_traces_create_wrapper
+
+
+class PlaygroundsModule:
+ def __init__(self, client):
+ self._client = client
+
+ def retrieve_image(
+ self,
+ sharable_playground_uuid: str,
+ ):
+ return api_playgrounds_image_retrieve_wrapper(self._client)(
+ sharable_playground_uuid,
+ )
+
+ def retrieve_ot_info(
+ self,
+ sharable_playground_uuid: str,
+ ):
+ return api_playgrounds_ot_info_retrieve_wrapper(self._client)(
+ sharable_playground_uuid,
+ )
+
+
+class DatapointsModule:
+ def __init__(self, client):
+ self._client = client
+
+ def list(
+ self,
+ ):
+ return api_projects_data_points_list_wrapper(self._client)()
+
+ def create(self, **kwargs: Unpack[ApiProjectsDataPointsCreateJsonBodyDict]):
+ return api_projects_data_points_create_wrapper(self._client)(**kwargs)
+
+ def retrieve(
+ self,
+ id: int,
+ ):
+ return api_projects_data_points_retrieve_wrapper(self._client)(
+ id,
+ )
+
+ def update(self, id: int, **kwargs: Unpack[ApiProjectsDataPointsUpdateJsonBodyDict]):
+ return api_projects_data_points_update_wrapper(self._client)(id, **kwargs)
+
+ def delete(
+ self,
+ id: int,
+ ):
+ return api_projects_data_points_destroy_wrapper(self._client)(
+ id,
+ )
+
+ def patch(
+ self, id: int, **kwargs: Unpack[ApiProjectsDataPointsPartialUpdateJsonBodyDict]
+ ):
+ return api_projects_data_points_partial_update_wrapper(self._client)(id, **kwargs)
+
+
+class TracesModule:
+ def __init__(self, client):
+ self._client = client
+
+ def create(self, **kwargs: Unpack[ApiProjectsTracesCreateJsonBodyDict]):
+ return api_projects_traces_create_wrapper(self._client)(**kwargs)
+
+
+class ProvidersModule:
+ def __init__(self, client):
+ self._client = client
+
+ def retrieve_providers(
+ self,
+ days: int = None,
+ ):
+ return api_providers_retrieve_wrapper(self._client)(
+ days,
+ )
+
+ def retrieve_leaderboard(
+ self,
+ days: int = None,
+ ):
+ return api_providers_leaderboard_retrieve_wrapper(self._client)(
+ days,
+ )
+
+
+class ApiModule:
+ def __init__(self, client):
+ self._client = client
+
+ def retrieve(
+ self,
+ format: ApiSchemaRetrieveFormat = None,
+ lang: ApiSchemaRetrieveLang = None,
+ ):
+ return api_schema_retrieve_wrapper(self._client)(
+ format,
+ lang,
+ )
+
+
+class AuthTokenModule:
+ def __init__(self, client):
+ self._client = client
+
+ def create(self, **kwargs: Unpack[AuthTokenCreateDataBodyDict]):
+ return auth_token_create_wrapper(self._client)(**kwargs)
+
+
+class ChatCompletionsModule:
+ def __init__(self, client):
+ self._client = client
+
+ def create(self, **kwargs: Unpack[V1ChatCompletionsCreateJsonBodyDict]):
+ return v1_chat_completions_create_wrapper(self._client)(**kwargs)
+
+
+class EmbeddingsModule:
+ def __init__(self, client):
+ self._client = client
+
+ def create(self, **kwargs: Unpack[V1EmbeddingsCreateJsonBodyDict]):
+ return v1_embeddings_create_wrapper(self._client)(**kwargs)
+
+
+class FinetuningModule:
+ def __init__(self, client):
+ self._client = client
+
+ def create(self, **kwargs: Unpack[V1FinetuningCreateJsonBodyDict]):
+ return v1_finetuning_create_wrapper(self._client)(**kwargs)
+
+ def retrieve(
+ self,
+ job_id: str,
+ ):
+ return v1_finetuning_retrieve_wrapper(self._client)(
+ job_id,
+ )
+
+
+class AuthModuleWrapper:
+ token: AuthTokenModule
+
+ def __init__(self, client):
+ self.token = AuthTokenModule(client)
+
+
+class ChatModuleWrapper:
+ completions: ChatCompletionsModule
+
+ def __init__(self, client):
+ self.completions = ChatCompletionsModule(client)
diff --git a/prem/resources/completions/__init__.py b/premai/api/api/__init__.py
similarity index 100%
rename from prem/resources/completions/__init__.py
rename to premai/api/api/__init__.py
diff --git a/premai/api/api/api_schema_retrieve.py b/premai/api/api/api_schema_retrieve.py
new file mode 100644
index 0000000..9cab72a
--- /dev/null
+++ b/premai/api/api/api_schema_retrieve.py
@@ -0,0 +1,100 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+from ...models.api_schema_retrieve_format import ApiSchemaRetrieveFormat
+from ...models.api_schema_retrieve_lang import ApiSchemaRetrieveLang
+from ...models.api_schema_retrieve_response_200 import ApiSchemaRetrieveResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import UNSET, Response, Unset
+
+
+def _get_kwargs(
+ format_: Union[Unset, ApiSchemaRetrieveFormat] = UNSET,
+ lang: Union[Unset, ApiSchemaRetrieveLang] = UNSET,
+) -> Dict[str, Any]:
+ params: Dict[str, Any] = {}
+
+ json_format_: Union[Unset, str] = UNSET
+ if not isinstance(format_, Unset):
+ json_format_ = format_.value
+
+ params["format"] = json_format_
+
+ json_lang: Union[Unset, str] = UNSET
+ if not isinstance(lang, Unset):
+ json_lang = lang.value
+
+ params["lang"] = json_lang
+
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": "/api/schema/",
+ "params": params,
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiSchemaRetrieveResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = ApiSchemaRetrieveResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiSchemaRetrieveResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_schema_retrieve_wrapper(client):
+ def api_schema_retrieve_wrapped(
+ format_: Union[Unset, ApiSchemaRetrieveFormat] = UNSET,
+ lang: Union[Unset, ApiSchemaRetrieveLang] = UNSET,
+ ) -> ApiSchemaRetrieveResponse200:
+ """OpenApi3 schema for this API. Format can be selected via content negotiation.
+
+ - YAML: application/vnd.oai.openapi
+ - JSON: application/vnd.oai.openapi+json
+
+ Args:
+ format_ (Union[Unset, ApiSchemaRetrieveFormat]):
+ lang (Union[Unset, ApiSchemaRetrieveLang]):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiSchemaRetrieveResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ format_=format_,
+ lang=lang,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_schema_retrieve_wrapped
diff --git a/prem/resources/datapoints/__init__.py b/premai/api/auth_token/__init__.py
similarity index 100%
rename from prem/resources/datapoints/__init__.py
rename to premai/api/auth_token/__init__.py
diff --git a/premai/api/auth_token/auth_token_create.py b/premai/api/auth_token/auth_token_create.py
new file mode 100644
index 0000000..0718503
--- /dev/null
+++ b/premai/api/auth_token/auth_token_create.py
@@ -0,0 +1,84 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.auth_token_create_data_body import AuthTokenCreateDataBody
+from ...models.auth_token_create_response_200 import AuthTokenCreateResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ **body: Unpack[AuthTokenCreateDataBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/auth-token/",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[AuthTokenCreateResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = AuthTokenCreateResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[AuthTokenCreateResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def auth_token_create_wrapper(client):
+ def auth_token_create_wrapped(
+ **body: Unpack[AuthTokenCreateDataBody],
+ ) -> AuthTokenCreateResponse200:
+ """
+ Args:
+ body (AuthTokenCreateDataBody):
+ body (AuthTokenCreateFilesBody):
+ body (AuthTokenCreateJsonBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[AuthTokenCreateResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return auth_token_create_wrapped
diff --git a/prem/resources/embeddings/__init__.py b/premai/api/chat_completions/__init__.py
similarity index 100%
rename from prem/resources/embeddings/__init__.py
rename to premai/api/chat_completions/__init__.py
diff --git a/premai/api/chat_completions/v1_chat_completions_create.py b/premai/api/chat_completions/v1_chat_completions_create.py
new file mode 100644
index 0000000..0e8f9ac
--- /dev/null
+++ b/premai/api/chat_completions/v1_chat_completions_create.py
@@ -0,0 +1,272 @@
+from typing import Dict, Union , List, Type, TypeVar
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, Unpack
+import re
+import httpx
+import json
+
+from ...models.v1_chat_completions_create_json_body import V1ChatCompletionsCreateJsonBody
+from ...models.v1_chat_completions_create_response_200 import V1ChatCompletionsCreateResponse200, V1ChatCompletionsCreateResponse200ChoicesItem
+from ...models.v1_chat_completions_create_response_200_usage import V1ChatCompletionsCreateResponse200Usage
+from ...types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse200ChoicesItem")
+
+
+def _get_kwargs(
+ **body: Unpack[V1ChatCompletionsCreateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/v1/chat/completions",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def v1_chat_completions_create_wrapper(client):
+ def v1_chat_completions_create_wrapped(
+ **body: Unpack[V1ChatCompletionsCreateJsonBody],
+ ) -> Union[V1ChatCompletionsCreateResponse200, V1ChatCompletionsCreateResponse200StreamContainer]:
+ """Creates a model response for the given chat conversation.
+
+ Args:
+ body (V1ChatCompletionsCreateJsonBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Union[V1ChatCompletionsCreateResponse200, V1ChatCompletionsCreateResponse200StreamContainer]
+ """
+ kwargs = _get_kwargs(
+ **body,
+ )
+ httpx_client = client.get_httpx_client()
+ if ('stream' in body) and (body['stream']):
+ stream = httpx_client.stream(**kwargs)
+ return V1ChatCompletionsCreateResponse200StreamContainer(stream)
+ else:
+ response = httpx_client.request(
+ **kwargs,
+ )
+ return V1ChatCompletionsCreateResponse200.from_dict(response.json())
+ return v1_chat_completions_create_wrapped
+
+
+END_STREAM = 'done'
+class V1ChatCompletionsCreateResponse200StreamContainer:
+ _pattern = '(?<={key}: )(.*)'
+ trace_id: str = None
+
+ def __init__(self, stream: httpx.Response):
+ self._stream = stream
+
+ def _parse_data(self, text: str):
+ match = re.search(self._pattern.format(key='data'), text)
+ if match:
+ data = json.loads(match.group(1))
+ parsed_data: V1ChatCompletionsCreateResponse200Stream = V1ChatCompletionsCreateResponse200Stream.from_dict(data)
+ return parsed_data
+ else: return None
+
+ def _parse_event(self, text: str):
+ match = re.search(self._pattern.format(key='event'), text)
+ if match: return match.group(1)
+ else: return None
+
+ def _parse_trace_id(self, text: str):
+ match = re.search(self._pattern.format(key='trace_id'), text)
+ if match: return match.group(1)
+ else: return None
+
+ def __iter__(self):
+ def generator():
+ with self._stream as stream:
+ for text in stream.iter_text():
+ event = self._parse_event(text)
+ self.trace_id = self._parse_trace_id(text)
+ if event == END_STREAM:
+ break
+ data = self._parse_data(text)
+
+ yield data
+ return generator()
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse200Stream:
+ """
+ Attributes:
+ id (str): A unique identifier for the chat completion. Each chunk has the same ID.
+ choices (List['V1ChatCompletionsCreateResponse200ChoicesItem']): A list of chat completion choices. Can be more
+ than one if n is greater than 1.
+ created (int): The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same
+ timestamp.
+ model (str): The model to generate the completion.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ usage (Union[Unset, V1ChatCompletionsCreateResponse200Usage]): The usage statistics for the completion.
+ """
+
+ id: str
+ choices: List["V1ChatCompletionsCreateResponse200ChoicesItemStream"]
+ created: int
+ model: str
+ usage: Union[Unset, "V1ChatCompletionsCreateResponse200Usage"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ choices = []
+ for choices_item_data in self.choices:
+ choices_item = choices_item_data.to_dict()
+ choices.append(choices_item)
+
+ created = self.created
+
+ model = self.model
+
+
+ usage: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.usage, Unset):
+ usage = self.usage.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "choices": choices,
+ "created": created,
+ "model": model,
+ }
+ )
+ if usage is not UNSET:
+ field_dict["usage"] = usage
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ choices = []
+ _choices = d.pop("choices")
+ for choices_item_data in _choices:
+ choices_item = V1ChatCompletionsCreateResponse200ChoicesItemStream.from_dict(choices_item_data)
+
+ choices.append(choices_item)
+
+ created = d.pop("created")
+
+ model = d.pop("model")
+
+ _usage = d.pop("usage", UNSET)
+ usage: Union[Unset, V1ChatCompletionsCreateResponse200Usage]
+ if isinstance(_usage, Unset):
+ usage = UNSET
+ else:
+ usage = V1ChatCompletionsCreateResponse200Usage.from_dict(_usage)
+
+ v1_chat_completions_create_response_200 = cls(
+ id=id,
+ choices=choices,
+ created=created,
+ model=model,
+ usage=usage,
+ )
+
+ v1_chat_completions_create_response_200.additional_properties = d
+ return v1_chat_completions_create_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse200ChoicesItemStream:
+ """
+ Attributes:
+ message (str): The generated message in the chat completion choice.
+ finish_reason (str): The reason the chat completion finished, e.g., 'stop' or 'length'.
+ """
+
+ delta: str
+ finish_reason: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ delta = self.delta
+
+ finish_reason = self.finish_reason
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "delta": delta,
+ "finish_reason": finish_reason,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ delta = d.pop("delta")
+
+ finish_reason = d.pop("finish_reason")
+
+ v1_chat_completions_create_response_200_choices_item = cls(
+ delta=delta,
+ finish_reason=finish_reason,
+ )
+
+ v1_chat_completions_create_response_200_choices_item.additional_properties = d
+ return v1_chat_completions_create_response_200_choices_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
\ No newline at end of file
diff --git a/premai/api/datapoints/__init__.py b/premai/api/datapoints/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/datapoints/api_projects_data_points_create.py b/premai/api/datapoints/api_projects_data_points_create.py
new file mode 100644
index 0000000..c091a1e
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_create.py
@@ -0,0 +1,84 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.api_projects_data_points_create_json_body import ApiProjectsDataPointsCreateJsonBody
+from ...models.api_projects_data_points_create_response_201 import ApiProjectsDataPointsCreateResponse201
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ **body: Unpack[ApiProjectsDataPointsCreateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/api/projects/data-points/",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProjectsDataPointsCreateResponse201]:
+ if response.status_code == HTTPStatus.CREATED:
+ response_201 = ApiProjectsDataPointsCreateResponse201.from_dict(response.json())
+
+ return response_201
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProjectsDataPointsCreateResponse201]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_create_wrapper(client):
+ def api_projects_data_points_create_wrapped(
+ **body: Unpack[ApiProjectsDataPointsCreateJsonBody],
+ ) -> ApiProjectsDataPointsCreateResponse201:
+ """
+ Args:
+ body (ApiProjectsDataPointsCreateJsonBody):
+ body (ApiProjectsDataPointsCreateDataBody):
+ body (ApiProjectsDataPointsCreateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProjectsDataPointsCreateResponse201]
+ """
+
+ kwargs = _get_kwargs(
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_create_wrapped
diff --git a/premai/api/datapoints/api_projects_data_points_destroy.py b/premai/api/datapoints/api_projects_data_points_destroy.py
new file mode 100644
index 0000000..f69ea7c
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_destroy.py
@@ -0,0 +1,70 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ id: int,
+) -> Dict[str, Any]:
+ _kwargs: Dict[str, Any] = {
+ "method": "delete",
+ "url": f"/api/projects/data-points/{id}/",
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[Any]:
+ if response.status_code == HTTPStatus.NO_CONTENT:
+ return None
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[Any]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_destroy_wrapper(client):
+ def api_projects_data_points_destroy_wrapped(
+ id: int,
+ ) -> Any:
+ """
+ Args:
+ id (int):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Any]
+ """
+
+ kwargs = _get_kwargs(
+ id=id,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_destroy_wrapped
diff --git a/premai/api/datapoints/api_projects_data_points_list.py b/premai/api/datapoints/api_projects_data_points_list.py
new file mode 100644
index 0000000..74e34e3
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_list.py
@@ -0,0 +1,69 @@
+from http import HTTPStatus
+from typing import Dict, List, Optional
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+from ...models.api_projects_data_points_list_response_200_item import ApiProjectsDataPointsListResponse200Item
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs() -> Dict[str, Any]:
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": "/api/projects/data-points/",
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[List["ApiProjectsDataPointsListResponse200Item"]]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = []
+ _response_200 = response.json()
+ for response_200_item_data in _response_200:
+ response_200_item = ApiProjectsDataPointsListResponse200Item.from_dict(response_200_item_data)
+
+ response_200.append(response_200_item)
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[List["ApiProjectsDataPointsListResponse200Item"]]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_list_wrapper(client):
+ def api_projects_data_points_list_wrapped() -> List["ApiProjectsDataPointsListResponse200Item"]:
+ """
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[List['ApiProjectsDataPointsListResponse200Item']]
+ """
+
+ kwargs = _get_kwargs()
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_list_wrapped
diff --git a/premai/api/datapoints/api_projects_data_points_partial_update.py b/premai/api/datapoints/api_projects_data_points_partial_update.py
new file mode 100644
index 0000000..6d7e796
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_partial_update.py
@@ -0,0 +1,88 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.api_projects_data_points_partial_update_json_body import ApiProjectsDataPointsPartialUpdateJsonBody
+from ...models.api_projects_data_points_partial_update_response_200 import ApiProjectsDataPointsPartialUpdateResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ id: int,
+ **body: Unpack[ApiProjectsDataPointsPartialUpdateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "patch",
+ "url": f"/api/projects/data-points/{id}/",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProjectsDataPointsPartialUpdateResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = ApiProjectsDataPointsPartialUpdateResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProjectsDataPointsPartialUpdateResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_partial_update_wrapper(client):
+ def api_projects_data_points_partial_update_wrapped(
+ id: int,
+ **body: Unpack[ApiProjectsDataPointsPartialUpdateJsonBody],
+ ) -> ApiProjectsDataPointsPartialUpdateResponse200:
+ """
+ Args:
+ id (int):
+ body (ApiProjectsDataPointsPartialUpdateJsonBody):
+ body (ApiProjectsDataPointsPartialUpdateDataBody):
+ body (ApiProjectsDataPointsPartialUpdateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProjectsDataPointsPartialUpdateResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ id=id,
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_partial_update_wrapped
diff --git a/premai/api/datapoints/api_projects_data_points_retrieve.py b/premai/api/datapoints/api_projects_data_points_retrieve.py
new file mode 100644
index 0000000..ee3c22b
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_retrieve.py
@@ -0,0 +1,73 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+from ...models.api_projects_data_points_retrieve_response_200 import ApiProjectsDataPointsRetrieveResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ id: int,
+) -> Dict[str, Any]:
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": f"/api/projects/data-points/{id}/",
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProjectsDataPointsRetrieveResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = ApiProjectsDataPointsRetrieveResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProjectsDataPointsRetrieveResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_retrieve_wrapper(client):
+ def api_projects_data_points_retrieve_wrapped(
+ id: int,
+ ) -> ApiProjectsDataPointsRetrieveResponse200:
+ """
+ Args:
+ id (int):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProjectsDataPointsRetrieveResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ id=id,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_retrieve_wrapped
diff --git a/premai/api/datapoints/api_projects_data_points_update.py b/premai/api/datapoints/api_projects_data_points_update.py
new file mode 100644
index 0000000..909facb
--- /dev/null
+++ b/premai/api/datapoints/api_projects_data_points_update.py
@@ -0,0 +1,88 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.api_projects_data_points_update_json_body import ApiProjectsDataPointsUpdateJsonBody
+from ...models.api_projects_data_points_update_response_200 import ApiProjectsDataPointsUpdateResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ id: int,
+ **body: Unpack[ApiProjectsDataPointsUpdateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "put",
+ "url": f"/api/projects/data-points/{id}/",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProjectsDataPointsUpdateResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = ApiProjectsDataPointsUpdateResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProjectsDataPointsUpdateResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_data_points_update_wrapper(client):
+ def api_projects_data_points_update_wrapped(
+ id: int,
+ **body: Unpack[ApiProjectsDataPointsUpdateJsonBody],
+ ) -> ApiProjectsDataPointsUpdateResponse200:
+ """
+ Args:
+ id (int):
+ body (ApiProjectsDataPointsUpdateJsonBody):
+ body (ApiProjectsDataPointsUpdateDataBody):
+ body (ApiProjectsDataPointsUpdateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProjectsDataPointsUpdateResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ id=id,
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_data_points_update_wrapped
diff --git a/premai/api/embeddings/__init__.py b/premai/api/embeddings/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/embeddings/v1_embeddings_create.py b/premai/api/embeddings/v1_embeddings_create.py
new file mode 100644
index 0000000..e1c02ab
--- /dev/null
+++ b/premai/api/embeddings/v1_embeddings_create.py
@@ -0,0 +1,266 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.v1_embeddings_create_json_body import V1EmbeddingsCreateJsonBody
+from ...models.v1_embeddings_create_response_200 import V1EmbeddingsCreateResponse200
+from ...models.v1_embeddings_create_response_400 import V1EmbeddingsCreateResponse400
+from ...models.v1_embeddings_create_response_401 import V1EmbeddingsCreateResponse401
+from ...models.v1_embeddings_create_response_403 import V1EmbeddingsCreateResponse403
+from ...models.v1_embeddings_create_response_404_type_0 import V1EmbeddingsCreateResponse404Type0
+from ...models.v1_embeddings_create_response_404_type_1 import V1EmbeddingsCreateResponse404Type1
+from ...models.v1_embeddings_create_response_409 import V1EmbeddingsCreateResponse409
+from ...models.v1_embeddings_create_response_422 import V1EmbeddingsCreateResponse422
+from ...models.v1_embeddings_create_response_429 import V1EmbeddingsCreateResponse429
+from ...models.v1_embeddings_create_response_500_type_0 import V1EmbeddingsCreateResponse500Type0
+from ...models.v1_embeddings_create_response_500_type_1 import V1EmbeddingsCreateResponse500Type1
+from ...models.v1_embeddings_create_response_500_type_2 import V1EmbeddingsCreateResponse500Type2
+from ...models.v1_embeddings_create_response_500_type_3 import V1EmbeddingsCreateResponse500Type3
+from ...models.v1_embeddings_create_response_500_type_4 import V1EmbeddingsCreateResponse500Type4
+from ...models.v1_embeddings_create_response_500_type_5 import V1EmbeddingsCreateResponse500Type5
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ **body: Unpack[V1EmbeddingsCreateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/v1/embeddings",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(
+ *, client, response: httpx.Response
+) -> Optional[
+ Union[
+ Union["V1EmbeddingsCreateResponse404Type0", "V1EmbeddingsCreateResponse404Type1"],
+ Union[
+ "V1EmbeddingsCreateResponse500Type0",
+ "V1EmbeddingsCreateResponse500Type1",
+ "V1EmbeddingsCreateResponse500Type2",
+ "V1EmbeddingsCreateResponse500Type3",
+ "V1EmbeddingsCreateResponse500Type4",
+ "V1EmbeddingsCreateResponse500Type5",
+ ],
+ V1EmbeddingsCreateResponse200,
+ V1EmbeddingsCreateResponse400,
+ V1EmbeddingsCreateResponse401,
+ V1EmbeddingsCreateResponse403,
+ V1EmbeddingsCreateResponse409,
+ V1EmbeddingsCreateResponse422,
+ V1EmbeddingsCreateResponse429,
+ ]
+]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = V1EmbeddingsCreateResponse200.from_dict(response.json())
+
+ return response_200
+ if response.status_code == HTTPStatus.BAD_REQUEST:
+ response_400 = V1EmbeddingsCreateResponse400.from_dict(response.json())
+
+ return response_400
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
+ response_401 = V1EmbeddingsCreateResponse401.from_dict(response.json())
+
+ return response_401
+ if response.status_code == HTTPStatus.FORBIDDEN:
+ response_403 = V1EmbeddingsCreateResponse403.from_dict(response.json())
+
+ return response_403
+ if response.status_code == HTTPStatus.NOT_FOUND:
+
+ def _parse_response_404(
+ data: object,
+ ) -> Union["V1EmbeddingsCreateResponse404Type0", "V1EmbeddingsCreateResponse404Type1"]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_0 = V1EmbeddingsCreateResponse404Type0.from_dict(data)
+
+ return response_404_type_0
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_1 = V1EmbeddingsCreateResponse404Type1.from_dict(data)
+
+ return response_404_type_1
+
+ response_404 = _parse_response_404(response.json())
+
+ return response_404
+ if response.status_code == HTTPStatus.CONFLICT:
+ response_409 = V1EmbeddingsCreateResponse409.from_dict(response.json())
+
+ return response_409
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
+ response_422 = V1EmbeddingsCreateResponse422.from_dict(response.json())
+
+ return response_422
+ if response.status_code == HTTPStatus.TOO_MANY_REQUESTS:
+ response_429 = V1EmbeddingsCreateResponse429.from_dict(response.json())
+
+ return response_429
+ if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
+
+ def _parse_response_500(
+ data: object,
+ ) -> Union[
+ "V1EmbeddingsCreateResponse500Type0",
+ "V1EmbeddingsCreateResponse500Type1",
+ "V1EmbeddingsCreateResponse500Type2",
+ "V1EmbeddingsCreateResponse500Type3",
+ "V1EmbeddingsCreateResponse500Type4",
+ "V1EmbeddingsCreateResponse500Type5",
+ ]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_0 = V1EmbeddingsCreateResponse500Type0.from_dict(data)
+
+ return response_500_type_0
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_1 = V1EmbeddingsCreateResponse500Type1.from_dict(data)
+
+ return response_500_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_2 = V1EmbeddingsCreateResponse500Type2.from_dict(data)
+
+ return response_500_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_3 = V1EmbeddingsCreateResponse500Type3.from_dict(data)
+
+ return response_500_type_3
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_4 = V1EmbeddingsCreateResponse500Type4.from_dict(data)
+
+ return response_500_type_4
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_5 = V1EmbeddingsCreateResponse500Type5.from_dict(data)
+
+ return response_500_type_5
+
+ response_500 = _parse_response_500(response.json())
+
+ return response_500
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(
+ *, client, response: httpx.Response
+) -> Response[
+ Union[
+ Union["V1EmbeddingsCreateResponse404Type0", "V1EmbeddingsCreateResponse404Type1"],
+ Union[
+ "V1EmbeddingsCreateResponse500Type0",
+ "V1EmbeddingsCreateResponse500Type1",
+ "V1EmbeddingsCreateResponse500Type2",
+ "V1EmbeddingsCreateResponse500Type3",
+ "V1EmbeddingsCreateResponse500Type4",
+ "V1EmbeddingsCreateResponse500Type5",
+ ],
+ V1EmbeddingsCreateResponse200,
+ V1EmbeddingsCreateResponse400,
+ V1EmbeddingsCreateResponse401,
+ V1EmbeddingsCreateResponse403,
+ V1EmbeddingsCreateResponse409,
+ V1EmbeddingsCreateResponse422,
+ V1EmbeddingsCreateResponse429,
+ ]
+]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def v1_embeddings_create_wrapper(client):
+ def v1_embeddings_create_wrapped(
+ **body: Unpack[V1EmbeddingsCreateJsonBody],
+ ) -> Union[
+ Union["V1EmbeddingsCreateResponse404Type0", "V1EmbeddingsCreateResponse404Type1"],
+ Union[
+ "V1EmbeddingsCreateResponse500Type0",
+ "V1EmbeddingsCreateResponse500Type1",
+ "V1EmbeddingsCreateResponse500Type2",
+ "V1EmbeddingsCreateResponse500Type3",
+ "V1EmbeddingsCreateResponse500Type4",
+ "V1EmbeddingsCreateResponse500Type5",
+ ],
+ V1EmbeddingsCreateResponse200,
+ V1EmbeddingsCreateResponse400,
+ V1EmbeddingsCreateResponse401,
+ V1EmbeddingsCreateResponse403,
+ V1EmbeddingsCreateResponse409,
+ V1EmbeddingsCreateResponse422,
+ V1EmbeddingsCreateResponse429,
+ ]:
+ """Creates embeddings for the given input.
+
+ Args:
+ authorization (str):
+ body (V1EmbeddingsCreateJsonBody):
+ body (V1EmbeddingsCreateDataBody):
+ body (V1EmbeddingsCreateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Union[Union['V1EmbeddingsCreateResponse404Type0', 'V1EmbeddingsCreateResponse404Type1'], Union['V1EmbeddingsCreateResponse500Type0', 'V1EmbeddingsCreateResponse500Type1', 'V1EmbeddingsCreateResponse500Type2', 'V1EmbeddingsCreateResponse500Type3', 'V1EmbeddingsCreateResponse500Type4', 'V1EmbeddingsCreateResponse500Type5'], V1EmbeddingsCreateResponse200, V1EmbeddingsCreateResponse400, V1EmbeddingsCreateResponse401, V1EmbeddingsCreateResponse403, V1EmbeddingsCreateResponse409, V1EmbeddingsCreateResponse422, V1EmbeddingsCreateResponse429]]
+ """
+
+ kwargs = _get_kwargs(
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return v1_embeddings_create_wrapped
diff --git a/premai/api/finetuning/__init__.py b/premai/api/finetuning/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/finetuning/v1_finetuning_create.py b/premai/api/finetuning/v1_finetuning_create.py
new file mode 100644
index 0000000..ac26581
--- /dev/null
+++ b/premai/api/finetuning/v1_finetuning_create.py
@@ -0,0 +1,266 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.v1_finetuning_create_json_body import V1FinetuningCreateJsonBody
+from ...models.v1_finetuning_create_response_200 import V1FinetuningCreateResponse200
+from ...models.v1_finetuning_create_response_400 import V1FinetuningCreateResponse400
+from ...models.v1_finetuning_create_response_401 import V1FinetuningCreateResponse401
+from ...models.v1_finetuning_create_response_403 import V1FinetuningCreateResponse403
+from ...models.v1_finetuning_create_response_404_type_0 import V1FinetuningCreateResponse404Type0
+from ...models.v1_finetuning_create_response_404_type_1 import V1FinetuningCreateResponse404Type1
+from ...models.v1_finetuning_create_response_409 import V1FinetuningCreateResponse409
+from ...models.v1_finetuning_create_response_422 import V1FinetuningCreateResponse422
+from ...models.v1_finetuning_create_response_429 import V1FinetuningCreateResponse429
+from ...models.v1_finetuning_create_response_500_type_0 import V1FinetuningCreateResponse500Type0
+from ...models.v1_finetuning_create_response_500_type_1 import V1FinetuningCreateResponse500Type1
+from ...models.v1_finetuning_create_response_500_type_2 import V1FinetuningCreateResponse500Type2
+from ...models.v1_finetuning_create_response_500_type_3 import V1FinetuningCreateResponse500Type3
+from ...models.v1_finetuning_create_response_500_type_4 import V1FinetuningCreateResponse500Type4
+from ...models.v1_finetuning_create_response_500_type_5 import V1FinetuningCreateResponse500Type5
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ **body: Unpack[V1FinetuningCreateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/v1/finetuning",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(
+ *, client, response: httpx.Response
+) -> Optional[
+ Union[
+ Union["V1FinetuningCreateResponse404Type0", "V1FinetuningCreateResponse404Type1"],
+ Union[
+ "V1FinetuningCreateResponse500Type0",
+ "V1FinetuningCreateResponse500Type1",
+ "V1FinetuningCreateResponse500Type2",
+ "V1FinetuningCreateResponse500Type3",
+ "V1FinetuningCreateResponse500Type4",
+ "V1FinetuningCreateResponse500Type5",
+ ],
+ V1FinetuningCreateResponse200,
+ V1FinetuningCreateResponse400,
+ V1FinetuningCreateResponse401,
+ V1FinetuningCreateResponse403,
+ V1FinetuningCreateResponse409,
+ V1FinetuningCreateResponse422,
+ V1FinetuningCreateResponse429,
+ ]
+]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = V1FinetuningCreateResponse200.from_dict(response.json())
+
+ return response_200
+ if response.status_code == HTTPStatus.BAD_REQUEST:
+ response_400 = V1FinetuningCreateResponse400.from_dict(response.json())
+
+ return response_400
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
+ response_401 = V1FinetuningCreateResponse401.from_dict(response.json())
+
+ return response_401
+ if response.status_code == HTTPStatus.FORBIDDEN:
+ response_403 = V1FinetuningCreateResponse403.from_dict(response.json())
+
+ return response_403
+ if response.status_code == HTTPStatus.NOT_FOUND:
+
+ def _parse_response_404(
+ data: object,
+ ) -> Union["V1FinetuningCreateResponse404Type0", "V1FinetuningCreateResponse404Type1"]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_0 = V1FinetuningCreateResponse404Type0.from_dict(data)
+
+ return response_404_type_0
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_1 = V1FinetuningCreateResponse404Type1.from_dict(data)
+
+ return response_404_type_1
+
+ response_404 = _parse_response_404(response.json())
+
+ return response_404
+ if response.status_code == HTTPStatus.CONFLICT:
+ response_409 = V1FinetuningCreateResponse409.from_dict(response.json())
+
+ return response_409
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
+ response_422 = V1FinetuningCreateResponse422.from_dict(response.json())
+
+ return response_422
+ if response.status_code == HTTPStatus.TOO_MANY_REQUESTS:
+ response_429 = V1FinetuningCreateResponse429.from_dict(response.json())
+
+ return response_429
+ if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
+
+ def _parse_response_500(
+ data: object,
+ ) -> Union[
+ "V1FinetuningCreateResponse500Type0",
+ "V1FinetuningCreateResponse500Type1",
+ "V1FinetuningCreateResponse500Type2",
+ "V1FinetuningCreateResponse500Type3",
+ "V1FinetuningCreateResponse500Type4",
+ "V1FinetuningCreateResponse500Type5",
+ ]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_0 = V1FinetuningCreateResponse500Type0.from_dict(data)
+
+ return response_500_type_0
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_1 = V1FinetuningCreateResponse500Type1.from_dict(data)
+
+ return response_500_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_2 = V1FinetuningCreateResponse500Type2.from_dict(data)
+
+ return response_500_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_3 = V1FinetuningCreateResponse500Type3.from_dict(data)
+
+ return response_500_type_3
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_4 = V1FinetuningCreateResponse500Type4.from_dict(data)
+
+ return response_500_type_4
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_5 = V1FinetuningCreateResponse500Type5.from_dict(data)
+
+ return response_500_type_5
+
+ response_500 = _parse_response_500(response.json())
+
+ return response_500
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(
+ *, client, response: httpx.Response
+) -> Response[
+ Union[
+ Union["V1FinetuningCreateResponse404Type0", "V1FinetuningCreateResponse404Type1"],
+ Union[
+ "V1FinetuningCreateResponse500Type0",
+ "V1FinetuningCreateResponse500Type1",
+ "V1FinetuningCreateResponse500Type2",
+ "V1FinetuningCreateResponse500Type3",
+ "V1FinetuningCreateResponse500Type4",
+ "V1FinetuningCreateResponse500Type5",
+ ],
+ V1FinetuningCreateResponse200,
+ V1FinetuningCreateResponse400,
+ V1FinetuningCreateResponse401,
+ V1FinetuningCreateResponse403,
+ V1FinetuningCreateResponse409,
+ V1FinetuningCreateResponse422,
+ V1FinetuningCreateResponse429,
+ ]
+]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def v1_finetuning_create_wrapper(client):
+ def v1_finetuning_create_wrapped(
+ **body: Unpack[V1FinetuningCreateJsonBody],
+ ) -> Union[
+ Union["V1FinetuningCreateResponse404Type0", "V1FinetuningCreateResponse404Type1"],
+ Union[
+ "V1FinetuningCreateResponse500Type0",
+ "V1FinetuningCreateResponse500Type1",
+ "V1FinetuningCreateResponse500Type2",
+ "V1FinetuningCreateResponse500Type3",
+ "V1FinetuningCreateResponse500Type4",
+ "V1FinetuningCreateResponse500Type5",
+ ],
+ V1FinetuningCreateResponse200,
+ V1FinetuningCreateResponse400,
+ V1FinetuningCreateResponse401,
+ V1FinetuningCreateResponse403,
+ V1FinetuningCreateResponse409,
+ V1FinetuningCreateResponse422,
+ V1FinetuningCreateResponse429,
+ ]:
+ """Creates a finetuning job.
+
+ Args:
+ authorization (str):
+ body (V1FinetuningCreateJsonBody):
+ body (V1FinetuningCreateDataBody):
+ body (V1FinetuningCreateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Union[Union['V1FinetuningCreateResponse404Type0', 'V1FinetuningCreateResponse404Type1'], Union['V1FinetuningCreateResponse500Type0', 'V1FinetuningCreateResponse500Type1', 'V1FinetuningCreateResponse500Type2', 'V1FinetuningCreateResponse500Type3', 'V1FinetuningCreateResponse500Type4', 'V1FinetuningCreateResponse500Type5'], V1FinetuningCreateResponse200, V1FinetuningCreateResponse400, V1FinetuningCreateResponse401, V1FinetuningCreateResponse403, V1FinetuningCreateResponse409, V1FinetuningCreateResponse422, V1FinetuningCreateResponse429]]
+ """
+
+ kwargs = _get_kwargs(
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return v1_finetuning_create_wrapped
diff --git a/premai/api/finetuning/v1_finetuning_retrieve.py b/premai/api/finetuning/v1_finetuning_retrieve.py
new file mode 100644
index 0000000..7dbf4f5
--- /dev/null
+++ b/premai/api/finetuning/v1_finetuning_retrieve.py
@@ -0,0 +1,258 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+from ...models.v1_finetuning_retrieve_response_200 import V1FinetuningRetrieveResponse200
+from ...models.v1_finetuning_retrieve_response_400 import V1FinetuningRetrieveResponse400
+from ...models.v1_finetuning_retrieve_response_401 import V1FinetuningRetrieveResponse401
+from ...models.v1_finetuning_retrieve_response_403 import V1FinetuningRetrieveResponse403
+from ...models.v1_finetuning_retrieve_response_404_type_0 import V1FinetuningRetrieveResponse404Type0
+from ...models.v1_finetuning_retrieve_response_404_type_1 import V1FinetuningRetrieveResponse404Type1
+from ...models.v1_finetuning_retrieve_response_409 import V1FinetuningRetrieveResponse409
+from ...models.v1_finetuning_retrieve_response_422 import V1FinetuningRetrieveResponse422
+from ...models.v1_finetuning_retrieve_response_429 import V1FinetuningRetrieveResponse429
+from ...models.v1_finetuning_retrieve_response_500_type_0 import V1FinetuningRetrieveResponse500Type0
+from ...models.v1_finetuning_retrieve_response_500_type_1 import V1FinetuningRetrieveResponse500Type1
+from ...models.v1_finetuning_retrieve_response_500_type_2 import V1FinetuningRetrieveResponse500Type2
+from ...models.v1_finetuning_retrieve_response_500_type_3 import V1FinetuningRetrieveResponse500Type3
+from ...models.v1_finetuning_retrieve_response_500_type_4 import V1FinetuningRetrieveResponse500Type4
+from ...models.v1_finetuning_retrieve_response_500_type_5 import V1FinetuningRetrieveResponse500Type5
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ job_id: str,
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": f"/v1/finetuning/{job_id}",
+ }
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(
+ *, client, response: httpx.Response
+) -> Optional[
+ Union[
+ Union["V1FinetuningRetrieveResponse404Type0", "V1FinetuningRetrieveResponse404Type1"],
+ Union[
+ "V1FinetuningRetrieveResponse500Type0",
+ "V1FinetuningRetrieveResponse500Type1",
+ "V1FinetuningRetrieveResponse500Type2",
+ "V1FinetuningRetrieveResponse500Type3",
+ "V1FinetuningRetrieveResponse500Type4",
+ "V1FinetuningRetrieveResponse500Type5",
+ ],
+ V1FinetuningRetrieveResponse200,
+ V1FinetuningRetrieveResponse400,
+ V1FinetuningRetrieveResponse401,
+ V1FinetuningRetrieveResponse403,
+ V1FinetuningRetrieveResponse409,
+ V1FinetuningRetrieveResponse422,
+ V1FinetuningRetrieveResponse429,
+ ]
+]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = V1FinetuningRetrieveResponse200.from_dict(response.json())
+
+ return response_200
+ if response.status_code == HTTPStatus.BAD_REQUEST:
+ response_400 = V1FinetuningRetrieveResponse400.from_dict(response.json())
+
+ return response_400
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
+ response_401 = V1FinetuningRetrieveResponse401.from_dict(response.json())
+
+ return response_401
+ if response.status_code == HTTPStatus.FORBIDDEN:
+ response_403 = V1FinetuningRetrieveResponse403.from_dict(response.json())
+
+ return response_403
+ if response.status_code == HTTPStatus.NOT_FOUND:
+
+ def _parse_response_404(
+ data: object,
+ ) -> Union["V1FinetuningRetrieveResponse404Type0", "V1FinetuningRetrieveResponse404Type1"]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_0 = V1FinetuningRetrieveResponse404Type0.from_dict(data)
+
+ return response_404_type_0
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_404_type_1 = V1FinetuningRetrieveResponse404Type1.from_dict(data)
+
+ return response_404_type_1
+
+ response_404 = _parse_response_404(response.json())
+
+ return response_404
+ if response.status_code == HTTPStatus.CONFLICT:
+ response_409 = V1FinetuningRetrieveResponse409.from_dict(response.json())
+
+ return response_409
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
+ response_422 = V1FinetuningRetrieveResponse422.from_dict(response.json())
+
+ return response_422
+ if response.status_code == HTTPStatus.TOO_MANY_REQUESTS:
+ response_429 = V1FinetuningRetrieveResponse429.from_dict(response.json())
+
+ return response_429
+ if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
+
+ def _parse_response_500(
+ data: object,
+ ) -> Union[
+ "V1FinetuningRetrieveResponse500Type0",
+ "V1FinetuningRetrieveResponse500Type1",
+ "V1FinetuningRetrieveResponse500Type2",
+ "V1FinetuningRetrieveResponse500Type3",
+ "V1FinetuningRetrieveResponse500Type4",
+ "V1FinetuningRetrieveResponse500Type5",
+ ]:
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_0 = V1FinetuningRetrieveResponse500Type0.from_dict(data)
+
+ return response_500_type_0
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_1 = V1FinetuningRetrieveResponse500Type1.from_dict(data)
+
+ return response_500_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_2 = V1FinetuningRetrieveResponse500Type2.from_dict(data)
+
+ return response_500_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_3 = V1FinetuningRetrieveResponse500Type3.from_dict(data)
+
+ return response_500_type_3
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_4 = V1FinetuningRetrieveResponse500Type4.from_dict(data)
+
+ return response_500_type_4
+ except: # noqa: E722
+ pass
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_500_type_5 = V1FinetuningRetrieveResponse500Type5.from_dict(data)
+
+ return response_500_type_5
+
+ response_500 = _parse_response_500(response.json())
+
+ return response_500
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(
+ *, client, response: httpx.Response
+) -> Response[
+ Union[
+ Union["V1FinetuningRetrieveResponse404Type0", "V1FinetuningRetrieveResponse404Type1"],
+ Union[
+ "V1FinetuningRetrieveResponse500Type0",
+ "V1FinetuningRetrieveResponse500Type1",
+ "V1FinetuningRetrieveResponse500Type2",
+ "V1FinetuningRetrieveResponse500Type3",
+ "V1FinetuningRetrieveResponse500Type4",
+ "V1FinetuningRetrieveResponse500Type5",
+ ],
+ V1FinetuningRetrieveResponse200,
+ V1FinetuningRetrieveResponse400,
+ V1FinetuningRetrieveResponse401,
+ V1FinetuningRetrieveResponse403,
+ V1FinetuningRetrieveResponse409,
+ V1FinetuningRetrieveResponse422,
+ V1FinetuningRetrieveResponse429,
+ ]
+]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def v1_finetuning_retrieve_wrapper(client):
+ def v1_finetuning_retrieve_wrapped(
+ job_id: str,
+ ) -> Union[
+ Union["V1FinetuningRetrieveResponse404Type0", "V1FinetuningRetrieveResponse404Type1"],
+ Union[
+ "V1FinetuningRetrieveResponse500Type0",
+ "V1FinetuningRetrieveResponse500Type1",
+ "V1FinetuningRetrieveResponse500Type2",
+ "V1FinetuningRetrieveResponse500Type3",
+ "V1FinetuningRetrieveResponse500Type4",
+ "V1FinetuningRetrieveResponse500Type5",
+ ],
+ V1FinetuningRetrieveResponse200,
+ V1FinetuningRetrieveResponse400,
+ V1FinetuningRetrieveResponse401,
+ V1FinetuningRetrieveResponse403,
+ V1FinetuningRetrieveResponse409,
+ V1FinetuningRetrieveResponse422,
+ V1FinetuningRetrieveResponse429,
+ ]:
+ """Retrieve a finetuning job.
+
+ Args:
+ job_id (str):
+ authorization (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Union[Union['V1FinetuningRetrieveResponse404Type0', 'V1FinetuningRetrieveResponse404Type1'], Union['V1FinetuningRetrieveResponse500Type0', 'V1FinetuningRetrieveResponse500Type1', 'V1FinetuningRetrieveResponse500Type2', 'V1FinetuningRetrieveResponse500Type3', 'V1FinetuningRetrieveResponse500Type4', 'V1FinetuningRetrieveResponse500Type5'], V1FinetuningRetrieveResponse200, V1FinetuningRetrieveResponse400, V1FinetuningRetrieveResponse401, V1FinetuningRetrieveResponse403, V1FinetuningRetrieveResponse409, V1FinetuningRetrieveResponse422, V1FinetuningRetrieveResponse429]]
+ """
+
+ kwargs = _get_kwargs(
+ job_id=job_id,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return v1_finetuning_retrieve_wrapped
diff --git a/premai/api/playgrounds/__init__.py b/premai/api/playgrounds/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/playgrounds/api_playgrounds_image_retrieve.py b/premai/api/playgrounds/api_playgrounds_image_retrieve.py
new file mode 100644
index 0000000..029f980
--- /dev/null
+++ b/premai/api/playgrounds/api_playgrounds_image_retrieve.py
@@ -0,0 +1,70 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ sharable_playground_uuid: str,
+) -> Dict[str, Any]:
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": f"/api/playgrounds/image/{sharable_playground_uuid}",
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[Any]:
+ if response.status_code == HTTPStatus.OK:
+ return None
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[Any]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_playgrounds_image_retrieve_wrapper(client):
+ def api_playgrounds_image_retrieve_wrapped(
+ sharable_playground_uuid: str,
+ ) -> Any:
+ """
+ Args:
+ sharable_playground_uuid (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Any]
+ """
+
+ kwargs = _get_kwargs(
+ sharable_playground_uuid=sharable_playground_uuid,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_playgrounds_image_retrieve_wrapped
diff --git a/premai/api/playgrounds/api_playgrounds_ot_info_retrieve.py b/premai/api/playgrounds/api_playgrounds_ot_info_retrieve.py
new file mode 100644
index 0000000..4dd88c9
--- /dev/null
+++ b/premai/api/playgrounds/api_playgrounds_ot_info_retrieve.py
@@ -0,0 +1,70 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ sharable_playground_uuid: str,
+) -> Dict[str, Any]:
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": f"/api/playgrounds/ot-info/{sharable_playground_uuid}",
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[Any]:
+ if response.status_code == HTTPStatus.OK:
+ return None
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[Any]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_playgrounds_ot_info_retrieve_wrapper(client):
+ def api_playgrounds_ot_info_retrieve_wrapped(
+ sharable_playground_uuid: str,
+ ) -> Any:
+ """
+ Args:
+ sharable_playground_uuid (str):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Any]
+ """
+
+ kwargs = _get_kwargs(
+ sharable_playground_uuid=sharable_playground_uuid,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_playgrounds_ot_info_retrieve_wrapped
diff --git a/premai/api/providers/__init__.py b/premai/api/providers/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/providers/api_providers_leaderboard_retrieve.py b/premai/api/providers/api_providers_leaderboard_retrieve.py
new file mode 100644
index 0000000..28dd18d
--- /dev/null
+++ b/premai/api/providers/api_providers_leaderboard_retrieve.py
@@ -0,0 +1,80 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+from ...models.api_providers_leaderboard_retrieve_response_200 import ApiProvidersLeaderboardRetrieveResponse200
+
+# from ...client import AuthenticatedClient, Client
+from ...types import UNSET, Response, Unset
+
+
+def _get_kwargs(
+ days: Union[Unset, int] = 30,
+) -> Dict[str, Any]:
+ params: Dict[str, Any] = {}
+
+ params["days"] = days
+
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": "/api/providers/leaderboard",
+ "params": params,
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProvidersLeaderboardRetrieveResponse200]:
+ if response.status_code == HTTPStatus.OK:
+ response_200 = ApiProvidersLeaderboardRetrieveResponse200.from_dict(response.json())
+
+ return response_200
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProvidersLeaderboardRetrieveResponse200]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_providers_leaderboard_retrieve_wrapper(client):
+ def api_providers_leaderboard_retrieve_wrapped(
+ days: Union[Unset, int] = 30,
+ ) -> ApiProvidersLeaderboardRetrieveResponse200:
+ """
+ Args:
+ days (Union[Unset, int]): Default: 30.
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProvidersLeaderboardRetrieveResponse200]
+ """
+
+ kwargs = _get_kwargs(
+ days=days,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_providers_leaderboard_retrieve_wrapped
diff --git a/premai/api/providers/api_providers_retrieve.py b/premai/api/providers/api_providers_retrieve.py
new file mode 100644
index 0000000..2573efe
--- /dev/null
+++ b/premai/api/providers/api_providers_retrieve.py
@@ -0,0 +1,77 @@
+from http import HTTPStatus
+from typing import Dict, Optional, Union
+
+import httpx
+from typing_extensions import Any
+
+from ... import errors
+
+# from ...client import AuthenticatedClient, Client
+from ...types import UNSET, Response, Unset
+
+
+def _get_kwargs(
+ days: Union[Unset, int] = 30,
+) -> Dict[str, Any]:
+ params: Dict[str, Any] = {}
+
+ params["days"] = days
+
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "get",
+ "url": "/api/providers/",
+ "params": params,
+ }
+
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[Any]:
+ if response.status_code == HTTPStatus.OK:
+ return None
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[Any]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_providers_retrieve_wrapper(client):
+ def api_providers_retrieve_wrapped(
+ days: Union[Unset, int] = 30,
+ ) -> Any:
+ """
+ Args:
+ days (Union[Unset, int]): Default: 30.
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[Any]
+ """
+
+ kwargs = _get_kwargs(
+ days=days,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_providers_retrieve_wrapped
diff --git a/premai/api/traces/__init__.py b/premai/api/traces/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/premai/api/traces/api_projects_traces_create.py b/premai/api/traces/api_projects_traces_create.py
new file mode 100644
index 0000000..1382b48
--- /dev/null
+++ b/premai/api/traces/api_projects_traces_create.py
@@ -0,0 +1,84 @@
+from http import HTTPStatus
+from typing import Dict, Optional
+
+import httpx
+from typing_extensions import Any, Unpack
+
+from ... import errors
+from ...models.api_projects_traces_create_json_body import ApiProjectsTracesCreateJsonBody
+from ...models.api_projects_traces_create_response_201 import ApiProjectsTracesCreateResponse201
+
+# from ...client import AuthenticatedClient, Client
+from ...types import Response
+
+
+def _get_kwargs(
+ **body: Unpack[ApiProjectsTracesCreateJsonBody],
+) -> Dict[str, Any]:
+ headers: Dict[str, Any] = {}
+
+ _kwargs: Dict[str, Any] = {
+ "method": "post",
+ "url": "/api/projects/traces/",
+ }
+
+ _json_body = body
+
+ _kwargs["json"] = _json_body
+ headers["Content-Type"] = "application/json"
+
+ _kwargs["headers"] = headers
+ return _kwargs
+
+
+def _parse_response(*, client, response: httpx.Response) -> Optional[ApiProjectsTracesCreateResponse201]:
+ if response.status_code == HTTPStatus.CREATED:
+ response_201 = ApiProjectsTracesCreateResponse201.from_dict(response.json())
+
+ return response_201
+ if client.raise_on_unexpected_status:
+ raise errors.UnexpectedStatus(response.status_code, response.content)
+ else:
+ return None
+
+
+def _build_response(*, client, response: httpx.Response) -> Response[ApiProjectsTracesCreateResponse201]:
+ return Response(
+ status_code=HTTPStatus(response.status_code),
+ content=response.content,
+ headers=response.headers,
+ parsed=_parse_response(client=client, response=response),
+ )
+
+
+def api_projects_traces_create_wrapper(client):
+ def api_projects_traces_create_wrapped(
+ **body: Unpack[ApiProjectsTracesCreateJsonBody],
+ ) -> ApiProjectsTracesCreateResponse201:
+ """
+ Args:
+ body (ApiProjectsTracesCreateJsonBody):
+ body (ApiProjectsTracesCreateDataBody):
+ body (ApiProjectsTracesCreateFilesBody):
+
+ Raises:
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
+
+ Returns:
+ Response[ApiProjectsTracesCreateResponse201]
+ """
+
+ kwargs = _get_kwargs(
+ **body,
+ )
+
+ httpx_client = client.get_httpx_client()
+
+ response = httpx_client.request(
+ **kwargs,
+ )
+
+ return _build_response(client=client, response=response).parsed
+
+ return api_projects_traces_create_wrapped
diff --git a/premai/client.py b/premai/client.py
new file mode 100644
index 0000000..e9be704
--- /dev/null
+++ b/premai/client.py
@@ -0,0 +1,272 @@
+import ssl
+from typing import Dict, Optional, Union
+
+import httpx
+from attrs import define, evolve, field
+
+# from typing import Any, Dict, Union, Optional
+from typing_extensions import Any
+
+from .api import (
+ ApiModule,
+ AuthTokenModule,
+ ChatCompletionsModule,
+ DatapointsModule,
+ EmbeddingsModule,
+ FinetuningModule,
+ PlaygroundsModule,
+ ProvidersModule,
+ TracesModule,
+)
+
+
+@define
+class Client:
+ """A class for keeping track of data related to the API
+
+
+ Attributes:
+ raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
+ status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
+ argument to the constructor.
+ """
+
+ raise_on_unexpected_status: bool = field(default=False, kw_only=True)
+ _base_url: str
+ _cookies: Dict[str, str] = field(factory=dict, kw_only=True)
+ _headers: Dict[str, str] = field(factory=dict, kw_only=True)
+ _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True)
+ _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True)
+ _follow_redirects: bool = field(default=False, kw_only=True)
+ _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True)
+ _client: Optional[httpx.Client] = field(default=None, init=False)
+ _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
+
+ def with_headers(self, headers: Dict[str, str]) -> "Client":
+ """Get a new client matching this one with additional headers"""
+ if self._client is not None:
+ self._client.headers.update(headers)
+ if self._async_client is not None:
+ self._async_client.headers.update(headers)
+ return evolve(self, headers={**self._headers, **headers})
+
+ def with_cookies(self, cookies: Dict[str, str]) -> "Client":
+ """Get a new client matching this one with additional cookies"""
+ if self._client is not None:
+ self._client.cookies.update(cookies)
+ if self._async_client is not None:
+ self._async_client.cookies.update(cookies)
+ return evolve(self, cookies={**self._cookies, **cookies})
+
+ def with_timeout(self, timeout: httpx.Timeout) -> "Client":
+ """Get a new client matching this one with a new timeout (in seconds)"""
+ if self._client is not None:
+ self._client.timeout = timeout
+ if self._async_client is not None:
+ self._async_client.timeout = timeout
+ return evolve(self, timeout=timeout)
+
+ def set_httpx_client(self, client: httpx.Client) -> "Client":
+ """Manually the underlying httpx.Client
+
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
+ """
+ self._client = client
+ return self
+
+ def get_httpx_client(self) -> httpx.Client:
+ """Get the underlying httpx.Client, constructing a new one if not previously set"""
+ if self._client is None:
+ self._client = httpx.Client(
+ base_url=self._base_url,
+ cookies=self._cookies,
+ headers=self._headers,
+ timeout=self._timeout,
+ verify=self._verify_ssl,
+ follow_redirects=self._follow_redirects,
+ **self._httpx_args,
+ )
+ return self._client
+
+ def __enter__(self) -> "Client":
+ """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
+ self.get_httpx_client().__enter__()
+ return self
+
+ def __exit__(self, *args: Any, **kwargs: Any) -> None:
+ """Exit a context manager for internal httpx.Client (see httpx docs)"""
+ self.get_httpx_client().__exit__(*args, **kwargs)
+
+ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
+ """Manually the underlying httpx.AsyncClient
+
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
+ """
+ self._async_client = async_client
+ return self
+
+ def get_async_httpx_client(self) -> httpx.AsyncClient:
+ """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
+ if self._async_client is None:
+ self._async_client = httpx.AsyncClient(
+ base_url=self._base_url,
+ cookies=self._cookies,
+ headers=self._headers,
+ timeout=self._timeout,
+ verify=self._verify_ssl,
+ follow_redirects=self._follow_redirects,
+ **self._httpx_args,
+ )
+ return self._async_client
+
+ async def __aenter__(self) -> "Client":
+ """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
+ await self.get_async_httpx_client().__aenter__()
+ return self
+
+ async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
+ """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
+ await self.get_async_httpx_client().__aexit__(*args, **kwargs)
+
+
+@define
+class AuthenticatedClient:
+ """A Client which has been authenticated for use on secured endpoints
+
+
+ Attributes:
+ raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
+ status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
+ argument to the constructor.
+ token: The token to use for authentication
+ prefix: The prefix to use for the Authorization header
+ auth_header_name: The name of the Authorization header
+ """
+
+ raise_on_unexpected_status: bool = field(default=False, kw_only=True)
+ _base_url: str
+ _cookies: Dict[str, str] = field(factory=dict, kw_only=True)
+ _headers: Dict[str, str] = field(factory=dict, kw_only=True)
+ _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True)
+ _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True)
+ _follow_redirects: bool = field(default=False, kw_only=True)
+ _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True)
+ _client: Optional[httpx.Client] = field(default=None, init=False)
+ _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
+
+ token: str = ""
+ prefix: str = "Bearer"
+ auth_header_name: str = "Authorization"
+
+ def with_headers(self, headers: Dict[str, str]) -> "AuthenticatedClient":
+ """Get a new client matching this one with additional headers"""
+ if self._client is not None:
+ self._client.headers.update(headers)
+ if self._async_client is not None:
+ self._async_client.headers.update(headers)
+ return evolve(self, headers={**self._headers, **headers})
+
+ def with_cookies(self, cookies: Dict[str, str]) -> "AuthenticatedClient":
+ """Get a new client matching this one with additional cookies"""
+ if self._client is not None:
+ self._client.cookies.update(cookies)
+ if self._async_client is not None:
+ self._async_client.cookies.update(cookies)
+ return evolve(self, cookies={**self._cookies, **cookies})
+
+ def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
+ """Get a new client matching this one with a new timeout (in seconds)"""
+ if self._client is not None:
+ self._client.timeout = timeout
+ if self._async_client is not None:
+ self._async_client.timeout = timeout
+ return evolve(self, timeout=timeout)
+
+ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
+ """Manually the underlying httpx.Client
+
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
+ """
+ self._client = client
+ return self
+
+ def get_httpx_client(self) -> httpx.Client:
+ """Get the underlying httpx.Client, constructing a new one if not previously set"""
+ if self._client is None:
+ self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
+ self._client = httpx.Client(
+ base_url=self._base_url,
+ cookies=self._cookies,
+ headers=self._headers,
+ timeout=self._timeout,
+ verify=self._verify_ssl,
+ follow_redirects=self._follow_redirects,
+ **self._httpx_args,
+ )
+ return self._client
+
+ def __enter__(self) -> "AuthenticatedClient":
+ """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
+ self.get_httpx_client().__enter__()
+ return self
+
+ def __exit__(self, *args: Any, **kwargs: Any) -> None:
+ """Exit a context manager for internal httpx.Client (see httpx docs)"""
+ self.get_httpx_client().__exit__(*args, **kwargs)
+
+ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
+ """Manually the underlying httpx.AsyncClient
+
+ **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
+ """
+ self._async_client = async_client
+ return self
+
+ def get_async_httpx_client(self) -> httpx.AsyncClient:
+ """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
+ if self._async_client is None:
+ self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
+ self._async_client = httpx.AsyncClient(
+ base_url=self._base_url,
+ cookies=self._cookies,
+ headers=self._headers,
+ timeout=self._timeout,
+ verify=self._verify_ssl,
+ follow_redirects=self._follow_redirects,
+ **self._httpx_args,
+ )
+ return self._async_client
+
+ async def __aenter__(self) -> "AuthenticatedClient":
+ """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
+ await self.get_async_httpx_client().__aenter__()
+ return self
+
+ async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
+ """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
+ await self.get_async_httpx_client().__aexit__(*args, **kwargs)
+
+
+class Prem:
+ playgrounds: PlaygroundsModule
+ datapoints: DatapointsModule
+ traces: TracesModule
+ providers: ProvidersModule
+ api: ApiModule
+ auth_token: AuthTokenModule
+ chat_completions: ChatCompletionsModule
+ embeddings: EmbeddingsModule
+ finetuning: FinetuningModule
+
+ def __init__(self, api_key: str = "", base_url="https://app.premai.io"):
+ client = AuthenticatedClient(token=api_key, base_url=base_url)
+ # Init modules
+ self.playgrounds = PlaygroundsModule(client)
+ self.datapoints = DatapointsModule(client)
+ self.traces = TracesModule(client)
+ self.providers = ProvidersModule(client)
+ self.api = ApiModule(client)
+ self.auth_token = AuthTokenModule(client)
+ self.chat_completions = ChatCompletionsModule(client)
+ self.embeddings = EmbeddingsModule(client)
+ self.finetuning = FinetuningModule(client)
diff --git a/premai/errors.py b/premai/errors.py
new file mode 100644
index 0000000..65a6f7e
--- /dev/null
+++ b/premai/errors.py
@@ -0,0 +1 @@
+""" Contains shared errors types that can be raised from API functions """
diff --git a/premai/models/__init__.py b/premai/models/__init__.py
new file mode 100644
index 0000000..82de6a0
--- /dev/null
+++ b/premai/models/__init__.py
@@ -0,0 +1,692 @@
+""" Contains all the data models used in inputs/outputs """
+
+from .api_projects_data_points_create_data_body import (
+ ApiProjectsDataPointsCreateDataBody,
+ ApiProjectsDataPointsCreateDataBodyDict,
+)
+from .api_projects_data_points_create_files_body import (
+ ApiProjectsDataPointsCreateFilesBody,
+ ApiProjectsDataPointsCreateFilesBodyDict,
+)
+from .api_projects_data_points_create_json_body import (
+ ApiProjectsDataPointsCreateJsonBody,
+ ApiProjectsDataPointsCreateJsonBodyDict,
+)
+from .api_projects_data_points_create_response_201 import ApiProjectsDataPointsCreateResponse201
+from .api_projects_data_points_list_response_200_item import ApiProjectsDataPointsListResponse200Item
+from .api_projects_data_points_partial_update_data_body import (
+ ApiProjectsDataPointsPartialUpdateDataBody,
+ ApiProjectsDataPointsPartialUpdateDataBodyDict,
+)
+from .api_projects_data_points_partial_update_files_body import (
+ ApiProjectsDataPointsPartialUpdateFilesBody,
+ ApiProjectsDataPointsPartialUpdateFilesBodyDict,
+)
+from .api_projects_data_points_partial_update_json_body import (
+ ApiProjectsDataPointsPartialUpdateJsonBody,
+ ApiProjectsDataPointsPartialUpdateJsonBodyDict,
+)
+from .api_projects_data_points_partial_update_response_200 import ApiProjectsDataPointsPartialUpdateResponse200
+from .api_projects_data_points_retrieve_response_200 import ApiProjectsDataPointsRetrieveResponse200
+from .api_projects_data_points_update_data_body import (
+ ApiProjectsDataPointsUpdateDataBody,
+ ApiProjectsDataPointsUpdateDataBodyDict,
+)
+from .api_projects_data_points_update_files_body import (
+ ApiProjectsDataPointsUpdateFilesBody,
+ ApiProjectsDataPointsUpdateFilesBodyDict,
+)
+from .api_projects_data_points_update_json_body import (
+ ApiProjectsDataPointsUpdateJsonBody,
+ ApiProjectsDataPointsUpdateJsonBodyDict,
+)
+from .api_projects_data_points_update_response_200 import ApiProjectsDataPointsUpdateResponse200
+from .api_projects_traces_create_data_body import ApiProjectsTracesCreateDataBody, ApiProjectsTracesCreateDataBodyDict
+from .api_projects_traces_create_data_body_raw_request_type_0 import ApiProjectsTracesCreateDataBodyRawRequestType0
+from .api_projects_traces_create_data_body_raw_response_type_0 import ApiProjectsTracesCreateDataBodyRawResponseType0
+from .api_projects_traces_create_files_body import (
+ ApiProjectsTracesCreateFilesBody,
+ ApiProjectsTracesCreateFilesBodyDict,
+)
+from .api_projects_traces_create_files_body_raw_request_type_0 import ApiProjectsTracesCreateFilesBodyRawRequestType0
+from .api_projects_traces_create_files_body_raw_response_type_0 import ApiProjectsTracesCreateFilesBodyRawResponseType0
+from .api_projects_traces_create_json_body import ApiProjectsTracesCreateJsonBody, ApiProjectsTracesCreateJsonBodyDict
+from .api_projects_traces_create_json_body_raw_request_type_0 import ApiProjectsTracesCreateJsonBodyRawRequestType0
+from .api_projects_traces_create_json_body_raw_response_type_0 import ApiProjectsTracesCreateJsonBodyRawResponseType0
+from .api_projects_traces_create_response_201 import ApiProjectsTracesCreateResponse201
+from .api_projects_traces_create_response_201_raw_request_type_0 import (
+ ApiProjectsTracesCreateResponse201RawRequestType0,
+)
+from .api_projects_traces_create_response_201_raw_response_type_0 import (
+ ApiProjectsTracesCreateResponse201RawResponseType0,
+)
+from .api_providers_leaderboard_retrieve_response_200 import ApiProvidersLeaderboardRetrieveResponse200
+from .api_providers_leaderboard_retrieve_response_200_leaderboard_item import (
+ ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem,
+)
+from .api_response_validation_error import APIResponseValidationError
+from .api_response_validation_error_code import APIResponseValidationErrorCode
+from .api_response_validation_error_code_enum import APIResponseValidationErrorCodeEnum
+from .api_schema_retrieve_format import ApiSchemaRetrieveFormat
+from .api_schema_retrieve_lang import ApiSchemaRetrieveLang
+from .api_schema_retrieve_response_200 import ApiSchemaRetrieveResponse200
+from .auth_token import AuthToken
+from .auth_token_create_data_body import AuthTokenCreateDataBody, AuthTokenCreateDataBodyDict
+from .auth_token_create_files_body import AuthTokenCreateFilesBody, AuthTokenCreateFilesBodyDict
+from .auth_token_create_json_body import AuthTokenCreateJsonBody, AuthTokenCreateJsonBodyDict
+from .auth_token_create_response_200 import AuthTokenCreateResponse200
+from .authentication_error import AuthenticationError
+from .authentication_error_code import AuthenticationErrorCode
+from .authentication_error_code_enum import AuthenticationErrorCodeEnum
+from .catch_all_error import CatchAllError
+from .catch_all_error_code import CatchAllErrorCode
+from .catch_all_error_code_enum import CatchAllErrorCodeEnum
+from .chat_completion_input import ChatCompletionInput
+from .chat_completion_input_logit_bias_type_0 import ChatCompletionInputLogitBiasType0
+from .chat_completion_input_messages_item import ChatCompletionInputMessagesItem
+from .chat_completion_input_messages_item_role import ChatCompletionInputMessagesItemRole
+from .chat_completion_input_response_format_type_0 import ChatCompletionInputResponseFormatType0
+from .chat_completion_input_tools_item import ChatCompletionInputToolsItem
+from .chat_completion_response import ChatCompletionResponse
+from .chat_completion_response_choices_item import ChatCompletionResponseChoicesItem
+from .chat_completion_response_usage import ChatCompletionResponseUsage
+from .conflict_error import ConflictError
+from .conflict_error_code import ConflictErrorCode
+from .conflict_error_code_enum import ConflictErrorCodeEnum
+from .data_point import DataPoint
+from .embedding import Embedding
+from .embeddings_input import EmbeddingsInput
+from .embeddings_input_encoding_format import EmbeddingsInputEncodingFormat
+from .embeddings_response import EmbeddingsResponse
+from .embeddings_response_data_item import EmbeddingsResponseDataItem
+from .embeddings_response_usage import EmbeddingsResponseUsage
+from .encoding_format_enum import EncodingFormatEnum
+from .fine_tuning_input import FineTuningInput
+from .fine_tuning_input_training_data_item import FineTuningInputTrainingDataItem
+from .fine_tuning_input_validaton_data_item import FineTuningInputValidatonDataItem
+from .fine_tuning_response import FineTuningResponse
+from .fine_tuning_sample import FineTuningSample
+from .input_data_point import InputDataPoint
+from .internal_server_error_type_0 import InternalServerErrorType0
+from .internal_server_error_type_0_code import InternalServerErrorType0Code
+from .internal_server_error_type_1 import InternalServerErrorType1
+from .internal_server_error_type_1_code import InternalServerErrorType1Code
+from .internal_server_error_type_2 import InternalServerErrorType2
+from .internal_server_error_type_2_code import InternalServerErrorType2Code
+from .internal_server_error_type_3 import InternalServerErrorType3
+from .internal_server_error_type_3_code import InternalServerErrorType3Code
+from .internal_server_error_type_4 import InternalServerErrorType4
+from .internal_server_error_type_4_code import InternalServerErrorType4Code
+from .internal_server_error_type_5 import InternalServerErrorType5
+from .internal_server_error_type_5_code import InternalServerErrorType5Code
+from .leaderboard_item import LeaderboardItem
+from .leaderboard_response import LeaderboardResponse
+from .leaderboard_response_leaderboard_item import LeaderboardResponseLeaderboardItem
+from .message import Message
+from .message_role import MessageRole
+from .model_not_found_error import ModelNotFoundError
+from .model_not_found_error_code import ModelNotFoundErrorCode
+from .model_not_found_error_code_enum import ModelNotFoundErrorCodeEnum
+from .not_found_error_type_0 import NotFoundErrorType0
+from .not_found_error_type_0_code import NotFoundErrorType0Code
+from .not_found_error_type_1 import NotFoundErrorType1
+from .not_found_error_type_1_code import NotFoundErrorType1Code
+from .patched_data_point import PatchedDataPoint
+from .permission_denied_error import PermissionDeniedError
+from .permission_denied_error_code import PermissionDeniedErrorCode
+from .permission_denied_error_code_enum import PermissionDeniedErrorCodeEnum
+from .provider_api_connection_error import ProviderAPIConnectionError
+from .provider_api_connection_error_code import ProviderAPIConnectionErrorCode
+from .provider_api_connection_error_code_enum import ProviderAPIConnectionErrorCodeEnum
+from .provider_api_status_error import ProviderAPIStatusError
+from .provider_api_status_error_code import ProviderAPIStatusErrorCode
+from .provider_api_status_error_code_enum import ProviderAPIStatusErrorCodeEnum
+from .provider_api_timeout_error import ProviderAPITimeoutError
+from .provider_api_timeout_error_code import ProviderAPITimeoutErrorCode
+from .provider_api_timeout_error_code_enum import ProviderAPITimeoutErrorCodeEnum
+from .provider_internal_server_error import ProviderInternalServerError
+from .provider_internal_server_error_code import ProviderInternalServerErrorCode
+from .provider_internal_server_error_code_enum import ProviderInternalServerErrorCodeEnum
+from .provider_not_found_error import ProviderNotFoundError
+from .provider_not_found_error_code import ProviderNotFoundErrorCode
+from .provider_not_found_error_code_enum import ProviderNotFoundErrorCodeEnum
+from .rate_limit_error import RateLimitError
+from .rate_limit_error_code import RateLimitErrorCode
+from .rate_limit_error_code_enum import RateLimitErrorCodeEnum
+from .response_choice import ResponseChoice
+from .retrieve_fine_tuning_response import RetrieveFineTuningResponse
+from .role_enum import RoleEnum
+from .trace import Trace
+from .trace_raw_request_type_0 import TraceRawRequestType0
+from .trace_raw_response_type_0 import TraceRawResponseType0
+from .unprocessable_entity_error import UnprocessableEntityError
+from .unprocessable_entity_error_code import UnprocessableEntityErrorCode
+from .unprocessable_entity_error_code_enum import UnprocessableEntityErrorCodeEnum
+from .usage import Usage
+from .v1_chat_completions_create_data_body import V1ChatCompletionsCreateDataBody, V1ChatCompletionsCreateDataBodyDict
+from .v1_chat_completions_create_data_body_logit_bias_type_0 import V1ChatCompletionsCreateDataBodyLogitBiasType0
+from .v1_chat_completions_create_data_body_messages_item import V1ChatCompletionsCreateDataBodyMessagesItem
+from .v1_chat_completions_create_data_body_messages_item_role import V1ChatCompletionsCreateDataBodyMessagesItemRole
+from .v1_chat_completions_create_data_body_response_format_type_0 import (
+ V1ChatCompletionsCreateDataBodyResponseFormatType0,
+)
+from .v1_chat_completions_create_data_body_tools_item import V1ChatCompletionsCreateDataBodyToolsItem
+from .v1_chat_completions_create_files_body import (
+ V1ChatCompletionsCreateFilesBody,
+ V1ChatCompletionsCreateFilesBodyDict,
+)
+from .v1_chat_completions_create_files_body_logit_bias_type_0 import V1ChatCompletionsCreateFilesBodyLogitBiasType0
+from .v1_chat_completions_create_files_body_messages_item import V1ChatCompletionsCreateFilesBodyMessagesItem
+from .v1_chat_completions_create_files_body_messages_item_role import V1ChatCompletionsCreateFilesBodyMessagesItemRole
+from .v1_chat_completions_create_files_body_response_format_type_0 import (
+ V1ChatCompletionsCreateFilesBodyResponseFormatType0,
+)
+from .v1_chat_completions_create_files_body_tools_item import V1ChatCompletionsCreateFilesBodyToolsItem
+from .v1_chat_completions_create_json_body import V1ChatCompletionsCreateJsonBody, V1ChatCompletionsCreateJsonBodyDict
+from .v1_chat_completions_create_json_body_logit_bias_type_0 import V1ChatCompletionsCreateJsonBodyLogitBiasType0
+from .v1_chat_completions_create_json_body_messages_item import V1ChatCompletionsCreateJsonBodyMessagesItem
+from .v1_chat_completions_create_json_body_messages_item_role import V1ChatCompletionsCreateJsonBodyMessagesItemRole
+from .v1_chat_completions_create_json_body_response_format_type_0 import (
+ V1ChatCompletionsCreateJsonBodyResponseFormatType0,
+)
+from .v1_chat_completions_create_json_body_tools_item import V1ChatCompletionsCreateJsonBodyToolsItem
+from .v1_chat_completions_create_response_200 import V1ChatCompletionsCreateResponse200
+from .v1_chat_completions_create_response_200_choices_item import V1ChatCompletionsCreateResponse200ChoicesItem
+from .v1_chat_completions_create_response_200_usage import V1ChatCompletionsCreateResponse200Usage
+from .v1_chat_completions_create_response_400 import V1ChatCompletionsCreateResponse400
+from .v1_chat_completions_create_response_400_code import V1ChatCompletionsCreateResponse400Code
+from .v1_chat_completions_create_response_400_details import V1ChatCompletionsCreateResponse400Details
+from .v1_chat_completions_create_response_400_details_additional_property import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalProperty,
+)
+from .v1_chat_completions_create_response_400_details_additional_property_error_messages_item import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+from .v1_chat_completions_create_response_401 import V1ChatCompletionsCreateResponse401
+from .v1_chat_completions_create_response_401_code import V1ChatCompletionsCreateResponse401Code
+from .v1_chat_completions_create_response_403 import V1ChatCompletionsCreateResponse403
+from .v1_chat_completions_create_response_403_code import V1ChatCompletionsCreateResponse403Code
+from .v1_chat_completions_create_response_404_type_0 import V1ChatCompletionsCreateResponse404Type0
+from .v1_chat_completions_create_response_404_type_0_code import V1ChatCompletionsCreateResponse404Type0Code
+from .v1_chat_completions_create_response_404_type_1 import V1ChatCompletionsCreateResponse404Type1
+from .v1_chat_completions_create_response_404_type_1_code import V1ChatCompletionsCreateResponse404Type1Code
+from .v1_chat_completions_create_response_409 import V1ChatCompletionsCreateResponse409
+from .v1_chat_completions_create_response_409_code import V1ChatCompletionsCreateResponse409Code
+from .v1_chat_completions_create_response_422 import V1ChatCompletionsCreateResponse422
+from .v1_chat_completions_create_response_422_code import V1ChatCompletionsCreateResponse422Code
+from .v1_chat_completions_create_response_429 import V1ChatCompletionsCreateResponse429
+from .v1_chat_completions_create_response_429_code import V1ChatCompletionsCreateResponse429Code
+from .v1_chat_completions_create_response_500_type_0 import V1ChatCompletionsCreateResponse500Type0
+from .v1_chat_completions_create_response_500_type_0_code import V1ChatCompletionsCreateResponse500Type0Code
+from .v1_chat_completions_create_response_500_type_1 import V1ChatCompletionsCreateResponse500Type1
+from .v1_chat_completions_create_response_500_type_1_code import V1ChatCompletionsCreateResponse500Type1Code
+from .v1_chat_completions_create_response_500_type_2 import V1ChatCompletionsCreateResponse500Type2
+from .v1_chat_completions_create_response_500_type_2_code import V1ChatCompletionsCreateResponse500Type2Code
+from .v1_chat_completions_create_response_500_type_3 import V1ChatCompletionsCreateResponse500Type3
+from .v1_chat_completions_create_response_500_type_3_code import V1ChatCompletionsCreateResponse500Type3Code
+from .v1_chat_completions_create_response_500_type_4 import V1ChatCompletionsCreateResponse500Type4
+from .v1_chat_completions_create_response_500_type_4_code import V1ChatCompletionsCreateResponse500Type4Code
+from .v1_chat_completions_create_response_500_type_5 import V1ChatCompletionsCreateResponse500Type5
+from .v1_chat_completions_create_response_500_type_5_code import V1ChatCompletionsCreateResponse500Type5Code
+from .v1_embeddings_create_data_body import V1EmbeddingsCreateDataBody, V1EmbeddingsCreateDataBodyDict
+from .v1_embeddings_create_data_body_encoding_format import V1EmbeddingsCreateDataBodyEncodingFormat
+from .v1_embeddings_create_files_body import V1EmbeddingsCreateFilesBody, V1EmbeddingsCreateFilesBodyDict
+from .v1_embeddings_create_files_body_encoding_format import V1EmbeddingsCreateFilesBodyEncodingFormat
+from .v1_embeddings_create_json_body import V1EmbeddingsCreateJsonBody, V1EmbeddingsCreateJsonBodyDict
+from .v1_embeddings_create_json_body_encoding_format import V1EmbeddingsCreateJsonBodyEncodingFormat
+from .v1_embeddings_create_response_200 import V1EmbeddingsCreateResponse200
+from .v1_embeddings_create_response_200_data_item import V1EmbeddingsCreateResponse200DataItem
+from .v1_embeddings_create_response_200_usage import V1EmbeddingsCreateResponse200Usage
+from .v1_embeddings_create_response_400 import V1EmbeddingsCreateResponse400
+from .v1_embeddings_create_response_400_code import V1EmbeddingsCreateResponse400Code
+from .v1_embeddings_create_response_400_details import V1EmbeddingsCreateResponse400Details
+from .v1_embeddings_create_response_400_details_additional_property import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalProperty,
+)
+from .v1_embeddings_create_response_400_details_additional_property_error_messages_item import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+from .v1_embeddings_create_response_401 import V1EmbeddingsCreateResponse401
+from .v1_embeddings_create_response_401_code import V1EmbeddingsCreateResponse401Code
+from .v1_embeddings_create_response_403 import V1EmbeddingsCreateResponse403
+from .v1_embeddings_create_response_403_code import V1EmbeddingsCreateResponse403Code
+from .v1_embeddings_create_response_404_type_0 import V1EmbeddingsCreateResponse404Type0
+from .v1_embeddings_create_response_404_type_0_code import V1EmbeddingsCreateResponse404Type0Code
+from .v1_embeddings_create_response_404_type_1 import V1EmbeddingsCreateResponse404Type1
+from .v1_embeddings_create_response_404_type_1_code import V1EmbeddingsCreateResponse404Type1Code
+from .v1_embeddings_create_response_409 import V1EmbeddingsCreateResponse409
+from .v1_embeddings_create_response_409_code import V1EmbeddingsCreateResponse409Code
+from .v1_embeddings_create_response_422 import V1EmbeddingsCreateResponse422
+from .v1_embeddings_create_response_422_code import V1EmbeddingsCreateResponse422Code
+from .v1_embeddings_create_response_429 import V1EmbeddingsCreateResponse429
+from .v1_embeddings_create_response_429_code import V1EmbeddingsCreateResponse429Code
+from .v1_embeddings_create_response_500_type_0 import V1EmbeddingsCreateResponse500Type0
+from .v1_embeddings_create_response_500_type_0_code import V1EmbeddingsCreateResponse500Type0Code
+from .v1_embeddings_create_response_500_type_1 import V1EmbeddingsCreateResponse500Type1
+from .v1_embeddings_create_response_500_type_1_code import V1EmbeddingsCreateResponse500Type1Code
+from .v1_embeddings_create_response_500_type_2 import V1EmbeddingsCreateResponse500Type2
+from .v1_embeddings_create_response_500_type_2_code import V1EmbeddingsCreateResponse500Type2Code
+from .v1_embeddings_create_response_500_type_3 import V1EmbeddingsCreateResponse500Type3
+from .v1_embeddings_create_response_500_type_3_code import V1EmbeddingsCreateResponse500Type3Code
+from .v1_embeddings_create_response_500_type_4 import V1EmbeddingsCreateResponse500Type4
+from .v1_embeddings_create_response_500_type_4_code import V1EmbeddingsCreateResponse500Type4Code
+from .v1_embeddings_create_response_500_type_5 import V1EmbeddingsCreateResponse500Type5
+from .v1_embeddings_create_response_500_type_5_code import V1EmbeddingsCreateResponse500Type5Code
+from .v1_finetuning_create_data_body import V1FinetuningCreateDataBody, V1FinetuningCreateDataBodyDict
+from .v1_finetuning_create_data_body_training_data_item import V1FinetuningCreateDataBodyTrainingDataItem
+from .v1_finetuning_create_data_body_validaton_data_item import V1FinetuningCreateDataBodyValidatonDataItem
+from .v1_finetuning_create_files_body import V1FinetuningCreateFilesBody, V1FinetuningCreateFilesBodyDict
+from .v1_finetuning_create_files_body_training_data_item import V1FinetuningCreateFilesBodyTrainingDataItem
+from .v1_finetuning_create_files_body_validaton_data_item import V1FinetuningCreateFilesBodyValidatonDataItem
+from .v1_finetuning_create_json_body import V1FinetuningCreateJsonBody, V1FinetuningCreateJsonBodyDict
+from .v1_finetuning_create_json_body_training_data_item import V1FinetuningCreateJsonBodyTrainingDataItem
+from .v1_finetuning_create_json_body_validaton_data_item import V1FinetuningCreateJsonBodyValidatonDataItem
+from .v1_finetuning_create_response_200 import V1FinetuningCreateResponse200
+from .v1_finetuning_create_response_400 import V1FinetuningCreateResponse400
+from .v1_finetuning_create_response_400_code import V1FinetuningCreateResponse400Code
+from .v1_finetuning_create_response_400_details import V1FinetuningCreateResponse400Details
+from .v1_finetuning_create_response_400_details_additional_property import (
+ V1FinetuningCreateResponse400DetailsAdditionalProperty,
+)
+from .v1_finetuning_create_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+from .v1_finetuning_create_response_401 import V1FinetuningCreateResponse401
+from .v1_finetuning_create_response_401_code import V1FinetuningCreateResponse401Code
+from .v1_finetuning_create_response_403 import V1FinetuningCreateResponse403
+from .v1_finetuning_create_response_403_code import V1FinetuningCreateResponse403Code
+from .v1_finetuning_create_response_404_type_0 import V1FinetuningCreateResponse404Type0
+from .v1_finetuning_create_response_404_type_0_code import V1FinetuningCreateResponse404Type0Code
+from .v1_finetuning_create_response_404_type_1 import V1FinetuningCreateResponse404Type1
+from .v1_finetuning_create_response_404_type_1_code import V1FinetuningCreateResponse404Type1Code
+from .v1_finetuning_create_response_409 import V1FinetuningCreateResponse409
+from .v1_finetuning_create_response_409_code import V1FinetuningCreateResponse409Code
+from .v1_finetuning_create_response_422 import V1FinetuningCreateResponse422
+from .v1_finetuning_create_response_422_code import V1FinetuningCreateResponse422Code
+from .v1_finetuning_create_response_429 import V1FinetuningCreateResponse429
+from .v1_finetuning_create_response_429_code import V1FinetuningCreateResponse429Code
+from .v1_finetuning_create_response_500_type_0 import V1FinetuningCreateResponse500Type0
+from .v1_finetuning_create_response_500_type_0_code import V1FinetuningCreateResponse500Type0Code
+from .v1_finetuning_create_response_500_type_1 import V1FinetuningCreateResponse500Type1
+from .v1_finetuning_create_response_500_type_1_code import V1FinetuningCreateResponse500Type1Code
+from .v1_finetuning_create_response_500_type_2 import V1FinetuningCreateResponse500Type2
+from .v1_finetuning_create_response_500_type_2_code import V1FinetuningCreateResponse500Type2Code
+from .v1_finetuning_create_response_500_type_3 import V1FinetuningCreateResponse500Type3
+from .v1_finetuning_create_response_500_type_3_code import V1FinetuningCreateResponse500Type3Code
+from .v1_finetuning_create_response_500_type_4 import V1FinetuningCreateResponse500Type4
+from .v1_finetuning_create_response_500_type_4_code import V1FinetuningCreateResponse500Type4Code
+from .v1_finetuning_create_response_500_type_5 import V1FinetuningCreateResponse500Type5
+from .v1_finetuning_create_response_500_type_5_code import V1FinetuningCreateResponse500Type5Code
+from .v1_finetuning_retrieve_response_200 import V1FinetuningRetrieveResponse200
+from .v1_finetuning_retrieve_response_400 import V1FinetuningRetrieveResponse400
+from .v1_finetuning_retrieve_response_400_code import V1FinetuningRetrieveResponse400Code
+from .v1_finetuning_retrieve_response_400_details import V1FinetuningRetrieveResponse400Details
+from .v1_finetuning_retrieve_response_400_details_additional_property import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalProperty,
+)
+from .v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+from .v1_finetuning_retrieve_response_401 import V1FinetuningRetrieveResponse401
+from .v1_finetuning_retrieve_response_401_code import V1FinetuningRetrieveResponse401Code
+from .v1_finetuning_retrieve_response_403 import V1FinetuningRetrieveResponse403
+from .v1_finetuning_retrieve_response_403_code import V1FinetuningRetrieveResponse403Code
+from .v1_finetuning_retrieve_response_404_type_0 import V1FinetuningRetrieveResponse404Type0
+from .v1_finetuning_retrieve_response_404_type_0_code import V1FinetuningRetrieveResponse404Type0Code
+from .v1_finetuning_retrieve_response_404_type_1 import V1FinetuningRetrieveResponse404Type1
+from .v1_finetuning_retrieve_response_404_type_1_code import V1FinetuningRetrieveResponse404Type1Code
+from .v1_finetuning_retrieve_response_409 import V1FinetuningRetrieveResponse409
+from .v1_finetuning_retrieve_response_409_code import V1FinetuningRetrieveResponse409Code
+from .v1_finetuning_retrieve_response_422 import V1FinetuningRetrieveResponse422
+from .v1_finetuning_retrieve_response_422_code import V1FinetuningRetrieveResponse422Code
+from .v1_finetuning_retrieve_response_429 import V1FinetuningRetrieveResponse429
+from .v1_finetuning_retrieve_response_429_code import V1FinetuningRetrieveResponse429Code
+from .v1_finetuning_retrieve_response_500_type_0 import V1FinetuningRetrieveResponse500Type0
+from .v1_finetuning_retrieve_response_500_type_0_code import V1FinetuningRetrieveResponse500Type0Code
+from .v1_finetuning_retrieve_response_500_type_1 import V1FinetuningRetrieveResponse500Type1
+from .v1_finetuning_retrieve_response_500_type_1_code import V1FinetuningRetrieveResponse500Type1Code
+from .v1_finetuning_retrieve_response_500_type_2 import V1FinetuningRetrieveResponse500Type2
+from .v1_finetuning_retrieve_response_500_type_2_code import V1FinetuningRetrieveResponse500Type2Code
+from .v1_finetuning_retrieve_response_500_type_3 import V1FinetuningRetrieveResponse500Type3
+from .v1_finetuning_retrieve_response_500_type_3_code import V1FinetuningRetrieveResponse500Type3Code
+from .v1_finetuning_retrieve_response_500_type_4 import V1FinetuningRetrieveResponse500Type4
+from .v1_finetuning_retrieve_response_500_type_4_code import V1FinetuningRetrieveResponse500Type4Code
+from .v1_finetuning_retrieve_response_500_type_5 import V1FinetuningRetrieveResponse500Type5
+from .v1_finetuning_retrieve_response_500_type_5_code import V1FinetuningRetrieveResponse500Type5Code
+from .validation_detail import ValidationDetail
+from .validation_detail_error_messages_item import ValidationDetailErrorMessagesItem
+from .validation_error import ValidationError
+from .validation_error_code import ValidationErrorCode
+from .validation_error_code_enum import ValidationErrorCodeEnum
+from .validation_error_details import ValidationErrorDetails
+from .validation_error_details_additional_property import ValidationErrorDetailsAdditionalProperty
+from .validation_error_details_additional_property_error_messages_item import (
+ ValidationErrorDetailsAdditionalPropertyErrorMessagesItem,
+)
+
+__all__ = (
+ "ApiProjectsDataPointsCreateDataBody",
+ "ApiProjectsDataPointsCreateFilesBody",
+ "ApiProjectsDataPointsCreateJsonBody",
+ "ApiProjectsDataPointsCreateResponse201",
+ "ApiProjectsDataPointsListResponse200Item",
+ "ApiProjectsDataPointsPartialUpdateDataBody",
+ "ApiProjectsDataPointsPartialUpdateFilesBody",
+ "ApiProjectsDataPointsPartialUpdateJsonBody",
+ "ApiProjectsDataPointsPartialUpdateResponse200",
+ "ApiProjectsDataPointsRetrieveResponse200",
+ "ApiProjectsDataPointsUpdateDataBody",
+ "ApiProjectsDataPointsUpdateFilesBody",
+ "ApiProjectsDataPointsUpdateJsonBody",
+ "ApiProjectsDataPointsUpdateResponse200",
+ "ApiProjectsTracesCreateDataBody",
+ "ApiProjectsTracesCreateDataBodyRawRequestType0",
+ "ApiProjectsTracesCreateDataBodyRawResponseType0",
+ "ApiProjectsTracesCreateFilesBody",
+ "ApiProjectsTracesCreateFilesBodyRawRequestType0",
+ "ApiProjectsTracesCreateFilesBodyRawResponseType0",
+ "ApiProjectsTracesCreateJsonBody",
+ "ApiProjectsTracesCreateJsonBodyRawRequestType0",
+ "ApiProjectsTracesCreateJsonBodyRawResponseType0",
+ "ApiProjectsTracesCreateResponse201",
+ "ApiProjectsTracesCreateResponse201RawRequestType0",
+ "ApiProjectsTracesCreateResponse201RawResponseType0",
+ "ApiProvidersLeaderboardRetrieveResponse200",
+ "ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem",
+ "APIResponseValidationError",
+ "APIResponseValidationErrorCode",
+ "APIResponseValidationErrorCodeEnum",
+ "ApiSchemaRetrieveFormat",
+ "ApiSchemaRetrieveLang",
+ "ApiSchemaRetrieveResponse200",
+ "AuthenticationError",
+ "AuthenticationErrorCode",
+ "AuthenticationErrorCodeEnum",
+ "AuthToken",
+ "AuthTokenCreateDataBody",
+ "AuthTokenCreateFilesBody",
+ "AuthTokenCreateJsonBody",
+ "AuthTokenCreateResponse200",
+ "CatchAllError",
+ "CatchAllErrorCode",
+ "CatchAllErrorCodeEnum",
+ "ChatCompletionInput",
+ "ChatCompletionInputLogitBiasType0",
+ "ChatCompletionInputMessagesItem",
+ "ChatCompletionInputMessagesItemRole",
+ "ChatCompletionInputResponseFormatType0",
+ "ChatCompletionInputToolsItem",
+ "ChatCompletionResponse",
+ "ChatCompletionResponseChoicesItem",
+ "ChatCompletionResponseUsage",
+ "ConflictError",
+ "ConflictErrorCode",
+ "ConflictErrorCodeEnum",
+ "DataPoint",
+ "Embedding",
+ "EmbeddingsInput",
+ "EmbeddingsInputEncodingFormat",
+ "EmbeddingsResponse",
+ "EmbeddingsResponseDataItem",
+ "EmbeddingsResponseUsage",
+ "EncodingFormatEnum",
+ "FineTuningInput",
+ "FineTuningInputTrainingDataItem",
+ "FineTuningInputValidatonDataItem",
+ "FineTuningResponse",
+ "FineTuningSample",
+ "InputDataPoint",
+ "InternalServerErrorType0",
+ "InternalServerErrorType0Code",
+ "InternalServerErrorType1",
+ "InternalServerErrorType1Code",
+ "InternalServerErrorType2",
+ "InternalServerErrorType2Code",
+ "InternalServerErrorType3",
+ "InternalServerErrorType3Code",
+ "InternalServerErrorType4",
+ "InternalServerErrorType4Code",
+ "InternalServerErrorType5",
+ "InternalServerErrorType5Code",
+ "LeaderboardItem",
+ "LeaderboardResponse",
+ "LeaderboardResponseLeaderboardItem",
+ "Message",
+ "MessageRole",
+ "ModelNotFoundError",
+ "ModelNotFoundErrorCode",
+ "ModelNotFoundErrorCodeEnum",
+ "NotFoundErrorType0",
+ "NotFoundErrorType0Code",
+ "NotFoundErrorType1",
+ "NotFoundErrorType1Code",
+ "PatchedDataPoint",
+ "PermissionDeniedError",
+ "PermissionDeniedErrorCode",
+ "PermissionDeniedErrorCodeEnum",
+ "ProviderAPIConnectionError",
+ "ProviderAPIConnectionErrorCode",
+ "ProviderAPIConnectionErrorCodeEnum",
+ "ProviderAPIStatusError",
+ "ProviderAPIStatusErrorCode",
+ "ProviderAPIStatusErrorCodeEnum",
+ "ProviderAPITimeoutError",
+ "ProviderAPITimeoutErrorCode",
+ "ProviderAPITimeoutErrorCodeEnum",
+ "ProviderInternalServerError",
+ "ProviderInternalServerErrorCode",
+ "ProviderInternalServerErrorCodeEnum",
+ "ProviderNotFoundError",
+ "ProviderNotFoundErrorCode",
+ "ProviderNotFoundErrorCodeEnum",
+ "RateLimitError",
+ "RateLimitErrorCode",
+ "RateLimitErrorCodeEnum",
+ "ResponseChoice",
+ "RetrieveFineTuningResponse",
+ "RoleEnum",
+ "Trace",
+ "TraceRawRequestType0",
+ "TraceRawResponseType0",
+ "UnprocessableEntityError",
+ "UnprocessableEntityErrorCode",
+ "UnprocessableEntityErrorCodeEnum",
+ "Usage",
+ "V1ChatCompletionsCreateDataBody",
+ "V1ChatCompletionsCreateDataBodyLogitBiasType0",
+ "V1ChatCompletionsCreateDataBodyMessagesItem",
+ "V1ChatCompletionsCreateDataBodyMessagesItemRole",
+ "V1ChatCompletionsCreateDataBodyResponseFormatType0",
+ "V1ChatCompletionsCreateDataBodyToolsItem",
+ "V1ChatCompletionsCreateFilesBody",
+ "V1ChatCompletionsCreateFilesBodyLogitBiasType0",
+ "V1ChatCompletionsCreateFilesBodyMessagesItem",
+ "V1ChatCompletionsCreateFilesBodyMessagesItemRole",
+ "V1ChatCompletionsCreateFilesBodyResponseFormatType0",
+ "V1ChatCompletionsCreateFilesBodyToolsItem",
+ "V1ChatCompletionsCreateJsonBody",
+ "V1ChatCompletionsCreateJsonBodyLogitBiasType0",
+ "V1ChatCompletionsCreateJsonBodyMessagesItem",
+ "V1ChatCompletionsCreateJsonBodyMessagesItemRole",
+ "V1ChatCompletionsCreateJsonBodyResponseFormatType0",
+ "V1ChatCompletionsCreateJsonBodyToolsItem",
+ "V1ChatCompletionsCreateResponse200",
+ "V1ChatCompletionsCreateResponse200ChoicesItem",
+ "V1ChatCompletionsCreateResponse200Usage",
+ "V1ChatCompletionsCreateResponse400",
+ "V1ChatCompletionsCreateResponse400Code",
+ "V1ChatCompletionsCreateResponse400Details",
+ "V1ChatCompletionsCreateResponse400DetailsAdditionalProperty",
+ "V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem",
+ "V1ChatCompletionsCreateResponse401",
+ "V1ChatCompletionsCreateResponse401Code",
+ "V1ChatCompletionsCreateResponse403",
+ "V1ChatCompletionsCreateResponse403Code",
+ "V1ChatCompletionsCreateResponse404Type0",
+ "V1ChatCompletionsCreateResponse404Type0Code",
+ "V1ChatCompletionsCreateResponse404Type1",
+ "V1ChatCompletionsCreateResponse404Type1Code",
+ "V1ChatCompletionsCreateResponse409",
+ "V1ChatCompletionsCreateResponse409Code",
+ "V1ChatCompletionsCreateResponse422",
+ "V1ChatCompletionsCreateResponse422Code",
+ "V1ChatCompletionsCreateResponse429",
+ "V1ChatCompletionsCreateResponse429Code",
+ "V1ChatCompletionsCreateResponse500Type0",
+ "V1ChatCompletionsCreateResponse500Type0Code",
+ "V1ChatCompletionsCreateResponse500Type1",
+ "V1ChatCompletionsCreateResponse500Type1Code",
+ "V1ChatCompletionsCreateResponse500Type2",
+ "V1ChatCompletionsCreateResponse500Type2Code",
+ "V1ChatCompletionsCreateResponse500Type3",
+ "V1ChatCompletionsCreateResponse500Type3Code",
+ "V1ChatCompletionsCreateResponse500Type4",
+ "V1ChatCompletionsCreateResponse500Type4Code",
+ "V1ChatCompletionsCreateResponse500Type5",
+ "V1ChatCompletionsCreateResponse500Type5Code",
+ "V1EmbeddingsCreateDataBody",
+ "V1EmbeddingsCreateDataBodyEncodingFormat",
+ "V1EmbeddingsCreateFilesBody",
+ "V1EmbeddingsCreateFilesBodyEncodingFormat",
+ "V1EmbeddingsCreateJsonBody",
+ "V1EmbeddingsCreateJsonBodyEncodingFormat",
+ "V1EmbeddingsCreateResponse200",
+ "V1EmbeddingsCreateResponse200DataItem",
+ "V1EmbeddingsCreateResponse200Usage",
+ "V1EmbeddingsCreateResponse400",
+ "V1EmbeddingsCreateResponse400Code",
+ "V1EmbeddingsCreateResponse400Details",
+ "V1EmbeddingsCreateResponse400DetailsAdditionalProperty",
+ "V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem",
+ "V1EmbeddingsCreateResponse401",
+ "V1EmbeddingsCreateResponse401Code",
+ "V1EmbeddingsCreateResponse403",
+ "V1EmbeddingsCreateResponse403Code",
+ "V1EmbeddingsCreateResponse404Type0",
+ "V1EmbeddingsCreateResponse404Type0Code",
+ "V1EmbeddingsCreateResponse404Type1",
+ "V1EmbeddingsCreateResponse404Type1Code",
+ "V1EmbeddingsCreateResponse409",
+ "V1EmbeddingsCreateResponse409Code",
+ "V1EmbeddingsCreateResponse422",
+ "V1EmbeddingsCreateResponse422Code",
+ "V1EmbeddingsCreateResponse429",
+ "V1EmbeddingsCreateResponse429Code",
+ "V1EmbeddingsCreateResponse500Type0",
+ "V1EmbeddingsCreateResponse500Type0Code",
+ "V1EmbeddingsCreateResponse500Type1",
+ "V1EmbeddingsCreateResponse500Type1Code",
+ "V1EmbeddingsCreateResponse500Type2",
+ "V1EmbeddingsCreateResponse500Type2Code",
+ "V1EmbeddingsCreateResponse500Type3",
+ "V1EmbeddingsCreateResponse500Type3Code",
+ "V1EmbeddingsCreateResponse500Type4",
+ "V1EmbeddingsCreateResponse500Type4Code",
+ "V1EmbeddingsCreateResponse500Type5",
+ "V1EmbeddingsCreateResponse500Type5Code",
+ "V1FinetuningCreateDataBody",
+ "V1FinetuningCreateDataBodyTrainingDataItem",
+ "V1FinetuningCreateDataBodyValidatonDataItem",
+ "V1FinetuningCreateFilesBody",
+ "V1FinetuningCreateFilesBodyTrainingDataItem",
+ "V1FinetuningCreateFilesBodyValidatonDataItem",
+ "V1FinetuningCreateJsonBody",
+ "V1FinetuningCreateJsonBodyTrainingDataItem",
+ "V1FinetuningCreateJsonBodyValidatonDataItem",
+ "V1FinetuningCreateResponse200",
+ "V1FinetuningCreateResponse400",
+ "V1FinetuningCreateResponse400Code",
+ "V1FinetuningCreateResponse400Details",
+ "V1FinetuningCreateResponse400DetailsAdditionalProperty",
+ "V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem",
+ "V1FinetuningCreateResponse401",
+ "V1FinetuningCreateResponse401Code",
+ "V1FinetuningCreateResponse403",
+ "V1FinetuningCreateResponse403Code",
+ "V1FinetuningCreateResponse404Type0",
+ "V1FinetuningCreateResponse404Type0Code",
+ "V1FinetuningCreateResponse404Type1",
+ "V1FinetuningCreateResponse404Type1Code",
+ "V1FinetuningCreateResponse409",
+ "V1FinetuningCreateResponse409Code",
+ "V1FinetuningCreateResponse422",
+ "V1FinetuningCreateResponse422Code",
+ "V1FinetuningCreateResponse429",
+ "V1FinetuningCreateResponse429Code",
+ "V1FinetuningCreateResponse500Type0",
+ "V1FinetuningCreateResponse500Type0Code",
+ "V1FinetuningCreateResponse500Type1",
+ "V1FinetuningCreateResponse500Type1Code",
+ "V1FinetuningCreateResponse500Type2",
+ "V1FinetuningCreateResponse500Type2Code",
+ "V1FinetuningCreateResponse500Type3",
+ "V1FinetuningCreateResponse500Type3Code",
+ "V1FinetuningCreateResponse500Type4",
+ "V1FinetuningCreateResponse500Type4Code",
+ "V1FinetuningCreateResponse500Type5",
+ "V1FinetuningCreateResponse500Type5Code",
+ "V1FinetuningRetrieveResponse200",
+ "V1FinetuningRetrieveResponse400",
+ "V1FinetuningRetrieveResponse400Code",
+ "V1FinetuningRetrieveResponse400Details",
+ "V1FinetuningRetrieveResponse400DetailsAdditionalProperty",
+ "V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem",
+ "V1FinetuningRetrieveResponse401",
+ "V1FinetuningRetrieveResponse401Code",
+ "V1FinetuningRetrieveResponse403",
+ "V1FinetuningRetrieveResponse403Code",
+ "V1FinetuningRetrieveResponse404Type0",
+ "V1FinetuningRetrieveResponse404Type0Code",
+ "V1FinetuningRetrieveResponse404Type1",
+ "V1FinetuningRetrieveResponse404Type1Code",
+ "V1FinetuningRetrieveResponse409",
+ "V1FinetuningRetrieveResponse409Code",
+ "V1FinetuningRetrieveResponse422",
+ "V1FinetuningRetrieveResponse422Code",
+ "V1FinetuningRetrieveResponse429",
+ "V1FinetuningRetrieveResponse429Code",
+ "V1FinetuningRetrieveResponse500Type0",
+ "V1FinetuningRetrieveResponse500Type0Code",
+ "V1FinetuningRetrieveResponse500Type1",
+ "V1FinetuningRetrieveResponse500Type1Code",
+ "V1FinetuningRetrieveResponse500Type2",
+ "V1FinetuningRetrieveResponse500Type2Code",
+ "V1FinetuningRetrieveResponse500Type3",
+ "V1FinetuningRetrieveResponse500Type3Code",
+ "V1FinetuningRetrieveResponse500Type4",
+ "V1FinetuningRetrieveResponse500Type4Code",
+ "V1FinetuningRetrieveResponse500Type5",
+ "V1FinetuningRetrieveResponse500Type5Code",
+ "ValidationDetail",
+ "ValidationDetailErrorMessagesItem",
+ "ValidationError",
+ "ValidationErrorCode",
+ "ValidationErrorCodeEnum",
+ "ValidationErrorDetails",
+ "ValidationErrorDetailsAdditionalProperty",
+ "ValidationErrorDetailsAdditionalPropertyErrorMessagesItem",
+ "ApiProjectsDataPointsCreateJsonBodyDict",
+ "ApiProjectsDataPointsCreateDataBodyDict",
+ "ApiProjectsDataPointsCreateFilesBodyDict",
+ "ApiProjectsDataPointsUpdateJsonBodyDict",
+ "ApiProjectsDataPointsUpdateDataBodyDict",
+ "ApiProjectsDataPointsUpdateFilesBodyDict",
+ "ApiProjectsDataPointsPartialUpdateJsonBodyDict",
+ "ApiProjectsDataPointsPartialUpdateDataBodyDict",
+ "ApiProjectsDataPointsPartialUpdateFilesBodyDict",
+ "ApiProjectsTracesCreateJsonBodyDict",
+ "ApiProjectsTracesCreateDataBodyDict",
+ "ApiProjectsTracesCreateFilesBodyDict",
+ "AuthTokenCreateDataBodyDict",
+ "AuthTokenCreateFilesBodyDict",
+ "AuthTokenCreateJsonBodyDict",
+ "V1ChatCompletionsCreateJsonBodyDict",
+ "V1ChatCompletionsCreateDataBodyDict",
+ "V1ChatCompletionsCreateFilesBodyDict",
+ "V1EmbeddingsCreateJsonBodyDict",
+ "V1EmbeddingsCreateDataBodyDict",
+ "V1EmbeddingsCreateFilesBodyDict",
+ "V1FinetuningCreateJsonBodyDict",
+ "V1FinetuningCreateDataBodyDict",
+ "V1FinetuningCreateFilesBodyDict",
+)
diff --git a/premai/models/api_projects_data_points_create_data_body.py b/premai/models/api_projects_data_points_create_data_body.py
new file mode 100644
index 0000000..88713a6
--- /dev/null
+++ b/premai/models/api_projects_data_points_create_data_body.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsCreateDataBody")
+
+
+class ApiProjectsDataPointsCreateDataBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsCreateDataBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_create_data_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_create_data_body.additional_properties = d
+ return api_projects_data_points_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_create_files_body.py b/premai/models/api_projects_data_points_create_files_body.py
new file mode 100644
index 0000000..062fdc9
--- /dev/null
+++ b/premai/models/api_projects_data_points_create_files_body.py
@@ -0,0 +1,195 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsCreateFilesBody")
+
+
+class ApiProjectsDataPointsCreateFilesBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsCreateFilesBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ id = self.id if isinstance(self.id, Unset) else (None, str(self.id).encode(), "text/plain")
+
+ positive = (
+ self.positive if isinstance(self.positive, Unset) else (None, str(self.positive).encode(), "text/plain")
+ )
+
+ project = self.project if isinstance(self.project, Unset) else (None, str(self.project).encode(), "text/plain")
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_create_files_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_create_files_body.additional_properties = d
+ return api_projects_data_points_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_create_json_body.py b/premai/models/api_projects_data_points_create_json_body.py
new file mode 100644
index 0000000..0e29048
--- /dev/null
+++ b/premai/models/api_projects_data_points_create_json_body.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsCreateJsonBody")
+
+
+class ApiProjectsDataPointsCreateJsonBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsCreateJsonBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_create_json_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_create_json_body.additional_properties = d
+ return api_projects_data_points_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_create_response_201.py b/premai/models/api_projects_data_points_create_response_201.py
new file mode 100644
index 0000000..a329beb
--- /dev/null
+++ b/premai/models/api_projects_data_points_create_response_201.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsCreateResponse201")
+
+
+class ApiProjectsDataPointsCreateResponse201Dict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsCreateResponse201:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_create_response_201 = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_create_response_201.additional_properties = d
+ return api_projects_data_points_create_response_201
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_list_response_200_item.py b/premai/models/api_projects_data_points_list_response_200_item.py
new file mode 100644
index 0000000..5c089a5
--- /dev/null
+++ b/premai/models/api_projects_data_points_list_response_200_item.py
@@ -0,0 +1,159 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsListResponse200Item")
+
+
+class ApiProjectsDataPointsListResponse200ItemDict(TypedDict):
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsListResponse200Item:
+ """
+ Attributes:
+ id (int):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ positive (bool):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ positive = self.positive
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "positive": positive,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ positive = d.pop("positive")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_list_response_200_item = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ positive=positive,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_list_response_200_item.additional_properties = d
+ return api_projects_data_points_list_response_200_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_partial_update_data_body.py b/premai/models/api_projects_data_points_partial_update_data_body.py
new file mode 100644
index 0000000..bddf52d
--- /dev/null
+++ b/premai/models/api_projects_data_points_partial_update_data_body.py
@@ -0,0 +1,174 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsPartialUpdateDataBody")
+
+
+class ApiProjectsDataPointsPartialUpdateDataBodyDict(TypedDict):
+ id: NotRequired[Union[Unset, int]]
+ created_at: NotRequired[Union[Unset, datetime.datetime]]
+ updated_at: NotRequired[Union[Unset, datetime.datetime]]
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ positive: NotRequired[Union[Unset, bool]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsPartialUpdateDataBody:
+ """
+ Attributes:
+ id (Union[Unset, int]):
+ created_at (Union[Unset, datetime.datetime]):
+ updated_at (Union[Unset, datetime.datetime]):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ positive (Union[Unset, bool]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: Union[Unset, int] = UNSET
+ created_at: Union[Unset, datetime.datetime] = UNSET
+ updated_at: Union[Unset, datetime.datetime] = UNSET
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ positive: Union[Unset, bool] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at: Union[Unset, str] = UNSET
+ if not isinstance(self.created_at, Unset):
+ created_at = self.created_at.isoformat()
+
+ updated_at: Union[Unset, str] = UNSET
+ if not isinstance(self.updated_at, Unset):
+ updated_at = self.updated_at.isoformat()
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ positive = self.positive
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if id is not UNSET:
+ field_dict["id"] = id
+ if created_at is not UNSET:
+ field_dict["created_at"] = created_at
+ if updated_at is not UNSET:
+ field_dict["updated_at"] = updated_at
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if positive is not UNSET:
+ field_dict["positive"] = positive
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id", UNSET)
+
+ _created_at = d.pop("created_at", UNSET)
+ created_at: Union[Unset, datetime.datetime]
+ if isinstance(_created_at, Unset):
+ created_at = UNSET
+ else:
+ created_at = isoparse(_created_at)
+
+ _updated_at = d.pop("updated_at", UNSET)
+ updated_at: Union[Unset, datetime.datetime]
+ if isinstance(_updated_at, Unset):
+ updated_at = UNSET
+ else:
+ updated_at = isoparse(_updated_at)
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ positive = d.pop("positive", UNSET)
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_partial_update_data_body = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ input_=input_,
+ output=output,
+ positive=positive,
+ trace=trace,
+ )
+
+ api_projects_data_points_partial_update_data_body.additional_properties = d
+ return api_projects_data_points_partial_update_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_partial_update_files_body.py b/premai/models/api_projects_data_points_partial_update_files_body.py
new file mode 100644
index 0000000..0620759
--- /dev/null
+++ b/premai/models/api_projects_data_points_partial_update_files_body.py
@@ -0,0 +1,229 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsPartialUpdateFilesBody")
+
+
+class ApiProjectsDataPointsPartialUpdateFilesBodyDict(TypedDict):
+ id: NotRequired[Union[Unset, int]]
+ created_at: NotRequired[Union[Unset, datetime.datetime]]
+ updated_at: NotRequired[Union[Unset, datetime.datetime]]
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ positive: NotRequired[Union[Unset, bool]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsPartialUpdateFilesBody:
+ """
+ Attributes:
+ id (Union[Unset, int]):
+ created_at (Union[Unset, datetime.datetime]):
+ updated_at (Union[Unset, datetime.datetime]):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ positive (Union[Unset, bool]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: Union[Unset, int] = UNSET
+ created_at: Union[Unset, datetime.datetime] = UNSET
+ updated_at: Union[Unset, datetime.datetime] = UNSET
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ positive: Union[Unset, bool] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at: Union[Unset, str] = UNSET
+ if not isinstance(self.created_at, Unset):
+ created_at = self.created_at.isoformat()
+
+ updated_at: Union[Unset, str] = UNSET
+ if not isinstance(self.updated_at, Unset):
+ updated_at = self.updated_at.isoformat()
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ positive = self.positive
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if id is not UNSET:
+ field_dict["id"] = id
+ if created_at is not UNSET:
+ field_dict["created_at"] = created_at
+ if updated_at is not UNSET:
+ field_dict["updated_at"] = updated_at
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if positive is not UNSET:
+ field_dict["positive"] = positive
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ id = self.id if isinstance(self.id, Unset) else (None, str(self.id).encode(), "text/plain")
+
+ created_at: Union[Unset, bytes] = UNSET
+ if not isinstance(self.created_at, Unset):
+ created_at = self.created_at.isoformat().encode()
+
+ updated_at: Union[Unset, bytes] = UNSET
+ if not isinstance(self.updated_at, Unset):
+ updated_at = self.updated_at.isoformat().encode()
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ positive = (
+ self.positive if isinstance(self.positive, Unset) else (None, str(self.positive).encode(), "text/plain")
+ )
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update({})
+ if id is not UNSET:
+ field_dict["id"] = id
+ if created_at is not UNSET:
+ field_dict["created_at"] = created_at
+ if updated_at is not UNSET:
+ field_dict["updated_at"] = updated_at
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if positive is not UNSET:
+ field_dict["positive"] = positive
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id", UNSET)
+
+ _created_at = d.pop("created_at", UNSET)
+ created_at: Union[Unset, datetime.datetime]
+ if isinstance(_created_at, Unset):
+ created_at = UNSET
+ else:
+ created_at = isoparse(_created_at)
+
+ _updated_at = d.pop("updated_at", UNSET)
+ updated_at: Union[Unset, datetime.datetime]
+ if isinstance(_updated_at, Unset):
+ updated_at = UNSET
+ else:
+ updated_at = isoparse(_updated_at)
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ positive = d.pop("positive", UNSET)
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_partial_update_files_body = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ input_=input_,
+ output=output,
+ positive=positive,
+ trace=trace,
+ )
+
+ api_projects_data_points_partial_update_files_body.additional_properties = d
+ return api_projects_data_points_partial_update_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_partial_update_json_body.py b/premai/models/api_projects_data_points_partial_update_json_body.py
new file mode 100644
index 0000000..f6a6913
--- /dev/null
+++ b/premai/models/api_projects_data_points_partial_update_json_body.py
@@ -0,0 +1,174 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsPartialUpdateJsonBody")
+
+
+class ApiProjectsDataPointsPartialUpdateJsonBodyDict(TypedDict):
+ id: NotRequired[Union[Unset, int]]
+ created_at: NotRequired[Union[Unset, datetime.datetime]]
+ updated_at: NotRequired[Union[Unset, datetime.datetime]]
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ positive: NotRequired[Union[Unset, bool]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsPartialUpdateJsonBody:
+ """
+ Attributes:
+ id (Union[Unset, int]):
+ created_at (Union[Unset, datetime.datetime]):
+ updated_at (Union[Unset, datetime.datetime]):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ positive (Union[Unset, bool]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: Union[Unset, int] = UNSET
+ created_at: Union[Unset, datetime.datetime] = UNSET
+ updated_at: Union[Unset, datetime.datetime] = UNSET
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ positive: Union[Unset, bool] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at: Union[Unset, str] = UNSET
+ if not isinstance(self.created_at, Unset):
+ created_at = self.created_at.isoformat()
+
+ updated_at: Union[Unset, str] = UNSET
+ if not isinstance(self.updated_at, Unset):
+ updated_at = self.updated_at.isoformat()
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ positive = self.positive
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if id is not UNSET:
+ field_dict["id"] = id
+ if created_at is not UNSET:
+ field_dict["created_at"] = created_at
+ if updated_at is not UNSET:
+ field_dict["updated_at"] = updated_at
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if positive is not UNSET:
+ field_dict["positive"] = positive
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id", UNSET)
+
+ _created_at = d.pop("created_at", UNSET)
+ created_at: Union[Unset, datetime.datetime]
+ if isinstance(_created_at, Unset):
+ created_at = UNSET
+ else:
+ created_at = isoparse(_created_at)
+
+ _updated_at = d.pop("updated_at", UNSET)
+ updated_at: Union[Unset, datetime.datetime]
+ if isinstance(_updated_at, Unset):
+ updated_at = UNSET
+ else:
+ updated_at = isoparse(_updated_at)
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ positive = d.pop("positive", UNSET)
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_partial_update_json_body = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ input_=input_,
+ output=output,
+ positive=positive,
+ trace=trace,
+ )
+
+ api_projects_data_points_partial_update_json_body.additional_properties = d
+ return api_projects_data_points_partial_update_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_partial_update_response_200.py b/premai/models/api_projects_data_points_partial_update_response_200.py
new file mode 100644
index 0000000..0401185
--- /dev/null
+++ b/premai/models/api_projects_data_points_partial_update_response_200.py
@@ -0,0 +1,159 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsPartialUpdateResponse200")
+
+
+class ApiProjectsDataPointsPartialUpdateResponse200Dict(TypedDict):
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsPartialUpdateResponse200:
+ """
+ Attributes:
+ id (int):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ positive (bool):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ positive = self.positive
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "positive": positive,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ positive = d.pop("positive")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_partial_update_response_200 = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ positive=positive,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_partial_update_response_200.additional_properties = d
+ return api_projects_data_points_partial_update_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_retrieve_response_200.py b/premai/models/api_projects_data_points_retrieve_response_200.py
new file mode 100644
index 0000000..3426e9d
--- /dev/null
+++ b/premai/models/api_projects_data_points_retrieve_response_200.py
@@ -0,0 +1,159 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsRetrieveResponse200")
+
+
+class ApiProjectsDataPointsRetrieveResponse200Dict(TypedDict):
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsRetrieveResponse200:
+ """
+ Attributes:
+ id (int):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ positive (bool):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ positive = self.positive
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "positive": positive,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ positive = d.pop("positive")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_retrieve_response_200 = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ positive=positive,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_retrieve_response_200.additional_properties = d
+ return api_projects_data_points_retrieve_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_update_data_body.py b/premai/models/api_projects_data_points_update_data_body.py
new file mode 100644
index 0000000..a93ef08
--- /dev/null
+++ b/premai/models/api_projects_data_points_update_data_body.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsUpdateDataBody")
+
+
+class ApiProjectsDataPointsUpdateDataBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsUpdateDataBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_update_data_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_update_data_body.additional_properties = d
+ return api_projects_data_points_update_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_update_files_body.py b/premai/models/api_projects_data_points_update_files_body.py
new file mode 100644
index 0000000..f1486c6
--- /dev/null
+++ b/premai/models/api_projects_data_points_update_files_body.py
@@ -0,0 +1,195 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsUpdateFilesBody")
+
+
+class ApiProjectsDataPointsUpdateFilesBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsUpdateFilesBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ id = self.id if isinstance(self.id, Unset) else (None, str(self.id).encode(), "text/plain")
+
+ positive = (
+ self.positive if isinstance(self.positive, Unset) else (None, str(self.positive).encode(), "text/plain")
+ )
+
+ project = self.project if isinstance(self.project, Unset) else (None, str(self.project).encode(), "text/plain")
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_update_files_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_update_files_body.additional_properties = d
+ return api_projects_data_points_update_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_update_json_body.py b/premai/models/api_projects_data_points_update_json_body.py
new file mode 100644
index 0000000..c6a1c61
--- /dev/null
+++ b/premai/models/api_projects_data_points_update_json_body.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsUpdateJsonBody")
+
+
+class ApiProjectsDataPointsUpdateJsonBodyDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsUpdateJsonBody:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_update_json_body = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_update_json_body.additional_properties = d
+ return api_projects_data_points_update_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_data_points_update_response_200.py b/premai/models/api_projects_data_points_update_response_200.py
new file mode 100644
index 0000000..4c57ad4
--- /dev/null
+++ b/premai/models/api_projects_data_points_update_response_200.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsDataPointsUpdateResponse200")
+
+
+class ApiProjectsDataPointsUpdateResponse200Dict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsDataPointsUpdateResponse200:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ api_projects_data_points_update_response_200 = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ api_projects_data_points_update_response_200.additional_properties = d
+ return api_projects_data_points_update_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_data_body.py b/premai/models/api_projects_traces_create_data_body.py
new file mode 100644
index 0000000..d6578cc
--- /dev/null
+++ b/premai/models/api_projects_traces_create_data_body.py
@@ -0,0 +1,414 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.api_projects_traces_create_data_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawRequestType0,
+)
+from ..models.api_projects_traces_create_data_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawResponseType0,
+)
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateDataBody")
+
+
+class ApiProjectsTracesCreateDataBodyDict(TypedDict):
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: NotRequired[Union[Unset, bool]]
+ input_prompt: NotRequired[Union[Unset, str]]
+ input_file_prompt: NotRequired[Union[None, Unset, str]]
+ endpoint_type: NotRequired[Union[None, Unset, str]]
+ privacy_score: NotRequired[Union[None, Unset, str]]
+ output_text: NotRequired[Union[Unset, str]]
+ http_status_code: NotRequired[Union[None, Unset, int]]
+ raw_request: NotRequired[Union["ApiProjectsTracesCreateDataBodyRawRequestType0", None, Unset]]
+ raw_response: NotRequired[Union["ApiProjectsTracesCreateDataBodyRawResponseType0", None, Unset]]
+ tag: NotRequired[Union[None, Unset, str]]
+ error: NotRequired[Union[None, Unset, str]]
+ text_to_text_model_parameters: NotRequired[Union[None, Unset, int]]
+ api_key: NotRequired[Union[None, Unset, int]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateDataBody:
+ """
+ Attributes:
+ id (str):
+ model_name (str):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ start_time (datetime.datetime):
+ end_time (datetime.datetime):
+ input_prompt_tokens_number (int):
+ output_text_tokens_number (int):
+ is_deleted (Union[Unset, bool]):
+ input_prompt (Union[Unset, str]):
+ input_file_prompt (Union[None, Unset, str]):
+ endpoint_type (Union[None, Unset, str]):
+ privacy_score (Union[None, Unset, str]):
+ output_text (Union[Unset, str]):
+ http_status_code (Union[None, Unset, int]):
+ raw_request (Union['ApiProjectsTracesCreateDataBodyRawRequestType0', None, Unset]):
+ raw_response (Union['ApiProjectsTracesCreateDataBodyRawResponseType0', None, Unset]):
+ tag (Union[None, Unset, str]):
+ error (Union[None, Unset, str]):
+ text_to_text_model_parameters (Union[None, Unset, int]):
+ api_key (Union[None, Unset, int]):
+ """
+
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: Union[Unset, bool] = UNSET
+ input_prompt: Union[Unset, str] = UNSET
+ input_file_prompt: Union[None, Unset, str] = UNSET
+ endpoint_type: Union[None, Unset, str] = UNSET
+ privacy_score: Union[None, Unset, str] = UNSET
+ output_text: Union[Unset, str] = UNSET
+ http_status_code: Union[None, Unset, int] = UNSET
+ raw_request: Union["ApiProjectsTracesCreateDataBodyRawRequestType0", None, Unset] = UNSET
+ raw_response: Union["ApiProjectsTracesCreateDataBodyRawResponseType0", None, Unset] = UNSET
+ tag: Union[None, Unset, str] = UNSET
+ error: Union[None, Unset, str] = UNSET
+ text_to_text_model_parameters: Union[None, Unset, int] = UNSET
+ api_key: Union[None, Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.api_projects_traces_create_data_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_data_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawResponseType0,
+ )
+
+ id = self.id
+
+ model_name = self.model_name
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ start_time = self.start_time.isoformat()
+
+ end_time = self.end_time.isoformat()
+
+ input_prompt_tokens_number = self.input_prompt_tokens_number
+
+ output_text_tokens_number = self.output_text_tokens_number
+
+ is_deleted = self.is_deleted
+
+ input_prompt = self.input_prompt
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = self.output_text
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, ApiProjectsTracesCreateDataBodyRawRequestType0):
+ raw_request = self.raw_request.to_dict()
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, ApiProjectsTracesCreateDataBodyRawResponseType0):
+ raw_response = self.raw_response.to_dict()
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.api_projects_traces_create_data_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_data_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateDataBodyRawResponseType0,
+ )
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ model_name = d.pop("model_name")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ start_time = isoparse(d.pop("start_time"))
+
+ end_time = isoparse(d.pop("end_time"))
+
+ input_prompt_tokens_number = d.pop("input_prompt_tokens_number")
+
+ output_text_tokens_number = d.pop("output_text_tokens_number")
+
+ is_deleted = d.pop("is_deleted", UNSET)
+
+ input_prompt = d.pop("input_prompt", UNSET)
+
+ def _parse_input_file_prompt(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_file_prompt = _parse_input_file_prompt(d.pop("input_file_prompt", UNSET))
+
+ def _parse_endpoint_type(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ endpoint_type = _parse_endpoint_type(d.pop("endpoint_type", UNSET))
+
+ def _parse_privacy_score(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ privacy_score = _parse_privacy_score(d.pop("privacy_score", UNSET))
+
+ output_text = d.pop("output_text", UNSET)
+
+ def _parse_http_status_code(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ http_status_code = _parse_http_status_code(d.pop("http_status_code", UNSET))
+
+ def _parse_raw_request(data: object) -> Union["ApiProjectsTracesCreateDataBodyRawRequestType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_request_type_0 = ApiProjectsTracesCreateDataBodyRawRequestType0.from_dict(data)
+
+ return raw_request_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateDataBodyRawRequestType0", None, Unset], data)
+
+ raw_request = _parse_raw_request(d.pop("raw_request", UNSET))
+
+ def _parse_raw_response(data: object) -> Union["ApiProjectsTracesCreateDataBodyRawResponseType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_response_type_0 = ApiProjectsTracesCreateDataBodyRawResponseType0.from_dict(data)
+
+ return raw_response_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateDataBodyRawResponseType0", None, Unset], data)
+
+ raw_response = _parse_raw_response(d.pop("raw_response", UNSET))
+
+ def _parse_tag(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ tag = _parse_tag(d.pop("tag", UNSET))
+
+ def _parse_error(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ error = _parse_error(d.pop("error", UNSET))
+
+ def _parse_text_to_text_model_parameters(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ text_to_text_model_parameters = _parse_text_to_text_model_parameters(
+ d.pop("text_to_text_model_parameters", UNSET)
+ )
+
+ def _parse_api_key(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ api_key = _parse_api_key(d.pop("api_key", UNSET))
+
+ api_projects_traces_create_data_body = cls(
+ id=id,
+ model_name=model_name,
+ created_at=created_at,
+ updated_at=updated_at,
+ start_time=start_time,
+ end_time=end_time,
+ input_prompt_tokens_number=input_prompt_tokens_number,
+ output_text_tokens_number=output_text_tokens_number,
+ is_deleted=is_deleted,
+ input_prompt=input_prompt,
+ input_file_prompt=input_file_prompt,
+ endpoint_type=endpoint_type,
+ privacy_score=privacy_score,
+ output_text=output_text,
+ http_status_code=http_status_code,
+ raw_request=raw_request,
+ raw_response=raw_response,
+ tag=tag,
+ error=error,
+ text_to_text_model_parameters=text_to_text_model_parameters,
+ api_key=api_key,
+ )
+
+ api_projects_traces_create_data_body.additional_properties = d
+ return api_projects_traces_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_data_body_raw_request_type_0.py b/premai/models/api_projects_traces_create_data_body_raw_request_type_0.py
new file mode 100644
index 0000000..5473863
--- /dev/null
+++ b/premai/models/api_projects_traces_create_data_body_raw_request_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateDataBodyRawRequestType0")
+
+
+class ApiProjectsTracesCreateDataBodyRawRequestType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateDataBodyRawRequestType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_data_body_raw_request_type_0 = cls()
+
+ api_projects_traces_create_data_body_raw_request_type_0.additional_properties = d
+ return api_projects_traces_create_data_body_raw_request_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_data_body_raw_response_type_0.py b/premai/models/api_projects_traces_create_data_body_raw_response_type_0.py
new file mode 100644
index 0000000..ae4ba0e
--- /dev/null
+++ b/premai/models/api_projects_traces_create_data_body_raw_response_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateDataBodyRawResponseType0")
+
+
+class ApiProjectsTracesCreateDataBodyRawResponseType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateDataBodyRawResponseType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_data_body_raw_response_type_0 = cls()
+
+ api_projects_traces_create_data_body_raw_response_type_0.additional_properties = d
+ return api_projects_traces_create_data_body_raw_response_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_files_body.py b/premai/models/api_projects_traces_create_files_body.py
new file mode 100644
index 0000000..388233c
--- /dev/null
+++ b/premai/models/api_projects_traces_create_files_body.py
@@ -0,0 +1,571 @@
+import datetime
+import json
+from typing import Dict, List, Tuple, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.api_projects_traces_create_files_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawRequestType0,
+)
+from ..models.api_projects_traces_create_files_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawResponseType0,
+)
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateFilesBody")
+
+
+class ApiProjectsTracesCreateFilesBodyDict(TypedDict):
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: NotRequired[Union[Unset, bool]]
+ input_prompt: NotRequired[Union[Unset, str]]
+ input_file_prompt: NotRequired[Union[None, Unset, str]]
+ endpoint_type: NotRequired[Union[None, Unset, str]]
+ privacy_score: NotRequired[Union[None, Unset, str]]
+ output_text: NotRequired[Union[Unset, str]]
+ http_status_code: NotRequired[Union[None, Unset, int]]
+ raw_request: NotRequired[Union["ApiProjectsTracesCreateFilesBodyRawRequestType0", None, Unset]]
+ raw_response: NotRequired[Union["ApiProjectsTracesCreateFilesBodyRawResponseType0", None, Unset]]
+ tag: NotRequired[Union[None, Unset, str]]
+ error: NotRequired[Union[None, Unset, str]]
+ text_to_text_model_parameters: NotRequired[Union[None, Unset, int]]
+ api_key: NotRequired[Union[None, Unset, int]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateFilesBody:
+ """
+ Attributes:
+ id (str):
+ model_name (str):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ start_time (datetime.datetime):
+ end_time (datetime.datetime):
+ input_prompt_tokens_number (int):
+ output_text_tokens_number (int):
+ is_deleted (Union[Unset, bool]):
+ input_prompt (Union[Unset, str]):
+ input_file_prompt (Union[None, Unset, str]):
+ endpoint_type (Union[None, Unset, str]):
+ privacy_score (Union[None, Unset, str]):
+ output_text (Union[Unset, str]):
+ http_status_code (Union[None, Unset, int]):
+ raw_request (Union['ApiProjectsTracesCreateFilesBodyRawRequestType0', None, Unset]):
+ raw_response (Union['ApiProjectsTracesCreateFilesBodyRawResponseType0', None, Unset]):
+ tag (Union[None, Unset, str]):
+ error (Union[None, Unset, str]):
+ text_to_text_model_parameters (Union[None, Unset, int]):
+ api_key (Union[None, Unset, int]):
+ """
+
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: Union[Unset, bool] = UNSET
+ input_prompt: Union[Unset, str] = UNSET
+ input_file_prompt: Union[None, Unset, str] = UNSET
+ endpoint_type: Union[None, Unset, str] = UNSET
+ privacy_score: Union[None, Unset, str] = UNSET
+ output_text: Union[Unset, str] = UNSET
+ http_status_code: Union[None, Unset, int] = UNSET
+ raw_request: Union["ApiProjectsTracesCreateFilesBodyRawRequestType0", None, Unset] = UNSET
+ raw_response: Union["ApiProjectsTracesCreateFilesBodyRawResponseType0", None, Unset] = UNSET
+ tag: Union[None, Unset, str] = UNSET
+ error: Union[None, Unset, str] = UNSET
+ text_to_text_model_parameters: Union[None, Unset, int] = UNSET
+ api_key: Union[None, Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.api_projects_traces_create_files_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_files_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawResponseType0,
+ )
+
+ id = self.id
+
+ model_name = self.model_name
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ start_time = self.start_time.isoformat()
+
+ end_time = self.end_time.isoformat()
+
+ input_prompt_tokens_number = self.input_prompt_tokens_number
+
+ output_text_tokens_number = self.output_text_tokens_number
+
+ is_deleted = self.is_deleted
+
+ input_prompt = self.input_prompt
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = self.output_text
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, ApiProjectsTracesCreateFilesBodyRawRequestType0):
+ raw_request = self.raw_request.to_dict()
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, ApiProjectsTracesCreateFilesBodyRawResponseType0):
+ raw_response = self.raw_response.to_dict()
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ id = self.id if isinstance(self.id, Unset) else (None, str(self.id).encode(), "text/plain")
+
+ model_name = (
+ self.model_name
+ if isinstance(self.model_name, Unset)
+ else (None, str(self.model_name).encode(), "text/plain")
+ )
+
+ created_at = self.created_at.isoformat().encode()
+
+ updated_at = self.updated_at.isoformat().encode()
+
+ start_time = self.start_time.isoformat().encode()
+
+ end_time = self.end_time.isoformat().encode()
+
+ input_prompt_tokens_number = (
+ self.input_prompt_tokens_number
+ if isinstance(self.input_prompt_tokens_number, Unset)
+ else (None, str(self.input_prompt_tokens_number).encode(), "text/plain")
+ )
+
+ output_text_tokens_number = (
+ self.output_text_tokens_number
+ if isinstance(self.output_text_tokens_number, Unset)
+ else (None, str(self.output_text_tokens_number).encode(), "text/plain")
+ )
+
+ is_deleted = (
+ self.is_deleted
+ if isinstance(self.is_deleted, Unset)
+ else (None, str(self.is_deleted).encode(), "text/plain")
+ )
+
+ input_prompt = (
+ self.input_prompt
+ if isinstance(self.input_prompt, Unset)
+ else (None, str(self.input_prompt).encode(), "text/plain")
+ )
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = (
+ self.output_text
+ if isinstance(self.output_text, Unset)
+ else (None, str(self.output_text).encode(), "text/plain")
+ )
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[None, Tuple[None, bytes, str], Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, ApiProjectsTracesCreateFilesBodyRawRequestType0):
+ raw_request = (None, json.dumps(self.raw_request.to_dict()).encode(), "application/json")
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[None, Tuple[None, bytes, str], Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, ApiProjectsTracesCreateFilesBodyRawResponseType0):
+ raw_response = (None, json.dumps(self.raw_response.to_dict()).encode(), "application/json")
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.api_projects_traces_create_files_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_files_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateFilesBodyRawResponseType0,
+ )
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ model_name = d.pop("model_name")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ start_time = isoparse(d.pop("start_time"))
+
+ end_time = isoparse(d.pop("end_time"))
+
+ input_prompt_tokens_number = d.pop("input_prompt_tokens_number")
+
+ output_text_tokens_number = d.pop("output_text_tokens_number")
+
+ is_deleted = d.pop("is_deleted", UNSET)
+
+ input_prompt = d.pop("input_prompt", UNSET)
+
+ def _parse_input_file_prompt(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_file_prompt = _parse_input_file_prompt(d.pop("input_file_prompt", UNSET))
+
+ def _parse_endpoint_type(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ endpoint_type = _parse_endpoint_type(d.pop("endpoint_type", UNSET))
+
+ def _parse_privacy_score(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ privacy_score = _parse_privacy_score(d.pop("privacy_score", UNSET))
+
+ output_text = d.pop("output_text", UNSET)
+
+ def _parse_http_status_code(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ http_status_code = _parse_http_status_code(d.pop("http_status_code", UNSET))
+
+ def _parse_raw_request(data: object) -> Union["ApiProjectsTracesCreateFilesBodyRawRequestType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_request_type_0 = ApiProjectsTracesCreateFilesBodyRawRequestType0.from_dict(data)
+
+ return raw_request_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateFilesBodyRawRequestType0", None, Unset], data)
+
+ raw_request = _parse_raw_request(d.pop("raw_request", UNSET))
+
+ def _parse_raw_response(data: object) -> Union["ApiProjectsTracesCreateFilesBodyRawResponseType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_response_type_0 = ApiProjectsTracesCreateFilesBodyRawResponseType0.from_dict(data)
+
+ return raw_response_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateFilesBodyRawResponseType0", None, Unset], data)
+
+ raw_response = _parse_raw_response(d.pop("raw_response", UNSET))
+
+ def _parse_tag(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ tag = _parse_tag(d.pop("tag", UNSET))
+
+ def _parse_error(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ error = _parse_error(d.pop("error", UNSET))
+
+ def _parse_text_to_text_model_parameters(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ text_to_text_model_parameters = _parse_text_to_text_model_parameters(
+ d.pop("text_to_text_model_parameters", UNSET)
+ )
+
+ def _parse_api_key(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ api_key = _parse_api_key(d.pop("api_key", UNSET))
+
+ api_projects_traces_create_files_body = cls(
+ id=id,
+ model_name=model_name,
+ created_at=created_at,
+ updated_at=updated_at,
+ start_time=start_time,
+ end_time=end_time,
+ input_prompt_tokens_number=input_prompt_tokens_number,
+ output_text_tokens_number=output_text_tokens_number,
+ is_deleted=is_deleted,
+ input_prompt=input_prompt,
+ input_file_prompt=input_file_prompt,
+ endpoint_type=endpoint_type,
+ privacy_score=privacy_score,
+ output_text=output_text,
+ http_status_code=http_status_code,
+ raw_request=raw_request,
+ raw_response=raw_response,
+ tag=tag,
+ error=error,
+ text_to_text_model_parameters=text_to_text_model_parameters,
+ api_key=api_key,
+ )
+
+ api_projects_traces_create_files_body.additional_properties = d
+ return api_projects_traces_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_files_body_raw_request_type_0.py b/premai/models/api_projects_traces_create_files_body_raw_request_type_0.py
new file mode 100644
index 0000000..537838a
--- /dev/null
+++ b/premai/models/api_projects_traces_create_files_body_raw_request_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateFilesBodyRawRequestType0")
+
+
+class ApiProjectsTracesCreateFilesBodyRawRequestType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateFilesBodyRawRequestType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_files_body_raw_request_type_0 = cls()
+
+ api_projects_traces_create_files_body_raw_request_type_0.additional_properties = d
+ return api_projects_traces_create_files_body_raw_request_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_files_body_raw_response_type_0.py b/premai/models/api_projects_traces_create_files_body_raw_response_type_0.py
new file mode 100644
index 0000000..d829a4c
--- /dev/null
+++ b/premai/models/api_projects_traces_create_files_body_raw_response_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateFilesBodyRawResponseType0")
+
+
+class ApiProjectsTracesCreateFilesBodyRawResponseType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateFilesBodyRawResponseType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_files_body_raw_response_type_0 = cls()
+
+ api_projects_traces_create_files_body_raw_response_type_0.additional_properties = d
+ return api_projects_traces_create_files_body_raw_response_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_json_body.py b/premai/models/api_projects_traces_create_json_body.py
new file mode 100644
index 0000000..29c1c14
--- /dev/null
+++ b/premai/models/api_projects_traces_create_json_body.py
@@ -0,0 +1,414 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.api_projects_traces_create_json_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawRequestType0,
+)
+from ..models.api_projects_traces_create_json_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawResponseType0,
+)
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateJsonBody")
+
+
+class ApiProjectsTracesCreateJsonBodyDict(TypedDict):
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: NotRequired[Union[Unset, bool]]
+ input_prompt: NotRequired[Union[Unset, str]]
+ input_file_prompt: NotRequired[Union[None, Unset, str]]
+ endpoint_type: NotRequired[Union[None, Unset, str]]
+ privacy_score: NotRequired[Union[None, Unset, str]]
+ output_text: NotRequired[Union[Unset, str]]
+ http_status_code: NotRequired[Union[None, Unset, int]]
+ raw_request: NotRequired[Union["ApiProjectsTracesCreateJsonBodyRawRequestType0", None, Unset]]
+ raw_response: NotRequired[Union["ApiProjectsTracesCreateJsonBodyRawResponseType0", None, Unset]]
+ tag: NotRequired[Union[None, Unset, str]]
+ error: NotRequired[Union[None, Unset, str]]
+ text_to_text_model_parameters: NotRequired[Union[None, Unset, int]]
+ api_key: NotRequired[Union[None, Unset, int]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateJsonBody:
+ """
+ Attributes:
+ id (str):
+ model_name (str):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ start_time (datetime.datetime):
+ end_time (datetime.datetime):
+ input_prompt_tokens_number (int):
+ output_text_tokens_number (int):
+ is_deleted (Union[Unset, bool]):
+ input_prompt (Union[Unset, str]):
+ input_file_prompt (Union[None, Unset, str]):
+ endpoint_type (Union[None, Unset, str]):
+ privacy_score (Union[None, Unset, str]):
+ output_text (Union[Unset, str]):
+ http_status_code (Union[None, Unset, int]):
+ raw_request (Union['ApiProjectsTracesCreateJsonBodyRawRequestType0', None, Unset]):
+ raw_response (Union['ApiProjectsTracesCreateJsonBodyRawResponseType0', None, Unset]):
+ tag (Union[None, Unset, str]):
+ error (Union[None, Unset, str]):
+ text_to_text_model_parameters (Union[None, Unset, int]):
+ api_key (Union[None, Unset, int]):
+ """
+
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: Union[Unset, bool] = UNSET
+ input_prompt: Union[Unset, str] = UNSET
+ input_file_prompt: Union[None, Unset, str] = UNSET
+ endpoint_type: Union[None, Unset, str] = UNSET
+ privacy_score: Union[None, Unset, str] = UNSET
+ output_text: Union[Unset, str] = UNSET
+ http_status_code: Union[None, Unset, int] = UNSET
+ raw_request: Union["ApiProjectsTracesCreateJsonBodyRawRequestType0", None, Unset] = UNSET
+ raw_response: Union["ApiProjectsTracesCreateJsonBodyRawResponseType0", None, Unset] = UNSET
+ tag: Union[None, Unset, str] = UNSET
+ error: Union[None, Unset, str] = UNSET
+ text_to_text_model_parameters: Union[None, Unset, int] = UNSET
+ api_key: Union[None, Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.api_projects_traces_create_json_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_json_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawResponseType0,
+ )
+
+ id = self.id
+
+ model_name = self.model_name
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ start_time = self.start_time.isoformat()
+
+ end_time = self.end_time.isoformat()
+
+ input_prompt_tokens_number = self.input_prompt_tokens_number
+
+ output_text_tokens_number = self.output_text_tokens_number
+
+ is_deleted = self.is_deleted
+
+ input_prompt = self.input_prompt
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = self.output_text
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, ApiProjectsTracesCreateJsonBodyRawRequestType0):
+ raw_request = self.raw_request.to_dict()
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, ApiProjectsTracesCreateJsonBodyRawResponseType0):
+ raw_response = self.raw_response.to_dict()
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.api_projects_traces_create_json_body_raw_request_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawRequestType0,
+ )
+ from ..models.api_projects_traces_create_json_body_raw_response_type_0 import (
+ ApiProjectsTracesCreateJsonBodyRawResponseType0,
+ )
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ model_name = d.pop("model_name")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ start_time = isoparse(d.pop("start_time"))
+
+ end_time = isoparse(d.pop("end_time"))
+
+ input_prompt_tokens_number = d.pop("input_prompt_tokens_number")
+
+ output_text_tokens_number = d.pop("output_text_tokens_number")
+
+ is_deleted = d.pop("is_deleted", UNSET)
+
+ input_prompt = d.pop("input_prompt", UNSET)
+
+ def _parse_input_file_prompt(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_file_prompt = _parse_input_file_prompt(d.pop("input_file_prompt", UNSET))
+
+ def _parse_endpoint_type(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ endpoint_type = _parse_endpoint_type(d.pop("endpoint_type", UNSET))
+
+ def _parse_privacy_score(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ privacy_score = _parse_privacy_score(d.pop("privacy_score", UNSET))
+
+ output_text = d.pop("output_text", UNSET)
+
+ def _parse_http_status_code(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ http_status_code = _parse_http_status_code(d.pop("http_status_code", UNSET))
+
+ def _parse_raw_request(data: object) -> Union["ApiProjectsTracesCreateJsonBodyRawRequestType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_request_type_0 = ApiProjectsTracesCreateJsonBodyRawRequestType0.from_dict(data)
+
+ return raw_request_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateJsonBodyRawRequestType0", None, Unset], data)
+
+ raw_request = _parse_raw_request(d.pop("raw_request", UNSET))
+
+ def _parse_raw_response(data: object) -> Union["ApiProjectsTracesCreateJsonBodyRawResponseType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_response_type_0 = ApiProjectsTracesCreateJsonBodyRawResponseType0.from_dict(data)
+
+ return raw_response_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateJsonBodyRawResponseType0", None, Unset], data)
+
+ raw_response = _parse_raw_response(d.pop("raw_response", UNSET))
+
+ def _parse_tag(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ tag = _parse_tag(d.pop("tag", UNSET))
+
+ def _parse_error(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ error = _parse_error(d.pop("error", UNSET))
+
+ def _parse_text_to_text_model_parameters(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ text_to_text_model_parameters = _parse_text_to_text_model_parameters(
+ d.pop("text_to_text_model_parameters", UNSET)
+ )
+
+ def _parse_api_key(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ api_key = _parse_api_key(d.pop("api_key", UNSET))
+
+ api_projects_traces_create_json_body = cls(
+ id=id,
+ model_name=model_name,
+ created_at=created_at,
+ updated_at=updated_at,
+ start_time=start_time,
+ end_time=end_time,
+ input_prompt_tokens_number=input_prompt_tokens_number,
+ output_text_tokens_number=output_text_tokens_number,
+ is_deleted=is_deleted,
+ input_prompt=input_prompt,
+ input_file_prompt=input_file_prompt,
+ endpoint_type=endpoint_type,
+ privacy_score=privacy_score,
+ output_text=output_text,
+ http_status_code=http_status_code,
+ raw_request=raw_request,
+ raw_response=raw_response,
+ tag=tag,
+ error=error,
+ text_to_text_model_parameters=text_to_text_model_parameters,
+ api_key=api_key,
+ )
+
+ api_projects_traces_create_json_body.additional_properties = d
+ return api_projects_traces_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_json_body_raw_request_type_0.py b/premai/models/api_projects_traces_create_json_body_raw_request_type_0.py
new file mode 100644
index 0000000..ceb9a51
--- /dev/null
+++ b/premai/models/api_projects_traces_create_json_body_raw_request_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateJsonBodyRawRequestType0")
+
+
+class ApiProjectsTracesCreateJsonBodyRawRequestType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateJsonBodyRawRequestType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_json_body_raw_request_type_0 = cls()
+
+ api_projects_traces_create_json_body_raw_request_type_0.additional_properties = d
+ return api_projects_traces_create_json_body_raw_request_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_json_body_raw_response_type_0.py b/premai/models/api_projects_traces_create_json_body_raw_response_type_0.py
new file mode 100644
index 0000000..13adf3f
--- /dev/null
+++ b/premai/models/api_projects_traces_create_json_body_raw_response_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateJsonBodyRawResponseType0")
+
+
+class ApiProjectsTracesCreateJsonBodyRawResponseType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateJsonBodyRawResponseType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_json_body_raw_response_type_0 = cls()
+
+ api_projects_traces_create_json_body_raw_response_type_0.additional_properties = d
+ return api_projects_traces_create_json_body_raw_response_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_response_201.py b/premai/models/api_projects_traces_create_response_201.py
new file mode 100644
index 0000000..d47453e
--- /dev/null
+++ b/premai/models/api_projects_traces_create_response_201.py
@@ -0,0 +1,416 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.api_projects_traces_create_response_201_raw_request_type_0 import (
+ ApiProjectsTracesCreateResponse201RawRequestType0,
+)
+from ..models.api_projects_traces_create_response_201_raw_response_type_0 import (
+ ApiProjectsTracesCreateResponse201RawResponseType0,
+)
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateResponse201")
+
+
+class ApiProjectsTracesCreateResponse201Dict(TypedDict):
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: NotRequired[Union[Unset, bool]]
+ input_prompt: NotRequired[Union[Unset, str]]
+ input_file_prompt: NotRequired[Union[None, Unset, str]]
+ endpoint_type: NotRequired[Union[None, Unset, str]]
+ privacy_score: NotRequired[Union[None, Unset, str]]
+ output_text: NotRequired[Union[Unset, str]]
+ http_status_code: NotRequired[Union[None, Unset, int]]
+ raw_request: NotRequired[Union["ApiProjectsTracesCreateResponse201RawRequestType0", None, Unset]]
+ raw_response: NotRequired[Union["ApiProjectsTracesCreateResponse201RawResponseType0", None, Unset]]
+ tag: NotRequired[Union[None, Unset, str]]
+ error: NotRequired[Union[None, Unset, str]]
+ text_to_text_model_parameters: NotRequired[Union[None, Unset, int]]
+ api_key: NotRequired[Union[None, Unset, int]]
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateResponse201:
+ """
+ Attributes:
+ id (str):
+ model_name (str):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ start_time (datetime.datetime):
+ end_time (datetime.datetime):
+ input_prompt_tokens_number (int):
+ output_text_tokens_number (int):
+ is_deleted (Union[Unset, bool]):
+ input_prompt (Union[Unset, str]):
+ input_file_prompt (Union[None, Unset, str]):
+ endpoint_type (Union[None, Unset, str]):
+ privacy_score (Union[None, Unset, str]):
+ output_text (Union[Unset, str]):
+ http_status_code (Union[None, Unset, int]):
+ raw_request (Union['ApiProjectsTracesCreateResponse201RawRequestType0', None, Unset]):
+ raw_response (Union['ApiProjectsTracesCreateResponse201RawResponseType0', None, Unset]):
+ tag (Union[None, Unset, str]):
+ error (Union[None, Unset, str]):
+ text_to_text_model_parameters (Union[None, Unset, int]):
+ api_key (Union[None, Unset, int]):
+ """
+
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: Union[Unset, bool] = UNSET
+ input_prompt: Union[Unset, str] = UNSET
+ input_file_prompt: Union[None, Unset, str] = UNSET
+ endpoint_type: Union[None, Unset, str] = UNSET
+ privacy_score: Union[None, Unset, str] = UNSET
+ output_text: Union[Unset, str] = UNSET
+ http_status_code: Union[None, Unset, int] = UNSET
+ raw_request: Union["ApiProjectsTracesCreateResponse201RawRequestType0", None, Unset] = UNSET
+ raw_response: Union["ApiProjectsTracesCreateResponse201RawResponseType0", None, Unset] = UNSET
+ tag: Union[None, Unset, str] = UNSET
+ error: Union[None, Unset, str] = UNSET
+ text_to_text_model_parameters: Union[None, Unset, int] = UNSET
+ api_key: Union[None, Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.api_projects_traces_create_response_201_raw_request_type_0 import (
+ ApiProjectsTracesCreateResponse201RawRequestType0,
+ )
+ from ..models.api_projects_traces_create_response_201_raw_response_type_0 import (
+ ApiProjectsTracesCreateResponse201RawResponseType0,
+ )
+
+ id = self.id
+
+ model_name = self.model_name
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ start_time = self.start_time.isoformat()
+
+ end_time = self.end_time.isoformat()
+
+ input_prompt_tokens_number = self.input_prompt_tokens_number
+
+ output_text_tokens_number = self.output_text_tokens_number
+
+ is_deleted = self.is_deleted
+
+ input_prompt = self.input_prompt
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = self.output_text
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, ApiProjectsTracesCreateResponse201RawRequestType0):
+ raw_request = self.raw_request.to_dict()
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, ApiProjectsTracesCreateResponse201RawResponseType0):
+ raw_response = self.raw_response.to_dict()
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.api_projects_traces_create_response_201_raw_request_type_0 import (
+ ApiProjectsTracesCreateResponse201RawRequestType0,
+ )
+ from ..models.api_projects_traces_create_response_201_raw_response_type_0 import (
+ ApiProjectsTracesCreateResponse201RawResponseType0,
+ )
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ model_name = d.pop("model_name")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ start_time = isoparse(d.pop("start_time"))
+
+ end_time = isoparse(d.pop("end_time"))
+
+ input_prompt_tokens_number = d.pop("input_prompt_tokens_number")
+
+ output_text_tokens_number = d.pop("output_text_tokens_number")
+
+ is_deleted = d.pop("is_deleted", UNSET)
+
+ input_prompt = d.pop("input_prompt", UNSET)
+
+ def _parse_input_file_prompt(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_file_prompt = _parse_input_file_prompt(d.pop("input_file_prompt", UNSET))
+
+ def _parse_endpoint_type(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ endpoint_type = _parse_endpoint_type(d.pop("endpoint_type", UNSET))
+
+ def _parse_privacy_score(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ privacy_score = _parse_privacy_score(d.pop("privacy_score", UNSET))
+
+ output_text = d.pop("output_text", UNSET)
+
+ def _parse_http_status_code(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ http_status_code = _parse_http_status_code(d.pop("http_status_code", UNSET))
+
+ def _parse_raw_request(data: object) -> Union["ApiProjectsTracesCreateResponse201RawRequestType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_request_type_0 = ApiProjectsTracesCreateResponse201RawRequestType0.from_dict(data)
+
+ return raw_request_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateResponse201RawRequestType0", None, Unset], data)
+
+ raw_request = _parse_raw_request(d.pop("raw_request", UNSET))
+
+ def _parse_raw_response(
+ data: object,
+ ) -> Union["ApiProjectsTracesCreateResponse201RawResponseType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_response_type_0 = ApiProjectsTracesCreateResponse201RawResponseType0.from_dict(data)
+
+ return raw_response_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ApiProjectsTracesCreateResponse201RawResponseType0", None, Unset], data)
+
+ raw_response = _parse_raw_response(d.pop("raw_response", UNSET))
+
+ def _parse_tag(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ tag = _parse_tag(d.pop("tag", UNSET))
+
+ def _parse_error(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ error = _parse_error(d.pop("error", UNSET))
+
+ def _parse_text_to_text_model_parameters(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ text_to_text_model_parameters = _parse_text_to_text_model_parameters(
+ d.pop("text_to_text_model_parameters", UNSET)
+ )
+
+ def _parse_api_key(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ api_key = _parse_api_key(d.pop("api_key", UNSET))
+
+ api_projects_traces_create_response_201 = cls(
+ id=id,
+ model_name=model_name,
+ created_at=created_at,
+ updated_at=updated_at,
+ start_time=start_time,
+ end_time=end_time,
+ input_prompt_tokens_number=input_prompt_tokens_number,
+ output_text_tokens_number=output_text_tokens_number,
+ is_deleted=is_deleted,
+ input_prompt=input_prompt,
+ input_file_prompt=input_file_prompt,
+ endpoint_type=endpoint_type,
+ privacy_score=privacy_score,
+ output_text=output_text,
+ http_status_code=http_status_code,
+ raw_request=raw_request,
+ raw_response=raw_response,
+ tag=tag,
+ error=error,
+ text_to_text_model_parameters=text_to_text_model_parameters,
+ api_key=api_key,
+ )
+
+ api_projects_traces_create_response_201.additional_properties = d
+ return api_projects_traces_create_response_201
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_response_201_raw_request_type_0.py b/premai/models/api_projects_traces_create_response_201_raw_request_type_0.py
new file mode 100644
index 0000000..da7cf71
--- /dev/null
+++ b/premai/models/api_projects_traces_create_response_201_raw_request_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateResponse201RawRequestType0")
+
+
+class ApiProjectsTracesCreateResponse201RawRequestType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateResponse201RawRequestType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_response_201_raw_request_type_0 = cls()
+
+ api_projects_traces_create_response_201_raw_request_type_0.additional_properties = d
+ return api_projects_traces_create_response_201_raw_request_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_projects_traces_create_response_201_raw_response_type_0.py b/premai/models/api_projects_traces_create_response_201_raw_response_type_0.py
new file mode 100644
index 0000000..075e928
--- /dev/null
+++ b/premai/models/api_projects_traces_create_response_201_raw_response_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProjectsTracesCreateResponse201RawResponseType0")
+
+
+class ApiProjectsTracesCreateResponse201RawResponseType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiProjectsTracesCreateResponse201RawResponseType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_projects_traces_create_response_201_raw_response_type_0 = cls()
+
+ api_projects_traces_create_response_201_raw_response_type_0.additional_properties = d
+ return api_projects_traces_create_response_201_raw_response_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_providers_leaderboard_retrieve_response_200.py b/premai/models/api_providers_leaderboard_retrieve_response_200.py
new file mode 100644
index 0000000..16c7823
--- /dev/null
+++ b/premai/models/api_providers_leaderboard_retrieve_response_200.py
@@ -0,0 +1,92 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.api_providers_leaderboard_retrieve_response_200_leaderboard_item import (
+ ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem,
+)
+
+T = TypeVar("T", bound="ApiProvidersLeaderboardRetrieveResponse200")
+
+
+class ApiProvidersLeaderboardRetrieveResponse200Dict(TypedDict):
+ days: int
+ leaderboard: List["ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem"]
+ pass
+
+
+@_attrs_define
+class ApiProvidersLeaderboardRetrieveResponse200:
+ """
+ Attributes:
+ days (int):
+ leaderboard (List['ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem']):
+ """
+
+ days: int
+ leaderboard: List["ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ days = self.days
+
+ leaderboard = []
+ for leaderboard_item_data in self.leaderboard:
+ leaderboard_item = leaderboard_item_data.to_dict()
+ leaderboard.append(leaderboard_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "days": days,
+ "leaderboard": leaderboard,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.api_providers_leaderboard_retrieve_response_200_leaderboard_item import (
+ ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem,
+ )
+
+ d = src_dict.copy()
+ days = d.pop("days")
+
+ leaderboard = []
+ _leaderboard = d.pop("leaderboard")
+ for leaderboard_item_data in _leaderboard:
+ leaderboard_item = ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem.from_dict(
+ leaderboard_item_data
+ )
+
+ leaderboard.append(leaderboard_item)
+
+ api_providers_leaderboard_retrieve_response_200 = cls(
+ days=days,
+ leaderboard=leaderboard,
+ )
+
+ api_providers_leaderboard_retrieve_response_200.additional_properties = d
+ return api_providers_leaderboard_retrieve_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_providers_leaderboard_retrieve_response_200_leaderboard_item.py b/premai/models/api_providers_leaderboard_retrieve_response_200_leaderboard_item.py
new file mode 100644
index 0000000..7d3c869
--- /dev/null
+++ b/premai/models/api_providers_leaderboard_retrieve_response_200_leaderboard_item.py
@@ -0,0 +1,128 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem")
+
+
+class ApiProvidersLeaderboardRetrieveResponse200LeaderboardItemDict(TypedDict):
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+ pass
+
+
+@_attrs_define
+class ApiProvidersLeaderboardRetrieveResponse200LeaderboardItem:
+ """
+ Attributes:
+ provider (str):
+ provider_slug (str):
+ provider_name (str):
+ avg_final_score (float):
+ avg_tokens_per_second (float):
+ avg_uptime (float):
+ avg_uptime_score (int):
+ avg_tokens_score (int):
+ """
+
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ provider = self.provider
+
+ provider_slug = self.provider_slug
+
+ provider_name = self.provider_name
+
+ avg_final_score = self.avg_final_score
+
+ avg_tokens_per_second = self.avg_tokens_per_second
+
+ avg_uptime = self.avg_uptime
+
+ avg_uptime_score = self.avg_uptime_score
+
+ avg_tokens_score = self.avg_tokens_score
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "provider": provider,
+ "provider_slug": provider_slug,
+ "provider_name": provider_name,
+ "avg_final_score": avg_final_score,
+ "avg_tokens_per_second": avg_tokens_per_second,
+ "avg_uptime": avg_uptime,
+ "avg_uptime_score": avg_uptime_score,
+ "avg_tokens_score": avg_tokens_score,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ provider = d.pop("provider")
+
+ provider_slug = d.pop("provider_slug")
+
+ provider_name = d.pop("provider_name")
+
+ avg_final_score = d.pop("avg_final_score")
+
+ avg_tokens_per_second = d.pop("avg_tokens_per_second")
+
+ avg_uptime = d.pop("avg_uptime")
+
+ avg_uptime_score = d.pop("avg_uptime_score")
+
+ avg_tokens_score = d.pop("avg_tokens_score")
+
+ api_providers_leaderboard_retrieve_response_200_leaderboard_item = cls(
+ provider=provider,
+ provider_slug=provider_slug,
+ provider_name=provider_name,
+ avg_final_score=avg_final_score,
+ avg_tokens_per_second=avg_tokens_per_second,
+ avg_uptime=avg_uptime,
+ avg_uptime_score=avg_uptime_score,
+ avg_tokens_score=avg_tokens_score,
+ )
+
+ api_providers_leaderboard_retrieve_response_200_leaderboard_item.additional_properties = d
+ return api_providers_leaderboard_retrieve_response_200_leaderboard_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_response_validation_error.py b/premai/models/api_response_validation_error.py
new file mode 100644
index 0000000..f8a68e4
--- /dev/null
+++ b/premai/models/api_response_validation_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.api_response_validation_error_code import APIResponseValidationErrorCode
+
+T = TypeVar("T", bound="APIResponseValidationError")
+
+
+class APIResponseValidationErrorDict(TypedDict):
+ message: str
+ code: APIResponseValidationErrorCode
+ pass
+
+
+@_attrs_define
+class APIResponseValidationError:
+ """
+ Attributes:
+ message (str):
+ code (APIResponseValidationErrorCode): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: APIResponseValidationErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = APIResponseValidationErrorCode(d.pop("code"))
+
+ api_response_validation_error = cls(
+ message=message,
+ code=code,
+ )
+
+ api_response_validation_error.additional_properties = d
+ return api_response_validation_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/api_response_validation_error_code.py b/premai/models/api_response_validation_error_code.py
new file mode 100644
index 0000000..87b3caf
--- /dev/null
+++ b/premai/models/api_response_validation_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class APIResponseValidationErrorCode(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/api_response_validation_error_code_enum.py b/premai/models/api_response_validation_error_code_enum.py
new file mode 100644
index 0000000..4387f03
--- /dev/null
+++ b/premai/models/api_response_validation_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class APIResponseValidationErrorCodeEnum(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/api_schema_retrieve_format.py b/premai/models/api_schema_retrieve_format.py
new file mode 100644
index 0000000..7ee1431
--- /dev/null
+++ b/premai/models/api_schema_retrieve_format.py
@@ -0,0 +1,9 @@
+from enum import Enum
+
+
+class ApiSchemaRetrieveFormat(str, Enum):
+ JSON = "json"
+ YAML = "yaml"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/api_schema_retrieve_lang.py b/premai/models/api_schema_retrieve_lang.py
new file mode 100644
index 0000000..7340145
--- /dev/null
+++ b/premai/models/api_schema_retrieve_lang.py
@@ -0,0 +1,105 @@
+from enum import Enum
+
+
+class ApiSchemaRetrieveLang(str, Enum):
+ AF = "af"
+ AR = "ar"
+ AR_DZ = "ar-dz"
+ AST = "ast"
+ AZ = "az"
+ BE = "be"
+ BG = "bg"
+ BN = "bn"
+ BR = "br"
+ BS = "bs"
+ CA = "ca"
+ CKB = "ckb"
+ CS = "cs"
+ CY = "cy"
+ DA = "da"
+ DE = "de"
+ DSB = "dsb"
+ EL = "el"
+ EN = "en"
+ EN_AU = "en-au"
+ EN_GB = "en-gb"
+ EO = "eo"
+ ES = "es"
+ ES_AR = "es-ar"
+ ES_CO = "es-co"
+ ES_MX = "es-mx"
+ ES_NI = "es-ni"
+ ES_VE = "es-ve"
+ ET = "et"
+ EU = "eu"
+ FA = "fa"
+ FI = "fi"
+ FR = "fr"
+ FY = "fy"
+ GA = "ga"
+ GD = "gd"
+ GL = "gl"
+ HE = "he"
+ HI = "hi"
+ HR = "hr"
+ HSB = "hsb"
+ HU = "hu"
+ HY = "hy"
+ IA = "ia"
+ ID = "id"
+ IG = "ig"
+ IO = "io"
+ IS = "is"
+ IT = "it"
+ JA = "ja"
+ KA = "ka"
+ KAB = "kab"
+ KK = "kk"
+ KM = "km"
+ KN = "kn"
+ KO = "ko"
+ KY = "ky"
+ LB = "lb"
+ LT = "lt"
+ LV = "lv"
+ MK = "mk"
+ ML = "ml"
+ MN = "mn"
+ MR = "mr"
+ MS = "ms"
+ MY = "my"
+ NB = "nb"
+ NE = "ne"
+ NL = "nl"
+ NN = "nn"
+ OS = "os"
+ PA = "pa"
+ PL = "pl"
+ PT = "pt"
+ PT_BR = "pt-br"
+ RO = "ro"
+ RU = "ru"
+ SK = "sk"
+ SL = "sl"
+ SQ = "sq"
+ SR = "sr"
+ SR_LATN = "sr-latn"
+ SV = "sv"
+ SW = "sw"
+ TA = "ta"
+ TE = "te"
+ TG = "tg"
+ TH = "th"
+ TK = "tk"
+ TR = "tr"
+ TT = "tt"
+ UDM = "udm"
+ UK = "uk"
+ UR = "ur"
+ UZ = "uz"
+ VI = "vi"
+ ZH_HANS = "zh-hans"
+ ZH_HANT = "zh-hant"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/api_schema_retrieve_response_200.py b/premai/models/api_schema_retrieve_response_200.py
new file mode 100644
index 0000000..f5da00c
--- /dev/null
+++ b/premai/models/api_schema_retrieve_response_200.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ApiSchemaRetrieveResponse200")
+
+
+class ApiSchemaRetrieveResponse200Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ApiSchemaRetrieveResponse200:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ api_schema_retrieve_response_200 = cls()
+
+ api_schema_retrieve_response_200.additional_properties = d
+ return api_schema_retrieve_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/auth_token.py b/premai/models/auth_token.py
new file mode 100644
index 0000000..baad62a
--- /dev/null
+++ b/premai/models/auth_token.py
@@ -0,0 +1,83 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="AuthToken")
+
+
+class AuthTokenDict(TypedDict):
+ username: str
+ password: str
+ token: str
+ pass
+
+
+@_attrs_define
+class AuthToken:
+ """
+ Attributes:
+ username (str):
+ password (str):
+ token (str):
+ """
+
+ username: str
+ password: str
+ token: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ username = self.username
+
+ password = self.password
+
+ token = self.token
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ username = d.pop("username")
+
+ password = d.pop("password")
+
+ token = d.pop("token")
+
+ auth_token = cls(
+ username=username,
+ password=password,
+ token=token,
+ )
+
+ auth_token.additional_properties = d
+ return auth_token
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/auth_token_create_data_body.py b/premai/models/auth_token_create_data_body.py
new file mode 100644
index 0000000..32da62d
--- /dev/null
+++ b/premai/models/auth_token_create_data_body.py
@@ -0,0 +1,83 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="AuthTokenCreateDataBody")
+
+
+class AuthTokenCreateDataBodyDict(TypedDict):
+ username: str
+ password: str
+ token: str
+ pass
+
+
+@_attrs_define
+class AuthTokenCreateDataBody:
+ """
+ Attributes:
+ username (str):
+ password (str):
+ token (str):
+ """
+
+ username: str
+ password: str
+ token: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ username = self.username
+
+ password = self.password
+
+ token = self.token
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ username = d.pop("username")
+
+ password = d.pop("password")
+
+ token = d.pop("token")
+
+ auth_token_create_data_body = cls(
+ username=username,
+ password=password,
+ token=token,
+ )
+
+ auth_token_create_data_body.additional_properties = d
+ return auth_token_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/auth_token_create_files_body.py b/premai/models/auth_token_create_files_body.py
new file mode 100644
index 0000000..98f6170
--- /dev/null
+++ b/premai/models/auth_token_create_files_body.py
@@ -0,0 +1,110 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..types import Unset
+
+T = TypeVar("T", bound="AuthTokenCreateFilesBody")
+
+
+class AuthTokenCreateFilesBodyDict(TypedDict):
+ username: str
+ password: str
+ token: str
+ pass
+
+
+@_attrs_define
+class AuthTokenCreateFilesBody:
+ """
+ Attributes:
+ username (str):
+ password (str):
+ token (str):
+ """
+
+ username: str
+ password: str
+ token: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ username = self.username
+
+ password = self.password
+
+ token = self.token
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ username = (
+ self.username if isinstance(self.username, Unset) else (None, str(self.username).encode(), "text/plain")
+ )
+
+ password = (
+ self.password if isinstance(self.password, Unset) else (None, str(self.password).encode(), "text/plain")
+ )
+
+ token = self.token if isinstance(self.token, Unset) else (None, str(self.token).encode(), "text/plain")
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ username = d.pop("username")
+
+ password = d.pop("password")
+
+ token = d.pop("token")
+
+ auth_token_create_files_body = cls(
+ username=username,
+ password=password,
+ token=token,
+ )
+
+ auth_token_create_files_body.additional_properties = d
+ return auth_token_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/auth_token_create_json_body.py b/premai/models/auth_token_create_json_body.py
new file mode 100644
index 0000000..c7938d0
--- /dev/null
+++ b/premai/models/auth_token_create_json_body.py
@@ -0,0 +1,83 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="AuthTokenCreateJsonBody")
+
+
+class AuthTokenCreateJsonBodyDict(TypedDict):
+ username: str
+ password: str
+ token: str
+ pass
+
+
+@_attrs_define
+class AuthTokenCreateJsonBody:
+ """
+ Attributes:
+ username (str):
+ password (str):
+ token (str):
+ """
+
+ username: str
+ password: str
+ token: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ username = self.username
+
+ password = self.password
+
+ token = self.token
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ username = d.pop("username")
+
+ password = d.pop("password")
+
+ token = d.pop("token")
+
+ auth_token_create_json_body = cls(
+ username=username,
+ password=password,
+ token=token,
+ )
+
+ auth_token_create_json_body.additional_properties = d
+ return auth_token_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/auth_token_create_response_200.py b/premai/models/auth_token_create_response_200.py
new file mode 100644
index 0000000..95ce667
--- /dev/null
+++ b/premai/models/auth_token_create_response_200.py
@@ -0,0 +1,83 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="AuthTokenCreateResponse200")
+
+
+class AuthTokenCreateResponse200Dict(TypedDict):
+ username: str
+ password: str
+ token: str
+ pass
+
+
+@_attrs_define
+class AuthTokenCreateResponse200:
+ """
+ Attributes:
+ username (str):
+ password (str):
+ token (str):
+ """
+
+ username: str
+ password: str
+ token: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ username = self.username
+
+ password = self.password
+
+ token = self.token
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "username": username,
+ "password": password,
+ "token": token,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ username = d.pop("username")
+
+ password = d.pop("password")
+
+ token = d.pop("token")
+
+ auth_token_create_response_200 = cls(
+ username=username,
+ password=password,
+ token=token,
+ )
+
+ auth_token_create_response_200.additional_properties = d
+ return auth_token_create_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/authentication_error.py b/premai/models/authentication_error.py
new file mode 100644
index 0000000..aae2814
--- /dev/null
+++ b/premai/models/authentication_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.authentication_error_code import AuthenticationErrorCode
+
+T = TypeVar("T", bound="AuthenticationError")
+
+
+class AuthenticationErrorDict(TypedDict):
+ message: str
+ code: AuthenticationErrorCode
+ pass
+
+
+@_attrs_define
+class AuthenticationError:
+ """
+ Attributes:
+ message (str):
+ code (AuthenticationErrorCode): * `AuthenticationError` - AuthenticationError
+ """
+
+ message: str
+ code: AuthenticationErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = AuthenticationErrorCode(d.pop("code"))
+
+ authentication_error = cls(
+ message=message,
+ code=code,
+ )
+
+ authentication_error.additional_properties = d
+ return authentication_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/authentication_error_code.py b/premai/models/authentication_error_code.py
new file mode 100644
index 0000000..9380588
--- /dev/null
+++ b/premai/models/authentication_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class AuthenticationErrorCode(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/authentication_error_code_enum.py b/premai/models/authentication_error_code_enum.py
new file mode 100644
index 0000000..4820f1f
--- /dev/null
+++ b/premai/models/authentication_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class AuthenticationErrorCodeEnum(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/catch_all_error.py b/premai/models/catch_all_error.py
new file mode 100644
index 0000000..8356181
--- /dev/null
+++ b/premai/models/catch_all_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.catch_all_error_code import CatchAllErrorCode
+
+T = TypeVar("T", bound="CatchAllError")
+
+
+class CatchAllErrorDict(TypedDict):
+ message: str
+ code: CatchAllErrorCode
+ pass
+
+
+@_attrs_define
+class CatchAllError:
+ """
+ Attributes:
+ message (str):
+ code (CatchAllErrorCode): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: CatchAllErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = CatchAllErrorCode(d.pop("code"))
+
+ catch_all_error = cls(
+ message=message,
+ code=code,
+ )
+
+ catch_all_error.additional_properties = d
+ return catch_all_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/catch_all_error_code.py b/premai/models/catch_all_error_code.py
new file mode 100644
index 0000000..fef3c4a
--- /dev/null
+++ b/premai/models/catch_all_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class CatchAllErrorCode(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/catch_all_error_code_enum.py b/premai/models/catch_all_error_code_enum.py
new file mode 100644
index 0000000..43027a2
--- /dev/null
+++ b/premai/models/catch_all_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class CatchAllErrorCodeEnum(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/chat_completion_input.py b/premai/models/chat_completion_input.py
new file mode 100644
index 0000000..83ab51c
--- /dev/null
+++ b/premai/models/chat_completion_input.py
@@ -0,0 +1,360 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.chat_completion_input_logit_bias_type_0 import ChatCompletionInputLogitBiasType0
+from ..models.chat_completion_input_messages_item import ChatCompletionInputMessagesItem
+from ..models.chat_completion_input_response_format_type_0 import ChatCompletionInputResponseFormatType0
+from ..models.chat_completion_input_tools_item import ChatCompletionInputToolsItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ChatCompletionInput")
+
+
+class ChatCompletionInputDict(TypedDict):
+ project_id: int
+ messages: List["ChatCompletionInputMessagesItem"]
+ model: NotRequired[Union[Unset, str]]
+ frequency_penalty: NotRequired[Union[Unset, float]]
+ logit_bias: NotRequired[Union["ChatCompletionInputLogitBiasType0", None, Unset]]
+ max_tokens: NotRequired[Union[None, Unset, int]]
+ n: NotRequired[Union[Unset, int]]
+ presence_penalty: NotRequired[Union[Unset, float]]
+ response_format: NotRequired[Union["ChatCompletionInputResponseFormatType0", None, Unset]]
+ seed: NotRequired[Union[None, Unset, int]]
+ stop: NotRequired[Union[None, Unset, str]]
+ stream: NotRequired[Union[Unset, bool]]
+ temperature: NotRequired[Union[None, Unset, float]]
+ top_p: NotRequired[Union[None, Unset, float]]
+ tools: NotRequired[Union[Unset, List["ChatCompletionInputToolsItem"]]]
+ user: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class ChatCompletionInput:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ messages (List['ChatCompletionInputMessagesItem']): A list of messages comprising the conversation so far.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ frequency_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on their existing frequency.
+ logit_bias (Union['ChatCompletionInputLogitBiasType0', None, Unset]): JSON object that maps tokens to an
+ associated bias value from -100 to 100.
+ max_tokens (Union[None, Unset, int]): The maximum number of tokens to generate in the chat completion.
+ n (Union[Unset, int]): How many chat completion choices to generate for each input message.
+ presence_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on whether they appear in the text so far.
+ response_format (Union['ChatCompletionInputResponseFormatType0', None, Unset]): An object specifying the format
+ that the model must output.
+ seed (Union[None, Unset, int]): This feature is in Beta. If specified, our system will make a best effort to
+ sample deterministically.
+ stop (Union[None, Unset, str]): Up to 4 sequences where the API will stop generating further tokens.
+ stream (Union[Unset, bool]): If set, partial message deltas will be sent, like in ChatGPT.
+ temperature (Union[None, Unset, float]): What sampling temperature to use, between 0 and 2.
+ top_p (Union[None, Unset, float]): An alternative to sampling with temperature, called nucleus sampling.
+ tools (Union[Unset, List['ChatCompletionInputToolsItem']]): A list of tools the model may call. Currently, only
+ functions are supported as a tool.
+ user (Union[None, Unset, str]): A unique identifier representing your end-user.
+ """
+
+ project_id: int
+ messages: List["ChatCompletionInputMessagesItem"]
+ model: Union[Unset, str] = UNSET
+ frequency_penalty: Union[Unset, float] = UNSET
+ logit_bias: Union["ChatCompletionInputLogitBiasType0", None, Unset] = UNSET
+ max_tokens: Union[None, Unset, int] = UNSET
+ n: Union[Unset, int] = UNSET
+ presence_penalty: Union[Unset, float] = UNSET
+ response_format: Union["ChatCompletionInputResponseFormatType0", None, Unset] = UNSET
+ seed: Union[None, Unset, int] = UNSET
+ stop: Union[None, Unset, str] = UNSET
+ stream: Union[Unset, bool] = UNSET
+ temperature: Union[None, Unset, float] = UNSET
+ top_p: Union[None, Unset, float] = UNSET
+ tools: Union[Unset, List["ChatCompletionInputToolsItem"]] = UNSET
+ user: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.chat_completion_input_logit_bias_type_0 import ChatCompletionInputLogitBiasType0
+ from ..models.chat_completion_input_response_format_type_0 import ChatCompletionInputResponseFormatType0
+
+ project_id = self.project_id
+
+ messages = []
+ for messages_item_data in self.messages:
+ messages_item = messages_item_data.to_dict()
+ messages.append(messages_item)
+
+ model = self.model
+
+ frequency_penalty = self.frequency_penalty
+
+ logit_bias: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.logit_bias, Unset):
+ logit_bias = UNSET
+ elif isinstance(self.logit_bias, ChatCompletionInputLogitBiasType0):
+ logit_bias = self.logit_bias.to_dict()
+ else:
+ logit_bias = self.logit_bias
+
+ max_tokens: Union[None, Unset, int]
+ if isinstance(self.max_tokens, Unset):
+ max_tokens = UNSET
+ else:
+ max_tokens = self.max_tokens
+
+ n = self.n
+
+ presence_penalty = self.presence_penalty
+
+ response_format: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.response_format, Unset):
+ response_format = UNSET
+ elif isinstance(self.response_format, ChatCompletionInputResponseFormatType0):
+ response_format = self.response_format.to_dict()
+ else:
+ response_format = self.response_format
+
+ seed: Union[None, Unset, int]
+ if isinstance(self.seed, Unset):
+ seed = UNSET
+ else:
+ seed = self.seed
+
+ stop: Union[None, Unset, str]
+ if isinstance(self.stop, Unset):
+ stop = UNSET
+ else:
+ stop = self.stop
+
+ stream = self.stream
+
+ temperature: Union[None, Unset, float]
+ if isinstance(self.temperature, Unset):
+ temperature = UNSET
+ else:
+ temperature = self.temperature
+
+ top_p: Union[None, Unset, float]
+ if isinstance(self.top_p, Unset):
+ top_p = UNSET
+ else:
+ top_p = self.top_p
+
+ tools: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.tools, Unset):
+ tools = []
+ for tools_item_data in self.tools:
+ tools_item = tools_item_data.to_dict()
+ tools.append(tools_item)
+
+ user: Union[None, Unset, str]
+ if isinstance(self.user, Unset):
+ user = UNSET
+ else:
+ user = self.user
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "messages": messages,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if frequency_penalty is not UNSET:
+ field_dict["frequency_penalty"] = frequency_penalty
+ if logit_bias is not UNSET:
+ field_dict["logit_bias"] = logit_bias
+ if max_tokens is not UNSET:
+ field_dict["max_tokens"] = max_tokens
+ if n is not UNSET:
+ field_dict["n"] = n
+ if presence_penalty is not UNSET:
+ field_dict["presence_penalty"] = presence_penalty
+ if response_format is not UNSET:
+ field_dict["response_format"] = response_format
+ if seed is not UNSET:
+ field_dict["seed"] = seed
+ if stop is not UNSET:
+ field_dict["stop"] = stop
+ if stream is not UNSET:
+ field_dict["stream"] = stream
+ if temperature is not UNSET:
+ field_dict["temperature"] = temperature
+ if top_p is not UNSET:
+ field_dict["top_p"] = top_p
+ if tools is not UNSET:
+ field_dict["tools"] = tools
+ if user is not UNSET:
+ field_dict["user"] = user
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.chat_completion_input_logit_bias_type_0 import ChatCompletionInputLogitBiasType0
+ from ..models.chat_completion_input_messages_item import ChatCompletionInputMessagesItem
+ from ..models.chat_completion_input_response_format_type_0 import ChatCompletionInputResponseFormatType0
+ from ..models.chat_completion_input_tools_item import ChatCompletionInputToolsItem
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ messages = []
+ _messages = d.pop("messages")
+ for messages_item_data in _messages:
+ messages_item = ChatCompletionInputMessagesItem.from_dict(messages_item_data)
+
+ messages.append(messages_item)
+
+ model = d.pop("model", UNSET)
+
+ frequency_penalty = d.pop("frequency_penalty", UNSET)
+
+ def _parse_logit_bias(data: object) -> Union["ChatCompletionInputLogitBiasType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ logit_bias_type_0 = ChatCompletionInputLogitBiasType0.from_dict(data)
+
+ return logit_bias_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ChatCompletionInputLogitBiasType0", None, Unset], data)
+
+ logit_bias = _parse_logit_bias(d.pop("logit_bias", UNSET))
+
+ def _parse_max_tokens(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ max_tokens = _parse_max_tokens(d.pop("max_tokens", UNSET))
+
+ n = d.pop("n", UNSET)
+
+ presence_penalty = d.pop("presence_penalty", UNSET)
+
+ def _parse_response_format(data: object) -> Union["ChatCompletionInputResponseFormatType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_format_type_0 = ChatCompletionInputResponseFormatType0.from_dict(data)
+
+ return response_format_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["ChatCompletionInputResponseFormatType0", None, Unset], data)
+
+ response_format = _parse_response_format(d.pop("response_format", UNSET))
+
+ def _parse_seed(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ seed = _parse_seed(d.pop("seed", UNSET))
+
+ def _parse_stop(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ stop = _parse_stop(d.pop("stop", UNSET))
+
+ stream = d.pop("stream", UNSET)
+
+ def _parse_temperature(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ temperature = _parse_temperature(d.pop("temperature", UNSET))
+
+ def _parse_top_p(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ top_p = _parse_top_p(d.pop("top_p", UNSET))
+
+ tools = []
+ _tools = d.pop("tools", UNSET)
+ for tools_item_data in _tools or []:
+ tools_item = ChatCompletionInputToolsItem.from_dict(tools_item_data)
+
+ tools.append(tools_item)
+
+ def _parse_user(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ user = _parse_user(d.pop("user", UNSET))
+
+ chat_completion_input = cls(
+ project_id=project_id,
+ messages=messages,
+ model=model,
+ frequency_penalty=frequency_penalty,
+ logit_bias=logit_bias,
+ max_tokens=max_tokens,
+ n=n,
+ presence_penalty=presence_penalty,
+ response_format=response_format,
+ seed=seed,
+ stop=stop,
+ stream=stream,
+ temperature=temperature,
+ top_p=top_p,
+ tools=tools,
+ user=user,
+ )
+
+ chat_completion_input.additional_properties = d
+ return chat_completion_input
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_input_logit_bias_type_0.py b/premai/models/chat_completion_input_logit_bias_type_0.py
new file mode 100644
index 0000000..16c6ba1
--- /dev/null
+++ b/premai/models/chat_completion_input_logit_bias_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ChatCompletionInputLogitBiasType0")
+
+
+class ChatCompletionInputLogitBiasType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ChatCompletionInputLogitBiasType0:
+ """JSON object that maps tokens to an associated bias value from -100 to 100."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ chat_completion_input_logit_bias_type_0 = cls()
+
+ chat_completion_input_logit_bias_type_0.additional_properties = d
+ return chat_completion_input_logit_bias_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_input_messages_item.py b/premai/models/chat_completion_input_messages_item.py
new file mode 100644
index 0000000..bbedc2b
--- /dev/null
+++ b/premai/models/chat_completion_input_messages_item.py
@@ -0,0 +1,81 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.chat_completion_input_messages_item_role import ChatCompletionInputMessagesItemRole
+
+T = TypeVar("T", bound="ChatCompletionInputMessagesItem")
+
+
+class ChatCompletionInputMessagesItemDict(TypedDict):
+ role: "ChatCompletionInputMessagesItemRole"
+ content: str
+ pass
+
+
+@_attrs_define
+class ChatCompletionInputMessagesItem:
+ """
+ Attributes:
+ role (ChatCompletionInputMessagesItemRole): The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+ content (str): The content of the message.
+ """
+
+ role: "ChatCompletionInputMessagesItemRole"
+ content: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ role = self.role.to_dict()
+
+ content = self.content
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "role": role,
+ "content": content,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.chat_completion_input_messages_item_role import ChatCompletionInputMessagesItemRole
+
+ d = src_dict.copy()
+ role = ChatCompletionInputMessagesItemRole.from_dict(d.pop("role"))
+
+ content = d.pop("content")
+
+ chat_completion_input_messages_item = cls(
+ role=role,
+ content=content,
+ )
+
+ chat_completion_input_messages_item.additional_properties = d
+ return chat_completion_input_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_input_messages_item_role.py b/premai/models/chat_completion_input_messages_item_role.py
new file mode 100644
index 0000000..ed563f6
--- /dev/null
+++ b/premai/models/chat_completion_input_messages_item_role.py
@@ -0,0 +1,54 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ChatCompletionInputMessagesItemRole")
+
+
+class ChatCompletionInputMessagesItemRoleDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ChatCompletionInputMessagesItemRole:
+ """The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+
+ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ chat_completion_input_messages_item_role = cls()
+
+ chat_completion_input_messages_item_role.additional_properties = d
+ return chat_completion_input_messages_item_role
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_input_response_format_type_0.py b/premai/models/chat_completion_input_response_format_type_0.py
new file mode 100644
index 0000000..ad017ca
--- /dev/null
+++ b/premai/models/chat_completion_input_response_format_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ChatCompletionInputResponseFormatType0")
+
+
+class ChatCompletionInputResponseFormatType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ChatCompletionInputResponseFormatType0:
+ """An object specifying the format that the model must output."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ chat_completion_input_response_format_type_0 = cls()
+
+ chat_completion_input_response_format_type_0.additional_properties = d
+ return chat_completion_input_response_format_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_input_tools_item.py b/premai/models/chat_completion_input_tools_item.py
new file mode 100644
index 0000000..7a4d592
--- /dev/null
+++ b/premai/models/chat_completion_input_tools_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ChatCompletionInputToolsItem")
+
+
+class ChatCompletionInputToolsItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ChatCompletionInputToolsItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ chat_completion_input_tools_item = cls()
+
+ chat_completion_input_tools_item.additional_properties = d
+ return chat_completion_input_tools_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_response.py b/premai/models/chat_completion_response.py
new file mode 100644
index 0000000..79a7421
--- /dev/null
+++ b/premai/models/chat_completion_response.py
@@ -0,0 +1,144 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.chat_completion_response_choices_item import ChatCompletionResponseChoicesItem
+from ..models.chat_completion_response_usage import ChatCompletionResponseUsage
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ChatCompletionResponse")
+
+
+class ChatCompletionResponseDict(TypedDict):
+ id: str
+ choices: List["ChatCompletionResponseChoicesItem"]
+ created: int
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: NotRequired[Union[Unset, ChatCompletionResponseUsage]]
+ pass
+
+
+@_attrs_define
+class ChatCompletionResponse:
+ """
+ Attributes:
+ id (str): A unique identifier for the chat completion. Each chunk has the same ID.
+ choices (List['ChatCompletionResponseChoicesItem']): A list of chat completion choices. Can be more than one if
+ n is greater than 1.
+ created (int): The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same
+ timestamp.
+ model (str): The model to generate the completion.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ usage (Union[Unset, ChatCompletionResponseUsage]): The usage statistics for the completion.
+ """
+
+ id: str
+ choices: List["ChatCompletionResponseChoicesItem"]
+ created: int
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: Union[Unset, "ChatCompletionResponseUsage"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ choices = []
+ for choices_item_data in self.choices:
+ choices_item = choices_item_data.to_dict()
+ choices.append(choices_item)
+
+ created = self.created
+
+ model = self.model
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ usage: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.usage, Unset):
+ usage = self.usage.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "choices": choices,
+ "created": created,
+ "model": model,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ }
+ )
+ if usage is not UNSET:
+ field_dict["usage"] = usage
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.chat_completion_response_choices_item import ChatCompletionResponseChoicesItem
+ from ..models.chat_completion_response_usage import ChatCompletionResponseUsage
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ choices = []
+ _choices = d.pop("choices")
+ for choices_item_data in _choices:
+ choices_item = ChatCompletionResponseChoicesItem.from_dict(choices_item_data)
+
+ choices.append(choices_item)
+
+ created = d.pop("created")
+
+ model = d.pop("model")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ _usage = d.pop("usage", UNSET)
+ usage: Union[Unset, ChatCompletionResponseUsage]
+ if isinstance(_usage, Unset):
+ usage = UNSET
+ else:
+ usage = ChatCompletionResponseUsage.from_dict(_usage)
+
+ chat_completion_response = cls(
+ id=id,
+ choices=choices,
+ created=created,
+ model=model,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ usage=usage,
+ )
+
+ chat_completion_response.additional_properties = d
+ return chat_completion_response
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_response_choices_item.py b/premai/models/chat_completion_response_choices_item.py
new file mode 100644
index 0000000..a8a706e
--- /dev/null
+++ b/premai/models/chat_completion_response_choices_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ChatCompletionResponseChoicesItem")
+
+
+class ChatCompletionResponseChoicesItemDict(TypedDict):
+ message: str
+ finish_reason: str
+ pass
+
+
+@_attrs_define
+class ChatCompletionResponseChoicesItem:
+ """
+ Attributes:
+ message (str): The generated message in the chat completion choice.
+ finish_reason (str): The reason the chat completion finished, e.g., 'stop' or 'length'.
+ """
+
+ message: str
+ finish_reason: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ finish_reason = self.finish_reason
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "finish_reason": finish_reason,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ finish_reason = d.pop("finish_reason")
+
+ chat_completion_response_choices_item = cls(
+ message=message,
+ finish_reason=finish_reason,
+ )
+
+ chat_completion_response_choices_item.additional_properties = d
+ return chat_completion_response_choices_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/chat_completion_response_usage.py b/premai/models/chat_completion_response_usage.py
new file mode 100644
index 0000000..4a3738f
--- /dev/null
+++ b/premai/models/chat_completion_response_usage.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="ChatCompletionResponseUsage")
+
+
+class ChatCompletionResponseUsageDict(TypedDict):
+ completion_tokens: NotRequired[Union[Unset, int]]
+ prompt_tokens: NotRequired[Union[Unset, int]]
+ total_tokens: NotRequired[Union[Unset, int]]
+ pass
+
+
+@_attrs_define
+class ChatCompletionResponseUsage:
+ """The usage statistics for the completion.
+
+ Attributes:
+ completion_tokens (Union[Unset, int]):
+ prompt_tokens (Union[Unset, int]):
+ total_tokens (Union[Unset, int]):
+ """
+
+ completion_tokens: Union[Unset, int] = UNSET
+ prompt_tokens: Union[Unset, int] = UNSET
+ total_tokens: Union[Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ completion_tokens = self.completion_tokens
+
+ prompt_tokens = self.prompt_tokens
+
+ total_tokens = self.total_tokens
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if completion_tokens is not UNSET:
+ field_dict["completion_tokens"] = completion_tokens
+ if prompt_tokens is not UNSET:
+ field_dict["prompt_tokens"] = prompt_tokens
+ if total_tokens is not UNSET:
+ field_dict["total_tokens"] = total_tokens
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ completion_tokens = d.pop("completion_tokens", UNSET)
+
+ prompt_tokens = d.pop("prompt_tokens", UNSET)
+
+ total_tokens = d.pop("total_tokens", UNSET)
+
+ chat_completion_response_usage = cls(
+ completion_tokens=completion_tokens,
+ prompt_tokens=prompt_tokens,
+ total_tokens=total_tokens,
+ )
+
+ chat_completion_response_usage.additional_properties = d
+ return chat_completion_response_usage
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/conflict_error.py b/premai/models/conflict_error.py
new file mode 100644
index 0000000..d23f32c
--- /dev/null
+++ b/premai/models/conflict_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.conflict_error_code import ConflictErrorCode
+
+T = TypeVar("T", bound="ConflictError")
+
+
+class ConflictErrorDict(TypedDict):
+ message: str
+ code: ConflictErrorCode
+ pass
+
+
+@_attrs_define
+class ConflictError:
+ """
+ Attributes:
+ message (str):
+ code (ConflictErrorCode): * `ConflictError` - ConflictError
+ """
+
+ message: str
+ code: ConflictErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ConflictErrorCode(d.pop("code"))
+
+ conflict_error = cls(
+ message=message,
+ code=code,
+ )
+
+ conflict_error.additional_properties = d
+ return conflict_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/conflict_error_code.py b/premai/models/conflict_error_code.py
new file mode 100644
index 0000000..7f4ac5e
--- /dev/null
+++ b/premai/models/conflict_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ConflictErrorCode(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/conflict_error_code_enum.py b/premai/models/conflict_error_code_enum.py
new file mode 100644
index 0000000..1c6caaf
--- /dev/null
+++ b/premai/models/conflict_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ConflictErrorCodeEnum(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/data_point.py b/premai/models/data_point.py
new file mode 100644
index 0000000..9f4713f
--- /dev/null
+++ b/premai/models/data_point.py
@@ -0,0 +1,159 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="DataPoint")
+
+
+class DataPointDict(TypedDict):
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class DataPoint:
+ """
+ Attributes:
+ id (int):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ positive (bool):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ positive: bool
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ positive = self.positive
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "positive": positive,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ positive = d.pop("positive")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ data_point = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ positive=positive,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ data_point.additional_properties = d
+ return data_point
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embedding.py b/premai/models/embedding.py
new file mode 100644
index 0000000..5961a6e
--- /dev/null
+++ b/premai/models/embedding.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="Embedding")
+
+
+class EmbeddingDict(TypedDict):
+ index: int
+ embedding: List[float]
+ pass
+
+
+@_attrs_define
+class Embedding:
+ """
+ Attributes:
+ index (int): The index of the token in the input.
+ embedding (List[float]): The embedding for the input.
+ """
+
+ index: int
+ embedding: List[float]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ index = self.index
+
+ embedding = self.embedding
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "index": index,
+ "embedding": embedding,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ index = d.pop("index")
+
+ embedding = cast(List[float], d.pop("embedding"))
+
+ embedding = cls(
+ index=index,
+ embedding=embedding,
+ )
+
+ embedding.additional_properties = d
+ return embedding
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embeddings_input.py b/premai/models/embeddings_input.py
new file mode 100644
index 0000000..e58631f
--- /dev/null
+++ b/premai/models/embeddings_input.py
@@ -0,0 +1,162 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.embeddings_input_encoding_format import EmbeddingsInputEncodingFormat
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="EmbeddingsInput")
+
+
+class EmbeddingsInputDict(TypedDict):
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: NotRequired[Union[Unset, str]]
+ encoding_format: NotRequired[Union[Unset, EmbeddingsInputEncodingFormat]]
+ pass
+
+
+@_attrs_define
+class EmbeddingsInput:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ input_ (List[Union[List[List[int]], List[int], List[str], str]]): Embedding Input
+ model (Union[Unset, str]):
+ encoding_format (Union[Unset, EmbeddingsInputEncodingFormat]):
+ """
+
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: Union[Unset, str] = UNSET
+ encoding_format: Union[Unset, "EmbeddingsInputEncodingFormat"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ input_ = []
+ for input_item_data in self.input_:
+ input_item: Union[List[List[int]], List[int], List[str], str]
+ if isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = []
+ for input_item_type_3_item_data in input_item_data:
+ input_item_type_3_item = input_item_type_3_item_data
+
+ input_item.append(input_item_type_3_item)
+
+ else:
+ input_item = input_item_data
+ input_.append(input_item)
+
+ model = self.model
+
+ encoding_format: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.encoding_format, Unset):
+ encoding_format = self.encoding_format.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "input": input_,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if encoding_format is not UNSET:
+ field_dict["encoding_format"] = encoding_format
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.embeddings_input_encoding_format import EmbeddingsInputEncodingFormat
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ input_ = []
+ _input_ = d.pop("input")
+ for input_item_data in _input_:
+
+ def _parse_input_item(data: object) -> Union[List[List[int]], List[int], List[str], str]:
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_1 = cast(List[str], data)
+
+ return input_item_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_2 = cast(List[int], data)
+
+ return input_item_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_3 = []
+ _input_item_type_3 = data
+ for input_item_type_3_item_data in _input_item_type_3:
+ input_item_type_3_item = cast(List[int], input_item_type_3_item_data)
+
+ input_item_type_3.append(input_item_type_3_item)
+
+ return input_item_type_3
+ except: # noqa: E722
+ pass
+ return cast(Union[List[List[int]], List[int], List[str], str], data)
+
+ input_item = _parse_input_item(input_item_data)
+
+ input_.append(input_item)
+
+ model = d.pop("model", UNSET)
+
+ _encoding_format = d.pop("encoding_format", UNSET)
+ encoding_format: Union[Unset, EmbeddingsInputEncodingFormat]
+ if isinstance(_encoding_format, Unset):
+ encoding_format = UNSET
+ else:
+ encoding_format = EmbeddingsInputEncodingFormat.from_dict(_encoding_format)
+
+ embeddings_input = cls(
+ project_id=project_id,
+ input_=input_,
+ model=model,
+ encoding_format=encoding_format,
+ )
+
+ embeddings_input.additional_properties = d
+ return embeddings_input
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embeddings_input_encoding_format.py b/premai/models/embeddings_input_encoding_format.py
new file mode 100644
index 0000000..210df5b
--- /dev/null
+++ b/premai/models/embeddings_input_encoding_format.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="EmbeddingsInputEncodingFormat")
+
+
+class EmbeddingsInputEncodingFormatDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class EmbeddingsInputEncodingFormat:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ embeddings_input_encoding_format = cls()
+
+ embeddings_input_encoding_format.additional_properties = d
+ return embeddings_input_encoding_format
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embeddings_response.py b/premai/models/embeddings_response.py
new file mode 100644
index 0000000..e186d18
--- /dev/null
+++ b/premai/models/embeddings_response.py
@@ -0,0 +1,124 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.embeddings_response_data_item import EmbeddingsResponseDataItem
+from ..models.embeddings_response_usage import EmbeddingsResponseUsage
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="EmbeddingsResponse")
+
+
+class EmbeddingsResponseDict(TypedDict):
+ data: List["EmbeddingsResponseDataItem"]
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: NotRequired[Union[Unset, EmbeddingsResponseUsage]]
+ pass
+
+
+@_attrs_define
+class EmbeddingsResponse:
+ """
+ Attributes:
+ data (List['EmbeddingsResponseDataItem']): The embeddings for the input.
+ model (str): The model to generate the embeddings.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ usage (Union[Unset, EmbeddingsResponseUsage]): The usage statistics for the completion.
+ """
+
+ data: List["EmbeddingsResponseDataItem"]
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: Union[Unset, "EmbeddingsResponseUsage"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ data = []
+ for data_item_data in self.data:
+ data_item = data_item_data.to_dict()
+ data.append(data_item)
+
+ model = self.model
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ usage: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.usage, Unset):
+ usage = self.usage.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "data": data,
+ "model": model,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ }
+ )
+ if usage is not UNSET:
+ field_dict["usage"] = usage
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.embeddings_response_data_item import EmbeddingsResponseDataItem
+ from ..models.embeddings_response_usage import EmbeddingsResponseUsage
+
+ d = src_dict.copy()
+ data = []
+ _data = d.pop("data")
+ for data_item_data in _data:
+ data_item = EmbeddingsResponseDataItem.from_dict(data_item_data)
+
+ data.append(data_item)
+
+ model = d.pop("model")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ _usage = d.pop("usage", UNSET)
+ usage: Union[Unset, EmbeddingsResponseUsage]
+ if isinstance(_usage, Unset):
+ usage = UNSET
+ else:
+ usage = EmbeddingsResponseUsage.from_dict(_usage)
+
+ embeddings_response = cls(
+ data=data,
+ model=model,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ usage=usage,
+ )
+
+ embeddings_response.additional_properties = d
+ return embeddings_response
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embeddings_response_data_item.py b/premai/models/embeddings_response_data_item.py
new file mode 100644
index 0000000..82820ad
--- /dev/null
+++ b/premai/models/embeddings_response_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="EmbeddingsResponseDataItem")
+
+
+class EmbeddingsResponseDataItemDict(TypedDict):
+ index: int
+ embedding: List[float]
+ pass
+
+
+@_attrs_define
+class EmbeddingsResponseDataItem:
+ """
+ Attributes:
+ index (int): The index of the token in the input.
+ embedding (List[float]): The embedding for the input.
+ """
+
+ index: int
+ embedding: List[float]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ index = self.index
+
+ embedding = self.embedding
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "index": index,
+ "embedding": embedding,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ index = d.pop("index")
+
+ embedding = cast(List[float], d.pop("embedding"))
+
+ embeddings_response_data_item = cls(
+ index=index,
+ embedding=embedding,
+ )
+
+ embeddings_response_data_item.additional_properties = d
+ return embeddings_response_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/embeddings_response_usage.py b/premai/models/embeddings_response_usage.py
new file mode 100644
index 0000000..107a277
--- /dev/null
+++ b/premai/models/embeddings_response_usage.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="EmbeddingsResponseUsage")
+
+
+class EmbeddingsResponseUsageDict(TypedDict):
+ completion_tokens: NotRequired[Union[Unset, int]]
+ prompt_tokens: NotRequired[Union[Unset, int]]
+ total_tokens: NotRequired[Union[Unset, int]]
+ pass
+
+
+@_attrs_define
+class EmbeddingsResponseUsage:
+ """The usage statistics for the completion.
+
+ Attributes:
+ completion_tokens (Union[Unset, int]):
+ prompt_tokens (Union[Unset, int]):
+ total_tokens (Union[Unset, int]):
+ """
+
+ completion_tokens: Union[Unset, int] = UNSET
+ prompt_tokens: Union[Unset, int] = UNSET
+ total_tokens: Union[Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ completion_tokens = self.completion_tokens
+
+ prompt_tokens = self.prompt_tokens
+
+ total_tokens = self.total_tokens
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if completion_tokens is not UNSET:
+ field_dict["completion_tokens"] = completion_tokens
+ if prompt_tokens is not UNSET:
+ field_dict["prompt_tokens"] = prompt_tokens
+ if total_tokens is not UNSET:
+ field_dict["total_tokens"] = total_tokens
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ completion_tokens = d.pop("completion_tokens", UNSET)
+
+ prompt_tokens = d.pop("prompt_tokens", UNSET)
+
+ total_tokens = d.pop("total_tokens", UNSET)
+
+ embeddings_response_usage = cls(
+ completion_tokens=completion_tokens,
+ prompt_tokens=prompt_tokens,
+ total_tokens=total_tokens,
+ )
+
+ embeddings_response_usage.additional_properties = d
+ return embeddings_response_usage
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/encoding_format_enum.py b/premai/models/encoding_format_enum.py
new file mode 100644
index 0000000..07d9e17
--- /dev/null
+++ b/premai/models/encoding_format_enum.py
@@ -0,0 +1,9 @@
+from enum import Enum
+
+
+class EncodingFormatEnum(str, Enum):
+ BASE64 = "base64"
+ FLOAT = "float"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/fine_tuning_input.py b/premai/models/fine_tuning_input.py
new file mode 100644
index 0000000..71dbec8
--- /dev/null
+++ b/premai/models/fine_tuning_input.py
@@ -0,0 +1,129 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.fine_tuning_input_training_data_item import FineTuningInputTrainingDataItem
+from ..models.fine_tuning_input_validaton_data_item import FineTuningInputValidatonDataItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="FineTuningInput")
+
+
+class FineTuningInputDict(TypedDict):
+ project_id: int
+ training_data: List["FineTuningInputTrainingDataItem"]
+ model: NotRequired[Union[Unset, str]]
+ validaton_data: NotRequired[Union[Unset, List["FineTuningInputValidatonDataItem"]]]
+ num_epochs: Union[Unset, int] = 1
+ pass
+
+
+@_attrs_define
+class FineTuningInput:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ training_data (List['FineTuningInputTrainingDataItem']): The training file.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ validaton_data (Union[Unset, List['FineTuningInputValidatonDataItem']]): The training file.
+ num_epochs (Union[Unset, int]): The number of epochs to train for. Default: 1.
+ """
+
+ project_id: int
+ training_data: List["FineTuningInputTrainingDataItem"]
+ model: Union[Unset, str] = UNSET
+ validaton_data: Union[Unset, List["FineTuningInputValidatonDataItem"]] = UNSET
+ num_epochs: Union[Unset, int] = 1
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ training_data = []
+ for training_data_item_data in self.training_data:
+ training_data_item = training_data_item_data.to_dict()
+ training_data.append(training_data_item)
+
+ model = self.model
+
+ validaton_data: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.validaton_data, Unset):
+ validaton_data = []
+ for validaton_data_item_data in self.validaton_data:
+ validaton_data_item = validaton_data_item_data.to_dict()
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = self.num_epochs
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "training_data": training_data,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if validaton_data is not UNSET:
+ field_dict["validaton_data"] = validaton_data
+ if num_epochs is not UNSET:
+ field_dict["num_epochs"] = num_epochs
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.fine_tuning_input_training_data_item import FineTuningInputTrainingDataItem
+ from ..models.fine_tuning_input_validaton_data_item import FineTuningInputValidatonDataItem
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ training_data = []
+ _training_data = d.pop("training_data")
+ for training_data_item_data in _training_data:
+ training_data_item = FineTuningInputTrainingDataItem.from_dict(training_data_item_data)
+
+ training_data.append(training_data_item)
+
+ model = d.pop("model", UNSET)
+
+ validaton_data = []
+ _validaton_data = d.pop("validaton_data", UNSET)
+ for validaton_data_item_data in _validaton_data or []:
+ validaton_data_item = FineTuningInputValidatonDataItem.from_dict(validaton_data_item_data)
+
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = d.pop("num_epochs", UNSET)
+
+ fine_tuning_input = cls(
+ project_id=project_id,
+ training_data=training_data,
+ model=model,
+ validaton_data=validaton_data,
+ num_epochs=num_epochs,
+ )
+
+ fine_tuning_input.additional_properties = d
+ return fine_tuning_input
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/fine_tuning_input_training_data_item.py b/premai/models/fine_tuning_input_training_data_item.py
new file mode 100644
index 0000000..f825732
--- /dev/null
+++ b/premai/models/fine_tuning_input_training_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="FineTuningInputTrainingDataItem")
+
+
+class FineTuningInputTrainingDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class FineTuningInputTrainingDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ fine_tuning_input_training_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ fine_tuning_input_training_data_item.additional_properties = d
+ return fine_tuning_input_training_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/fine_tuning_input_validaton_data_item.py b/premai/models/fine_tuning_input_validaton_data_item.py
new file mode 100644
index 0000000..e9af809
--- /dev/null
+++ b/premai/models/fine_tuning_input_validaton_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="FineTuningInputValidatonDataItem")
+
+
+class FineTuningInputValidatonDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class FineTuningInputValidatonDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ fine_tuning_input_validaton_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ fine_tuning_input_validaton_data_item.additional_properties = d
+ return fine_tuning_input_validaton_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/fine_tuning_response.py b/premai/models/fine_tuning_response.py
new file mode 100644
index 0000000..44a592b
--- /dev/null
+++ b/premai/models/fine_tuning_response.py
@@ -0,0 +1,65 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="FineTuningResponse")
+
+
+class FineTuningResponseDict(TypedDict):
+ job_id: str
+ pass
+
+
+@_attrs_define
+class FineTuningResponse:
+ """
+ Attributes:
+ job_id (str): The ID of the fine-tuning job.
+ """
+
+ job_id: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ job_id = self.job_id
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "job_id": job_id,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ job_id = d.pop("job_id")
+
+ fine_tuning_response = cls(
+ job_id=job_id,
+ )
+
+ fine_tuning_response.additional_properties = d
+ return fine_tuning_response
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/fine_tuning_sample.py b/premai/models/fine_tuning_sample.py
new file mode 100644
index 0000000..c1a0842
--- /dev/null
+++ b/premai/models/fine_tuning_sample.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="FineTuningSample")
+
+
+class FineTuningSampleDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class FineTuningSample:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ fine_tuning_sample = cls(
+ input_=input_,
+ output=output,
+ )
+
+ fine_tuning_sample.additional_properties = d
+ return fine_tuning_sample
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/input_data_point.py b/premai/models/input_data_point.py
new file mode 100644
index 0000000..88ed303
--- /dev/null
+++ b/premai/models/input_data_point.py
@@ -0,0 +1,148 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="InputDataPoint")
+
+
+class InputDataPointDict(TypedDict):
+ id: int
+ positive: bool
+ project: int
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class InputDataPoint:
+ """
+ Attributes:
+ id (int):
+ positive (bool):
+ project (int):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: int
+ positive: bool
+ project: int
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ positive = self.positive
+
+ project = self.project
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "positive": positive,
+ "project": project,
+ }
+ )
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ positive = d.pop("positive")
+
+ project = d.pop("project")
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ input_data_point = cls(
+ id=id,
+ positive=positive,
+ project=project,
+ input_=input_,
+ output=output,
+ trace=trace,
+ )
+
+ input_data_point.additional_properties = d
+ return input_data_point
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_0.py b/premai/models/internal_server_error_type_0.py
new file mode 100644
index 0000000..6203933
--- /dev/null
+++ b/premai/models/internal_server_error_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_0_code import InternalServerErrorType0Code
+
+T = TypeVar("T", bound="InternalServerErrorType0")
+
+
+class InternalServerErrorType0Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType0Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType0:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType0Code): * `ProviderInternalServerError` - ProviderInternalServerError
+ """
+
+ message: str
+ code: InternalServerErrorType0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType0Code(d.pop("code"))
+
+ internal_server_error_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_0.additional_properties = d
+ return internal_server_error_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_0_code.py b/premai/models/internal_server_error_type_0_code.py
new file mode 100644
index 0000000..c1f02a0
--- /dev/null
+++ b/premai/models/internal_server_error_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType0Code(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/internal_server_error_type_1.py b/premai/models/internal_server_error_type_1.py
new file mode 100644
index 0000000..43307a8
--- /dev/null
+++ b/premai/models/internal_server_error_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_1_code import InternalServerErrorType1Code
+
+T = TypeVar("T", bound="InternalServerErrorType1")
+
+
+class InternalServerErrorType1Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType1Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType1:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType1Code): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: InternalServerErrorType1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType1Code(d.pop("code"))
+
+ internal_server_error_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_1.additional_properties = d
+ return internal_server_error_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_1_code.py b/premai/models/internal_server_error_type_1_code.py
new file mode 100644
index 0000000..3692f58
--- /dev/null
+++ b/premai/models/internal_server_error_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType1Code(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/internal_server_error_type_2.py b/premai/models/internal_server_error_type_2.py
new file mode 100644
index 0000000..adea6d2
--- /dev/null
+++ b/premai/models/internal_server_error_type_2.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_2_code import InternalServerErrorType2Code
+
+T = TypeVar("T", bound="InternalServerErrorType2")
+
+
+class InternalServerErrorType2Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType2Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType2:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType2Code): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: InternalServerErrorType2Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType2Code(d.pop("code"))
+
+ internal_server_error_type_2 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_2.additional_properties = d
+ return internal_server_error_type_2
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_2_code.py b/premai/models/internal_server_error_type_2_code.py
new file mode 100644
index 0000000..066a0f5
--- /dev/null
+++ b/premai/models/internal_server_error_type_2_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType2Code(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/internal_server_error_type_3.py b/premai/models/internal_server_error_type_3.py
new file mode 100644
index 0000000..0d2dff0
--- /dev/null
+++ b/premai/models/internal_server_error_type_3.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_3_code import InternalServerErrorType3Code
+
+T = TypeVar("T", bound="InternalServerErrorType3")
+
+
+class InternalServerErrorType3Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType3Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType3:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType3Code): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: InternalServerErrorType3Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType3Code(d.pop("code"))
+
+ internal_server_error_type_3 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_3.additional_properties = d
+ return internal_server_error_type_3
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_3_code.py b/premai/models/internal_server_error_type_3_code.py
new file mode 100644
index 0000000..df4b29f
--- /dev/null
+++ b/premai/models/internal_server_error_type_3_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType3Code(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/internal_server_error_type_4.py b/premai/models/internal_server_error_type_4.py
new file mode 100644
index 0000000..62d0ee5
--- /dev/null
+++ b/premai/models/internal_server_error_type_4.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_4_code import InternalServerErrorType4Code
+
+T = TypeVar("T", bound="InternalServerErrorType4")
+
+
+class InternalServerErrorType4Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType4Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType4:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType4Code): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: InternalServerErrorType4Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType4Code(d.pop("code"))
+
+ internal_server_error_type_4 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_4.additional_properties = d
+ return internal_server_error_type_4
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_4_code.py b/premai/models/internal_server_error_type_4_code.py
new file mode 100644
index 0000000..0150ed8
--- /dev/null
+++ b/premai/models/internal_server_error_type_4_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType4Code(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/internal_server_error_type_5.py b/premai/models/internal_server_error_type_5.py
new file mode 100644
index 0000000..6ac89f2
--- /dev/null
+++ b/premai/models/internal_server_error_type_5.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.internal_server_error_type_5_code import InternalServerErrorType5Code
+
+T = TypeVar("T", bound="InternalServerErrorType5")
+
+
+class InternalServerErrorType5Dict(TypedDict):
+ message: str
+ code: InternalServerErrorType5Code
+ pass
+
+
+@_attrs_define
+class InternalServerErrorType5:
+ """
+ Attributes:
+ message (str):
+ code (InternalServerErrorType5Code): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: InternalServerErrorType5Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = InternalServerErrorType5Code(d.pop("code"))
+
+ internal_server_error_type_5 = cls(
+ message=message,
+ code=code,
+ )
+
+ internal_server_error_type_5.additional_properties = d
+ return internal_server_error_type_5
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/internal_server_error_type_5_code.py b/premai/models/internal_server_error_type_5_code.py
new file mode 100644
index 0000000..9563d0c
--- /dev/null
+++ b/premai/models/internal_server_error_type_5_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class InternalServerErrorType5Code(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/leaderboard_item.py b/premai/models/leaderboard_item.py
new file mode 100644
index 0000000..f4ee623
--- /dev/null
+++ b/premai/models/leaderboard_item.py
@@ -0,0 +1,128 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="LeaderboardItem")
+
+
+class LeaderboardItemDict(TypedDict):
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+ pass
+
+
+@_attrs_define
+class LeaderboardItem:
+ """
+ Attributes:
+ provider (str):
+ provider_slug (str):
+ provider_name (str):
+ avg_final_score (float):
+ avg_tokens_per_second (float):
+ avg_uptime (float):
+ avg_uptime_score (int):
+ avg_tokens_score (int):
+ """
+
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ provider = self.provider
+
+ provider_slug = self.provider_slug
+
+ provider_name = self.provider_name
+
+ avg_final_score = self.avg_final_score
+
+ avg_tokens_per_second = self.avg_tokens_per_second
+
+ avg_uptime = self.avg_uptime
+
+ avg_uptime_score = self.avg_uptime_score
+
+ avg_tokens_score = self.avg_tokens_score
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "provider": provider,
+ "provider_slug": provider_slug,
+ "provider_name": provider_name,
+ "avg_final_score": avg_final_score,
+ "avg_tokens_per_second": avg_tokens_per_second,
+ "avg_uptime": avg_uptime,
+ "avg_uptime_score": avg_uptime_score,
+ "avg_tokens_score": avg_tokens_score,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ provider = d.pop("provider")
+
+ provider_slug = d.pop("provider_slug")
+
+ provider_name = d.pop("provider_name")
+
+ avg_final_score = d.pop("avg_final_score")
+
+ avg_tokens_per_second = d.pop("avg_tokens_per_second")
+
+ avg_uptime = d.pop("avg_uptime")
+
+ avg_uptime_score = d.pop("avg_uptime_score")
+
+ avg_tokens_score = d.pop("avg_tokens_score")
+
+ leaderboard_item = cls(
+ provider=provider,
+ provider_slug=provider_slug,
+ provider_name=provider_name,
+ avg_final_score=avg_final_score,
+ avg_tokens_per_second=avg_tokens_per_second,
+ avg_uptime=avg_uptime,
+ avg_uptime_score=avg_uptime_score,
+ avg_tokens_score=avg_tokens_score,
+ )
+
+ leaderboard_item.additional_properties = d
+ return leaderboard_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/leaderboard_response.py b/premai/models/leaderboard_response.py
new file mode 100644
index 0000000..a43693f
--- /dev/null
+++ b/premai/models/leaderboard_response.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.leaderboard_response_leaderboard_item import LeaderboardResponseLeaderboardItem
+
+T = TypeVar("T", bound="LeaderboardResponse")
+
+
+class LeaderboardResponseDict(TypedDict):
+ days: int
+ leaderboard: List["LeaderboardResponseLeaderboardItem"]
+ pass
+
+
+@_attrs_define
+class LeaderboardResponse:
+ """
+ Attributes:
+ days (int):
+ leaderboard (List['LeaderboardResponseLeaderboardItem']):
+ """
+
+ days: int
+ leaderboard: List["LeaderboardResponseLeaderboardItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ days = self.days
+
+ leaderboard = []
+ for leaderboard_item_data in self.leaderboard:
+ leaderboard_item = leaderboard_item_data.to_dict()
+ leaderboard.append(leaderboard_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "days": days,
+ "leaderboard": leaderboard,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.leaderboard_response_leaderboard_item import LeaderboardResponseLeaderboardItem
+
+ d = src_dict.copy()
+ days = d.pop("days")
+
+ leaderboard = []
+ _leaderboard = d.pop("leaderboard")
+ for leaderboard_item_data in _leaderboard:
+ leaderboard_item = LeaderboardResponseLeaderboardItem.from_dict(leaderboard_item_data)
+
+ leaderboard.append(leaderboard_item)
+
+ leaderboard_response = cls(
+ days=days,
+ leaderboard=leaderboard,
+ )
+
+ leaderboard_response.additional_properties = d
+ return leaderboard_response
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/leaderboard_response_leaderboard_item.py b/premai/models/leaderboard_response_leaderboard_item.py
new file mode 100644
index 0000000..2b564f2
--- /dev/null
+++ b/premai/models/leaderboard_response_leaderboard_item.py
@@ -0,0 +1,128 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="LeaderboardResponseLeaderboardItem")
+
+
+class LeaderboardResponseLeaderboardItemDict(TypedDict):
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+ pass
+
+
+@_attrs_define
+class LeaderboardResponseLeaderboardItem:
+ """
+ Attributes:
+ provider (str):
+ provider_slug (str):
+ provider_name (str):
+ avg_final_score (float):
+ avg_tokens_per_second (float):
+ avg_uptime (float):
+ avg_uptime_score (int):
+ avg_tokens_score (int):
+ """
+
+ provider: str
+ provider_slug: str
+ provider_name: str
+ avg_final_score: float
+ avg_tokens_per_second: float
+ avg_uptime: float
+ avg_uptime_score: int
+ avg_tokens_score: int
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ provider = self.provider
+
+ provider_slug = self.provider_slug
+
+ provider_name = self.provider_name
+
+ avg_final_score = self.avg_final_score
+
+ avg_tokens_per_second = self.avg_tokens_per_second
+
+ avg_uptime = self.avg_uptime
+
+ avg_uptime_score = self.avg_uptime_score
+
+ avg_tokens_score = self.avg_tokens_score
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "provider": provider,
+ "provider_slug": provider_slug,
+ "provider_name": provider_name,
+ "avg_final_score": avg_final_score,
+ "avg_tokens_per_second": avg_tokens_per_second,
+ "avg_uptime": avg_uptime,
+ "avg_uptime_score": avg_uptime_score,
+ "avg_tokens_score": avg_tokens_score,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ provider = d.pop("provider")
+
+ provider_slug = d.pop("provider_slug")
+
+ provider_name = d.pop("provider_name")
+
+ avg_final_score = d.pop("avg_final_score")
+
+ avg_tokens_per_second = d.pop("avg_tokens_per_second")
+
+ avg_uptime = d.pop("avg_uptime")
+
+ avg_uptime_score = d.pop("avg_uptime_score")
+
+ avg_tokens_score = d.pop("avg_tokens_score")
+
+ leaderboard_response_leaderboard_item = cls(
+ provider=provider,
+ provider_slug=provider_slug,
+ provider_name=provider_name,
+ avg_final_score=avg_final_score,
+ avg_tokens_per_second=avg_tokens_per_second,
+ avg_uptime=avg_uptime,
+ avg_uptime_score=avg_uptime_score,
+ avg_tokens_score=avg_tokens_score,
+ )
+
+ leaderboard_response_leaderboard_item.additional_properties = d
+ return leaderboard_response_leaderboard_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/message.py b/premai/models/message.py
new file mode 100644
index 0000000..7f1e14f
--- /dev/null
+++ b/premai/models/message.py
@@ -0,0 +1,81 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.message_role import MessageRole
+
+T = TypeVar("T", bound="Message")
+
+
+class MessageDict(TypedDict):
+ role: "MessageRole"
+ content: str
+ pass
+
+
+@_attrs_define
+class Message:
+ """
+ Attributes:
+ role (MessageRole): The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+ content (str): The content of the message.
+ """
+
+ role: "MessageRole"
+ content: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ role = self.role.to_dict()
+
+ content = self.content
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "role": role,
+ "content": content,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.message_role import MessageRole
+
+ d = src_dict.copy()
+ role = MessageRole.from_dict(d.pop("role"))
+
+ content = d.pop("content")
+
+ message = cls(
+ role=role,
+ content=content,
+ )
+
+ message.additional_properties = d
+ return message
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/message_role.py b/premai/models/message_role.py
new file mode 100644
index 0000000..e85401e
--- /dev/null
+++ b/premai/models/message_role.py
@@ -0,0 +1,54 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="MessageRole")
+
+
+class MessageRoleDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class MessageRole:
+ """The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+
+ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message_role = cls()
+
+ message_role.additional_properties = d
+ return message_role
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/model_not_found_error.py b/premai/models/model_not_found_error.py
new file mode 100644
index 0000000..a18ce5b
--- /dev/null
+++ b/premai/models/model_not_found_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.model_not_found_error_code import ModelNotFoundErrorCode
+
+T = TypeVar("T", bound="ModelNotFoundError")
+
+
+class ModelNotFoundErrorDict(TypedDict):
+ message: str
+ code: ModelNotFoundErrorCode
+ pass
+
+
+@_attrs_define
+class ModelNotFoundError:
+ """
+ Attributes:
+ message (str):
+ code (ModelNotFoundErrorCode): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: ModelNotFoundErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ModelNotFoundErrorCode(d.pop("code"))
+
+ model_not_found_error = cls(
+ message=message,
+ code=code,
+ )
+
+ model_not_found_error.additional_properties = d
+ return model_not_found_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/model_not_found_error_code.py b/premai/models/model_not_found_error_code.py
new file mode 100644
index 0000000..e74570a
--- /dev/null
+++ b/premai/models/model_not_found_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ModelNotFoundErrorCode(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/model_not_found_error_code_enum.py b/premai/models/model_not_found_error_code_enum.py
new file mode 100644
index 0000000..fb49649
--- /dev/null
+++ b/premai/models/model_not_found_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ModelNotFoundErrorCodeEnum(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/not_found_error_type_0.py b/premai/models/not_found_error_type_0.py
new file mode 100644
index 0000000..1aef8ec
--- /dev/null
+++ b/premai/models/not_found_error_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.not_found_error_type_0_code import NotFoundErrorType0Code
+
+T = TypeVar("T", bound="NotFoundErrorType0")
+
+
+class NotFoundErrorType0Dict(TypedDict):
+ message: str
+ code: NotFoundErrorType0Code
+ pass
+
+
+@_attrs_define
+class NotFoundErrorType0:
+ """
+ Attributes:
+ message (str):
+ code (NotFoundErrorType0Code): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: NotFoundErrorType0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = NotFoundErrorType0Code(d.pop("code"))
+
+ not_found_error_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ not_found_error_type_0.additional_properties = d
+ return not_found_error_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/not_found_error_type_0_code.py b/premai/models/not_found_error_type_0_code.py
new file mode 100644
index 0000000..981ffee
--- /dev/null
+++ b/premai/models/not_found_error_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class NotFoundErrorType0Code(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/not_found_error_type_1.py b/premai/models/not_found_error_type_1.py
new file mode 100644
index 0000000..7744aca
--- /dev/null
+++ b/premai/models/not_found_error_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.not_found_error_type_1_code import NotFoundErrorType1Code
+
+T = TypeVar("T", bound="NotFoundErrorType1")
+
+
+class NotFoundErrorType1Dict(TypedDict):
+ message: str
+ code: NotFoundErrorType1Code
+ pass
+
+
+@_attrs_define
+class NotFoundErrorType1:
+ """
+ Attributes:
+ message (str):
+ code (NotFoundErrorType1Code): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: NotFoundErrorType1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = NotFoundErrorType1Code(d.pop("code"))
+
+ not_found_error_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ not_found_error_type_1.additional_properties = d
+ return not_found_error_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/not_found_error_type_1_code.py b/premai/models/not_found_error_type_1_code.py
new file mode 100644
index 0000000..d124e3b
--- /dev/null
+++ b/premai/models/not_found_error_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class NotFoundErrorType1Code(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/patched_data_point.py b/premai/models/patched_data_point.py
new file mode 100644
index 0000000..b9f218d
--- /dev/null
+++ b/premai/models/patched_data_point.py
@@ -0,0 +1,174 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="PatchedDataPoint")
+
+
+class PatchedDataPointDict(TypedDict):
+ id: NotRequired[Union[Unset, int]]
+ created_at: NotRequired[Union[Unset, datetime.datetime]]
+ updated_at: NotRequired[Union[Unset, datetime.datetime]]
+ input_: NotRequired[Union[None, Unset, str]]
+ output: NotRequired[Union[None, Unset, str]]
+ positive: NotRequired[Union[Unset, bool]]
+ trace: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class PatchedDataPoint:
+ """
+ Attributes:
+ id (Union[Unset, int]):
+ created_at (Union[Unset, datetime.datetime]):
+ updated_at (Union[Unset, datetime.datetime]):
+ input_ (Union[None, Unset, str]):
+ output (Union[None, Unset, str]):
+ positive (Union[Unset, bool]):
+ trace (Union[None, Unset, str]):
+ """
+
+ id: Union[Unset, int] = UNSET
+ created_at: Union[Unset, datetime.datetime] = UNSET
+ updated_at: Union[Unset, datetime.datetime] = UNSET
+ input_: Union[None, Unset, str] = UNSET
+ output: Union[None, Unset, str] = UNSET
+ positive: Union[Unset, bool] = UNSET
+ trace: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ created_at: Union[Unset, str] = UNSET
+ if not isinstance(self.created_at, Unset):
+ created_at = self.created_at.isoformat()
+
+ updated_at: Union[Unset, str] = UNSET
+ if not isinstance(self.updated_at, Unset):
+ updated_at = self.updated_at.isoformat()
+
+ input_: Union[None, Unset, str]
+ if isinstance(self.input_, Unset):
+ input_ = UNSET
+ else:
+ input_ = self.input_
+
+ output: Union[None, Unset, str]
+ if isinstance(self.output, Unset):
+ output = UNSET
+ else:
+ output = self.output
+
+ positive = self.positive
+
+ trace: Union[None, Unset, str]
+ if isinstance(self.trace, Unset):
+ trace = UNSET
+ else:
+ trace = self.trace
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if id is not UNSET:
+ field_dict["id"] = id
+ if created_at is not UNSET:
+ field_dict["created_at"] = created_at
+ if updated_at is not UNSET:
+ field_dict["updated_at"] = updated_at
+ if input_ is not UNSET:
+ field_dict["input"] = input_
+ if output is not UNSET:
+ field_dict["output"] = output
+ if positive is not UNSET:
+ field_dict["positive"] = positive
+ if trace is not UNSET:
+ field_dict["trace"] = trace
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id", UNSET)
+
+ _created_at = d.pop("created_at", UNSET)
+ created_at: Union[Unset, datetime.datetime]
+ if isinstance(_created_at, Unset):
+ created_at = UNSET
+ else:
+ created_at = isoparse(_created_at)
+
+ _updated_at = d.pop("updated_at", UNSET)
+ updated_at: Union[Unset, datetime.datetime]
+ if isinstance(_updated_at, Unset):
+ updated_at = UNSET
+ else:
+ updated_at = isoparse(_updated_at)
+
+ def _parse_input_(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_ = _parse_input_(d.pop("input", UNSET))
+
+ def _parse_output(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ output = _parse_output(d.pop("output", UNSET))
+
+ positive = d.pop("positive", UNSET)
+
+ def _parse_trace(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ trace = _parse_trace(d.pop("trace", UNSET))
+
+ patched_data_point = cls(
+ id=id,
+ created_at=created_at,
+ updated_at=updated_at,
+ input_=input_,
+ output=output,
+ positive=positive,
+ trace=trace,
+ )
+
+ patched_data_point.additional_properties = d
+ return patched_data_point
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/permission_denied_error.py b/premai/models/permission_denied_error.py
new file mode 100644
index 0000000..54b39a9
--- /dev/null
+++ b/premai/models/permission_denied_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.permission_denied_error_code import PermissionDeniedErrorCode
+
+T = TypeVar("T", bound="PermissionDeniedError")
+
+
+class PermissionDeniedErrorDict(TypedDict):
+ message: str
+ code: PermissionDeniedErrorCode
+ pass
+
+
+@_attrs_define
+class PermissionDeniedError:
+ """
+ Attributes:
+ message (str):
+ code (PermissionDeniedErrorCode): * `PermissionDeniedError` - PermissionDeniedError
+ """
+
+ message: str
+ code: PermissionDeniedErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = PermissionDeniedErrorCode(d.pop("code"))
+
+ permission_denied_error = cls(
+ message=message,
+ code=code,
+ )
+
+ permission_denied_error.additional_properties = d
+ return permission_denied_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/permission_denied_error_code.py b/premai/models/permission_denied_error_code.py
new file mode 100644
index 0000000..a327675
--- /dev/null
+++ b/premai/models/permission_denied_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class PermissionDeniedErrorCode(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/permission_denied_error_code_enum.py b/premai/models/permission_denied_error_code_enum.py
new file mode 100644
index 0000000..09f93dc
--- /dev/null
+++ b/premai/models/permission_denied_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class PermissionDeniedErrorCodeEnum(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_connection_error.py b/premai/models/provider_api_connection_error.py
new file mode 100644
index 0000000..6c37edb
--- /dev/null
+++ b/premai/models/provider_api_connection_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.provider_api_connection_error_code import ProviderAPIConnectionErrorCode
+
+T = TypeVar("T", bound="ProviderAPIConnectionError")
+
+
+class ProviderAPIConnectionErrorDict(TypedDict):
+ message: str
+ code: ProviderAPIConnectionErrorCode
+ pass
+
+
+@_attrs_define
+class ProviderAPIConnectionError:
+ """
+ Attributes:
+ message (str):
+ code (ProviderAPIConnectionErrorCode): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: ProviderAPIConnectionErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ProviderAPIConnectionErrorCode(d.pop("code"))
+
+ provider_api_connection_error = cls(
+ message=message,
+ code=code,
+ )
+
+ provider_api_connection_error.additional_properties = d
+ return provider_api_connection_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/provider_api_connection_error_code.py b/premai/models/provider_api_connection_error_code.py
new file mode 100644
index 0000000..7367f3f
--- /dev/null
+++ b/premai/models/provider_api_connection_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPIConnectionErrorCode(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_connection_error_code_enum.py b/premai/models/provider_api_connection_error_code_enum.py
new file mode 100644
index 0000000..9238ba4
--- /dev/null
+++ b/premai/models/provider_api_connection_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPIConnectionErrorCodeEnum(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_status_error.py b/premai/models/provider_api_status_error.py
new file mode 100644
index 0000000..d200747
--- /dev/null
+++ b/premai/models/provider_api_status_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.provider_api_status_error_code import ProviderAPIStatusErrorCode
+
+T = TypeVar("T", bound="ProviderAPIStatusError")
+
+
+class ProviderAPIStatusErrorDict(TypedDict):
+ message: str
+ code: ProviderAPIStatusErrorCode
+ pass
+
+
+@_attrs_define
+class ProviderAPIStatusError:
+ """
+ Attributes:
+ message (str):
+ code (ProviderAPIStatusErrorCode): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: ProviderAPIStatusErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ProviderAPIStatusErrorCode(d.pop("code"))
+
+ provider_api_status_error = cls(
+ message=message,
+ code=code,
+ )
+
+ provider_api_status_error.additional_properties = d
+ return provider_api_status_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/provider_api_status_error_code.py b/premai/models/provider_api_status_error_code.py
new file mode 100644
index 0000000..bcd601a
--- /dev/null
+++ b/premai/models/provider_api_status_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPIStatusErrorCode(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_status_error_code_enum.py b/premai/models/provider_api_status_error_code_enum.py
new file mode 100644
index 0000000..588cc42
--- /dev/null
+++ b/premai/models/provider_api_status_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPIStatusErrorCodeEnum(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_timeout_error.py b/premai/models/provider_api_timeout_error.py
new file mode 100644
index 0000000..c1458d4
--- /dev/null
+++ b/premai/models/provider_api_timeout_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.provider_api_timeout_error_code import ProviderAPITimeoutErrorCode
+
+T = TypeVar("T", bound="ProviderAPITimeoutError")
+
+
+class ProviderAPITimeoutErrorDict(TypedDict):
+ message: str
+ code: ProviderAPITimeoutErrorCode
+ pass
+
+
+@_attrs_define
+class ProviderAPITimeoutError:
+ """
+ Attributes:
+ message (str):
+ code (ProviderAPITimeoutErrorCode): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: ProviderAPITimeoutErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ProviderAPITimeoutErrorCode(d.pop("code"))
+
+ provider_api_timeout_error = cls(
+ message=message,
+ code=code,
+ )
+
+ provider_api_timeout_error.additional_properties = d
+ return provider_api_timeout_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/provider_api_timeout_error_code.py b/premai/models/provider_api_timeout_error_code.py
new file mode 100644
index 0000000..eca358f
--- /dev/null
+++ b/premai/models/provider_api_timeout_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPITimeoutErrorCode(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_api_timeout_error_code_enum.py b/premai/models/provider_api_timeout_error_code_enum.py
new file mode 100644
index 0000000..e7de034
--- /dev/null
+++ b/premai/models/provider_api_timeout_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderAPITimeoutErrorCodeEnum(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_internal_server_error.py b/premai/models/provider_internal_server_error.py
new file mode 100644
index 0000000..6e142d2
--- /dev/null
+++ b/premai/models/provider_internal_server_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.provider_internal_server_error_code import ProviderInternalServerErrorCode
+
+T = TypeVar("T", bound="ProviderInternalServerError")
+
+
+class ProviderInternalServerErrorDict(TypedDict):
+ message: str
+ code: ProviderInternalServerErrorCode
+ pass
+
+
+@_attrs_define
+class ProviderInternalServerError:
+ """
+ Attributes:
+ message (str):
+ code (ProviderInternalServerErrorCode): * `ProviderInternalServerError` - ProviderInternalServerError
+ """
+
+ message: str
+ code: ProviderInternalServerErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ProviderInternalServerErrorCode(d.pop("code"))
+
+ provider_internal_server_error = cls(
+ message=message,
+ code=code,
+ )
+
+ provider_internal_server_error.additional_properties = d
+ return provider_internal_server_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/provider_internal_server_error_code.py b/premai/models/provider_internal_server_error_code.py
new file mode 100644
index 0000000..242b7b0
--- /dev/null
+++ b/premai/models/provider_internal_server_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderInternalServerErrorCode(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_internal_server_error_code_enum.py b/premai/models/provider_internal_server_error_code_enum.py
new file mode 100644
index 0000000..966bf87
--- /dev/null
+++ b/premai/models/provider_internal_server_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderInternalServerErrorCodeEnum(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_not_found_error.py b/premai/models/provider_not_found_error.py
new file mode 100644
index 0000000..0db1118
--- /dev/null
+++ b/premai/models/provider_not_found_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.provider_not_found_error_code import ProviderNotFoundErrorCode
+
+T = TypeVar("T", bound="ProviderNotFoundError")
+
+
+class ProviderNotFoundErrorDict(TypedDict):
+ message: str
+ code: ProviderNotFoundErrorCode
+ pass
+
+
+@_attrs_define
+class ProviderNotFoundError:
+ """
+ Attributes:
+ message (str):
+ code (ProviderNotFoundErrorCode): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: ProviderNotFoundErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = ProviderNotFoundErrorCode(d.pop("code"))
+
+ provider_not_found_error = cls(
+ message=message,
+ code=code,
+ )
+
+ provider_not_found_error.additional_properties = d
+ return provider_not_found_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/provider_not_found_error_code.py b/premai/models/provider_not_found_error_code.py
new file mode 100644
index 0000000..c29cfc9
--- /dev/null
+++ b/premai/models/provider_not_found_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderNotFoundErrorCode(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/provider_not_found_error_code_enum.py b/premai/models/provider_not_found_error_code_enum.py
new file mode 100644
index 0000000..89054c0
--- /dev/null
+++ b/premai/models/provider_not_found_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ProviderNotFoundErrorCodeEnum(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/rate_limit_error.py b/premai/models/rate_limit_error.py
new file mode 100644
index 0000000..3226623
--- /dev/null
+++ b/premai/models/rate_limit_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.rate_limit_error_code import RateLimitErrorCode
+
+T = TypeVar("T", bound="RateLimitError")
+
+
+class RateLimitErrorDict(TypedDict):
+ message: str
+ code: RateLimitErrorCode
+ pass
+
+
+@_attrs_define
+class RateLimitError:
+ """
+ Attributes:
+ message (str):
+ code (RateLimitErrorCode): * `RateLimitError` - RateLimitError
+ """
+
+ message: str
+ code: RateLimitErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = RateLimitErrorCode(d.pop("code"))
+
+ rate_limit_error = cls(
+ message=message,
+ code=code,
+ )
+
+ rate_limit_error.additional_properties = d
+ return rate_limit_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/rate_limit_error_code.py b/premai/models/rate_limit_error_code.py
new file mode 100644
index 0000000..eff421d
--- /dev/null
+++ b/premai/models/rate_limit_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class RateLimitErrorCode(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/rate_limit_error_code_enum.py b/premai/models/rate_limit_error_code_enum.py
new file mode 100644
index 0000000..3999e5d
--- /dev/null
+++ b/premai/models/rate_limit_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class RateLimitErrorCodeEnum(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/response_choice.py b/premai/models/response_choice.py
new file mode 100644
index 0000000..a1b70e9
--- /dev/null
+++ b/premai/models/response_choice.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ResponseChoice")
+
+
+class ResponseChoiceDict(TypedDict):
+ message: str
+ finish_reason: str
+ pass
+
+
+@_attrs_define
+class ResponseChoice:
+ """
+ Attributes:
+ message (str): The generated message in the chat completion choice.
+ finish_reason (str): The reason the chat completion finished, e.g., 'stop' or 'length'.
+ """
+
+ message: str
+ finish_reason: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ finish_reason = self.finish_reason
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "finish_reason": finish_reason,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ finish_reason = d.pop("finish_reason")
+
+ response_choice = cls(
+ message=message,
+ finish_reason=finish_reason,
+ )
+
+ response_choice.additional_properties = d
+ return response_choice
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/retrieve_fine_tuning_response.py b/premai/models/retrieve_fine_tuning_response.py
new file mode 100644
index 0000000..b9d0eb1
--- /dev/null
+++ b/premai/models/retrieve_fine_tuning_response.py
@@ -0,0 +1,141 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="RetrieveFineTuningResponse")
+
+
+class RetrieveFineTuningResponseDict(TypedDict):
+ id: str
+ fine_tuned_model: str
+ created_at: int
+ status: str
+ provider_name: str
+ provider_id: str
+ status_code: int
+ finished_at: NotRequired[Union[Unset, int]]
+ error: NotRequired[Union[Unset, str]]
+ pass
+
+
+@_attrs_define
+class RetrieveFineTuningResponse:
+ """
+ Attributes:
+ id (str): The ID of the fine-tuning job.
+ fine_tuned_model (str): The ID of the fine-tuned model.
+ created_at (int): The Unix timestamp (in seconds) of when the fine-tuning job was created.
+ status (str): The status of the fine-tuning job.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ status_code (int): The status code of the fine-tuning job.
+ finished_at (Union[Unset, int]): The Unix timestamp (in seconds) of when the fine-tuning job was finished.
+ error (Union[Unset, str]): The error message of the fine-tuning job.
+ """
+
+ id: str
+ fine_tuned_model: str
+ created_at: int
+ status: str
+ provider_name: str
+ provider_id: str
+ status_code: int
+ finished_at: Union[Unset, int] = UNSET
+ error: Union[Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ fine_tuned_model = self.fine_tuned_model
+
+ created_at = self.created_at
+
+ status = self.status
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ status_code = self.status_code
+
+ finished_at = self.finished_at
+
+ error = self.error
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "fine_tuned_model": fine_tuned_model,
+ "created_at": created_at,
+ "status": status,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ "status_code": status_code,
+ }
+ )
+ if finished_at is not UNSET:
+ field_dict["finished_at"] = finished_at
+ if error is not UNSET:
+ field_dict["error"] = error
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ fine_tuned_model = d.pop("fine_tuned_model")
+
+ created_at = d.pop("created_at")
+
+ status = d.pop("status")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ status_code = d.pop("status_code")
+
+ finished_at = d.pop("finished_at", UNSET)
+
+ error = d.pop("error", UNSET)
+
+ retrieve_fine_tuning_response = cls(
+ id=id,
+ fine_tuned_model=fine_tuned_model,
+ created_at=created_at,
+ status=status,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ status_code=status_code,
+ finished_at=finished_at,
+ error=error,
+ )
+
+ retrieve_fine_tuning_response.additional_properties = d
+ return retrieve_fine_tuning_response
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/role_enum.py b/premai/models/role_enum.py
new file mode 100644
index 0000000..3c08567
--- /dev/null
+++ b/premai/models/role_enum.py
@@ -0,0 +1,9 @@
+from enum import Enum
+
+
+class RoleEnum(str, Enum):
+ SYSTEM = "system"
+ USER = "user"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/trace.py b/premai/models/trace.py
new file mode 100644
index 0000000..9a8a090
--- /dev/null
+++ b/premai/models/trace.py
@@ -0,0 +1,402 @@
+import datetime
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from dateutil.parser import isoparse
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.trace_raw_request_type_0 import TraceRawRequestType0
+from ..models.trace_raw_response_type_0 import TraceRawResponseType0
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="Trace")
+
+
+class TraceDict(TypedDict):
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: NotRequired[Union[Unset, bool]]
+ input_prompt: NotRequired[Union[Unset, str]]
+ input_file_prompt: NotRequired[Union[None, Unset, str]]
+ endpoint_type: NotRequired[Union[None, Unset, str]]
+ privacy_score: NotRequired[Union[None, Unset, str]]
+ output_text: NotRequired[Union[Unset, str]]
+ http_status_code: NotRequired[Union[None, Unset, int]]
+ raw_request: NotRequired[Union["TraceRawRequestType0", None, Unset]]
+ raw_response: NotRequired[Union["TraceRawResponseType0", None, Unset]]
+ tag: NotRequired[Union[None, Unset, str]]
+ error: NotRequired[Union[None, Unset, str]]
+ text_to_text_model_parameters: NotRequired[Union[None, Unset, int]]
+ api_key: NotRequired[Union[None, Unset, int]]
+ pass
+
+
+@_attrs_define
+class Trace:
+ """
+ Attributes:
+ id (str):
+ model_name (str):
+ created_at (datetime.datetime):
+ updated_at (datetime.datetime):
+ start_time (datetime.datetime):
+ end_time (datetime.datetime):
+ input_prompt_tokens_number (int):
+ output_text_tokens_number (int):
+ is_deleted (Union[Unset, bool]):
+ input_prompt (Union[Unset, str]):
+ input_file_prompt (Union[None, Unset, str]):
+ endpoint_type (Union[None, Unset, str]):
+ privacy_score (Union[None, Unset, str]):
+ output_text (Union[Unset, str]):
+ http_status_code (Union[None, Unset, int]):
+ raw_request (Union['TraceRawRequestType0', None, Unset]):
+ raw_response (Union['TraceRawResponseType0', None, Unset]):
+ tag (Union[None, Unset, str]):
+ error (Union[None, Unset, str]):
+ text_to_text_model_parameters (Union[None, Unset, int]):
+ api_key (Union[None, Unset, int]):
+ """
+
+ id: str
+ model_name: str
+ created_at: datetime.datetime
+ updated_at: datetime.datetime
+ start_time: datetime.datetime
+ end_time: datetime.datetime
+ input_prompt_tokens_number: int
+ output_text_tokens_number: int
+ is_deleted: Union[Unset, bool] = UNSET
+ input_prompt: Union[Unset, str] = UNSET
+ input_file_prompt: Union[None, Unset, str] = UNSET
+ endpoint_type: Union[None, Unset, str] = UNSET
+ privacy_score: Union[None, Unset, str] = UNSET
+ output_text: Union[Unset, str] = UNSET
+ http_status_code: Union[None, Unset, int] = UNSET
+ raw_request: Union["TraceRawRequestType0", None, Unset] = UNSET
+ raw_response: Union["TraceRawResponseType0", None, Unset] = UNSET
+ tag: Union[None, Unset, str] = UNSET
+ error: Union[None, Unset, str] = UNSET
+ text_to_text_model_parameters: Union[None, Unset, int] = UNSET
+ api_key: Union[None, Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.trace_raw_request_type_0 import TraceRawRequestType0
+ from ..models.trace_raw_response_type_0 import TraceRawResponseType0
+
+ id = self.id
+
+ model_name = self.model_name
+
+ created_at = self.created_at.isoformat()
+
+ updated_at = self.updated_at.isoformat()
+
+ start_time = self.start_time.isoformat()
+
+ end_time = self.end_time.isoformat()
+
+ input_prompt_tokens_number = self.input_prompt_tokens_number
+
+ output_text_tokens_number = self.output_text_tokens_number
+
+ is_deleted = self.is_deleted
+
+ input_prompt = self.input_prompt
+
+ input_file_prompt: Union[None, Unset, str]
+ if isinstance(self.input_file_prompt, Unset):
+ input_file_prompt = UNSET
+ else:
+ input_file_prompt = self.input_file_prompt
+
+ endpoint_type: Union[None, Unset, str]
+ if isinstance(self.endpoint_type, Unset):
+ endpoint_type = UNSET
+ else:
+ endpoint_type = self.endpoint_type
+
+ privacy_score: Union[None, Unset, str]
+ if isinstance(self.privacy_score, Unset):
+ privacy_score = UNSET
+ else:
+ privacy_score = self.privacy_score
+
+ output_text = self.output_text
+
+ http_status_code: Union[None, Unset, int]
+ if isinstance(self.http_status_code, Unset):
+ http_status_code = UNSET
+ else:
+ http_status_code = self.http_status_code
+
+ raw_request: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_request, Unset):
+ raw_request = UNSET
+ elif isinstance(self.raw_request, TraceRawRequestType0):
+ raw_request = self.raw_request.to_dict()
+ else:
+ raw_request = self.raw_request
+
+ raw_response: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.raw_response, Unset):
+ raw_response = UNSET
+ elif isinstance(self.raw_response, TraceRawResponseType0):
+ raw_response = self.raw_response.to_dict()
+ else:
+ raw_response = self.raw_response
+
+ tag: Union[None, Unset, str]
+ if isinstance(self.tag, Unset):
+ tag = UNSET
+ else:
+ tag = self.tag
+
+ error: Union[None, Unset, str]
+ if isinstance(self.error, Unset):
+ error = UNSET
+ else:
+ error = self.error
+
+ text_to_text_model_parameters: Union[None, Unset, int]
+ if isinstance(self.text_to_text_model_parameters, Unset):
+ text_to_text_model_parameters = UNSET
+ else:
+ text_to_text_model_parameters = self.text_to_text_model_parameters
+
+ api_key: Union[None, Unset, int]
+ if isinstance(self.api_key, Unset):
+ api_key = UNSET
+ else:
+ api_key = self.api_key
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "model_name": model_name,
+ "created_at": created_at,
+ "updated_at": updated_at,
+ "start_time": start_time,
+ "end_time": end_time,
+ "input_prompt_tokens_number": input_prompt_tokens_number,
+ "output_text_tokens_number": output_text_tokens_number,
+ }
+ )
+ if is_deleted is not UNSET:
+ field_dict["is_deleted"] = is_deleted
+ if input_prompt is not UNSET:
+ field_dict["input_prompt"] = input_prompt
+ if input_file_prompt is not UNSET:
+ field_dict["input_file_prompt"] = input_file_prompt
+ if endpoint_type is not UNSET:
+ field_dict["endpoint_type"] = endpoint_type
+ if privacy_score is not UNSET:
+ field_dict["privacy_score"] = privacy_score
+ if output_text is not UNSET:
+ field_dict["output_text"] = output_text
+ if http_status_code is not UNSET:
+ field_dict["http_status_code"] = http_status_code
+ if raw_request is not UNSET:
+ field_dict["raw_request"] = raw_request
+ if raw_response is not UNSET:
+ field_dict["raw_response"] = raw_response
+ if tag is not UNSET:
+ field_dict["tag"] = tag
+ if error is not UNSET:
+ field_dict["error"] = error
+ if text_to_text_model_parameters is not UNSET:
+ field_dict["text_to_text_model_parameters"] = text_to_text_model_parameters
+ if api_key is not UNSET:
+ field_dict["api_key"] = api_key
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.trace_raw_request_type_0 import TraceRawRequestType0
+ from ..models.trace_raw_response_type_0 import TraceRawResponseType0
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ model_name = d.pop("model_name")
+
+ created_at = isoparse(d.pop("created_at"))
+
+ updated_at = isoparse(d.pop("updated_at"))
+
+ start_time = isoparse(d.pop("start_time"))
+
+ end_time = isoparse(d.pop("end_time"))
+
+ input_prompt_tokens_number = d.pop("input_prompt_tokens_number")
+
+ output_text_tokens_number = d.pop("output_text_tokens_number")
+
+ is_deleted = d.pop("is_deleted", UNSET)
+
+ input_prompt = d.pop("input_prompt", UNSET)
+
+ def _parse_input_file_prompt(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ input_file_prompt = _parse_input_file_prompt(d.pop("input_file_prompt", UNSET))
+
+ def _parse_endpoint_type(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ endpoint_type = _parse_endpoint_type(d.pop("endpoint_type", UNSET))
+
+ def _parse_privacy_score(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ privacy_score = _parse_privacy_score(d.pop("privacy_score", UNSET))
+
+ output_text = d.pop("output_text", UNSET)
+
+ def _parse_http_status_code(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ http_status_code = _parse_http_status_code(d.pop("http_status_code", UNSET))
+
+ def _parse_raw_request(data: object) -> Union["TraceRawRequestType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_request_type_0 = TraceRawRequestType0.from_dict(data)
+
+ return raw_request_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["TraceRawRequestType0", None, Unset], data)
+
+ raw_request = _parse_raw_request(d.pop("raw_request", UNSET))
+
+ def _parse_raw_response(data: object) -> Union["TraceRawResponseType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ raw_response_type_0 = TraceRawResponseType0.from_dict(data)
+
+ return raw_response_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["TraceRawResponseType0", None, Unset], data)
+
+ raw_response = _parse_raw_response(d.pop("raw_response", UNSET))
+
+ def _parse_tag(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ tag = _parse_tag(d.pop("tag", UNSET))
+
+ def _parse_error(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ error = _parse_error(d.pop("error", UNSET))
+
+ def _parse_text_to_text_model_parameters(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ text_to_text_model_parameters = _parse_text_to_text_model_parameters(
+ d.pop("text_to_text_model_parameters", UNSET)
+ )
+
+ def _parse_api_key(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ api_key = _parse_api_key(d.pop("api_key", UNSET))
+
+ trace = cls(
+ id=id,
+ model_name=model_name,
+ created_at=created_at,
+ updated_at=updated_at,
+ start_time=start_time,
+ end_time=end_time,
+ input_prompt_tokens_number=input_prompt_tokens_number,
+ output_text_tokens_number=output_text_tokens_number,
+ is_deleted=is_deleted,
+ input_prompt=input_prompt,
+ input_file_prompt=input_file_prompt,
+ endpoint_type=endpoint_type,
+ privacy_score=privacy_score,
+ output_text=output_text,
+ http_status_code=http_status_code,
+ raw_request=raw_request,
+ raw_response=raw_response,
+ tag=tag,
+ error=error,
+ text_to_text_model_parameters=text_to_text_model_parameters,
+ api_key=api_key,
+ )
+
+ trace.additional_properties = d
+ return trace
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/trace_raw_request_type_0.py b/premai/models/trace_raw_request_type_0.py
new file mode 100644
index 0000000..1296448
--- /dev/null
+++ b/premai/models/trace_raw_request_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="TraceRawRequestType0")
+
+
+class TraceRawRequestType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class TraceRawRequestType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ trace_raw_request_type_0 = cls()
+
+ trace_raw_request_type_0.additional_properties = d
+ return trace_raw_request_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/trace_raw_response_type_0.py b/premai/models/trace_raw_response_type_0.py
new file mode 100644
index 0000000..6d7ad4b
--- /dev/null
+++ b/premai/models/trace_raw_response_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="TraceRawResponseType0")
+
+
+class TraceRawResponseType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class TraceRawResponseType0:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ trace_raw_response_type_0 = cls()
+
+ trace_raw_response_type_0.additional_properties = d
+ return trace_raw_response_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/unprocessable_entity_error.py b/premai/models/unprocessable_entity_error.py
new file mode 100644
index 0000000..0fc2c49
--- /dev/null
+++ b/premai/models/unprocessable_entity_error.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.unprocessable_entity_error_code import UnprocessableEntityErrorCode
+
+T = TypeVar("T", bound="UnprocessableEntityError")
+
+
+class UnprocessableEntityErrorDict(TypedDict):
+ message: str
+ code: UnprocessableEntityErrorCode
+ pass
+
+
+@_attrs_define
+class UnprocessableEntityError:
+ """
+ Attributes:
+ message (str):
+ code (UnprocessableEntityErrorCode): * `UnprocessableEntityError` - UnprocessableEntityError
+ """
+
+ message: str
+ code: UnprocessableEntityErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = UnprocessableEntityErrorCode(d.pop("code"))
+
+ unprocessable_entity_error = cls(
+ message=message,
+ code=code,
+ )
+
+ unprocessable_entity_error.additional_properties = d
+ return unprocessable_entity_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/unprocessable_entity_error_code.py b/premai/models/unprocessable_entity_error_code.py
new file mode 100644
index 0000000..966d544
--- /dev/null
+++ b/premai/models/unprocessable_entity_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class UnprocessableEntityErrorCode(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/unprocessable_entity_error_code_enum.py b/premai/models/unprocessable_entity_error_code_enum.py
new file mode 100644
index 0000000..57c6598
--- /dev/null
+++ b/premai/models/unprocessable_entity_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class UnprocessableEntityErrorCodeEnum(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/usage.py b/premai/models/usage.py
new file mode 100644
index 0000000..3eeb790
--- /dev/null
+++ b/premai/models/usage.py
@@ -0,0 +1,85 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="Usage")
+
+
+class UsageDict(TypedDict):
+ completion_tokens: NotRequired[Union[Unset, int]]
+ prompt_tokens: NotRequired[Union[Unset, int]]
+ total_tokens: NotRequired[Union[Unset, int]]
+ pass
+
+
+@_attrs_define
+class Usage:
+ """
+ Attributes:
+ completion_tokens (Union[Unset, int]):
+ prompt_tokens (Union[Unset, int]):
+ total_tokens (Union[Unset, int]):
+ """
+
+ completion_tokens: Union[Unset, int] = UNSET
+ prompt_tokens: Union[Unset, int] = UNSET
+ total_tokens: Union[Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ completion_tokens = self.completion_tokens
+
+ prompt_tokens = self.prompt_tokens
+
+ total_tokens = self.total_tokens
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if completion_tokens is not UNSET:
+ field_dict["completion_tokens"] = completion_tokens
+ if prompt_tokens is not UNSET:
+ field_dict["prompt_tokens"] = prompt_tokens
+ if total_tokens is not UNSET:
+ field_dict["total_tokens"] = total_tokens
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ completion_tokens = d.pop("completion_tokens", UNSET)
+
+ prompt_tokens = d.pop("prompt_tokens", UNSET)
+
+ total_tokens = d.pop("total_tokens", UNSET)
+
+ usage = cls(
+ completion_tokens=completion_tokens,
+ prompt_tokens=prompt_tokens,
+ total_tokens=total_tokens,
+ )
+
+ usage.additional_properties = d
+ return usage
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body.py b/premai/models/v1_chat_completions_create_data_body.py
new file mode 100644
index 0000000..fe9e717
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body.py
@@ -0,0 +1,377 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_data_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateDataBodyLogitBiasType0,
+)
+from ..models.v1_chat_completions_create_data_body_messages_item import V1ChatCompletionsCreateDataBodyMessagesItem
+from ..models.v1_chat_completions_create_data_body_response_format_type_0 import (
+ V1ChatCompletionsCreateDataBodyResponseFormatType0,
+)
+from ..models.v1_chat_completions_create_data_body_tools_item import V1ChatCompletionsCreateDataBodyToolsItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBody")
+
+
+class V1ChatCompletionsCreateDataBodyDict(TypedDict):
+ project_id: int
+ messages: List["V1ChatCompletionsCreateDataBodyMessagesItem"]
+ model: NotRequired[Union[Unset, str]]
+ frequency_penalty: NotRequired[Union[Unset, float]]
+ logit_bias: NotRequired[Union["V1ChatCompletionsCreateDataBodyLogitBiasType0", None, Unset]]
+ max_tokens: NotRequired[Union[None, Unset, int]]
+ n: NotRequired[Union[Unset, int]]
+ presence_penalty: NotRequired[Union[Unset, float]]
+ response_format: NotRequired[Union["V1ChatCompletionsCreateDataBodyResponseFormatType0", None, Unset]]
+ seed: NotRequired[Union[None, Unset, int]]
+ stop: NotRequired[Union[None, Unset, str]]
+ stream: NotRequired[Union[Unset, bool]]
+ temperature: NotRequired[Union[None, Unset, float]]
+ top_p: NotRequired[Union[None, Unset, float]]
+ tools: NotRequired[Union[Unset, List["V1ChatCompletionsCreateDataBodyToolsItem"]]]
+ user: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ messages (List['V1ChatCompletionsCreateDataBodyMessagesItem']): A list of messages comprising the conversation
+ so far.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ frequency_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on their existing frequency.
+ logit_bias (Union['V1ChatCompletionsCreateDataBodyLogitBiasType0', None, Unset]): JSON object that maps tokens
+ to an associated bias value from -100 to 100.
+ max_tokens (Union[None, Unset, int]): The maximum number of tokens to generate in the chat completion.
+ n (Union[Unset, int]): How many chat completion choices to generate for each input message.
+ presence_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on whether they appear in the text so far.
+ response_format (Union['V1ChatCompletionsCreateDataBodyResponseFormatType0', None, Unset]): An object specifying
+ the format that the model must output.
+ seed (Union[None, Unset, int]): This feature is in Beta. If specified, our system will make a best effort to
+ sample deterministically.
+ stop (Union[None, Unset, str]): Up to 4 sequences where the API will stop generating further tokens.
+ stream (Union[Unset, bool]): If set, partial message deltas will be sent, like in ChatGPT.
+ temperature (Union[None, Unset, float]): What sampling temperature to use, between 0 and 2.
+ top_p (Union[None, Unset, float]): An alternative to sampling with temperature, called nucleus sampling.
+ tools (Union[Unset, List['V1ChatCompletionsCreateDataBodyToolsItem']]): A list of tools the model may call.
+ Currently, only functions are supported as a tool.
+ user (Union[None, Unset, str]): A unique identifier representing your end-user.
+ """
+
+ project_id: int
+ messages: List["V1ChatCompletionsCreateDataBodyMessagesItem"]
+ model: Union[Unset, str] = UNSET
+ frequency_penalty: Union[Unset, float] = UNSET
+ logit_bias: Union["V1ChatCompletionsCreateDataBodyLogitBiasType0", None, Unset] = UNSET
+ max_tokens: Union[None, Unset, int] = UNSET
+ n: Union[Unset, int] = UNSET
+ presence_penalty: Union[Unset, float] = UNSET
+ response_format: Union["V1ChatCompletionsCreateDataBodyResponseFormatType0", None, Unset] = UNSET
+ seed: Union[None, Unset, int] = UNSET
+ stop: Union[None, Unset, str] = UNSET
+ stream: Union[Unset, bool] = UNSET
+ temperature: Union[None, Unset, float] = UNSET
+ top_p: Union[None, Unset, float] = UNSET
+ tools: Union[Unset, List["V1ChatCompletionsCreateDataBodyToolsItem"]] = UNSET
+ user: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.v1_chat_completions_create_data_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateDataBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_data_body_response_format_type_0 import (
+ V1ChatCompletionsCreateDataBodyResponseFormatType0,
+ )
+
+ project_id = self.project_id
+
+ messages = []
+ for messages_item_data in self.messages:
+ messages_item = messages_item_data.to_dict()
+ messages.append(messages_item)
+
+ model = self.model
+
+ frequency_penalty = self.frequency_penalty
+
+ logit_bias: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.logit_bias, Unset):
+ logit_bias = UNSET
+ elif isinstance(self.logit_bias, V1ChatCompletionsCreateDataBodyLogitBiasType0):
+ logit_bias = self.logit_bias.to_dict()
+ else:
+ logit_bias = self.logit_bias
+
+ max_tokens: Union[None, Unset, int]
+ if isinstance(self.max_tokens, Unset):
+ max_tokens = UNSET
+ else:
+ max_tokens = self.max_tokens
+
+ n = self.n
+
+ presence_penalty = self.presence_penalty
+
+ response_format: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.response_format, Unset):
+ response_format = UNSET
+ elif isinstance(self.response_format, V1ChatCompletionsCreateDataBodyResponseFormatType0):
+ response_format = self.response_format.to_dict()
+ else:
+ response_format = self.response_format
+
+ seed: Union[None, Unset, int]
+ if isinstance(self.seed, Unset):
+ seed = UNSET
+ else:
+ seed = self.seed
+
+ stop: Union[None, Unset, str]
+ if isinstance(self.stop, Unset):
+ stop = UNSET
+ else:
+ stop = self.stop
+
+ stream = self.stream
+
+ temperature: Union[None, Unset, float]
+ if isinstance(self.temperature, Unset):
+ temperature = UNSET
+ else:
+ temperature = self.temperature
+
+ top_p: Union[None, Unset, float]
+ if isinstance(self.top_p, Unset):
+ top_p = UNSET
+ else:
+ top_p = self.top_p
+
+ tools: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.tools, Unset):
+ tools = []
+ for tools_item_data in self.tools:
+ tools_item = tools_item_data.to_dict()
+ tools.append(tools_item)
+
+ user: Union[None, Unset, str]
+ if isinstance(self.user, Unset):
+ user = UNSET
+ else:
+ user = self.user
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "messages": messages,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if frequency_penalty is not UNSET:
+ field_dict["frequency_penalty"] = frequency_penalty
+ if logit_bias is not UNSET:
+ field_dict["logit_bias"] = logit_bias
+ if max_tokens is not UNSET:
+ field_dict["max_tokens"] = max_tokens
+ if n is not UNSET:
+ field_dict["n"] = n
+ if presence_penalty is not UNSET:
+ field_dict["presence_penalty"] = presence_penalty
+ if response_format is not UNSET:
+ field_dict["response_format"] = response_format
+ if seed is not UNSET:
+ field_dict["seed"] = seed
+ if stop is not UNSET:
+ field_dict["stop"] = stop
+ if stream is not UNSET:
+ field_dict["stream"] = stream
+ if temperature is not UNSET:
+ field_dict["temperature"] = temperature
+ if top_p is not UNSET:
+ field_dict["top_p"] = top_p
+ if tools is not UNSET:
+ field_dict["tools"] = tools
+ if user is not UNSET:
+ field_dict["user"] = user
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_data_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateDataBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_data_body_messages_item import (
+ V1ChatCompletionsCreateDataBodyMessagesItem,
+ )
+ from ..models.v1_chat_completions_create_data_body_response_format_type_0 import (
+ V1ChatCompletionsCreateDataBodyResponseFormatType0,
+ )
+ from ..models.v1_chat_completions_create_data_body_tools_item import V1ChatCompletionsCreateDataBodyToolsItem
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ messages = []
+ _messages = d.pop("messages")
+ for messages_item_data in _messages:
+ messages_item = V1ChatCompletionsCreateDataBodyMessagesItem.from_dict(messages_item_data)
+
+ messages.append(messages_item)
+
+ model = d.pop("model", UNSET)
+
+ frequency_penalty = d.pop("frequency_penalty", UNSET)
+
+ def _parse_logit_bias(data: object) -> Union["V1ChatCompletionsCreateDataBodyLogitBiasType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ logit_bias_type_0 = V1ChatCompletionsCreateDataBodyLogitBiasType0.from_dict(data)
+
+ return logit_bias_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateDataBodyLogitBiasType0", None, Unset], data)
+
+ logit_bias = _parse_logit_bias(d.pop("logit_bias", UNSET))
+
+ def _parse_max_tokens(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ max_tokens = _parse_max_tokens(d.pop("max_tokens", UNSET))
+
+ n = d.pop("n", UNSET)
+
+ presence_penalty = d.pop("presence_penalty", UNSET)
+
+ def _parse_response_format(
+ data: object,
+ ) -> Union["V1ChatCompletionsCreateDataBodyResponseFormatType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_format_type_0 = V1ChatCompletionsCreateDataBodyResponseFormatType0.from_dict(data)
+
+ return response_format_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateDataBodyResponseFormatType0", None, Unset], data)
+
+ response_format = _parse_response_format(d.pop("response_format", UNSET))
+
+ def _parse_seed(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ seed = _parse_seed(d.pop("seed", UNSET))
+
+ def _parse_stop(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ stop = _parse_stop(d.pop("stop", UNSET))
+
+ stream = d.pop("stream", UNSET)
+
+ def _parse_temperature(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ temperature = _parse_temperature(d.pop("temperature", UNSET))
+
+ def _parse_top_p(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ top_p = _parse_top_p(d.pop("top_p", UNSET))
+
+ tools = []
+ _tools = d.pop("tools", UNSET)
+ for tools_item_data in _tools or []:
+ tools_item = V1ChatCompletionsCreateDataBodyToolsItem.from_dict(tools_item_data)
+
+ tools.append(tools_item)
+
+ def _parse_user(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ user = _parse_user(d.pop("user", UNSET))
+
+ v1_chat_completions_create_data_body = cls(
+ project_id=project_id,
+ messages=messages,
+ model=model,
+ frequency_penalty=frequency_penalty,
+ logit_bias=logit_bias,
+ max_tokens=max_tokens,
+ n=n,
+ presence_penalty=presence_penalty,
+ response_format=response_format,
+ seed=seed,
+ stop=stop,
+ stream=stream,
+ temperature=temperature,
+ top_p=top_p,
+ tools=tools,
+ user=user,
+ )
+
+ v1_chat_completions_create_data_body.additional_properties = d
+ return v1_chat_completions_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body_logit_bias_type_0.py b/premai/models/v1_chat_completions_create_data_body_logit_bias_type_0.py
new file mode 100644
index 0000000..3969b22
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body_logit_bias_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBodyLogitBiasType0")
+
+
+class V1ChatCompletionsCreateDataBodyLogitBiasType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBodyLogitBiasType0:
+ """JSON object that maps tokens to an associated bias value from -100 to 100."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_data_body_logit_bias_type_0 = cls()
+
+ v1_chat_completions_create_data_body_logit_bias_type_0.additional_properties = d
+ return v1_chat_completions_create_data_body_logit_bias_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body_messages_item.py b/premai/models/v1_chat_completions_create_data_body_messages_item.py
new file mode 100644
index 0000000..e77e00f
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body_messages_item.py
@@ -0,0 +1,85 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_data_body_messages_item_role import (
+ V1ChatCompletionsCreateDataBodyMessagesItemRole,
+)
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBodyMessagesItem")
+
+
+class V1ChatCompletionsCreateDataBodyMessagesItemDict(TypedDict):
+ role: "V1ChatCompletionsCreateDataBodyMessagesItemRole"
+ content: str
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBodyMessagesItem:
+ """
+ Attributes:
+ role (V1ChatCompletionsCreateDataBodyMessagesItemRole): The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+ content (str): The content of the message.
+ """
+
+ role: "V1ChatCompletionsCreateDataBodyMessagesItemRole"
+ content: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ role = self.role.to_dict()
+
+ content = self.content
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "role": role,
+ "content": content,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_data_body_messages_item_role import (
+ V1ChatCompletionsCreateDataBodyMessagesItemRole,
+ )
+
+ d = src_dict.copy()
+ role = V1ChatCompletionsCreateDataBodyMessagesItemRole.from_dict(d.pop("role"))
+
+ content = d.pop("content")
+
+ v1_chat_completions_create_data_body_messages_item = cls(
+ role=role,
+ content=content,
+ )
+
+ v1_chat_completions_create_data_body_messages_item.additional_properties = d
+ return v1_chat_completions_create_data_body_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body_messages_item_role.py b/premai/models/v1_chat_completions_create_data_body_messages_item_role.py
new file mode 100644
index 0000000..60ed06b
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body_messages_item_role.py
@@ -0,0 +1,54 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBodyMessagesItemRole")
+
+
+class V1ChatCompletionsCreateDataBodyMessagesItemRoleDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBodyMessagesItemRole:
+ """The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+
+ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_data_body_messages_item_role = cls()
+
+ v1_chat_completions_create_data_body_messages_item_role.additional_properties = d
+ return v1_chat_completions_create_data_body_messages_item_role
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body_response_format_type_0.py b/premai/models/v1_chat_completions_create_data_body_response_format_type_0.py
new file mode 100644
index 0000000..ca9fee9
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body_response_format_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBodyResponseFormatType0")
+
+
+class V1ChatCompletionsCreateDataBodyResponseFormatType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBodyResponseFormatType0:
+ """An object specifying the format that the model must output."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_data_body_response_format_type_0 = cls()
+
+ v1_chat_completions_create_data_body_response_format_type_0.additional_properties = d
+ return v1_chat_completions_create_data_body_response_format_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_data_body_tools_item.py b/premai/models/v1_chat_completions_create_data_body_tools_item.py
new file mode 100644
index 0000000..c09a996
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_data_body_tools_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateDataBodyToolsItem")
+
+
+class V1ChatCompletionsCreateDataBodyToolsItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateDataBodyToolsItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_data_body_tools_item = cls()
+
+ v1_chat_completions_create_data_body_tools_item.additional_properties = d
+ return v1_chat_completions_create_data_body_tools_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body.py b/premai/models/v1_chat_completions_create_files_body.py
new file mode 100644
index 0000000..fba35d8
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body.py
@@ -0,0 +1,510 @@
+import json
+from typing import Dict, List, Tuple, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_files_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateFilesBodyLogitBiasType0,
+)
+from ..models.v1_chat_completions_create_files_body_messages_item import V1ChatCompletionsCreateFilesBodyMessagesItem
+from ..models.v1_chat_completions_create_files_body_response_format_type_0 import (
+ V1ChatCompletionsCreateFilesBodyResponseFormatType0,
+)
+from ..models.v1_chat_completions_create_files_body_tools_item import V1ChatCompletionsCreateFilesBodyToolsItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBody")
+
+
+class V1ChatCompletionsCreateFilesBodyDict(TypedDict):
+ project_id: int
+ messages: List["V1ChatCompletionsCreateFilesBodyMessagesItem"]
+ model: NotRequired[Union[Unset, str]]
+ frequency_penalty: NotRequired[Union[Unset, float]]
+ logit_bias: NotRequired[Union["V1ChatCompletionsCreateFilesBodyLogitBiasType0", None, Unset]]
+ max_tokens: NotRequired[Union[None, Unset, int]]
+ n: NotRequired[Union[Unset, int]]
+ presence_penalty: NotRequired[Union[Unset, float]]
+ response_format: NotRequired[Union["V1ChatCompletionsCreateFilesBodyResponseFormatType0", None, Unset]]
+ seed: NotRequired[Union[None, Unset, int]]
+ stop: NotRequired[Union[None, Unset, str]]
+ stream: NotRequired[Union[Unset, bool]]
+ temperature: NotRequired[Union[None, Unset, float]]
+ top_p: NotRequired[Union[None, Unset, float]]
+ tools: NotRequired[Union[Unset, List["V1ChatCompletionsCreateFilesBodyToolsItem"]]]
+ user: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ messages (List['V1ChatCompletionsCreateFilesBodyMessagesItem']): A list of messages comprising the conversation
+ so far.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ frequency_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on their existing frequency.
+ logit_bias (Union['V1ChatCompletionsCreateFilesBodyLogitBiasType0', None, Unset]): JSON object that maps tokens
+ to an associated bias value from -100 to 100.
+ max_tokens (Union[None, Unset, int]): The maximum number of tokens to generate in the chat completion.
+ n (Union[Unset, int]): How many chat completion choices to generate for each input message.
+ presence_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on whether they appear in the text so far.
+ response_format (Union['V1ChatCompletionsCreateFilesBodyResponseFormatType0', None, Unset]): An object
+ specifying the format that the model must output.
+ seed (Union[None, Unset, int]): This feature is in Beta. If specified, our system will make a best effort to
+ sample deterministically.
+ stop (Union[None, Unset, str]): Up to 4 sequences where the API will stop generating further tokens.
+ stream (Union[Unset, bool]): If set, partial message deltas will be sent, like in ChatGPT.
+ temperature (Union[None, Unset, float]): What sampling temperature to use, between 0 and 2.
+ top_p (Union[None, Unset, float]): An alternative to sampling with temperature, called nucleus sampling.
+ tools (Union[Unset, List['V1ChatCompletionsCreateFilesBodyToolsItem']]): A list of tools the model may call.
+ Currently, only functions are supported as a tool.
+ user (Union[None, Unset, str]): A unique identifier representing your end-user.
+ """
+
+ project_id: int
+ messages: List["V1ChatCompletionsCreateFilesBodyMessagesItem"]
+ model: Union[Unset, str] = UNSET
+ frequency_penalty: Union[Unset, float] = UNSET
+ logit_bias: Union["V1ChatCompletionsCreateFilesBodyLogitBiasType0", None, Unset] = UNSET
+ max_tokens: Union[None, Unset, int] = UNSET
+ n: Union[Unset, int] = UNSET
+ presence_penalty: Union[Unset, float] = UNSET
+ response_format: Union["V1ChatCompletionsCreateFilesBodyResponseFormatType0", None, Unset] = UNSET
+ seed: Union[None, Unset, int] = UNSET
+ stop: Union[None, Unset, str] = UNSET
+ stream: Union[Unset, bool] = UNSET
+ temperature: Union[None, Unset, float] = UNSET
+ top_p: Union[None, Unset, float] = UNSET
+ tools: Union[Unset, List["V1ChatCompletionsCreateFilesBodyToolsItem"]] = UNSET
+ user: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.v1_chat_completions_create_files_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateFilesBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_files_body_response_format_type_0 import (
+ V1ChatCompletionsCreateFilesBodyResponseFormatType0,
+ )
+
+ project_id = self.project_id
+
+ messages = []
+ for messages_item_data in self.messages:
+ messages_item = messages_item_data.to_dict()
+ messages.append(messages_item)
+
+ model = self.model
+
+ frequency_penalty = self.frequency_penalty
+
+ logit_bias: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.logit_bias, Unset):
+ logit_bias = UNSET
+ elif isinstance(self.logit_bias, V1ChatCompletionsCreateFilesBodyLogitBiasType0):
+ logit_bias = self.logit_bias.to_dict()
+ else:
+ logit_bias = self.logit_bias
+
+ max_tokens: Union[None, Unset, int]
+ if isinstance(self.max_tokens, Unset):
+ max_tokens = UNSET
+ else:
+ max_tokens = self.max_tokens
+
+ n = self.n
+
+ presence_penalty = self.presence_penalty
+
+ response_format: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.response_format, Unset):
+ response_format = UNSET
+ elif isinstance(self.response_format, V1ChatCompletionsCreateFilesBodyResponseFormatType0):
+ response_format = self.response_format.to_dict()
+ else:
+ response_format = self.response_format
+
+ seed: Union[None, Unset, int]
+ if isinstance(self.seed, Unset):
+ seed = UNSET
+ else:
+ seed = self.seed
+
+ stop: Union[None, Unset, str]
+ if isinstance(self.stop, Unset):
+ stop = UNSET
+ else:
+ stop = self.stop
+
+ stream = self.stream
+
+ temperature: Union[None, Unset, float]
+ if isinstance(self.temperature, Unset):
+ temperature = UNSET
+ else:
+ temperature = self.temperature
+
+ top_p: Union[None, Unset, float]
+ if isinstance(self.top_p, Unset):
+ top_p = UNSET
+ else:
+ top_p = self.top_p
+
+ tools: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.tools, Unset):
+ tools = []
+ for tools_item_data in self.tools:
+ tools_item = tools_item_data.to_dict()
+ tools.append(tools_item)
+
+ user: Union[None, Unset, str]
+ if isinstance(self.user, Unset):
+ user = UNSET
+ else:
+ user = self.user
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "messages": messages,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if frequency_penalty is not UNSET:
+ field_dict["frequency_penalty"] = frequency_penalty
+ if logit_bias is not UNSET:
+ field_dict["logit_bias"] = logit_bias
+ if max_tokens is not UNSET:
+ field_dict["max_tokens"] = max_tokens
+ if n is not UNSET:
+ field_dict["n"] = n
+ if presence_penalty is not UNSET:
+ field_dict["presence_penalty"] = presence_penalty
+ if response_format is not UNSET:
+ field_dict["response_format"] = response_format
+ if seed is not UNSET:
+ field_dict["seed"] = seed
+ if stop is not UNSET:
+ field_dict["stop"] = stop
+ if stream is not UNSET:
+ field_dict["stream"] = stream
+ if temperature is not UNSET:
+ field_dict["temperature"] = temperature
+ if top_p is not UNSET:
+ field_dict["top_p"] = top_p
+ if tools is not UNSET:
+ field_dict["tools"] = tools
+ if user is not UNSET:
+ field_dict["user"] = user
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ project_id = (
+ self.project_id
+ if isinstance(self.project_id, Unset)
+ else (None, str(self.project_id).encode(), "text/plain")
+ )
+
+ _temp_messages = []
+ for messages_item_data in self.messages:
+ messages_item = messages_item_data.to_dict()
+ _temp_messages.append(messages_item)
+ messages = (None, json.dumps(_temp_messages).encode(), "application/json")
+
+ model = self.model if isinstance(self.model, Unset) else (None, str(self.model).encode(), "text/plain")
+
+ frequency_penalty = (
+ self.frequency_penalty
+ if isinstance(self.frequency_penalty, Unset)
+ else (None, str(self.frequency_penalty).encode(), "text/plain")
+ )
+
+ logit_bias: Union[None, Tuple[None, bytes, str], Unset]
+ if isinstance(self.logit_bias, Unset):
+ logit_bias = UNSET
+ elif isinstance(self.logit_bias, V1ChatCompletionsCreateFilesBodyLogitBiasType0):
+ logit_bias = (None, json.dumps(self.logit_bias.to_dict()).encode(), "application/json")
+ else:
+ logit_bias = self.logit_bias
+
+ max_tokens: Union[None, Unset, int]
+ if isinstance(self.max_tokens, Unset):
+ max_tokens = UNSET
+ else:
+ max_tokens = self.max_tokens
+
+ n = self.n if isinstance(self.n, Unset) else (None, str(self.n).encode(), "text/plain")
+
+ presence_penalty = (
+ self.presence_penalty
+ if isinstance(self.presence_penalty, Unset)
+ else (None, str(self.presence_penalty).encode(), "text/plain")
+ )
+
+ response_format: Union[None, Tuple[None, bytes, str], Unset]
+ if isinstance(self.response_format, Unset):
+ response_format = UNSET
+ elif isinstance(self.response_format, V1ChatCompletionsCreateFilesBodyResponseFormatType0):
+ response_format = (None, json.dumps(self.response_format.to_dict()).encode(), "application/json")
+ else:
+ response_format = self.response_format
+
+ seed: Union[None, Unset, int]
+ if isinstance(self.seed, Unset):
+ seed = UNSET
+ else:
+ seed = self.seed
+
+ stop: Union[None, Unset, str]
+ if isinstance(self.stop, Unset):
+ stop = UNSET
+ else:
+ stop = self.stop
+
+ stream = self.stream if isinstance(self.stream, Unset) else (None, str(self.stream).encode(), "text/plain")
+
+ temperature: Union[None, Unset, float]
+ if isinstance(self.temperature, Unset):
+ temperature = UNSET
+ else:
+ temperature = self.temperature
+
+ top_p: Union[None, Unset, float]
+ if isinstance(self.top_p, Unset):
+ top_p = UNSET
+ else:
+ top_p = self.top_p
+
+ tools: Union[Unset, Tuple[None, bytes, str]] = UNSET
+ if not isinstance(self.tools, Unset):
+ _temp_tools = []
+ for tools_item_data in self.tools:
+ tools_item = tools_item_data.to_dict()
+ _temp_tools.append(tools_item)
+ tools = (None, json.dumps(_temp_tools).encode(), "application/json")
+
+ user: Union[None, Unset, str]
+ if isinstance(self.user, Unset):
+ user = UNSET
+ else:
+ user = self.user
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "messages": messages,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if frequency_penalty is not UNSET:
+ field_dict["frequency_penalty"] = frequency_penalty
+ if logit_bias is not UNSET:
+ field_dict["logit_bias"] = logit_bias
+ if max_tokens is not UNSET:
+ field_dict["max_tokens"] = max_tokens
+ if n is not UNSET:
+ field_dict["n"] = n
+ if presence_penalty is not UNSET:
+ field_dict["presence_penalty"] = presence_penalty
+ if response_format is not UNSET:
+ field_dict["response_format"] = response_format
+ if seed is not UNSET:
+ field_dict["seed"] = seed
+ if stop is not UNSET:
+ field_dict["stop"] = stop
+ if stream is not UNSET:
+ field_dict["stream"] = stream
+ if temperature is not UNSET:
+ field_dict["temperature"] = temperature
+ if top_p is not UNSET:
+ field_dict["top_p"] = top_p
+ if tools is not UNSET:
+ field_dict["tools"] = tools
+ if user is not UNSET:
+ field_dict["user"] = user
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_files_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateFilesBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_files_body_messages_item import (
+ V1ChatCompletionsCreateFilesBodyMessagesItem,
+ )
+ from ..models.v1_chat_completions_create_files_body_response_format_type_0 import (
+ V1ChatCompletionsCreateFilesBodyResponseFormatType0,
+ )
+ from ..models.v1_chat_completions_create_files_body_tools_item import V1ChatCompletionsCreateFilesBodyToolsItem
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ messages = []
+ _messages = d.pop("messages")
+ for messages_item_data in _messages:
+ messages_item = V1ChatCompletionsCreateFilesBodyMessagesItem.from_dict(messages_item_data)
+
+ messages.append(messages_item)
+
+ model = d.pop("model", UNSET)
+
+ frequency_penalty = d.pop("frequency_penalty", UNSET)
+
+ def _parse_logit_bias(data: object) -> Union["V1ChatCompletionsCreateFilesBodyLogitBiasType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ logit_bias_type_0 = V1ChatCompletionsCreateFilesBodyLogitBiasType0.from_dict(data)
+
+ return logit_bias_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateFilesBodyLogitBiasType0", None, Unset], data)
+
+ logit_bias = _parse_logit_bias(d.pop("logit_bias", UNSET))
+
+ def _parse_max_tokens(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ max_tokens = _parse_max_tokens(d.pop("max_tokens", UNSET))
+
+ n = d.pop("n", UNSET)
+
+ presence_penalty = d.pop("presence_penalty", UNSET)
+
+ def _parse_response_format(
+ data: object,
+ ) -> Union["V1ChatCompletionsCreateFilesBodyResponseFormatType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_format_type_0 = V1ChatCompletionsCreateFilesBodyResponseFormatType0.from_dict(data)
+
+ return response_format_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateFilesBodyResponseFormatType0", None, Unset], data)
+
+ response_format = _parse_response_format(d.pop("response_format", UNSET))
+
+ def _parse_seed(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ seed = _parse_seed(d.pop("seed", UNSET))
+
+ def _parse_stop(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ stop = _parse_stop(d.pop("stop", UNSET))
+
+ stream = d.pop("stream", UNSET)
+
+ def _parse_temperature(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ temperature = _parse_temperature(d.pop("temperature", UNSET))
+
+ def _parse_top_p(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ top_p = _parse_top_p(d.pop("top_p", UNSET))
+
+ tools = []
+ _tools = d.pop("tools", UNSET)
+ for tools_item_data in _tools or []:
+ tools_item = V1ChatCompletionsCreateFilesBodyToolsItem.from_dict(tools_item_data)
+
+ tools.append(tools_item)
+
+ def _parse_user(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ user = _parse_user(d.pop("user", UNSET))
+
+ v1_chat_completions_create_files_body = cls(
+ project_id=project_id,
+ messages=messages,
+ model=model,
+ frequency_penalty=frequency_penalty,
+ logit_bias=logit_bias,
+ max_tokens=max_tokens,
+ n=n,
+ presence_penalty=presence_penalty,
+ response_format=response_format,
+ seed=seed,
+ stop=stop,
+ stream=stream,
+ temperature=temperature,
+ top_p=top_p,
+ tools=tools,
+ user=user,
+ )
+
+ v1_chat_completions_create_files_body.additional_properties = d
+ return v1_chat_completions_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body_logit_bias_type_0.py b/premai/models/v1_chat_completions_create_files_body_logit_bias_type_0.py
new file mode 100644
index 0000000..9adbbb4
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body_logit_bias_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBodyLogitBiasType0")
+
+
+class V1ChatCompletionsCreateFilesBodyLogitBiasType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBodyLogitBiasType0:
+ """JSON object that maps tokens to an associated bias value from -100 to 100."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_files_body_logit_bias_type_0 = cls()
+
+ v1_chat_completions_create_files_body_logit_bias_type_0.additional_properties = d
+ return v1_chat_completions_create_files_body_logit_bias_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body_messages_item.py b/premai/models/v1_chat_completions_create_files_body_messages_item.py
new file mode 100644
index 0000000..3a2be98
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body_messages_item.py
@@ -0,0 +1,85 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_files_body_messages_item_role import (
+ V1ChatCompletionsCreateFilesBodyMessagesItemRole,
+)
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBodyMessagesItem")
+
+
+class V1ChatCompletionsCreateFilesBodyMessagesItemDict(TypedDict):
+ role: "V1ChatCompletionsCreateFilesBodyMessagesItemRole"
+ content: str
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBodyMessagesItem:
+ """
+ Attributes:
+ role (V1ChatCompletionsCreateFilesBodyMessagesItemRole): The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+ content (str): The content of the message.
+ """
+
+ role: "V1ChatCompletionsCreateFilesBodyMessagesItemRole"
+ content: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ role = self.role.to_dict()
+
+ content = self.content
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "role": role,
+ "content": content,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_files_body_messages_item_role import (
+ V1ChatCompletionsCreateFilesBodyMessagesItemRole,
+ )
+
+ d = src_dict.copy()
+ role = V1ChatCompletionsCreateFilesBodyMessagesItemRole.from_dict(d.pop("role"))
+
+ content = d.pop("content")
+
+ v1_chat_completions_create_files_body_messages_item = cls(
+ role=role,
+ content=content,
+ )
+
+ v1_chat_completions_create_files_body_messages_item.additional_properties = d
+ return v1_chat_completions_create_files_body_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body_messages_item_role.py b/premai/models/v1_chat_completions_create_files_body_messages_item_role.py
new file mode 100644
index 0000000..c1a97bf
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body_messages_item_role.py
@@ -0,0 +1,54 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBodyMessagesItemRole")
+
+
+class V1ChatCompletionsCreateFilesBodyMessagesItemRoleDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBodyMessagesItemRole:
+ """The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+
+ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_files_body_messages_item_role = cls()
+
+ v1_chat_completions_create_files_body_messages_item_role.additional_properties = d
+ return v1_chat_completions_create_files_body_messages_item_role
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body_response_format_type_0.py b/premai/models/v1_chat_completions_create_files_body_response_format_type_0.py
new file mode 100644
index 0000000..61bc393
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body_response_format_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBodyResponseFormatType0")
+
+
+class V1ChatCompletionsCreateFilesBodyResponseFormatType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBodyResponseFormatType0:
+ """An object specifying the format that the model must output."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_files_body_response_format_type_0 = cls()
+
+ v1_chat_completions_create_files_body_response_format_type_0.additional_properties = d
+ return v1_chat_completions_create_files_body_response_format_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_files_body_tools_item.py b/premai/models/v1_chat_completions_create_files_body_tools_item.py
new file mode 100644
index 0000000..2593dcf
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_files_body_tools_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateFilesBodyToolsItem")
+
+
+class V1ChatCompletionsCreateFilesBodyToolsItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateFilesBodyToolsItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_files_body_tools_item = cls()
+
+ v1_chat_completions_create_files_body_tools_item.additional_properties = d
+ return v1_chat_completions_create_files_body_tools_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body.py b/premai/models/v1_chat_completions_create_json_body.py
new file mode 100644
index 0000000..1fea58a
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body.py
@@ -0,0 +1,377 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_json_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateJsonBodyLogitBiasType0,
+)
+from ..models.v1_chat_completions_create_json_body_messages_item import V1ChatCompletionsCreateJsonBodyMessagesItem
+from ..models.v1_chat_completions_create_json_body_response_format_type_0 import (
+ V1ChatCompletionsCreateJsonBodyResponseFormatType0,
+)
+from ..models.v1_chat_completions_create_json_body_tools_item import V1ChatCompletionsCreateJsonBodyToolsItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBody")
+
+
+class V1ChatCompletionsCreateJsonBodyDict(TypedDict):
+ project_id: int
+ messages: List["V1ChatCompletionsCreateJsonBodyMessagesItem"]
+ model: NotRequired[Union[Unset, str]]
+ frequency_penalty: NotRequired[Union[Unset, float]]
+ logit_bias: NotRequired[Union["V1ChatCompletionsCreateJsonBodyLogitBiasType0", None, Unset]]
+ max_tokens: NotRequired[Union[None, Unset, int]]
+ n: NotRequired[Union[Unset, int]]
+ presence_penalty: NotRequired[Union[Unset, float]]
+ response_format: NotRequired[Union["V1ChatCompletionsCreateJsonBodyResponseFormatType0", None, Unset]]
+ seed: NotRequired[Union[None, Unset, int]]
+ stop: NotRequired[Union[None, Unset, str]]
+ stream: NotRequired[Union[Unset, bool]]
+ temperature: NotRequired[Union[None, Unset, float]]
+ top_p: NotRequired[Union[None, Unset, float]]
+ tools: NotRequired[Union[Unset, List["V1ChatCompletionsCreateJsonBodyToolsItem"]]]
+ user: NotRequired[Union[None, Unset, str]]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ messages (List['V1ChatCompletionsCreateJsonBodyMessagesItem']): A list of messages comprising the conversation
+ so far.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ frequency_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on their existing frequency.
+ logit_bias (Union['V1ChatCompletionsCreateJsonBodyLogitBiasType0', None, Unset]): JSON object that maps tokens
+ to an associated bias value from -100 to 100.
+ max_tokens (Union[None, Unset, int]): The maximum number of tokens to generate in the chat completion.
+ n (Union[Unset, int]): How many chat completion choices to generate for each input message.
+ presence_penalty (Union[Unset, float]): Number between -2.0 and 2.0. Positive values penalize new tokens based
+ on whether they appear in the text so far.
+ response_format (Union['V1ChatCompletionsCreateJsonBodyResponseFormatType0', None, Unset]): An object specifying
+ the format that the model must output.
+ seed (Union[None, Unset, int]): This feature is in Beta. If specified, our system will make a best effort to
+ sample deterministically.
+ stop (Union[None, Unset, str]): Up to 4 sequences where the API will stop generating further tokens.
+ stream (Union[Unset, bool]): If set, partial message deltas will be sent, like in ChatGPT.
+ temperature (Union[None, Unset, float]): What sampling temperature to use, between 0 and 2.
+ top_p (Union[None, Unset, float]): An alternative to sampling with temperature, called nucleus sampling.
+ tools (Union[Unset, List['V1ChatCompletionsCreateJsonBodyToolsItem']]): A list of tools the model may call.
+ Currently, only functions are supported as a tool.
+ user (Union[None, Unset, str]): A unique identifier representing your end-user.
+ """
+
+ project_id: int
+ messages: List["V1ChatCompletionsCreateJsonBodyMessagesItem"]
+ model: Union[Unset, str] = UNSET
+ frequency_penalty: Union[Unset, float] = UNSET
+ logit_bias: Union["V1ChatCompletionsCreateJsonBodyLogitBiasType0", None, Unset] = UNSET
+ max_tokens: Union[None, Unset, int] = UNSET
+ n: Union[Unset, int] = UNSET
+ presence_penalty: Union[Unset, float] = UNSET
+ response_format: Union["V1ChatCompletionsCreateJsonBodyResponseFormatType0", None, Unset] = UNSET
+ seed: Union[None, Unset, int] = UNSET
+ stop: Union[None, Unset, str] = UNSET
+ stream: Union[Unset, bool] = UNSET
+ temperature: Union[None, Unset, float] = UNSET
+ top_p: Union[None, Unset, float] = UNSET
+ tools: Union[Unset, List["V1ChatCompletionsCreateJsonBodyToolsItem"]] = UNSET
+ user: Union[None, Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ from ..models.v1_chat_completions_create_json_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateJsonBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_json_body_response_format_type_0 import (
+ V1ChatCompletionsCreateJsonBodyResponseFormatType0,
+ )
+
+ project_id = self.project_id
+
+ messages = []
+ for messages_item_data in self.messages:
+ messages_item = messages_item_data.to_dict()
+ messages.append(messages_item)
+
+ model = self.model
+
+ frequency_penalty = self.frequency_penalty
+
+ logit_bias: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.logit_bias, Unset):
+ logit_bias = UNSET
+ elif isinstance(self.logit_bias, V1ChatCompletionsCreateJsonBodyLogitBiasType0):
+ logit_bias = self.logit_bias.to_dict()
+ else:
+ logit_bias = self.logit_bias
+
+ max_tokens: Union[None, Unset, int]
+ if isinstance(self.max_tokens, Unset):
+ max_tokens = UNSET
+ else:
+ max_tokens = self.max_tokens
+
+ n = self.n
+
+ presence_penalty = self.presence_penalty
+
+ response_format: Union[Dict[str, Any], None, Unset]
+ if isinstance(self.response_format, Unset):
+ response_format = UNSET
+ elif isinstance(self.response_format, V1ChatCompletionsCreateJsonBodyResponseFormatType0):
+ response_format = self.response_format.to_dict()
+ else:
+ response_format = self.response_format
+
+ seed: Union[None, Unset, int]
+ if isinstance(self.seed, Unset):
+ seed = UNSET
+ else:
+ seed = self.seed
+
+ stop: Union[None, Unset, str]
+ if isinstance(self.stop, Unset):
+ stop = UNSET
+ else:
+ stop = self.stop
+
+ stream = self.stream
+
+ temperature: Union[None, Unset, float]
+ if isinstance(self.temperature, Unset):
+ temperature = UNSET
+ else:
+ temperature = self.temperature
+
+ top_p: Union[None, Unset, float]
+ if isinstance(self.top_p, Unset):
+ top_p = UNSET
+ else:
+ top_p = self.top_p
+
+ tools: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.tools, Unset):
+ tools = []
+ for tools_item_data in self.tools:
+ tools_item = tools_item_data.to_dict()
+ tools.append(tools_item)
+
+ user: Union[None, Unset, str]
+ if isinstance(self.user, Unset):
+ user = UNSET
+ else:
+ user = self.user
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "messages": messages,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if frequency_penalty is not UNSET:
+ field_dict["frequency_penalty"] = frequency_penalty
+ if logit_bias is not UNSET:
+ field_dict["logit_bias"] = logit_bias
+ if max_tokens is not UNSET:
+ field_dict["max_tokens"] = max_tokens
+ if n is not UNSET:
+ field_dict["n"] = n
+ if presence_penalty is not UNSET:
+ field_dict["presence_penalty"] = presence_penalty
+ if response_format is not UNSET:
+ field_dict["response_format"] = response_format
+ if seed is not UNSET:
+ field_dict["seed"] = seed
+ if stop is not UNSET:
+ field_dict["stop"] = stop
+ if stream is not UNSET:
+ field_dict["stream"] = stream
+ if temperature is not UNSET:
+ field_dict["temperature"] = temperature
+ if top_p is not UNSET:
+ field_dict["top_p"] = top_p
+ if tools is not UNSET:
+ field_dict["tools"] = tools
+ if user is not UNSET:
+ field_dict["user"] = user
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_json_body_logit_bias_type_0 import (
+ V1ChatCompletionsCreateJsonBodyLogitBiasType0,
+ )
+ from ..models.v1_chat_completions_create_json_body_messages_item import (
+ V1ChatCompletionsCreateJsonBodyMessagesItem,
+ )
+ from ..models.v1_chat_completions_create_json_body_response_format_type_0 import (
+ V1ChatCompletionsCreateJsonBodyResponseFormatType0,
+ )
+ from ..models.v1_chat_completions_create_json_body_tools_item import V1ChatCompletionsCreateJsonBodyToolsItem
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ messages = []
+ _messages = d.pop("messages")
+ for messages_item_data in _messages:
+ messages_item = V1ChatCompletionsCreateJsonBodyMessagesItem.from_dict(messages_item_data)
+
+ messages.append(messages_item)
+
+ model = d.pop("model", UNSET)
+
+ frequency_penalty = d.pop("frequency_penalty", UNSET)
+
+ def _parse_logit_bias(data: object) -> Union["V1ChatCompletionsCreateJsonBodyLogitBiasType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ logit_bias_type_0 = V1ChatCompletionsCreateJsonBodyLogitBiasType0.from_dict(data)
+
+ return logit_bias_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateJsonBodyLogitBiasType0", None, Unset], data)
+
+ logit_bias = _parse_logit_bias(d.pop("logit_bias", UNSET))
+
+ def _parse_max_tokens(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ max_tokens = _parse_max_tokens(d.pop("max_tokens", UNSET))
+
+ n = d.pop("n", UNSET)
+
+ presence_penalty = d.pop("presence_penalty", UNSET)
+
+ def _parse_response_format(
+ data: object,
+ ) -> Union["V1ChatCompletionsCreateJsonBodyResponseFormatType0", None, Unset]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ try:
+ if not isinstance(data, dict):
+ raise TypeError()
+ response_format_type_0 = V1ChatCompletionsCreateJsonBodyResponseFormatType0.from_dict(data)
+
+ return response_format_type_0
+ except: # noqa: E722
+ pass
+ return cast(Union["V1ChatCompletionsCreateJsonBodyResponseFormatType0", None, Unset], data)
+
+ response_format = _parse_response_format(d.pop("response_format", UNSET))
+
+ def _parse_seed(data: object) -> Union[None, Unset, int]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, int], data)
+
+ seed = _parse_seed(d.pop("seed", UNSET))
+
+ def _parse_stop(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ stop = _parse_stop(d.pop("stop", UNSET))
+
+ stream = d.pop("stream", UNSET)
+
+ def _parse_temperature(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ temperature = _parse_temperature(d.pop("temperature", UNSET))
+
+ def _parse_top_p(data: object) -> Union[None, Unset, float]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, float], data)
+
+ top_p = _parse_top_p(d.pop("top_p", UNSET))
+
+ tools = []
+ _tools = d.pop("tools", UNSET)
+ for tools_item_data in _tools or []:
+ tools_item = V1ChatCompletionsCreateJsonBodyToolsItem.from_dict(tools_item_data)
+
+ tools.append(tools_item)
+
+ def _parse_user(data: object) -> Union[None, Unset, str]:
+ if data is None:
+ return data
+ if isinstance(data, Unset):
+ return data
+ return cast(Union[None, Unset, str], data)
+
+ user = _parse_user(d.pop("user", UNSET))
+
+ v1_chat_completions_create_json_body = cls(
+ project_id=project_id,
+ messages=messages,
+ model=model,
+ frequency_penalty=frequency_penalty,
+ logit_bias=logit_bias,
+ max_tokens=max_tokens,
+ n=n,
+ presence_penalty=presence_penalty,
+ response_format=response_format,
+ seed=seed,
+ stop=stop,
+ stream=stream,
+ temperature=temperature,
+ top_p=top_p,
+ tools=tools,
+ user=user,
+ )
+
+ v1_chat_completions_create_json_body.additional_properties = d
+ return v1_chat_completions_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body_logit_bias_type_0.py b/premai/models/v1_chat_completions_create_json_body_logit_bias_type_0.py
new file mode 100644
index 0000000..c5b16c2
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body_logit_bias_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBodyLogitBiasType0")
+
+
+class V1ChatCompletionsCreateJsonBodyLogitBiasType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBodyLogitBiasType0:
+ """JSON object that maps tokens to an associated bias value from -100 to 100."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_json_body_logit_bias_type_0 = cls()
+
+ v1_chat_completions_create_json_body_logit_bias_type_0.additional_properties = d
+ return v1_chat_completions_create_json_body_logit_bias_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body_messages_item.py b/premai/models/v1_chat_completions_create_json_body_messages_item.py
new file mode 100644
index 0000000..4daf38a
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body_messages_item.py
@@ -0,0 +1,85 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_json_body_messages_item_role import (
+ V1ChatCompletionsCreateJsonBodyMessagesItemRole,
+)
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBodyMessagesItem")
+
+
+class V1ChatCompletionsCreateJsonBodyMessagesItemDict(TypedDict):
+ role: "V1ChatCompletionsCreateJsonBodyMessagesItemRole"
+ content: str
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBodyMessagesItem:
+ """
+ Attributes:
+ role (V1ChatCompletionsCreateJsonBodyMessagesItemRole): The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+ content (str): The content of the message.
+ """
+
+ role: "V1ChatCompletionsCreateJsonBodyMessagesItemRole"
+ content: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ role = self.role.to_dict()
+
+ content = self.content
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "role": role,
+ "content": content,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_json_body_messages_item_role import (
+ V1ChatCompletionsCreateJsonBodyMessagesItemRole,
+ )
+
+ d = src_dict.copy()
+ role = V1ChatCompletionsCreateJsonBodyMessagesItemRole.from_dict(d.pop("role"))
+
+ content = d.pop("content")
+
+ v1_chat_completions_create_json_body_messages_item = cls(
+ role=role,
+ content=content,
+ )
+
+ v1_chat_completions_create_json_body_messages_item.additional_properties = d
+ return v1_chat_completions_create_json_body_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body_messages_item_role.py b/premai/models/v1_chat_completions_create_json_body_messages_item_role.py
new file mode 100644
index 0000000..b9b81f7
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body_messages_item_role.py
@@ -0,0 +1,54 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBodyMessagesItemRole")
+
+
+class V1ChatCompletionsCreateJsonBodyMessagesItemRoleDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBodyMessagesItemRole:
+ """The role of the sender (e.g., 'user' or 'system').
+
+ * `user` - user
+ * `system` - system
+
+ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_json_body_messages_item_role = cls()
+
+ v1_chat_completions_create_json_body_messages_item_role.additional_properties = d
+ return v1_chat_completions_create_json_body_messages_item_role
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body_response_format_type_0.py b/premai/models/v1_chat_completions_create_json_body_response_format_type_0.py
new file mode 100644
index 0000000..d096594
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body_response_format_type_0.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBodyResponseFormatType0")
+
+
+class V1ChatCompletionsCreateJsonBodyResponseFormatType0Dict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBodyResponseFormatType0:
+ """An object specifying the format that the model must output."""
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_json_body_response_format_type_0 = cls()
+
+ v1_chat_completions_create_json_body_response_format_type_0.additional_properties = d
+ return v1_chat_completions_create_json_body_response_format_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_json_body_tools_item.py b/premai/models/v1_chat_completions_create_json_body_tools_item.py
new file mode 100644
index 0000000..eea1921
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_json_body_tools_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateJsonBodyToolsItem")
+
+
+class V1ChatCompletionsCreateJsonBodyToolsItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateJsonBodyToolsItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_json_body_tools_item = cls()
+
+ v1_chat_completions_create_json_body_tools_item.additional_properties = d
+ return v1_chat_completions_create_json_body_tools_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_200.py b/premai/models/v1_chat_completions_create_response_200.py
new file mode 100644
index 0000000..a11535d
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_200.py
@@ -0,0 +1,146 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_200_choices_item import V1ChatCompletionsCreateResponse200ChoicesItem
+from ..models.v1_chat_completions_create_response_200_usage import V1ChatCompletionsCreateResponse200Usage
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse200")
+
+
+class V1ChatCompletionsCreateResponse200Dict(TypedDict):
+ id: str
+ choices: List["V1ChatCompletionsCreateResponse200ChoicesItem"]
+ created: int
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: NotRequired[Union[Unset, V1ChatCompletionsCreateResponse200Usage]]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse200:
+ """
+ Attributes:
+ id (str): A unique identifier for the chat completion. Each chunk has the same ID.
+ choices (List['V1ChatCompletionsCreateResponse200ChoicesItem']): A list of chat completion choices. Can be more
+ than one if n is greater than 1.
+ created (int): The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same
+ timestamp.
+ model (str): The model to generate the completion.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ usage (Union[Unset, V1ChatCompletionsCreateResponse200Usage]): The usage statistics for the completion.
+ """
+
+ id: str
+ choices: List["V1ChatCompletionsCreateResponse200ChoicesItem"]
+ created: int
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: Union[Unset, "V1ChatCompletionsCreateResponse200Usage"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ choices = []
+ for choices_item_data in self.choices:
+ choices_item = choices_item_data.to_dict()
+ choices.append(choices_item)
+
+ created = self.created
+
+ model = self.model
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ usage: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.usage, Unset):
+ usage = self.usage.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "choices": choices,
+ "created": created,
+ "model": model,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ }
+ )
+ if usage is not UNSET:
+ field_dict["usage"] = usage
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_response_200_choices_item import (
+ V1ChatCompletionsCreateResponse200ChoicesItem,
+ )
+ from ..models.v1_chat_completions_create_response_200_usage import V1ChatCompletionsCreateResponse200Usage
+
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ choices = []
+ _choices = d.pop("choices")
+ for choices_item_data in _choices:
+ choices_item = V1ChatCompletionsCreateResponse200ChoicesItem.from_dict(choices_item_data)
+
+ choices.append(choices_item)
+
+ created = d.pop("created")
+
+ model = d.pop("model")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ _usage = d.pop("usage", UNSET)
+ usage: Union[Unset, V1ChatCompletionsCreateResponse200Usage]
+ if isinstance(_usage, Unset):
+ usage = UNSET
+ else:
+ usage = V1ChatCompletionsCreateResponse200Usage.from_dict(_usage)
+
+ v1_chat_completions_create_response_200 = cls(
+ id=id,
+ choices=choices,
+ created=created,
+ model=model,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ usage=usage,
+ )
+
+ v1_chat_completions_create_response_200.additional_properties = d
+ return v1_chat_completions_create_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_200_choices_item.py b/premai/models/v1_chat_completions_create_response_200_choices_item.py
new file mode 100644
index 0000000..5280d72
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_200_choices_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse200ChoicesItem")
+
+
+class V1ChatCompletionsCreateResponse200ChoicesItemDict(TypedDict):
+ message: str
+ finish_reason: str
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse200ChoicesItem:
+ """
+ Attributes:
+ message (str): The generated message in the chat completion choice.
+ finish_reason (str): The reason the chat completion finished, e.g., 'stop' or 'length'.
+ """
+
+ message: str
+ finish_reason: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ finish_reason = self.finish_reason
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "finish_reason": finish_reason,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ finish_reason = d.pop("finish_reason")
+
+ v1_chat_completions_create_response_200_choices_item = cls(
+ message=message,
+ finish_reason=finish_reason,
+ )
+
+ v1_chat_completions_create_response_200_choices_item.additional_properties = d
+ return v1_chat_completions_create_response_200_choices_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_200_usage.py b/premai/models/v1_chat_completions_create_response_200_usage.py
new file mode 100644
index 0000000..2248a60
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_200_usage.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse200Usage")
+
+
+class V1ChatCompletionsCreateResponse200UsageDict(TypedDict):
+ completion_tokens: NotRequired[Union[Unset, int]]
+ prompt_tokens: NotRequired[Union[Unset, int]]
+ total_tokens: NotRequired[Union[Unset, int]]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse200Usage:
+ """The usage statistics for the completion.
+
+ Attributes:
+ completion_tokens (Union[Unset, int]):
+ prompt_tokens (Union[Unset, int]):
+ total_tokens (Union[Unset, int]):
+ """
+
+ completion_tokens: Union[Unset, int] = UNSET
+ prompt_tokens: Union[Unset, int] = UNSET
+ total_tokens: Union[Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ completion_tokens = self.completion_tokens
+
+ prompt_tokens = self.prompt_tokens
+
+ total_tokens = self.total_tokens
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if completion_tokens is not UNSET:
+ field_dict["completion_tokens"] = completion_tokens
+ if prompt_tokens is not UNSET:
+ field_dict["prompt_tokens"] = prompt_tokens
+ if total_tokens is not UNSET:
+ field_dict["total_tokens"] = total_tokens
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ completion_tokens = d.pop("completion_tokens", UNSET)
+
+ prompt_tokens = d.pop("prompt_tokens", UNSET)
+
+ total_tokens = d.pop("total_tokens", UNSET)
+
+ v1_chat_completions_create_response_200_usage = cls(
+ completion_tokens=completion_tokens,
+ prompt_tokens=prompt_tokens,
+ total_tokens=total_tokens,
+ )
+
+ v1_chat_completions_create_response_200_usage.additional_properties = d
+ return v1_chat_completions_create_response_200_usage
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_400.py b/premai/models/v1_chat_completions_create_response_400.py
new file mode 100644
index 0000000..7938d13
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_400.py
@@ -0,0 +1,88 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_400_code import V1ChatCompletionsCreateResponse400Code
+from ..models.v1_chat_completions_create_response_400_details import V1ChatCompletionsCreateResponse400Details
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse400")
+
+
+class V1ChatCompletionsCreateResponse400Dict(TypedDict):
+ message: str
+ details: "V1ChatCompletionsCreateResponse400Details"
+ code: V1ChatCompletionsCreateResponse400Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse400:
+ """
+ Attributes:
+ message (str): A description of the validation error.
+ details (V1ChatCompletionsCreateResponse400Details): Detailed information about the validation errors.
+ code (V1ChatCompletionsCreateResponse400Code): * `ValidationError` - ValidationError
+ """
+
+ message: str
+ details: "V1ChatCompletionsCreateResponse400Details"
+ code: V1ChatCompletionsCreateResponse400Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ details = self.details.to_dict()
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "details": details,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_response_400_details import V1ChatCompletionsCreateResponse400Details
+
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ details = V1ChatCompletionsCreateResponse400Details.from_dict(d.pop("details"))
+
+ code = V1ChatCompletionsCreateResponse400Code(d.pop("code"))
+
+ v1_chat_completions_create_response_400 = cls(
+ message=message,
+ details=details,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_400.additional_properties = d
+ return v1_chat_completions_create_response_400
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_400_code.py b/premai/models/v1_chat_completions_create_response_400_code.py
new file mode 100644
index 0000000..36e636f
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_400_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse400Code(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_400_details.py b/premai/models/v1_chat_completions_create_response_400_details.py
new file mode 100644
index 0000000..7bacde3
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_400_details.py
@@ -0,0 +1,66 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_400_details_additional_property import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalProperty,
+)
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse400Details")
+
+
+class V1ChatCompletionsCreateResponse400DetailsDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse400Details:
+ """Detailed information about the validation errors."""
+
+ additional_properties: Dict[str, "V1ChatCompletionsCreateResponse400DetailsAdditionalProperty"] = _attrs_field(
+ init=False, factory=dict
+ )
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ for prop_name, prop in self.additional_properties.items():
+ field_dict[prop_name] = prop.to_dict()
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_response_400_details_additional_property import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalProperty,
+ )
+
+ d = src_dict.copy()
+ v1_chat_completions_create_response_400_details = cls()
+
+ additional_properties = {}
+ for prop_name, prop_dict in d.items():
+ additional_property = V1ChatCompletionsCreateResponse400DetailsAdditionalProperty.from_dict(prop_dict)
+
+ additional_properties[prop_name] = additional_property
+
+ v1_chat_completions_create_response_400_details.additional_properties = additional_properties
+ return v1_chat_completions_create_response_400_details
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> "V1ChatCompletionsCreateResponse400DetailsAdditionalProperty":
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: "V1ChatCompletionsCreateResponse400DetailsAdditionalProperty") -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_400_details_additional_property.py b/premai/models/v1_chat_completions_create_response_400_details_additional_property.py
new file mode 100644
index 0000000..944be5a
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_400_details_additional_property.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_400_details_additional_property_error_messages_item import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse400DetailsAdditionalProperty")
+
+
+class V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyDict(TypedDict):
+ error_messages: List["V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse400DetailsAdditionalProperty:
+ """
+ Attributes:
+ error_messages (List['V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem']): Error
+ messages for the field.
+ """
+
+ error_messages: List["V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_chat_completions_create_response_400_details_additional_property_error_messages_item import (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+ )
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = (
+ V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem.from_dict(
+ error_messages_item_data
+ )
+ )
+
+ error_messages.append(error_messages_item)
+
+ v1_chat_completions_create_response_400_details_additional_property = cls(
+ error_messages=error_messages,
+ )
+
+ v1_chat_completions_create_response_400_details_additional_property.additional_properties = d
+ return v1_chat_completions_create_response_400_details_additional_property
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_400_details_additional_property_error_messages_item.py b/premai/models/v1_chat_completions_create_response_400_details_additional_property_error_messages_item.py
new file mode 100644
index 0000000..45e8713
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_400_details_additional_property_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem")
+
+
+class V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_chat_completions_create_response_400_details_additional_property_error_messages_item = cls()
+
+ v1_chat_completions_create_response_400_details_additional_property_error_messages_item.additional_properties = d
+ return v1_chat_completions_create_response_400_details_additional_property_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_401.py b/premai/models/v1_chat_completions_create_response_401.py
new file mode 100644
index 0000000..e4bfb8c
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_401.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_401_code import V1ChatCompletionsCreateResponse401Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse401")
+
+
+class V1ChatCompletionsCreateResponse401Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse401Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse401:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse401Code): * `AuthenticationError` - AuthenticationError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse401Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse401Code(d.pop("code"))
+
+ v1_chat_completions_create_response_401 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_401.additional_properties = d
+ return v1_chat_completions_create_response_401
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_401_code.py b/premai/models/v1_chat_completions_create_response_401_code.py
new file mode 100644
index 0000000..6bdab33
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_401_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse401Code(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_403.py b/premai/models/v1_chat_completions_create_response_403.py
new file mode 100644
index 0000000..e1077b3
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_403.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_403_code import V1ChatCompletionsCreateResponse403Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse403")
+
+
+class V1ChatCompletionsCreateResponse403Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse403Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse403:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse403Code): * `PermissionDeniedError` - PermissionDeniedError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse403Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse403Code(d.pop("code"))
+
+ v1_chat_completions_create_response_403 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_403.additional_properties = d
+ return v1_chat_completions_create_response_403
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_403_code.py b/premai/models/v1_chat_completions_create_response_403_code.py
new file mode 100644
index 0000000..c50d50c
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_403_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse403Code(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_404_type_0.py b/premai/models/v1_chat_completions_create_response_404_type_0.py
new file mode 100644
index 0000000..32186bb
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_404_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_404_type_0_code import V1ChatCompletionsCreateResponse404Type0Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse404Type0")
+
+
+class V1ChatCompletionsCreateResponse404Type0Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse404Type0Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse404Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse404Type0Code): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse404Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse404Type0Code(d.pop("code"))
+
+ v1_chat_completions_create_response_404_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_404_type_0.additional_properties = d
+ return v1_chat_completions_create_response_404_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_404_type_0_code.py b/premai/models/v1_chat_completions_create_response_404_type_0_code.py
new file mode 100644
index 0000000..e30cc3a
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_404_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse404Type0Code(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_404_type_1.py b/premai/models/v1_chat_completions_create_response_404_type_1.py
new file mode 100644
index 0000000..9dcd4fa
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_404_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_404_type_1_code import V1ChatCompletionsCreateResponse404Type1Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse404Type1")
+
+
+class V1ChatCompletionsCreateResponse404Type1Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse404Type1Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse404Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse404Type1Code): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse404Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse404Type1Code(d.pop("code"))
+
+ v1_chat_completions_create_response_404_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_404_type_1.additional_properties = d
+ return v1_chat_completions_create_response_404_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_404_type_1_code.py b/premai/models/v1_chat_completions_create_response_404_type_1_code.py
new file mode 100644
index 0000000..70edbc7
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_404_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse404Type1Code(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_409.py b/premai/models/v1_chat_completions_create_response_409.py
new file mode 100644
index 0000000..ab4c22e
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_409.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_409_code import V1ChatCompletionsCreateResponse409Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse409")
+
+
+class V1ChatCompletionsCreateResponse409Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse409Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse409:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse409Code): * `ConflictError` - ConflictError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse409Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse409Code(d.pop("code"))
+
+ v1_chat_completions_create_response_409 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_409.additional_properties = d
+ return v1_chat_completions_create_response_409
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_409_code.py b/premai/models/v1_chat_completions_create_response_409_code.py
new file mode 100644
index 0000000..867cf98
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_409_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse409Code(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_422.py b/premai/models/v1_chat_completions_create_response_422.py
new file mode 100644
index 0000000..f16d91f
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_422.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_422_code import V1ChatCompletionsCreateResponse422Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse422")
+
+
+class V1ChatCompletionsCreateResponse422Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse422Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse422:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse422Code): * `UnprocessableEntityError` - UnprocessableEntityError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse422Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse422Code(d.pop("code"))
+
+ v1_chat_completions_create_response_422 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_422.additional_properties = d
+ return v1_chat_completions_create_response_422
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_422_code.py b/premai/models/v1_chat_completions_create_response_422_code.py
new file mode 100644
index 0000000..bec94a9
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_422_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse422Code(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_429.py b/premai/models/v1_chat_completions_create_response_429.py
new file mode 100644
index 0000000..18d47c8
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_429.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_429_code import V1ChatCompletionsCreateResponse429Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse429")
+
+
+class V1ChatCompletionsCreateResponse429Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse429Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse429:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse429Code): * `RateLimitError` - RateLimitError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse429Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse429Code(d.pop("code"))
+
+ v1_chat_completions_create_response_429 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_429.additional_properties = d
+ return v1_chat_completions_create_response_429
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_429_code.py b/premai/models/v1_chat_completions_create_response_429_code.py
new file mode 100644
index 0000000..a289193
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_429_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse429Code(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_0.py b/premai/models/v1_chat_completions_create_response_500_type_0.py
new file mode 100644
index 0000000..7b5c46e
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_0.py
@@ -0,0 +1,77 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_0_code import V1ChatCompletionsCreateResponse500Type0Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type0")
+
+
+class V1ChatCompletionsCreateResponse500Type0Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type0Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type0Code): * `ProviderInternalServerError` -
+ ProviderInternalServerError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type0Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_0.additional_properties = d
+ return v1_chat_completions_create_response_500_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_0_code.py b/premai/models/v1_chat_completions_create_response_500_type_0_code.py
new file mode 100644
index 0000000..87b0b40
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type0Code(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_1.py b/premai/models/v1_chat_completions_create_response_500_type_1.py
new file mode 100644
index 0000000..d78507c
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_1_code import V1ChatCompletionsCreateResponse500Type1Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type1")
+
+
+class V1ChatCompletionsCreateResponse500Type1Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type1Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type1Code): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type1Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_1.additional_properties = d
+ return v1_chat_completions_create_response_500_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_1_code.py b/premai/models/v1_chat_completions_create_response_500_type_1_code.py
new file mode 100644
index 0000000..636c2e3
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type1Code(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_2.py b/premai/models/v1_chat_completions_create_response_500_type_2.py
new file mode 100644
index 0000000..877352b
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_2.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_2_code import V1ChatCompletionsCreateResponse500Type2Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type2")
+
+
+class V1ChatCompletionsCreateResponse500Type2Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type2Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type2:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type2Code): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type2Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type2Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_2 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_2.additional_properties = d
+ return v1_chat_completions_create_response_500_type_2
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_2_code.py b/premai/models/v1_chat_completions_create_response_500_type_2_code.py
new file mode 100644
index 0000000..7218a61
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_2_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type2Code(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_3.py b/premai/models/v1_chat_completions_create_response_500_type_3.py
new file mode 100644
index 0000000..24be8fc
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_3.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_3_code import V1ChatCompletionsCreateResponse500Type3Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type3")
+
+
+class V1ChatCompletionsCreateResponse500Type3Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type3Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type3:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type3Code): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type3Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type3Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_3 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_3.additional_properties = d
+ return v1_chat_completions_create_response_500_type_3
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_3_code.py b/premai/models/v1_chat_completions_create_response_500_type_3_code.py
new file mode 100644
index 0000000..670f05c
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_3_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type3Code(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_4.py b/premai/models/v1_chat_completions_create_response_500_type_4.py
new file mode 100644
index 0000000..16ec798
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_4.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_4_code import V1ChatCompletionsCreateResponse500Type4Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type4")
+
+
+class V1ChatCompletionsCreateResponse500Type4Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type4Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type4:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type4Code): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type4Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type4Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_4 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_4.additional_properties = d
+ return v1_chat_completions_create_response_500_type_4
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_4_code.py b/premai/models/v1_chat_completions_create_response_500_type_4_code.py
new file mode 100644
index 0000000..4c4cee0
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_4_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type4Code(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_chat_completions_create_response_500_type_5.py b/premai/models/v1_chat_completions_create_response_500_type_5.py
new file mode 100644
index 0000000..5cc2233
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_5.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_chat_completions_create_response_500_type_5_code import V1ChatCompletionsCreateResponse500Type5Code
+
+T = TypeVar("T", bound="V1ChatCompletionsCreateResponse500Type5")
+
+
+class V1ChatCompletionsCreateResponse500Type5Dict(TypedDict):
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type5Code
+ pass
+
+
+@_attrs_define
+class V1ChatCompletionsCreateResponse500Type5:
+ """
+ Attributes:
+ message (str):
+ code (V1ChatCompletionsCreateResponse500Type5Code): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: V1ChatCompletionsCreateResponse500Type5Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1ChatCompletionsCreateResponse500Type5Code(d.pop("code"))
+
+ v1_chat_completions_create_response_500_type_5 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_chat_completions_create_response_500_type_5.additional_properties = d
+ return v1_chat_completions_create_response_500_type_5
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_chat_completions_create_response_500_type_5_code.py b/premai/models/v1_chat_completions_create_response_500_type_5_code.py
new file mode 100644
index 0000000..fd14201
--- /dev/null
+++ b/premai/models/v1_chat_completions_create_response_500_type_5_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1ChatCompletionsCreateResponse500Type5Code(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_data_body.py b/premai/models/v1_embeddings_create_data_body.py
new file mode 100644
index 0000000..20c7ea2
--- /dev/null
+++ b/premai/models/v1_embeddings_create_data_body.py
@@ -0,0 +1,162 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_data_body_encoding_format import V1EmbeddingsCreateDataBodyEncodingFormat
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1EmbeddingsCreateDataBody")
+
+
+class V1EmbeddingsCreateDataBodyDict(TypedDict):
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: NotRequired[Union[Unset, str]]
+ encoding_format: NotRequired[Union[Unset, V1EmbeddingsCreateDataBodyEncodingFormat]]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateDataBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ input_ (List[Union[List[List[int]], List[int], List[str], str]]): Embedding Input
+ model (Union[Unset, str]):
+ encoding_format (Union[Unset, V1EmbeddingsCreateDataBodyEncodingFormat]):
+ """
+
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: Union[Unset, str] = UNSET
+ encoding_format: Union[Unset, "V1EmbeddingsCreateDataBodyEncodingFormat"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ input_ = []
+ for input_item_data in self.input_:
+ input_item: Union[List[List[int]], List[int], List[str], str]
+ if isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = []
+ for input_item_type_3_item_data in input_item_data:
+ input_item_type_3_item = input_item_type_3_item_data
+
+ input_item.append(input_item_type_3_item)
+
+ else:
+ input_item = input_item_data
+ input_.append(input_item)
+
+ model = self.model
+
+ encoding_format: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.encoding_format, Unset):
+ encoding_format = self.encoding_format.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "input": input_,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if encoding_format is not UNSET:
+ field_dict["encoding_format"] = encoding_format
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_data_body_encoding_format import V1EmbeddingsCreateDataBodyEncodingFormat
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ input_ = []
+ _input_ = d.pop("input")
+ for input_item_data in _input_:
+
+ def _parse_input_item(data: object) -> Union[List[List[int]], List[int], List[str], str]:
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_1 = cast(List[str], data)
+
+ return input_item_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_2 = cast(List[int], data)
+
+ return input_item_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_3 = []
+ _input_item_type_3 = data
+ for input_item_type_3_item_data in _input_item_type_3:
+ input_item_type_3_item = cast(List[int], input_item_type_3_item_data)
+
+ input_item_type_3.append(input_item_type_3_item)
+
+ return input_item_type_3
+ except: # noqa: E722
+ pass
+ return cast(Union[List[List[int]], List[int], List[str], str], data)
+
+ input_item = _parse_input_item(input_item_data)
+
+ input_.append(input_item)
+
+ model = d.pop("model", UNSET)
+
+ _encoding_format = d.pop("encoding_format", UNSET)
+ encoding_format: Union[Unset, V1EmbeddingsCreateDataBodyEncodingFormat]
+ if isinstance(_encoding_format, Unset):
+ encoding_format = UNSET
+ else:
+ encoding_format = V1EmbeddingsCreateDataBodyEncodingFormat.from_dict(_encoding_format)
+
+ v1_embeddings_create_data_body = cls(
+ project_id=project_id,
+ input_=input_,
+ model=model,
+ encoding_format=encoding_format,
+ )
+
+ v1_embeddings_create_data_body.additional_properties = d
+ return v1_embeddings_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_data_body_encoding_format.py b/premai/models/v1_embeddings_create_data_body_encoding_format.py
new file mode 100644
index 0000000..c58304b
--- /dev/null
+++ b/premai/models/v1_embeddings_create_data_body_encoding_format.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1EmbeddingsCreateDataBodyEncodingFormat")
+
+
+class V1EmbeddingsCreateDataBodyEncodingFormatDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateDataBodyEncodingFormat:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_embeddings_create_data_body_encoding_format = cls()
+
+ v1_embeddings_create_data_body_encoding_format.additional_properties = d
+ return v1_embeddings_create_data_body_encoding_format
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_files_body.py b/premai/models/v1_embeddings_create_files_body.py
new file mode 100644
index 0000000..184aff8
--- /dev/null
+++ b/premai/models/v1_embeddings_create_files_body.py
@@ -0,0 +1,214 @@
+import json
+from typing import Dict, List, Tuple, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_files_body_encoding_format import V1EmbeddingsCreateFilesBodyEncodingFormat
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1EmbeddingsCreateFilesBody")
+
+
+class V1EmbeddingsCreateFilesBodyDict(TypedDict):
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: NotRequired[Union[Unset, str]]
+ encoding_format: NotRequired[Union[Unset, V1EmbeddingsCreateFilesBodyEncodingFormat]]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateFilesBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ input_ (List[Union[List[List[int]], List[int], List[str], str]]): Embedding Input
+ model (Union[Unset, str]):
+ encoding_format (Union[Unset, V1EmbeddingsCreateFilesBodyEncodingFormat]):
+ """
+
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: Union[Unset, str] = UNSET
+ encoding_format: Union[Unset, "V1EmbeddingsCreateFilesBodyEncodingFormat"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ input_ = []
+ for input_item_data in self.input_:
+ input_item: Union[List[List[int]], List[int], List[str], str]
+ if isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = []
+ for input_item_type_3_item_data in input_item_data:
+ input_item_type_3_item = input_item_type_3_item_data
+
+ input_item.append(input_item_type_3_item)
+
+ else:
+ input_item = input_item_data
+ input_.append(input_item)
+
+ model = self.model
+
+ encoding_format: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.encoding_format, Unset):
+ encoding_format = self.encoding_format.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "input": input_,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if encoding_format is not UNSET:
+ field_dict["encoding_format"] = encoding_format
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ project_id = (
+ self.project_id
+ if isinstance(self.project_id, Unset)
+ else (None, str(self.project_id).encode(), "text/plain")
+ )
+
+ _temp_input_ = []
+ for input_item_data in self.input_:
+ input_item: Union[List[List[int]], List[int], List[str], str]
+ if isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = []
+ for input_item_type_3_item_data in input_item_data:
+ input_item_type_3_item = input_item_type_3_item_data
+
+ input_item.append(input_item_type_3_item)
+
+ else:
+ input_item = input_item_data
+ _temp_input_.append(input_item)
+ input_ = (None, json.dumps(_temp_input_).encode(), "application/json")
+
+ model = self.model if isinstance(self.model, Unset) else (None, str(self.model).encode(), "text/plain")
+
+ encoding_format: Union[Unset, Tuple[None, bytes, str]] = UNSET
+ if not isinstance(self.encoding_format, Unset):
+ encoding_format = (None, json.dumps(self.encoding_format.to_dict()).encode(), "application/json")
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "input": input_,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if encoding_format is not UNSET:
+ field_dict["encoding_format"] = encoding_format
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_files_body_encoding_format import V1EmbeddingsCreateFilesBodyEncodingFormat
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ input_ = []
+ _input_ = d.pop("input")
+ for input_item_data in _input_:
+
+ def _parse_input_item(data: object) -> Union[List[List[int]], List[int], List[str], str]:
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_1 = cast(List[str], data)
+
+ return input_item_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_2 = cast(List[int], data)
+
+ return input_item_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_3 = []
+ _input_item_type_3 = data
+ for input_item_type_3_item_data in _input_item_type_3:
+ input_item_type_3_item = cast(List[int], input_item_type_3_item_data)
+
+ input_item_type_3.append(input_item_type_3_item)
+
+ return input_item_type_3
+ except: # noqa: E722
+ pass
+ return cast(Union[List[List[int]], List[int], List[str], str], data)
+
+ input_item = _parse_input_item(input_item_data)
+
+ input_.append(input_item)
+
+ model = d.pop("model", UNSET)
+
+ _encoding_format = d.pop("encoding_format", UNSET)
+ encoding_format: Union[Unset, V1EmbeddingsCreateFilesBodyEncodingFormat]
+ if isinstance(_encoding_format, Unset):
+ encoding_format = UNSET
+ else:
+ encoding_format = V1EmbeddingsCreateFilesBodyEncodingFormat.from_dict(_encoding_format)
+
+ v1_embeddings_create_files_body = cls(
+ project_id=project_id,
+ input_=input_,
+ model=model,
+ encoding_format=encoding_format,
+ )
+
+ v1_embeddings_create_files_body.additional_properties = d
+ return v1_embeddings_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_files_body_encoding_format.py b/premai/models/v1_embeddings_create_files_body_encoding_format.py
new file mode 100644
index 0000000..5dd78a1
--- /dev/null
+++ b/premai/models/v1_embeddings_create_files_body_encoding_format.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1EmbeddingsCreateFilesBodyEncodingFormat")
+
+
+class V1EmbeddingsCreateFilesBodyEncodingFormatDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateFilesBodyEncodingFormat:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_embeddings_create_files_body_encoding_format = cls()
+
+ v1_embeddings_create_files_body_encoding_format.additional_properties = d
+ return v1_embeddings_create_files_body_encoding_format
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_json_body.py b/premai/models/v1_embeddings_create_json_body.py
new file mode 100644
index 0000000..b5d2f05
--- /dev/null
+++ b/premai/models/v1_embeddings_create_json_body.py
@@ -0,0 +1,162 @@
+from typing import Dict, List, Type, Union, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_json_body_encoding_format import V1EmbeddingsCreateJsonBodyEncodingFormat
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1EmbeddingsCreateJsonBody")
+
+
+class V1EmbeddingsCreateJsonBodyDict(TypedDict):
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: NotRequired[Union[Unset, str]]
+ encoding_format: NotRequired[Union[Unset, V1EmbeddingsCreateJsonBodyEncodingFormat]]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateJsonBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ input_ (List[Union[List[List[int]], List[int], List[str], str]]): Embedding Input
+ model (Union[Unset, str]):
+ encoding_format (Union[Unset, V1EmbeddingsCreateJsonBodyEncodingFormat]):
+ """
+
+ project_id: int
+ input_: List[Union[List[List[int]], List[int], List[str], str]]
+ model: Union[Unset, str] = UNSET
+ encoding_format: Union[Unset, "V1EmbeddingsCreateJsonBodyEncodingFormat"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ input_ = []
+ for input_item_data in self.input_:
+ input_item: Union[List[List[int]], List[int], List[str], str]
+ if isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = input_item_data
+
+ elif isinstance(input_item_data, list):
+ input_item = []
+ for input_item_type_3_item_data in input_item_data:
+ input_item_type_3_item = input_item_type_3_item_data
+
+ input_item.append(input_item_type_3_item)
+
+ else:
+ input_item = input_item_data
+ input_.append(input_item)
+
+ model = self.model
+
+ encoding_format: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.encoding_format, Unset):
+ encoding_format = self.encoding_format.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "input": input_,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if encoding_format is not UNSET:
+ field_dict["encoding_format"] = encoding_format
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_json_body_encoding_format import V1EmbeddingsCreateJsonBodyEncodingFormat
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ input_ = []
+ _input_ = d.pop("input")
+ for input_item_data in _input_:
+
+ def _parse_input_item(data: object) -> Union[List[List[int]], List[int], List[str], str]:
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_1 = cast(List[str], data)
+
+ return input_item_type_1
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_2 = cast(List[int], data)
+
+ return input_item_type_2
+ except: # noqa: E722
+ pass
+ try:
+ if not isinstance(data, list):
+ raise TypeError()
+ input_item_type_3 = []
+ _input_item_type_3 = data
+ for input_item_type_3_item_data in _input_item_type_3:
+ input_item_type_3_item = cast(List[int], input_item_type_3_item_data)
+
+ input_item_type_3.append(input_item_type_3_item)
+
+ return input_item_type_3
+ except: # noqa: E722
+ pass
+ return cast(Union[List[List[int]], List[int], List[str], str], data)
+
+ input_item = _parse_input_item(input_item_data)
+
+ input_.append(input_item)
+
+ model = d.pop("model", UNSET)
+
+ _encoding_format = d.pop("encoding_format", UNSET)
+ encoding_format: Union[Unset, V1EmbeddingsCreateJsonBodyEncodingFormat]
+ if isinstance(_encoding_format, Unset):
+ encoding_format = UNSET
+ else:
+ encoding_format = V1EmbeddingsCreateJsonBodyEncodingFormat.from_dict(_encoding_format)
+
+ v1_embeddings_create_json_body = cls(
+ project_id=project_id,
+ input_=input_,
+ model=model,
+ encoding_format=encoding_format,
+ )
+
+ v1_embeddings_create_json_body.additional_properties = d
+ return v1_embeddings_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_json_body_encoding_format.py b/premai/models/v1_embeddings_create_json_body_encoding_format.py
new file mode 100644
index 0000000..887a4a4
--- /dev/null
+++ b/premai/models/v1_embeddings_create_json_body_encoding_format.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1EmbeddingsCreateJsonBodyEncodingFormat")
+
+
+class V1EmbeddingsCreateJsonBodyEncodingFormatDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateJsonBodyEncodingFormat:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_embeddings_create_json_body_encoding_format = cls()
+
+ v1_embeddings_create_json_body_encoding_format.additional_properties = d
+ return v1_embeddings_create_json_body_encoding_format
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_200.py b/premai/models/v1_embeddings_create_response_200.py
new file mode 100644
index 0000000..1c4252a
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_200.py
@@ -0,0 +1,124 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_200_data_item import V1EmbeddingsCreateResponse200DataItem
+from ..models.v1_embeddings_create_response_200_usage import V1EmbeddingsCreateResponse200Usage
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse200")
+
+
+class V1EmbeddingsCreateResponse200Dict(TypedDict):
+ data: List["V1EmbeddingsCreateResponse200DataItem"]
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: NotRequired[Union[Unset, V1EmbeddingsCreateResponse200Usage]]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse200:
+ """
+ Attributes:
+ data (List['V1EmbeddingsCreateResponse200DataItem']): The embeddings for the input.
+ model (str): The model to generate the embeddings.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ usage (Union[Unset, V1EmbeddingsCreateResponse200Usage]): The usage statistics for the completion.
+ """
+
+ data: List["V1EmbeddingsCreateResponse200DataItem"]
+ model: str
+ provider_name: str
+ provider_id: str
+ usage: Union[Unset, "V1EmbeddingsCreateResponse200Usage"] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ data = []
+ for data_item_data in self.data:
+ data_item = data_item_data.to_dict()
+ data.append(data_item)
+
+ model = self.model
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ usage: Union[Unset, Dict[str, Any]] = UNSET
+ if not isinstance(self.usage, Unset):
+ usage = self.usage.to_dict()
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "data": data,
+ "model": model,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ }
+ )
+ if usage is not UNSET:
+ field_dict["usage"] = usage
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_response_200_data_item import V1EmbeddingsCreateResponse200DataItem
+ from ..models.v1_embeddings_create_response_200_usage import V1EmbeddingsCreateResponse200Usage
+
+ d = src_dict.copy()
+ data = []
+ _data = d.pop("data")
+ for data_item_data in _data:
+ data_item = V1EmbeddingsCreateResponse200DataItem.from_dict(data_item_data)
+
+ data.append(data_item)
+
+ model = d.pop("model")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ _usage = d.pop("usage", UNSET)
+ usage: Union[Unset, V1EmbeddingsCreateResponse200Usage]
+ if isinstance(_usage, Unset):
+ usage = UNSET
+ else:
+ usage = V1EmbeddingsCreateResponse200Usage.from_dict(_usage)
+
+ v1_embeddings_create_response_200 = cls(
+ data=data,
+ model=model,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ usage=usage,
+ )
+
+ v1_embeddings_create_response_200.additional_properties = d
+ return v1_embeddings_create_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_200_data_item.py b/premai/models/v1_embeddings_create_response_200_data_item.py
new file mode 100644
index 0000000..1eb3a39
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_200_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type, cast
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse200DataItem")
+
+
+class V1EmbeddingsCreateResponse200DataItemDict(TypedDict):
+ index: int
+ embedding: List[float]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse200DataItem:
+ """
+ Attributes:
+ index (int): The index of the token in the input.
+ embedding (List[float]): The embedding for the input.
+ """
+
+ index: int
+ embedding: List[float]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ index = self.index
+
+ embedding = self.embedding
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "index": index,
+ "embedding": embedding,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ index = d.pop("index")
+
+ embedding = cast(List[float], d.pop("embedding"))
+
+ v1_embeddings_create_response_200_data_item = cls(
+ index=index,
+ embedding=embedding,
+ )
+
+ v1_embeddings_create_response_200_data_item.additional_properties = d
+ return v1_embeddings_create_response_200_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_200_usage.py b/premai/models/v1_embeddings_create_response_200_usage.py
new file mode 100644
index 0000000..541be6d
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_200_usage.py
@@ -0,0 +1,86 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse200Usage")
+
+
+class V1EmbeddingsCreateResponse200UsageDict(TypedDict):
+ completion_tokens: NotRequired[Union[Unset, int]]
+ prompt_tokens: NotRequired[Union[Unset, int]]
+ total_tokens: NotRequired[Union[Unset, int]]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse200Usage:
+ """The usage statistics for the completion.
+
+ Attributes:
+ completion_tokens (Union[Unset, int]):
+ prompt_tokens (Union[Unset, int]):
+ total_tokens (Union[Unset, int]):
+ """
+
+ completion_tokens: Union[Unset, int] = UNSET
+ prompt_tokens: Union[Unset, int] = UNSET
+ total_tokens: Union[Unset, int] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ completion_tokens = self.completion_tokens
+
+ prompt_tokens = self.prompt_tokens
+
+ total_tokens = self.total_tokens
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+ if completion_tokens is not UNSET:
+ field_dict["completion_tokens"] = completion_tokens
+ if prompt_tokens is not UNSET:
+ field_dict["prompt_tokens"] = prompt_tokens
+ if total_tokens is not UNSET:
+ field_dict["total_tokens"] = total_tokens
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ completion_tokens = d.pop("completion_tokens", UNSET)
+
+ prompt_tokens = d.pop("prompt_tokens", UNSET)
+
+ total_tokens = d.pop("total_tokens", UNSET)
+
+ v1_embeddings_create_response_200_usage = cls(
+ completion_tokens=completion_tokens,
+ prompt_tokens=prompt_tokens,
+ total_tokens=total_tokens,
+ )
+
+ v1_embeddings_create_response_200_usage.additional_properties = d
+ return v1_embeddings_create_response_200_usage
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_400.py b/premai/models/v1_embeddings_create_response_400.py
new file mode 100644
index 0000000..1636fc6
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_400.py
@@ -0,0 +1,88 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_400_code import V1EmbeddingsCreateResponse400Code
+from ..models.v1_embeddings_create_response_400_details import V1EmbeddingsCreateResponse400Details
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse400")
+
+
+class V1EmbeddingsCreateResponse400Dict(TypedDict):
+ message: str
+ details: "V1EmbeddingsCreateResponse400Details"
+ code: V1EmbeddingsCreateResponse400Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse400:
+ """
+ Attributes:
+ message (str): A description of the validation error.
+ details (V1EmbeddingsCreateResponse400Details): Detailed information about the validation errors.
+ code (V1EmbeddingsCreateResponse400Code): * `ValidationError` - ValidationError
+ """
+
+ message: str
+ details: "V1EmbeddingsCreateResponse400Details"
+ code: V1EmbeddingsCreateResponse400Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ details = self.details.to_dict()
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "details": details,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_response_400_details import V1EmbeddingsCreateResponse400Details
+
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ details = V1EmbeddingsCreateResponse400Details.from_dict(d.pop("details"))
+
+ code = V1EmbeddingsCreateResponse400Code(d.pop("code"))
+
+ v1_embeddings_create_response_400 = cls(
+ message=message,
+ details=details,
+ code=code,
+ )
+
+ v1_embeddings_create_response_400.additional_properties = d
+ return v1_embeddings_create_response_400
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_400_code.py b/premai/models/v1_embeddings_create_response_400_code.py
new file mode 100644
index 0000000..fd6dc01
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_400_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse400Code(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_400_details.py b/premai/models/v1_embeddings_create_response_400_details.py
new file mode 100644
index 0000000..66a866e
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_400_details.py
@@ -0,0 +1,66 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_400_details_additional_property import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalProperty,
+)
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse400Details")
+
+
+class V1EmbeddingsCreateResponse400DetailsDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse400Details:
+ """Detailed information about the validation errors."""
+
+ additional_properties: Dict[str, "V1EmbeddingsCreateResponse400DetailsAdditionalProperty"] = _attrs_field(
+ init=False, factory=dict
+ )
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ for prop_name, prop in self.additional_properties.items():
+ field_dict[prop_name] = prop.to_dict()
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_response_400_details_additional_property import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalProperty,
+ )
+
+ d = src_dict.copy()
+ v1_embeddings_create_response_400_details = cls()
+
+ additional_properties = {}
+ for prop_name, prop_dict in d.items():
+ additional_property = V1EmbeddingsCreateResponse400DetailsAdditionalProperty.from_dict(prop_dict)
+
+ additional_properties[prop_name] = additional_property
+
+ v1_embeddings_create_response_400_details.additional_properties = additional_properties
+ return v1_embeddings_create_response_400_details
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> "V1EmbeddingsCreateResponse400DetailsAdditionalProperty":
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: "V1EmbeddingsCreateResponse400DetailsAdditionalProperty") -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_400_details_additional_property.py b/premai/models/v1_embeddings_create_response_400_details_additional_property.py
new file mode 100644
index 0000000..3f23d4b
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_400_details_additional_property.py
@@ -0,0 +1,84 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_400_details_additional_property_error_messages_item import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse400DetailsAdditionalProperty")
+
+
+class V1EmbeddingsCreateResponse400DetailsAdditionalPropertyDict(TypedDict):
+ error_messages: List["V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse400DetailsAdditionalProperty:
+ """
+ Attributes:
+ error_messages (List['V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem']): Error messages
+ for the field.
+ """
+
+ error_messages: List["V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_embeddings_create_response_400_details_additional_property_error_messages_item import (
+ V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+ )
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem.from_dict(
+ error_messages_item_data
+ )
+
+ error_messages.append(error_messages_item)
+
+ v1_embeddings_create_response_400_details_additional_property = cls(
+ error_messages=error_messages,
+ )
+
+ v1_embeddings_create_response_400_details_additional_property.additional_properties = d
+ return v1_embeddings_create_response_400_details_additional_property
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_400_details_additional_property_error_messages_item.py b/premai/models/v1_embeddings_create_response_400_details_additional_property_error_messages_item.py
new file mode 100644
index 0000000..82c74b4
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_400_details_additional_property_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem")
+
+
+class V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse400DetailsAdditionalPropertyErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_embeddings_create_response_400_details_additional_property_error_messages_item = cls()
+
+ v1_embeddings_create_response_400_details_additional_property_error_messages_item.additional_properties = d
+ return v1_embeddings_create_response_400_details_additional_property_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_401.py b/premai/models/v1_embeddings_create_response_401.py
new file mode 100644
index 0000000..fb8e08c
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_401.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_401_code import V1EmbeddingsCreateResponse401Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse401")
+
+
+class V1EmbeddingsCreateResponse401Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse401Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse401:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse401Code): * `AuthenticationError` - AuthenticationError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse401Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse401Code(d.pop("code"))
+
+ v1_embeddings_create_response_401 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_401.additional_properties = d
+ return v1_embeddings_create_response_401
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_401_code.py b/premai/models/v1_embeddings_create_response_401_code.py
new file mode 100644
index 0000000..1e12c8f
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_401_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse401Code(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_403.py b/premai/models/v1_embeddings_create_response_403.py
new file mode 100644
index 0000000..5689f14
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_403.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_403_code import V1EmbeddingsCreateResponse403Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse403")
+
+
+class V1EmbeddingsCreateResponse403Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse403Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse403:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse403Code): * `PermissionDeniedError` - PermissionDeniedError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse403Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse403Code(d.pop("code"))
+
+ v1_embeddings_create_response_403 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_403.additional_properties = d
+ return v1_embeddings_create_response_403
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_403_code.py b/premai/models/v1_embeddings_create_response_403_code.py
new file mode 100644
index 0000000..8bdd7cc
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_403_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse403Code(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_404_type_0.py b/premai/models/v1_embeddings_create_response_404_type_0.py
new file mode 100644
index 0000000..6659d4b
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_404_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_404_type_0_code import V1EmbeddingsCreateResponse404Type0Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse404Type0")
+
+
+class V1EmbeddingsCreateResponse404Type0Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse404Type0Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse404Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse404Type0Code): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse404Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse404Type0Code(d.pop("code"))
+
+ v1_embeddings_create_response_404_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_404_type_0.additional_properties = d
+ return v1_embeddings_create_response_404_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_404_type_0_code.py b/premai/models/v1_embeddings_create_response_404_type_0_code.py
new file mode 100644
index 0000000..2284884
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_404_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse404Type0Code(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_404_type_1.py b/premai/models/v1_embeddings_create_response_404_type_1.py
new file mode 100644
index 0000000..726bc30
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_404_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_404_type_1_code import V1EmbeddingsCreateResponse404Type1Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse404Type1")
+
+
+class V1EmbeddingsCreateResponse404Type1Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse404Type1Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse404Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse404Type1Code): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse404Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse404Type1Code(d.pop("code"))
+
+ v1_embeddings_create_response_404_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_404_type_1.additional_properties = d
+ return v1_embeddings_create_response_404_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_404_type_1_code.py b/premai/models/v1_embeddings_create_response_404_type_1_code.py
new file mode 100644
index 0000000..4daf380
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_404_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse404Type1Code(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_409.py b/premai/models/v1_embeddings_create_response_409.py
new file mode 100644
index 0000000..078bd71
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_409.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_409_code import V1EmbeddingsCreateResponse409Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse409")
+
+
+class V1EmbeddingsCreateResponse409Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse409Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse409:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse409Code): * `ConflictError` - ConflictError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse409Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse409Code(d.pop("code"))
+
+ v1_embeddings_create_response_409 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_409.additional_properties = d
+ return v1_embeddings_create_response_409
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_409_code.py b/premai/models/v1_embeddings_create_response_409_code.py
new file mode 100644
index 0000000..d45e468
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_409_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse409Code(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_422.py b/premai/models/v1_embeddings_create_response_422.py
new file mode 100644
index 0000000..2d28641
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_422.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_422_code import V1EmbeddingsCreateResponse422Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse422")
+
+
+class V1EmbeddingsCreateResponse422Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse422Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse422:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse422Code): * `UnprocessableEntityError` - UnprocessableEntityError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse422Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse422Code(d.pop("code"))
+
+ v1_embeddings_create_response_422 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_422.additional_properties = d
+ return v1_embeddings_create_response_422
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_422_code.py b/premai/models/v1_embeddings_create_response_422_code.py
new file mode 100644
index 0000000..7d02e1e
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_422_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse422Code(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_429.py b/premai/models/v1_embeddings_create_response_429.py
new file mode 100644
index 0000000..9c22bfc
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_429.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_429_code import V1EmbeddingsCreateResponse429Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse429")
+
+
+class V1EmbeddingsCreateResponse429Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse429Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse429:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse429Code): * `RateLimitError` - RateLimitError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse429Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse429Code(d.pop("code"))
+
+ v1_embeddings_create_response_429 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_429.additional_properties = d
+ return v1_embeddings_create_response_429
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_429_code.py b/premai/models/v1_embeddings_create_response_429_code.py
new file mode 100644
index 0000000..4d6c1e2
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_429_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse429Code(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_0.py b/premai/models/v1_embeddings_create_response_500_type_0.py
new file mode 100644
index 0000000..746f54e
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_0_code import V1EmbeddingsCreateResponse500Type0Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type0")
+
+
+class V1EmbeddingsCreateResponse500Type0Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type0Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type0Code): * `ProviderInternalServerError` - ProviderInternalServerError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type0Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_0.additional_properties = d
+ return v1_embeddings_create_response_500_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_0_code.py b/premai/models/v1_embeddings_create_response_500_type_0_code.py
new file mode 100644
index 0000000..347be0b
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type0Code(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_1.py b/premai/models/v1_embeddings_create_response_500_type_1.py
new file mode 100644
index 0000000..7f5ee70
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_1_code import V1EmbeddingsCreateResponse500Type1Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type1")
+
+
+class V1EmbeddingsCreateResponse500Type1Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type1Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type1Code): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type1Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_1.additional_properties = d
+ return v1_embeddings_create_response_500_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_1_code.py b/premai/models/v1_embeddings_create_response_500_type_1_code.py
new file mode 100644
index 0000000..517a8b9
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type1Code(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_2.py b/premai/models/v1_embeddings_create_response_500_type_2.py
new file mode 100644
index 0000000..2426e19
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_2.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_2_code import V1EmbeddingsCreateResponse500Type2Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type2")
+
+
+class V1EmbeddingsCreateResponse500Type2Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type2Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type2:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type2Code): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type2Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type2Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_2 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_2.additional_properties = d
+ return v1_embeddings_create_response_500_type_2
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_2_code.py b/premai/models/v1_embeddings_create_response_500_type_2_code.py
new file mode 100644
index 0000000..ad3252f
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_2_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type2Code(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_3.py b/premai/models/v1_embeddings_create_response_500_type_3.py
new file mode 100644
index 0000000..1bafd5f
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_3.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_3_code import V1EmbeddingsCreateResponse500Type3Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type3")
+
+
+class V1EmbeddingsCreateResponse500Type3Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type3Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type3:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type3Code): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type3Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type3Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_3 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_3.additional_properties = d
+ return v1_embeddings_create_response_500_type_3
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_3_code.py b/premai/models/v1_embeddings_create_response_500_type_3_code.py
new file mode 100644
index 0000000..1ef19bd
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_3_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type3Code(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_4.py b/premai/models/v1_embeddings_create_response_500_type_4.py
new file mode 100644
index 0000000..4f3fa81
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_4.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_4_code import V1EmbeddingsCreateResponse500Type4Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type4")
+
+
+class V1EmbeddingsCreateResponse500Type4Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type4Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type4:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type4Code): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type4Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type4Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_4 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_4.additional_properties = d
+ return v1_embeddings_create_response_500_type_4
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_4_code.py b/premai/models/v1_embeddings_create_response_500_type_4_code.py
new file mode 100644
index 0000000..10239be
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_4_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type4Code(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_embeddings_create_response_500_type_5.py b/premai/models/v1_embeddings_create_response_500_type_5.py
new file mode 100644
index 0000000..df213de
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_5.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_embeddings_create_response_500_type_5_code import V1EmbeddingsCreateResponse500Type5Code
+
+T = TypeVar("T", bound="V1EmbeddingsCreateResponse500Type5")
+
+
+class V1EmbeddingsCreateResponse500Type5Dict(TypedDict):
+ message: str
+ code: V1EmbeddingsCreateResponse500Type5Code
+ pass
+
+
+@_attrs_define
+class V1EmbeddingsCreateResponse500Type5:
+ """
+ Attributes:
+ message (str):
+ code (V1EmbeddingsCreateResponse500Type5Code): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: V1EmbeddingsCreateResponse500Type5Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1EmbeddingsCreateResponse500Type5Code(d.pop("code"))
+
+ v1_embeddings_create_response_500_type_5 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_embeddings_create_response_500_type_5.additional_properties = d
+ return v1_embeddings_create_response_500_type_5
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_embeddings_create_response_500_type_5_code.py b/premai/models/v1_embeddings_create_response_500_type_5_code.py
new file mode 100644
index 0000000..d306ab3
--- /dev/null
+++ b/premai/models/v1_embeddings_create_response_500_type_5_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1EmbeddingsCreateResponse500Type5Code(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_data_body.py b/premai/models/v1_finetuning_create_data_body.py
new file mode 100644
index 0000000..43d34b6
--- /dev/null
+++ b/premai/models/v1_finetuning_create_data_body.py
@@ -0,0 +1,133 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_data_body_training_data_item import V1FinetuningCreateDataBodyTrainingDataItem
+from ..models.v1_finetuning_create_data_body_validaton_data_item import V1FinetuningCreateDataBodyValidatonDataItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1FinetuningCreateDataBody")
+
+
+class V1FinetuningCreateDataBodyDict(TypedDict):
+ project_id: int
+ training_data: List["V1FinetuningCreateDataBodyTrainingDataItem"]
+ model: NotRequired[Union[Unset, str]]
+ validaton_data: NotRequired[Union[Unset, List["V1FinetuningCreateDataBodyValidatonDataItem"]]]
+ num_epochs: Union[Unset, int] = 1
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateDataBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ training_data (List['V1FinetuningCreateDataBodyTrainingDataItem']): The training file.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ validaton_data (Union[Unset, List['V1FinetuningCreateDataBodyValidatonDataItem']]): The training file.
+ num_epochs (Union[Unset, int]): The number of epochs to train for. Default: 1.
+ """
+
+ project_id: int
+ training_data: List["V1FinetuningCreateDataBodyTrainingDataItem"]
+ model: Union[Unset, str] = UNSET
+ validaton_data: Union[Unset, List["V1FinetuningCreateDataBodyValidatonDataItem"]] = UNSET
+ num_epochs: Union[Unset, int] = 1
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ training_data = []
+ for training_data_item_data in self.training_data:
+ training_data_item = training_data_item_data.to_dict()
+ training_data.append(training_data_item)
+
+ model = self.model
+
+ validaton_data: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.validaton_data, Unset):
+ validaton_data = []
+ for validaton_data_item_data in self.validaton_data:
+ validaton_data_item = validaton_data_item_data.to_dict()
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = self.num_epochs
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "training_data": training_data,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if validaton_data is not UNSET:
+ field_dict["validaton_data"] = validaton_data
+ if num_epochs is not UNSET:
+ field_dict["num_epochs"] = num_epochs
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_data_body_training_data_item import (
+ V1FinetuningCreateDataBodyTrainingDataItem,
+ )
+ from ..models.v1_finetuning_create_data_body_validaton_data_item import (
+ V1FinetuningCreateDataBodyValidatonDataItem,
+ )
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ training_data = []
+ _training_data = d.pop("training_data")
+ for training_data_item_data in _training_data:
+ training_data_item = V1FinetuningCreateDataBodyTrainingDataItem.from_dict(training_data_item_data)
+
+ training_data.append(training_data_item)
+
+ model = d.pop("model", UNSET)
+
+ validaton_data = []
+ _validaton_data = d.pop("validaton_data", UNSET)
+ for validaton_data_item_data in _validaton_data or []:
+ validaton_data_item = V1FinetuningCreateDataBodyValidatonDataItem.from_dict(validaton_data_item_data)
+
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = d.pop("num_epochs", UNSET)
+
+ v1_finetuning_create_data_body = cls(
+ project_id=project_id,
+ training_data=training_data,
+ model=model,
+ validaton_data=validaton_data,
+ num_epochs=num_epochs,
+ )
+
+ v1_finetuning_create_data_body.additional_properties = d
+ return v1_finetuning_create_data_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_data_body_training_data_item.py b/premai/models/v1_finetuning_create_data_body_training_data_item.py
new file mode 100644
index 0000000..179cf72
--- /dev/null
+++ b/premai/models/v1_finetuning_create_data_body_training_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateDataBodyTrainingDataItem")
+
+
+class V1FinetuningCreateDataBodyTrainingDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateDataBodyTrainingDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_data_body_training_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_data_body_training_data_item.additional_properties = d
+ return v1_finetuning_create_data_body_training_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_data_body_validaton_data_item.py b/premai/models/v1_finetuning_create_data_body_validaton_data_item.py
new file mode 100644
index 0000000..6b8b1ca
--- /dev/null
+++ b/premai/models/v1_finetuning_create_data_body_validaton_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateDataBodyValidatonDataItem")
+
+
+class V1FinetuningCreateDataBodyValidatonDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateDataBodyValidatonDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_data_body_validaton_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_data_body_validaton_data_item.additional_properties = d
+ return v1_finetuning_create_data_body_validaton_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_files_body.py b/premai/models/v1_finetuning_create_files_body.py
new file mode 100644
index 0000000..f40d39c
--- /dev/null
+++ b/premai/models/v1_finetuning_create_files_body.py
@@ -0,0 +1,182 @@
+import json
+from typing import Dict, List, Tuple, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_files_body_training_data_item import V1FinetuningCreateFilesBodyTrainingDataItem
+from ..models.v1_finetuning_create_files_body_validaton_data_item import V1FinetuningCreateFilesBodyValidatonDataItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1FinetuningCreateFilesBody")
+
+
+class V1FinetuningCreateFilesBodyDict(TypedDict):
+ project_id: int
+ training_data: List["V1FinetuningCreateFilesBodyTrainingDataItem"]
+ model: NotRequired[Union[Unset, str]]
+ validaton_data: NotRequired[Union[Unset, List["V1FinetuningCreateFilesBodyValidatonDataItem"]]]
+ num_epochs: Union[Unset, int] = 1
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateFilesBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ training_data (List['V1FinetuningCreateFilesBodyTrainingDataItem']): The training file.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ validaton_data (Union[Unset, List['V1FinetuningCreateFilesBodyValidatonDataItem']]): The training file.
+ num_epochs (Union[Unset, int]): The number of epochs to train for. Default: 1.
+ """
+
+ project_id: int
+ training_data: List["V1FinetuningCreateFilesBodyTrainingDataItem"]
+ model: Union[Unset, str] = UNSET
+ validaton_data: Union[Unset, List["V1FinetuningCreateFilesBodyValidatonDataItem"]] = UNSET
+ num_epochs: Union[Unset, int] = 1
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ training_data = []
+ for training_data_item_data in self.training_data:
+ training_data_item = training_data_item_data.to_dict()
+ training_data.append(training_data_item)
+
+ model = self.model
+
+ validaton_data: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.validaton_data, Unset):
+ validaton_data = []
+ for validaton_data_item_data in self.validaton_data:
+ validaton_data_item = validaton_data_item_data.to_dict()
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = self.num_epochs
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "training_data": training_data,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if validaton_data is not UNSET:
+ field_dict["validaton_data"] = validaton_data
+ if num_epochs is not UNSET:
+ field_dict["num_epochs"] = num_epochs
+
+ return field_dict
+
+ def to_multipart(self) -> Dict[str, Any]:
+ project_id = (
+ self.project_id
+ if isinstance(self.project_id, Unset)
+ else (None, str(self.project_id).encode(), "text/plain")
+ )
+
+ _temp_training_data = []
+ for training_data_item_data in self.training_data:
+ training_data_item = training_data_item_data.to_dict()
+ _temp_training_data.append(training_data_item)
+ training_data = (None, json.dumps(_temp_training_data).encode(), "application/json")
+
+ model = self.model if isinstance(self.model, Unset) else (None, str(self.model).encode(), "text/plain")
+
+ validaton_data: Union[Unset, Tuple[None, bytes, str]] = UNSET
+ if not isinstance(self.validaton_data, Unset):
+ _temp_validaton_data = []
+ for validaton_data_item_data in self.validaton_data:
+ validaton_data_item = validaton_data_item_data.to_dict()
+ _temp_validaton_data.append(validaton_data_item)
+ validaton_data = (None, json.dumps(_temp_validaton_data).encode(), "application/json")
+
+ num_epochs = (
+ self.num_epochs
+ if isinstance(self.num_epochs, Unset)
+ else (None, str(self.num_epochs).encode(), "text/plain")
+ )
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(
+ {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
+ )
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "training_data": training_data,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if validaton_data is not UNSET:
+ field_dict["validaton_data"] = validaton_data
+ if num_epochs is not UNSET:
+ field_dict["num_epochs"] = num_epochs
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_files_body_training_data_item import (
+ V1FinetuningCreateFilesBodyTrainingDataItem,
+ )
+ from ..models.v1_finetuning_create_files_body_validaton_data_item import (
+ V1FinetuningCreateFilesBodyValidatonDataItem,
+ )
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ training_data = []
+ _training_data = d.pop("training_data")
+ for training_data_item_data in _training_data:
+ training_data_item = V1FinetuningCreateFilesBodyTrainingDataItem.from_dict(training_data_item_data)
+
+ training_data.append(training_data_item)
+
+ model = d.pop("model", UNSET)
+
+ validaton_data = []
+ _validaton_data = d.pop("validaton_data", UNSET)
+ for validaton_data_item_data in _validaton_data or []:
+ validaton_data_item = V1FinetuningCreateFilesBodyValidatonDataItem.from_dict(validaton_data_item_data)
+
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = d.pop("num_epochs", UNSET)
+
+ v1_finetuning_create_files_body = cls(
+ project_id=project_id,
+ training_data=training_data,
+ model=model,
+ validaton_data=validaton_data,
+ num_epochs=num_epochs,
+ )
+
+ v1_finetuning_create_files_body.additional_properties = d
+ return v1_finetuning_create_files_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_files_body_training_data_item.py b/premai/models/v1_finetuning_create_files_body_training_data_item.py
new file mode 100644
index 0000000..6927f07
--- /dev/null
+++ b/premai/models/v1_finetuning_create_files_body_training_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateFilesBodyTrainingDataItem")
+
+
+class V1FinetuningCreateFilesBodyTrainingDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateFilesBodyTrainingDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_files_body_training_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_files_body_training_data_item.additional_properties = d
+ return v1_finetuning_create_files_body_training_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_files_body_validaton_data_item.py b/premai/models/v1_finetuning_create_files_body_validaton_data_item.py
new file mode 100644
index 0000000..385df4d
--- /dev/null
+++ b/premai/models/v1_finetuning_create_files_body_validaton_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateFilesBodyValidatonDataItem")
+
+
+class V1FinetuningCreateFilesBodyValidatonDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateFilesBodyValidatonDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_files_body_validaton_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_files_body_validaton_data_item.additional_properties = d
+ return v1_finetuning_create_files_body_validaton_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_json_body.py b/premai/models/v1_finetuning_create_json_body.py
new file mode 100644
index 0000000..cce03ea
--- /dev/null
+++ b/premai/models/v1_finetuning_create_json_body.py
@@ -0,0 +1,133 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_json_body_training_data_item import V1FinetuningCreateJsonBodyTrainingDataItem
+from ..models.v1_finetuning_create_json_body_validaton_data_item import V1FinetuningCreateJsonBodyValidatonDataItem
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1FinetuningCreateJsonBody")
+
+
+class V1FinetuningCreateJsonBodyDict(TypedDict):
+ project_id: int
+ training_data: List["V1FinetuningCreateJsonBodyTrainingDataItem"]
+ model: NotRequired[Union[Unset, str]]
+ validaton_data: NotRequired[Union[Unset, List["V1FinetuningCreateJsonBodyValidatonDataItem"]]]
+ num_epochs: Union[Unset, int] = 1
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateJsonBody:
+ """
+ Attributes:
+ project_id (int): The ID of the project to use.
+ training_data (List['V1FinetuningCreateJsonBodyTrainingDataItem']): The training file.
+ model (Union[Unset, str]): ID of the model to use. See the model endpoint compatibility table for details.
+ validaton_data (Union[Unset, List['V1FinetuningCreateJsonBodyValidatonDataItem']]): The training file.
+ num_epochs (Union[Unset, int]): The number of epochs to train for. Default: 1.
+ """
+
+ project_id: int
+ training_data: List["V1FinetuningCreateJsonBodyTrainingDataItem"]
+ model: Union[Unset, str] = UNSET
+ validaton_data: Union[Unset, List["V1FinetuningCreateJsonBodyValidatonDataItem"]] = UNSET
+ num_epochs: Union[Unset, int] = 1
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ project_id = self.project_id
+
+ training_data = []
+ for training_data_item_data in self.training_data:
+ training_data_item = training_data_item_data.to_dict()
+ training_data.append(training_data_item)
+
+ model = self.model
+
+ validaton_data: Union[Unset, List[Dict[str, Any]]] = UNSET
+ if not isinstance(self.validaton_data, Unset):
+ validaton_data = []
+ for validaton_data_item_data in self.validaton_data:
+ validaton_data_item = validaton_data_item_data.to_dict()
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = self.num_epochs
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "project_id": project_id,
+ "training_data": training_data,
+ }
+ )
+ if model is not UNSET:
+ field_dict["model"] = model
+ if validaton_data is not UNSET:
+ field_dict["validaton_data"] = validaton_data
+ if num_epochs is not UNSET:
+ field_dict["num_epochs"] = num_epochs
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_json_body_training_data_item import (
+ V1FinetuningCreateJsonBodyTrainingDataItem,
+ )
+ from ..models.v1_finetuning_create_json_body_validaton_data_item import (
+ V1FinetuningCreateJsonBodyValidatonDataItem,
+ )
+
+ d = src_dict.copy()
+ project_id = d.pop("project_id")
+
+ training_data = []
+ _training_data = d.pop("training_data")
+ for training_data_item_data in _training_data:
+ training_data_item = V1FinetuningCreateJsonBodyTrainingDataItem.from_dict(training_data_item_data)
+
+ training_data.append(training_data_item)
+
+ model = d.pop("model", UNSET)
+
+ validaton_data = []
+ _validaton_data = d.pop("validaton_data", UNSET)
+ for validaton_data_item_data in _validaton_data or []:
+ validaton_data_item = V1FinetuningCreateJsonBodyValidatonDataItem.from_dict(validaton_data_item_data)
+
+ validaton_data.append(validaton_data_item)
+
+ num_epochs = d.pop("num_epochs", UNSET)
+
+ v1_finetuning_create_json_body = cls(
+ project_id=project_id,
+ training_data=training_data,
+ model=model,
+ validaton_data=validaton_data,
+ num_epochs=num_epochs,
+ )
+
+ v1_finetuning_create_json_body.additional_properties = d
+ return v1_finetuning_create_json_body
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_json_body_training_data_item.py b/premai/models/v1_finetuning_create_json_body_training_data_item.py
new file mode 100644
index 0000000..45e9cf0
--- /dev/null
+++ b/premai/models/v1_finetuning_create_json_body_training_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateJsonBodyTrainingDataItem")
+
+
+class V1FinetuningCreateJsonBodyTrainingDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateJsonBodyTrainingDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_json_body_training_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_json_body_training_data_item.additional_properties = d
+ return v1_finetuning_create_json_body_training_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_json_body_validaton_data_item.py b/premai/models/v1_finetuning_create_json_body_validaton_data_item.py
new file mode 100644
index 0000000..bf62013
--- /dev/null
+++ b/premai/models/v1_finetuning_create_json_body_validaton_data_item.py
@@ -0,0 +1,74 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateJsonBodyValidatonDataItem")
+
+
+class V1FinetuningCreateJsonBodyValidatonDataItemDict(TypedDict):
+ input_: str
+ output: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateJsonBodyValidatonDataItem:
+ """
+ Attributes:
+ input_ (str): The input text.
+ output (str): The output text.
+ """
+
+ input_: str
+ output: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ input_ = self.input_
+
+ output = self.output
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "input": input_,
+ "output": output,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ input_ = d.pop("input")
+
+ output = d.pop("output")
+
+ v1_finetuning_create_json_body_validaton_data_item = cls(
+ input_=input_,
+ output=output,
+ )
+
+ v1_finetuning_create_json_body_validaton_data_item.additional_properties = d
+ return v1_finetuning_create_json_body_validaton_data_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_200.py b/premai/models/v1_finetuning_create_response_200.py
new file mode 100644
index 0000000..dbaeade
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_200.py
@@ -0,0 +1,65 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse200")
+
+
+class V1FinetuningCreateResponse200Dict(TypedDict):
+ job_id: str
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse200:
+ """
+ Attributes:
+ job_id (str): The ID of the fine-tuning job.
+ """
+
+ job_id: str
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ job_id = self.job_id
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "job_id": job_id,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ job_id = d.pop("job_id")
+
+ v1_finetuning_create_response_200 = cls(
+ job_id=job_id,
+ )
+
+ v1_finetuning_create_response_200.additional_properties = d
+ return v1_finetuning_create_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_400.py b/premai/models/v1_finetuning_create_response_400.py
new file mode 100644
index 0000000..79be089
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_400.py
@@ -0,0 +1,88 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_400_code import V1FinetuningCreateResponse400Code
+from ..models.v1_finetuning_create_response_400_details import V1FinetuningCreateResponse400Details
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse400")
+
+
+class V1FinetuningCreateResponse400Dict(TypedDict):
+ message: str
+ details: "V1FinetuningCreateResponse400Details"
+ code: V1FinetuningCreateResponse400Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse400:
+ """
+ Attributes:
+ message (str): A description of the validation error.
+ details (V1FinetuningCreateResponse400Details): Detailed information about the validation errors.
+ code (V1FinetuningCreateResponse400Code): * `ValidationError` - ValidationError
+ """
+
+ message: str
+ details: "V1FinetuningCreateResponse400Details"
+ code: V1FinetuningCreateResponse400Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ details = self.details.to_dict()
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "details": details,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_response_400_details import V1FinetuningCreateResponse400Details
+
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ details = V1FinetuningCreateResponse400Details.from_dict(d.pop("details"))
+
+ code = V1FinetuningCreateResponse400Code(d.pop("code"))
+
+ v1_finetuning_create_response_400 = cls(
+ message=message,
+ details=details,
+ code=code,
+ )
+
+ v1_finetuning_create_response_400.additional_properties = d
+ return v1_finetuning_create_response_400
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_400_code.py b/premai/models/v1_finetuning_create_response_400_code.py
new file mode 100644
index 0000000..401ca4d
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_400_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse400Code(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_400_details.py b/premai/models/v1_finetuning_create_response_400_details.py
new file mode 100644
index 0000000..61a7747
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_400_details.py
@@ -0,0 +1,66 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_400_details_additional_property import (
+ V1FinetuningCreateResponse400DetailsAdditionalProperty,
+)
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse400Details")
+
+
+class V1FinetuningCreateResponse400DetailsDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse400Details:
+ """Detailed information about the validation errors."""
+
+ additional_properties: Dict[str, "V1FinetuningCreateResponse400DetailsAdditionalProperty"] = _attrs_field(
+ init=False, factory=dict
+ )
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ for prop_name, prop in self.additional_properties.items():
+ field_dict[prop_name] = prop.to_dict()
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_response_400_details_additional_property import (
+ V1FinetuningCreateResponse400DetailsAdditionalProperty,
+ )
+
+ d = src_dict.copy()
+ v1_finetuning_create_response_400_details = cls()
+
+ additional_properties = {}
+ for prop_name, prop_dict in d.items():
+ additional_property = V1FinetuningCreateResponse400DetailsAdditionalProperty.from_dict(prop_dict)
+
+ additional_properties[prop_name] = additional_property
+
+ v1_finetuning_create_response_400_details.additional_properties = additional_properties
+ return v1_finetuning_create_response_400_details
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> "V1FinetuningCreateResponse400DetailsAdditionalProperty":
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: "V1FinetuningCreateResponse400DetailsAdditionalProperty") -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_400_details_additional_property.py b/premai/models/v1_finetuning_create_response_400_details_additional_property.py
new file mode 100644
index 0000000..463b592
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_400_details_additional_property.py
@@ -0,0 +1,84 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse400DetailsAdditionalProperty")
+
+
+class V1FinetuningCreateResponse400DetailsAdditionalPropertyDict(TypedDict):
+ error_messages: List["V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse400DetailsAdditionalProperty:
+ """
+ Attributes:
+ error_messages (List['V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem']): Error messages
+ for the field.
+ """
+
+ error_messages: List["V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_create_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem,
+ )
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem.from_dict(
+ error_messages_item_data
+ )
+
+ error_messages.append(error_messages_item)
+
+ v1_finetuning_create_response_400_details_additional_property = cls(
+ error_messages=error_messages,
+ )
+
+ v1_finetuning_create_response_400_details_additional_property.additional_properties = d
+ return v1_finetuning_create_response_400_details_additional_property
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_400_details_additional_property_error_messages_item.py b/premai/models/v1_finetuning_create_response_400_details_additional_property_error_messages_item.py
new file mode 100644
index 0000000..eece868
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_400_details_additional_property_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem")
+
+
+class V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse400DetailsAdditionalPropertyErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_finetuning_create_response_400_details_additional_property_error_messages_item = cls()
+
+ v1_finetuning_create_response_400_details_additional_property_error_messages_item.additional_properties = d
+ return v1_finetuning_create_response_400_details_additional_property_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_401.py b/premai/models/v1_finetuning_create_response_401.py
new file mode 100644
index 0000000..4d5e95e
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_401.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_401_code import V1FinetuningCreateResponse401Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse401")
+
+
+class V1FinetuningCreateResponse401Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse401Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse401:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse401Code): * `AuthenticationError` - AuthenticationError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse401Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse401Code(d.pop("code"))
+
+ v1_finetuning_create_response_401 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_401.additional_properties = d
+ return v1_finetuning_create_response_401
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_401_code.py b/premai/models/v1_finetuning_create_response_401_code.py
new file mode 100644
index 0000000..cd14ac0
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_401_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse401Code(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_403.py b/premai/models/v1_finetuning_create_response_403.py
new file mode 100644
index 0000000..7dc7b14
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_403.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_403_code import V1FinetuningCreateResponse403Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse403")
+
+
+class V1FinetuningCreateResponse403Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse403Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse403:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse403Code): * `PermissionDeniedError` - PermissionDeniedError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse403Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse403Code(d.pop("code"))
+
+ v1_finetuning_create_response_403 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_403.additional_properties = d
+ return v1_finetuning_create_response_403
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_403_code.py b/premai/models/v1_finetuning_create_response_403_code.py
new file mode 100644
index 0000000..950f602
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_403_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse403Code(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_404_type_0.py b/premai/models/v1_finetuning_create_response_404_type_0.py
new file mode 100644
index 0000000..27f294c
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_404_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_404_type_0_code import V1FinetuningCreateResponse404Type0Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse404Type0")
+
+
+class V1FinetuningCreateResponse404Type0Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse404Type0Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse404Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse404Type0Code): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse404Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse404Type0Code(d.pop("code"))
+
+ v1_finetuning_create_response_404_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_404_type_0.additional_properties = d
+ return v1_finetuning_create_response_404_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_404_type_0_code.py b/premai/models/v1_finetuning_create_response_404_type_0_code.py
new file mode 100644
index 0000000..8366135
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_404_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse404Type0Code(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_404_type_1.py b/premai/models/v1_finetuning_create_response_404_type_1.py
new file mode 100644
index 0000000..17a23d8
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_404_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_404_type_1_code import V1FinetuningCreateResponse404Type1Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse404Type1")
+
+
+class V1FinetuningCreateResponse404Type1Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse404Type1Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse404Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse404Type1Code): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse404Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse404Type1Code(d.pop("code"))
+
+ v1_finetuning_create_response_404_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_404_type_1.additional_properties = d
+ return v1_finetuning_create_response_404_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_404_type_1_code.py b/premai/models/v1_finetuning_create_response_404_type_1_code.py
new file mode 100644
index 0000000..18f8794
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_404_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse404Type1Code(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_409.py b/premai/models/v1_finetuning_create_response_409.py
new file mode 100644
index 0000000..450e0c3
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_409.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_409_code import V1FinetuningCreateResponse409Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse409")
+
+
+class V1FinetuningCreateResponse409Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse409Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse409:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse409Code): * `ConflictError` - ConflictError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse409Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse409Code(d.pop("code"))
+
+ v1_finetuning_create_response_409 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_409.additional_properties = d
+ return v1_finetuning_create_response_409
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_409_code.py b/premai/models/v1_finetuning_create_response_409_code.py
new file mode 100644
index 0000000..e4eab1d
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_409_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse409Code(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_422.py b/premai/models/v1_finetuning_create_response_422.py
new file mode 100644
index 0000000..00e2630
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_422.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_422_code import V1FinetuningCreateResponse422Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse422")
+
+
+class V1FinetuningCreateResponse422Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse422Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse422:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse422Code): * `UnprocessableEntityError` - UnprocessableEntityError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse422Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse422Code(d.pop("code"))
+
+ v1_finetuning_create_response_422 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_422.additional_properties = d
+ return v1_finetuning_create_response_422
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_422_code.py b/premai/models/v1_finetuning_create_response_422_code.py
new file mode 100644
index 0000000..6863b90
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_422_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse422Code(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_429.py b/premai/models/v1_finetuning_create_response_429.py
new file mode 100644
index 0000000..f4c0160
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_429.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_429_code import V1FinetuningCreateResponse429Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse429")
+
+
+class V1FinetuningCreateResponse429Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse429Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse429:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse429Code): * `RateLimitError` - RateLimitError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse429Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse429Code(d.pop("code"))
+
+ v1_finetuning_create_response_429 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_429.additional_properties = d
+ return v1_finetuning_create_response_429
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_429_code.py b/premai/models/v1_finetuning_create_response_429_code.py
new file mode 100644
index 0000000..5cc9ead
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_429_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse429Code(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_0.py b/premai/models/v1_finetuning_create_response_500_type_0.py
new file mode 100644
index 0000000..1b0aa7b
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_0_code import V1FinetuningCreateResponse500Type0Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type0")
+
+
+class V1FinetuningCreateResponse500Type0Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type0Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type0Code): * `ProviderInternalServerError` - ProviderInternalServerError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type0Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_0.additional_properties = d
+ return v1_finetuning_create_response_500_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_0_code.py b/premai/models/v1_finetuning_create_response_500_type_0_code.py
new file mode 100644
index 0000000..afa0a13
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type0Code(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_1.py b/premai/models/v1_finetuning_create_response_500_type_1.py
new file mode 100644
index 0000000..95f198d
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_1_code import V1FinetuningCreateResponse500Type1Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type1")
+
+
+class V1FinetuningCreateResponse500Type1Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type1Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type1Code): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type1Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_1.additional_properties = d
+ return v1_finetuning_create_response_500_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_1_code.py b/premai/models/v1_finetuning_create_response_500_type_1_code.py
new file mode 100644
index 0000000..26380bf
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type1Code(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_2.py b/premai/models/v1_finetuning_create_response_500_type_2.py
new file mode 100644
index 0000000..9ff34ef
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_2.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_2_code import V1FinetuningCreateResponse500Type2Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type2")
+
+
+class V1FinetuningCreateResponse500Type2Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type2Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type2:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type2Code): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type2Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type2Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_2 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_2.additional_properties = d
+ return v1_finetuning_create_response_500_type_2
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_2_code.py b/premai/models/v1_finetuning_create_response_500_type_2_code.py
new file mode 100644
index 0000000..2cf3618
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_2_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type2Code(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_3.py b/premai/models/v1_finetuning_create_response_500_type_3.py
new file mode 100644
index 0000000..41db43c
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_3.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_3_code import V1FinetuningCreateResponse500Type3Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type3")
+
+
+class V1FinetuningCreateResponse500Type3Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type3Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type3:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type3Code): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type3Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type3Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_3 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_3.additional_properties = d
+ return v1_finetuning_create_response_500_type_3
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_3_code.py b/premai/models/v1_finetuning_create_response_500_type_3_code.py
new file mode 100644
index 0000000..d55c7d5
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_3_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type3Code(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_4.py b/premai/models/v1_finetuning_create_response_500_type_4.py
new file mode 100644
index 0000000..ecec2df
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_4.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_4_code import V1FinetuningCreateResponse500Type4Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type4")
+
+
+class V1FinetuningCreateResponse500Type4Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type4Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type4:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type4Code): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type4Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type4Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_4 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_4.additional_properties = d
+ return v1_finetuning_create_response_500_type_4
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_4_code.py b/premai/models/v1_finetuning_create_response_500_type_4_code.py
new file mode 100644
index 0000000..558fd89
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_4_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type4Code(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_create_response_500_type_5.py b/premai/models/v1_finetuning_create_response_500_type_5.py
new file mode 100644
index 0000000..eb34c32
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_5.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_create_response_500_type_5_code import V1FinetuningCreateResponse500Type5Code
+
+T = TypeVar("T", bound="V1FinetuningCreateResponse500Type5")
+
+
+class V1FinetuningCreateResponse500Type5Dict(TypedDict):
+ message: str
+ code: V1FinetuningCreateResponse500Type5Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningCreateResponse500Type5:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningCreateResponse500Type5Code): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: V1FinetuningCreateResponse500Type5Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningCreateResponse500Type5Code(d.pop("code"))
+
+ v1_finetuning_create_response_500_type_5 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_create_response_500_type_5.additional_properties = d
+ return v1_finetuning_create_response_500_type_5
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_create_response_500_type_5_code.py b/premai/models/v1_finetuning_create_response_500_type_5_code.py
new file mode 100644
index 0000000..1941ccb
--- /dev/null
+++ b/premai/models/v1_finetuning_create_response_500_type_5_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningCreateResponse500Type5Code(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_200.py b/premai/models/v1_finetuning_retrieve_response_200.py
new file mode 100644
index 0000000..972e65f
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_200.py
@@ -0,0 +1,141 @@
+from typing import Dict, List, Type, Union
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, NotRequired, TypedDict, TypeVar
+
+from ..types import UNSET, Unset
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse200")
+
+
+class V1FinetuningRetrieveResponse200Dict(TypedDict):
+ id: str
+ fine_tuned_model: str
+ created_at: int
+ status: str
+ provider_name: str
+ provider_id: str
+ status_code: int
+ finished_at: NotRequired[Union[Unset, int]]
+ error: NotRequired[Union[Unset, str]]
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse200:
+ """
+ Attributes:
+ id (str): The ID of the fine-tuning job.
+ fine_tuned_model (str): The ID of the fine-tuned model.
+ created_at (int): The Unix timestamp (in seconds) of when the fine-tuning job was created.
+ status (str): The status of the fine-tuning job.
+ provider_name (str): The name of the provider that generated the completion.
+ provider_id (str): The ID of the provider that generated the completion.
+ status_code (int): The status code of the fine-tuning job.
+ finished_at (Union[Unset, int]): The Unix timestamp (in seconds) of when the fine-tuning job was finished.
+ error (Union[Unset, str]): The error message of the fine-tuning job.
+ """
+
+ id: str
+ fine_tuned_model: str
+ created_at: int
+ status: str
+ provider_name: str
+ provider_id: str
+ status_code: int
+ finished_at: Union[Unset, int] = UNSET
+ error: Union[Unset, str] = UNSET
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ id = self.id
+
+ fine_tuned_model = self.fine_tuned_model
+
+ created_at = self.created_at
+
+ status = self.status
+
+ provider_name = self.provider_name
+
+ provider_id = self.provider_id
+
+ status_code = self.status_code
+
+ finished_at = self.finished_at
+
+ error = self.error
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "id": id,
+ "fine_tuned_model": fine_tuned_model,
+ "created_at": created_at,
+ "status": status,
+ "provider_name": provider_name,
+ "provider_id": provider_id,
+ "status_code": status_code,
+ }
+ )
+ if finished_at is not UNSET:
+ field_dict["finished_at"] = finished_at
+ if error is not UNSET:
+ field_dict["error"] = error
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ id = d.pop("id")
+
+ fine_tuned_model = d.pop("fine_tuned_model")
+
+ created_at = d.pop("created_at")
+
+ status = d.pop("status")
+
+ provider_name = d.pop("provider_name")
+
+ provider_id = d.pop("provider_id")
+
+ status_code = d.pop("status_code")
+
+ finished_at = d.pop("finished_at", UNSET)
+
+ error = d.pop("error", UNSET)
+
+ v1_finetuning_retrieve_response_200 = cls(
+ id=id,
+ fine_tuned_model=fine_tuned_model,
+ created_at=created_at,
+ status=status,
+ provider_name=provider_name,
+ provider_id=provider_id,
+ status_code=status_code,
+ finished_at=finished_at,
+ error=error,
+ )
+
+ v1_finetuning_retrieve_response_200.additional_properties = d
+ return v1_finetuning_retrieve_response_200
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_400.py b/premai/models/v1_finetuning_retrieve_response_400.py
new file mode 100644
index 0000000..0431e60
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_400.py
@@ -0,0 +1,88 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_400_code import V1FinetuningRetrieveResponse400Code
+from ..models.v1_finetuning_retrieve_response_400_details import V1FinetuningRetrieveResponse400Details
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse400")
+
+
+class V1FinetuningRetrieveResponse400Dict(TypedDict):
+ message: str
+ details: "V1FinetuningRetrieveResponse400Details"
+ code: V1FinetuningRetrieveResponse400Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse400:
+ """
+ Attributes:
+ message (str): A description of the validation error.
+ details (V1FinetuningRetrieveResponse400Details): Detailed information about the validation errors.
+ code (V1FinetuningRetrieveResponse400Code): * `ValidationError` - ValidationError
+ """
+
+ message: str
+ details: "V1FinetuningRetrieveResponse400Details"
+ code: V1FinetuningRetrieveResponse400Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ details = self.details.to_dict()
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "details": details,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_retrieve_response_400_details import V1FinetuningRetrieveResponse400Details
+
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ details = V1FinetuningRetrieveResponse400Details.from_dict(d.pop("details"))
+
+ code = V1FinetuningRetrieveResponse400Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_400 = cls(
+ message=message,
+ details=details,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_400.additional_properties = d
+ return v1_finetuning_retrieve_response_400
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_400_code.py b/premai/models/v1_finetuning_retrieve_response_400_code.py
new file mode 100644
index 0000000..cadf70c
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_400_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse400Code(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_400_details.py b/premai/models/v1_finetuning_retrieve_response_400_details.py
new file mode 100644
index 0000000..f843026
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_400_details.py
@@ -0,0 +1,66 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_400_details_additional_property import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalProperty,
+)
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse400Details")
+
+
+class V1FinetuningRetrieveResponse400DetailsDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse400Details:
+ """Detailed information about the validation errors."""
+
+ additional_properties: Dict[str, "V1FinetuningRetrieveResponse400DetailsAdditionalProperty"] = _attrs_field(
+ init=False, factory=dict
+ )
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ for prop_name, prop in self.additional_properties.items():
+ field_dict[prop_name] = prop.to_dict()
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_retrieve_response_400_details_additional_property import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalProperty,
+ )
+
+ d = src_dict.copy()
+ v1_finetuning_retrieve_response_400_details = cls()
+
+ additional_properties = {}
+ for prop_name, prop_dict in d.items():
+ additional_property = V1FinetuningRetrieveResponse400DetailsAdditionalProperty.from_dict(prop_dict)
+
+ additional_properties[prop_name] = additional_property
+
+ v1_finetuning_retrieve_response_400_details.additional_properties = additional_properties
+ return v1_finetuning_retrieve_response_400_details
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> "V1FinetuningRetrieveResponse400DetailsAdditionalProperty":
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: "V1FinetuningRetrieveResponse400DetailsAdditionalProperty") -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_400_details_additional_property.py b/premai/models/v1_finetuning_retrieve_response_400_details_additional_property.py
new file mode 100644
index 0000000..e49d668
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_400_details_additional_property.py
@@ -0,0 +1,84 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem,
+)
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse400DetailsAdditionalProperty")
+
+
+class V1FinetuningRetrieveResponse400DetailsAdditionalPropertyDict(TypedDict):
+ error_messages: List["V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse400DetailsAdditionalProperty:
+ """
+ Attributes:
+ error_messages (List['V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem']): Error
+ messages for the field.
+ """
+
+ error_messages: List["V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item import (
+ V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem,
+ )
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem.from_dict(
+ error_messages_item_data
+ )
+
+ error_messages.append(error_messages_item)
+
+ v1_finetuning_retrieve_response_400_details_additional_property = cls(
+ error_messages=error_messages,
+ )
+
+ v1_finetuning_retrieve_response_400_details_additional_property.additional_properties = d
+ return v1_finetuning_retrieve_response_400_details_additional_property
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item.py b/premai/models/v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item.py
new file mode 100644
index 0000000..fc72078
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem")
+
+
+class V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse400DetailsAdditionalPropertyErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item = cls()
+
+ v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item.additional_properties = d
+ return v1_finetuning_retrieve_response_400_details_additional_property_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_401.py b/premai/models/v1_finetuning_retrieve_response_401.py
new file mode 100644
index 0000000..c2edcde
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_401.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_401_code import V1FinetuningRetrieveResponse401Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse401")
+
+
+class V1FinetuningRetrieveResponse401Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse401Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse401:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse401Code): * `AuthenticationError` - AuthenticationError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse401Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse401Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_401 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_401.additional_properties = d
+ return v1_finetuning_retrieve_response_401
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_401_code.py b/premai/models/v1_finetuning_retrieve_response_401_code.py
new file mode 100644
index 0000000..f691ed1
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_401_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse401Code(str, Enum):
+ AUTHENTICATIONERROR = "AuthenticationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_403.py b/premai/models/v1_finetuning_retrieve_response_403.py
new file mode 100644
index 0000000..47a6fa0
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_403.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_403_code import V1FinetuningRetrieveResponse403Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse403")
+
+
+class V1FinetuningRetrieveResponse403Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse403Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse403:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse403Code): * `PermissionDeniedError` - PermissionDeniedError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse403Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse403Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_403 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_403.additional_properties = d
+ return v1_finetuning_retrieve_response_403
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_403_code.py b/premai/models/v1_finetuning_retrieve_response_403_code.py
new file mode 100644
index 0000000..60d4248
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_403_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse403Code(str, Enum):
+ PERMISSIONDENIEDERROR = "PermissionDeniedError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_404_type_0.py b/premai/models/v1_finetuning_retrieve_response_404_type_0.py
new file mode 100644
index 0000000..5dd730b
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_404_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_404_type_0_code import V1FinetuningRetrieveResponse404Type0Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse404Type0")
+
+
+class V1FinetuningRetrieveResponse404Type0Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse404Type0Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse404Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse404Type0Code): * `ProviderNotFoundError` - ProviderNotFoundError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse404Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse404Type0Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_404_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_404_type_0.additional_properties = d
+ return v1_finetuning_retrieve_response_404_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_404_type_0_code.py b/premai/models/v1_finetuning_retrieve_response_404_type_0_code.py
new file mode 100644
index 0000000..ef27e3f
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_404_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse404Type0Code(str, Enum):
+ PROVIDERNOTFOUNDERROR = "ProviderNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_404_type_1.py b/premai/models/v1_finetuning_retrieve_response_404_type_1.py
new file mode 100644
index 0000000..fdea250
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_404_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_404_type_1_code import V1FinetuningRetrieveResponse404Type1Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse404Type1")
+
+
+class V1FinetuningRetrieveResponse404Type1Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse404Type1Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse404Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse404Type1Code): * `ModelNotFoundError` - ModelNotFoundError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse404Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse404Type1Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_404_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_404_type_1.additional_properties = d
+ return v1_finetuning_retrieve_response_404_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_404_type_1_code.py b/premai/models/v1_finetuning_retrieve_response_404_type_1_code.py
new file mode 100644
index 0000000..df4bd39
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_404_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse404Type1Code(str, Enum):
+ MODELNOTFOUNDERROR = "ModelNotFoundError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_409.py b/premai/models/v1_finetuning_retrieve_response_409.py
new file mode 100644
index 0000000..b93b0b4
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_409.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_409_code import V1FinetuningRetrieveResponse409Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse409")
+
+
+class V1FinetuningRetrieveResponse409Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse409Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse409:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse409Code): * `ConflictError` - ConflictError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse409Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse409Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_409 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_409.additional_properties = d
+ return v1_finetuning_retrieve_response_409
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_409_code.py b/premai/models/v1_finetuning_retrieve_response_409_code.py
new file mode 100644
index 0000000..f563a6e
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_409_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse409Code(str, Enum):
+ CONFLICTERROR = "ConflictError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_422.py b/premai/models/v1_finetuning_retrieve_response_422.py
new file mode 100644
index 0000000..2e993c6
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_422.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_422_code import V1FinetuningRetrieveResponse422Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse422")
+
+
+class V1FinetuningRetrieveResponse422Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse422Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse422:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse422Code): * `UnprocessableEntityError` - UnprocessableEntityError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse422Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse422Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_422 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_422.additional_properties = d
+ return v1_finetuning_retrieve_response_422
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_422_code.py b/premai/models/v1_finetuning_retrieve_response_422_code.py
new file mode 100644
index 0000000..d84af2e
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_422_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse422Code(str, Enum):
+ UNPROCESSABLEENTITYERROR = "UnprocessableEntityError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_429.py b/premai/models/v1_finetuning_retrieve_response_429.py
new file mode 100644
index 0000000..d98e83d
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_429.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_429_code import V1FinetuningRetrieveResponse429Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse429")
+
+
+class V1FinetuningRetrieveResponse429Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse429Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse429:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse429Code): * `RateLimitError` - RateLimitError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse429Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse429Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_429 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_429.additional_properties = d
+ return v1_finetuning_retrieve_response_429
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_429_code.py b/premai/models/v1_finetuning_retrieve_response_429_code.py
new file mode 100644
index 0000000..209feb4
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_429_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse429Code(str, Enum):
+ RATELIMITERROR = "RateLimitError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_0.py b/premai/models/v1_finetuning_retrieve_response_500_type_0.py
new file mode 100644
index 0000000..6becfd7
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_0.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_0_code import V1FinetuningRetrieveResponse500Type0Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type0")
+
+
+class V1FinetuningRetrieveResponse500Type0Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type0Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type0:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type0Code): * `ProviderInternalServerError` - ProviderInternalServerError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type0Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type0Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_0 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_0.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_0
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_0_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_0_code.py
new file mode 100644
index 0000000..4f76d8c
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_0_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type0Code(str, Enum):
+ PROVIDERINTERNALSERVERERROR = "ProviderInternalServerError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_1.py b/premai/models/v1_finetuning_retrieve_response_500_type_1.py
new file mode 100644
index 0000000..7543758
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_1.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_1_code import V1FinetuningRetrieveResponse500Type1Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type1")
+
+
+class V1FinetuningRetrieveResponse500Type1Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type1Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type1:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type1Code): * `APIResponseValidationError` - APIResponseValidationError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type1Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type1Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_1 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_1.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_1
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_1_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_1_code.py
new file mode 100644
index 0000000..628638b
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_1_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type1Code(str, Enum):
+ APIRESPONSEVALIDATIONERROR = "APIResponseValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_2.py b/premai/models/v1_finetuning_retrieve_response_500_type_2.py
new file mode 100644
index 0000000..466d2ac
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_2.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_2_code import V1FinetuningRetrieveResponse500Type2Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type2")
+
+
+class V1FinetuningRetrieveResponse500Type2Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type2Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type2:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type2Code): * `ProviderAPIStatusError` - ProviderAPIStatusError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type2Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type2Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_2 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_2.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_2
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_2_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_2_code.py
new file mode 100644
index 0000000..5c7b25d
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_2_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type2Code(str, Enum):
+ PROVIDERAPISTATUSERROR = "ProviderAPIStatusError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_3.py b/premai/models/v1_finetuning_retrieve_response_500_type_3.py
new file mode 100644
index 0000000..ec30e8c
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_3.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_3_code import V1FinetuningRetrieveResponse500Type3Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type3")
+
+
+class V1FinetuningRetrieveResponse500Type3Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type3Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type3:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type3Code): * `ProviderAPITimeoutError` - ProviderAPITimeoutError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type3Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type3Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_3 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_3.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_3
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_3_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_3_code.py
new file mode 100644
index 0000000..a219944
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_3_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type3Code(str, Enum):
+ PROVIDERAPITIMEOUTERROR = "ProviderAPITimeoutError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_4.py b/premai/models/v1_finetuning_retrieve_response_500_type_4.py
new file mode 100644
index 0000000..c6278ca
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_4.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_4_code import V1FinetuningRetrieveResponse500Type4Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type4")
+
+
+class V1FinetuningRetrieveResponse500Type4Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type4Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type4:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type4Code): * `ProviderAPIConnectionError` - ProviderAPIConnectionError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type4Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type4Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_4 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_4.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_4
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_4_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_4_code.py
new file mode 100644
index 0000000..850a93c
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_4_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type4Code(str, Enum):
+ PROVIDERAPICONNECTIONERROR = "ProviderAPIConnectionError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_5.py b/premai/models/v1_finetuning_retrieve_response_500_type_5.py
new file mode 100644
index 0000000..92730ab
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_5.py
@@ -0,0 +1,76 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.v1_finetuning_retrieve_response_500_type_5_code import V1FinetuningRetrieveResponse500Type5Code
+
+T = TypeVar("T", bound="V1FinetuningRetrieveResponse500Type5")
+
+
+class V1FinetuningRetrieveResponse500Type5Dict(TypedDict):
+ message: str
+ code: V1FinetuningRetrieveResponse500Type5Code
+ pass
+
+
+@_attrs_define
+class V1FinetuningRetrieveResponse500Type5:
+ """
+ Attributes:
+ message (str):
+ code (V1FinetuningRetrieveResponse500Type5Code): * `CatchAllError` - CatchAllError
+ """
+
+ message: str
+ code: V1FinetuningRetrieveResponse500Type5Code
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ code = V1FinetuningRetrieveResponse500Type5Code(d.pop("code"))
+
+ v1_finetuning_retrieve_response_500_type_5 = cls(
+ message=message,
+ code=code,
+ )
+
+ v1_finetuning_retrieve_response_500_type_5.additional_properties = d
+ return v1_finetuning_retrieve_response_500_type_5
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/v1_finetuning_retrieve_response_500_type_5_code.py b/premai/models/v1_finetuning_retrieve_response_500_type_5_code.py
new file mode 100644
index 0000000..b28d193
--- /dev/null
+++ b/premai/models/v1_finetuning_retrieve_response_500_type_5_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class V1FinetuningRetrieveResponse500Type5Code(str, Enum):
+ CATCHALLERROR = "CatchAllError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/validation_detail.py b/premai/models/validation_detail.py
new file mode 100644
index 0000000..652075b
--- /dev/null
+++ b/premai/models/validation_detail.py
@@ -0,0 +1,77 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.validation_detail_error_messages_item import ValidationDetailErrorMessagesItem
+
+T = TypeVar("T", bound="ValidationDetail")
+
+
+class ValidationDetailDict(TypedDict):
+ error_messages: List["ValidationDetailErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class ValidationDetail:
+ """
+ Attributes:
+ error_messages (List['ValidationDetailErrorMessagesItem']): Error messages for the field.
+ """
+
+ error_messages: List["ValidationDetailErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.validation_detail_error_messages_item import ValidationDetailErrorMessagesItem
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = ValidationDetailErrorMessagesItem.from_dict(error_messages_item_data)
+
+ error_messages.append(error_messages_item)
+
+ validation_detail = cls(
+ error_messages=error_messages,
+ )
+
+ validation_detail.additional_properties = d
+ return validation_detail
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/validation_detail_error_messages_item.py b/premai/models/validation_detail_error_messages_item.py
new file mode 100644
index 0000000..064e230
--- /dev/null
+++ b/premai/models/validation_detail_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ValidationDetailErrorMessagesItem")
+
+
+class ValidationDetailErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ValidationDetailErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ validation_detail_error_messages_item = cls()
+
+ validation_detail_error_messages_item.additional_properties = d
+ return validation_detail_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/validation_error.py b/premai/models/validation_error.py
new file mode 100644
index 0000000..b14dedf
--- /dev/null
+++ b/premai/models/validation_error.py
@@ -0,0 +1,88 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.validation_error_code import ValidationErrorCode
+from ..models.validation_error_details import ValidationErrorDetails
+
+T = TypeVar("T", bound="ValidationError")
+
+
+class ValidationErrorDict(TypedDict):
+ message: str
+ details: "ValidationErrorDetails"
+ code: ValidationErrorCode
+ pass
+
+
+@_attrs_define
+class ValidationError:
+ """
+ Attributes:
+ message (str): A description of the validation error.
+ details (ValidationErrorDetails): Detailed information about the validation errors.
+ code (ValidationErrorCode): * `ValidationError` - ValidationError
+ """
+
+ message: str
+ details: "ValidationErrorDetails"
+ code: ValidationErrorCode
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ message = self.message
+
+ details = self.details.to_dict()
+
+ code = self.code.value
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "message": message,
+ "details": details,
+ "code": code,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.validation_error_details import ValidationErrorDetails
+
+ d = src_dict.copy()
+ message = d.pop("message")
+
+ details = ValidationErrorDetails.from_dict(d.pop("details"))
+
+ code = ValidationErrorCode(d.pop("code"))
+
+ validation_error = cls(
+ message=message,
+ details=details,
+ code=code,
+ )
+
+ validation_error.additional_properties = d
+ return validation_error
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/validation_error_code.py b/premai/models/validation_error_code.py
new file mode 100644
index 0000000..33d9442
--- /dev/null
+++ b/premai/models/validation_error_code.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ValidationErrorCode(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/validation_error_code_enum.py b/premai/models/validation_error_code_enum.py
new file mode 100644
index 0000000..04c07ca
--- /dev/null
+++ b/premai/models/validation_error_code_enum.py
@@ -0,0 +1,8 @@
+from enum import Enum
+
+
+class ValidationErrorCodeEnum(str, Enum):
+ VALIDATIONERROR = "ValidationError"
+
+ def __str__(self) -> str:
+ return str(self.value)
diff --git a/premai/models/validation_error_details.py b/premai/models/validation_error_details.py
new file mode 100644
index 0000000..efe21e9
--- /dev/null
+++ b/premai/models/validation_error_details.py
@@ -0,0 +1,62 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.validation_error_details_additional_property import ValidationErrorDetailsAdditionalProperty
+
+T = TypeVar("T", bound="ValidationErrorDetails")
+
+
+class ValidationErrorDetailsDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ValidationErrorDetails:
+ """Detailed information about the validation errors."""
+
+ additional_properties: Dict[str, "ValidationErrorDetailsAdditionalProperty"] = _attrs_field(
+ init=False, factory=dict
+ )
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ for prop_name, prop in self.additional_properties.items():
+ field_dict[prop_name] = prop.to_dict()
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.validation_error_details_additional_property import ValidationErrorDetailsAdditionalProperty
+
+ d = src_dict.copy()
+ validation_error_details = cls()
+
+ additional_properties = {}
+ for prop_name, prop_dict in d.items():
+ additional_property = ValidationErrorDetailsAdditionalProperty.from_dict(prop_dict)
+
+ additional_properties[prop_name] = additional_property
+
+ validation_error_details.additional_properties = additional_properties
+ return validation_error_details
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> "ValidationErrorDetailsAdditionalProperty":
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: "ValidationErrorDetailsAdditionalProperty") -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/validation_error_details_additional_property.py b/premai/models/validation_error_details_additional_property.py
new file mode 100644
index 0000000..465a75f
--- /dev/null
+++ b/premai/models/validation_error_details_additional_property.py
@@ -0,0 +1,84 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+from ..models.validation_error_details_additional_property_error_messages_item import (
+ ValidationErrorDetailsAdditionalPropertyErrorMessagesItem,
+)
+
+T = TypeVar("T", bound="ValidationErrorDetailsAdditionalProperty")
+
+
+class ValidationErrorDetailsAdditionalPropertyDict(TypedDict):
+ error_messages: List["ValidationErrorDetailsAdditionalPropertyErrorMessagesItem"]
+ pass
+
+
+@_attrs_define
+class ValidationErrorDetailsAdditionalProperty:
+ """
+ Attributes:
+ error_messages (List['ValidationErrorDetailsAdditionalPropertyErrorMessagesItem']): Error messages for the
+ field.
+ """
+
+ error_messages: List["ValidationErrorDetailsAdditionalPropertyErrorMessagesItem"]
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ error_messages = []
+ for error_messages_item_data in self.error_messages:
+ error_messages_item = error_messages_item_data.to_dict()
+ error_messages.append(error_messages_item)
+
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update(
+ {
+ "error_messages": error_messages,
+ }
+ )
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ from ..models.validation_error_details_additional_property_error_messages_item import (
+ ValidationErrorDetailsAdditionalPropertyErrorMessagesItem,
+ )
+
+ d = src_dict.copy()
+ error_messages = []
+ _error_messages = d.pop("error_messages")
+ for error_messages_item_data in _error_messages:
+ error_messages_item = ValidationErrorDetailsAdditionalPropertyErrorMessagesItem.from_dict(
+ error_messages_item_data
+ )
+
+ error_messages.append(error_messages_item)
+
+ validation_error_details_additional_property = cls(
+ error_messages=error_messages,
+ )
+
+ validation_error_details_additional_property.additional_properties = d
+ return validation_error_details_additional_property
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/models/validation_error_details_additional_property_error_messages_item.py b/premai/models/validation_error_details_additional_property_error_messages_item.py
new file mode 100644
index 0000000..4e3e9aa
--- /dev/null
+++ b/premai/models/validation_error_details_additional_property_error_messages_item.py
@@ -0,0 +1,49 @@
+from typing import Dict, List, Type
+
+from attrs import define as _attrs_define
+from attrs import field as _attrs_field
+from typing_extensions import Any, TypedDict, TypeVar
+
+T = TypeVar("T", bound="ValidationErrorDetailsAdditionalPropertyErrorMessagesItem")
+
+
+class ValidationErrorDetailsAdditionalPropertyErrorMessagesItemDict(TypedDict):
+ pass
+
+
+@_attrs_define
+class ValidationErrorDetailsAdditionalPropertyErrorMessagesItem:
+ """ """
+
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
+
+ def to_dict(self) -> Dict[str, Any]:
+ field_dict: Dict[str, Any] = {}
+ field_dict.update(self.additional_properties)
+ field_dict.update({})
+
+ return field_dict
+
+ @classmethod
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
+ d = src_dict.copy()
+ validation_error_details_additional_property_error_messages_item = cls()
+
+ validation_error_details_additional_property_error_messages_item.additional_properties = d
+ return validation_error_details_additional_property_error_messages_item
+
+ @property
+ def additional_keys(self) -> List[str]:
+ return list(self.additional_properties.keys())
+
+ def __getitem__(self, key: str) -> Any:
+ return self.additional_properties[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self.additional_properties[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self.additional_properties[key]
+
+ def __contains__(self, key: str) -> bool:
+ return key in self.additional_properties
diff --git a/premai/py.typed b/premai/py.typed
new file mode 100644
index 0000000..1aad327
--- /dev/null
+++ b/premai/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561
\ No newline at end of file
diff --git a/premai/types.py b/premai/types.py
new file mode 100644
index 0000000..c7e8f6a
--- /dev/null
+++ b/premai/types.py
@@ -0,0 +1,46 @@
+""" Contains some shared types for properties """
+from http import HTTPStatus
+from typing import BinaryIO, Generic, MutableMapping, Optional, Tuple
+
+from attrs import define
+from typing_extensions import Literal, TypeVar
+
+
+class Unset:
+ def __bool__(self) -> Literal[False]:
+ return False
+
+
+UNSET: Unset = Unset()
+
+
+FileJsonType = Tuple[Optional[str], BinaryIO, Optional[str]]
+
+
+@define
+class File:
+ """Contains information for file uploads"""
+
+ payload: BinaryIO
+ file_name: Optional[str] = None
+ mime_type: Optional[str] = None
+
+ def to_tuple(self) -> FileJsonType:
+ """Return a tuple representation that httpx will accept for multipart/form-data"""
+ return self.file_name, self.payload, self.mime_type
+
+
+T = TypeVar("T")
+
+
+@define
+class Response(Generic[T]):
+ """A response from an endpoint"""
+
+ status_code: HTTPStatus
+ content: bytes
+ headers: MutableMapping[str, str]
+ parsed: Optional[T]
+
+
+__all__ = ["File", "Response", "FileJsonType", "Unset", "UNSET"]
diff --git a/pyproject.toml b/pyproject.toml
index a74d2b8..ff2c83c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,25 +1,26 @@
-[build-system]
-requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4"]
-build-backend = "setuptools.build_meta"
+[tool.poetry]
+name = "premai"
+version = "0.0.1a3"
+description = "A client library for accessing Prem APIs"
+authors = []
+readme = "README.md"
+packages = [
+ {include = "premai"},
+]
+include = ["CHANGELOG.md", "premai/py.typed"]
-[tool.setuptools_scm]
-[project.urls]
-Homepage = "https://github.com/premAI-io/prem-python-sdk"
-Documentation = "https://premai-io.github.io/prem-python-sdk/"
-Releases = "https://github.com/premAI-io/prem-python-sdk/tags"
+[tool.poetry.dependencies]
+python = "^3.8"
+httpx = ">=0.20.0,<0.27.0"
+attrs = ">=21.3.0"
+python-dateutil = "^2.8.0"
+typing_extensions = ">=4.9.0"
-[project]
-name = "premai"
-dynamic = ["version", "dependencies"]
-maintainers = [{name = "Nicola Sosio", email = "nicola@premai.io"}]
-description = "The Prem Python SDK is a Python library for interacting with the Prem API"
-readme = "README.md"
-requires-python = ">=3.7"
-license = {text = "Apache-2.0"}
-classifiers = [
- "Development Status :: 1 - Planning",
- "Programming Language :: Python :: 3 :: Only"]
+[build-system]
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
-[tool.setuptools.dynamic]
-dependencies = {file = ["requirements.txt"]}
+[tool.ruff]
+select = ["F", "I", "UP"]
+line-length = 120
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index a82db02..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-requests
-pydantic
-sseclient-py
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 6aee7c7..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-[flake8]
-max-line-length = 120
-exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv
diff --git a/test.py b/test.py
deleted file mode 100644
index 804d2ec..0000000
--- a/test.py
+++ /dev/null
@@ -1,59 +0,0 @@
-import time
-
-from prem import Prem
-
-api_key = "t3c3WFsG53DPF6JZXWiYpQirc6sSsiLVS9"
-base_url = "http://localhost:8000"
-client = Prem(api_key=api_key, base_url=base_url)
-
-# Test Completions
-messages = [
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Who won the world series in 2020?"},
-]
-model = "gpt-3.5-turbo"
-response = client.completions.create(
- project_id=1, messages=messages, model=model, stream=False
-)
-print(response)
-response = client.completions.create(
- project_id=1, messages=messages, model=model, stream=True
-)
-print(f"Number of chunks: {len(response)}")
-
-# Test Embeddings
-input = "What is a transformer?"
-model = "text-embedding-ada-002"
-response = client.embeddings.create(project_id=1, input=input, model=model)
-print(f"Embedding dimension: {len(response.data[0])}")
-
-# Test DataPoints
-input = "What is a transformer?"
-output = "A transformer is a deep learning model that uses self-attention."
-# Creating 10 data points
-for _ in range(10):
- data_point = client.datapoints.create(
- project_id=1, input=input, output=output, positive=True
- )
- time.sleep(1)
-print(data_point)
-
-# Updating the last data point
-patched_data_point = client.datapoints.update(
- datapoint_id=data_point.id, data={"positive": False}
-)
-
-# Retrieving the udpated data point
-print(client.datapoints.retrieve(datapoint_id=data_point.id))
-
-# Deleting the udpated data point
-print("Deleted data point with ID: " + str(data_point.id))
-client.datapoints.delete(datapoint_id=data_point.id)
-
-# List the data points
-datapoints = client.datapoints.list()
-print("Total number of datapoints", len(datapoints))
-for datapoint in datapoints:
- print("Deleted data point with ID: " + str(datapoint.id))
- client.datapoints.delete(datapoint_id=datapoint.id)
- time.sleep(1)