diff --git a/.stats.yml b/.stats.yml index 2b7dbf39..fcbfe481 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 6 +configured_endpoints: 2 diff --git a/README.md b/README.md index d42f1dcb..202a3003 100644 --- a/README.md +++ b/README.md @@ -32,26 +32,11 @@ client = Openlayer( api_key=os.environ.get("OPENLAYER_API_KEY"), ) -data_stream_response = client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], +project_create_response = client.projects.create( + name="My Project", + task_type="llm-base", ) -print(data_stream_response.success) +print(project_create_response.id) ``` While you can provide an `api_key` keyword argument, @@ -75,26 +60,11 @@ client = AsyncOpenlayer( async def main() -> None: - data_stream_response = await client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], + project_create_response = await client.projects.create( + name="My Project", + task_type="llm-base", ) - print(data_stream_response.success) + print(project_create_response.id) asyncio.run(main()) @@ -127,24 +97,9 @@ from openlayer import Openlayer client = Openlayer() try: - client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], + client.projects.create( + name="My Project", + task_type="llm-base", ) except openlayer.APIConnectionError as e: print("The server could not be reached") @@ -188,24 +143,9 @@ client = Openlayer( ) # Or, configure per-request: -client.with_options(max_retries=5).inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], +client.with_options(max_retries=5).projects.create( + name="My Project", + task_type="llm-base", ) ``` @@ -229,24 +169,9 @@ client = Openlayer( ) # Override per-request: -client.with_options(timeout=5.0).inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], +client.with_options(timeout=5.0).projects.create( + name="My Project", + task_type="llm-base", ) ``` @@ -286,27 +211,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from openlayer import Openlayer client = Openlayer() -response = client.inference_pipelines.data.with_raw_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[{ - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - }], +response = client.projects.with_raw_response.create( + name="My Project", + task_type="llm-base", ) print(response.headers.get('X-My-Header')) -data = response.parse() # get the object that `inference_pipelines.data.stream()` would have returned -print(data.success) +project = response.parse() # get the object that `projects.create()` would have returned +print(project.id) ``` These methods return an [`APIResponse`](https://github.com/openlayer-ai/openlayer-python/tree/main/src/openlayer/_response.py) object. @@ -320,24 +232,9 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.inference_pipelines.data.with_streaming_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], +with client.projects.with_streaming_response.create( + name="My Project", + task_type="llm-base", ) as response: print(response.headers.get("X-My-Header")) diff --git a/api.md b/api.md index eef0e9c4..c6822845 100644 --- a/api.md +++ b/api.md @@ -10,55 +10,3 @@ Methods: - client.projects.create(\*\*params) -> ProjectCreateResponse - client.projects.list(\*\*params) -> ProjectListResponse - -## Commits - -Types: - -```python -from openlayer.types.projects import CommitListResponse -``` - -Methods: - -- client.projects.commits.list(id, \*\*params) -> CommitListResponse - -# Commits - -## TestResults - -Types: - -```python -from openlayer.types.commits import TestResultListResponse -``` - -Methods: - -- client.commits.test_results.list(id, \*\*params) -> TestResultListResponse - -# InferencePipelines - -## Data - -Types: - -```python -from openlayer.types.inference_pipelines import DataStreamResponse -``` - -Methods: - -- client.inference_pipelines.data.stream(id, \*\*params) -> DataStreamResponse - -## TestResults - -Types: - -```python -from openlayer.types.inference_pipelines import TestResultListResponse -``` - -Methods: - -- client.inference_pipelines.test_results.list(id, \*\*params) -> TestResultListResponse diff --git a/src/openlayer/_client.py b/src/openlayer/_client.py index 4188cb39..6ff59d39 100644 --- a/src/openlayer/_client.py +++ b/src/openlayer/_client.py @@ -48,8 +48,6 @@ class Openlayer(SyncAPIClient): projects: resources.ProjectsResource - commits: resources.CommitsResource - inference_pipelines: resources.InferencePipelinesResource with_raw_response: OpenlayerWithRawResponse with_streaming_response: OpenlayerWithStreamedResponse @@ -104,8 +102,6 @@ def __init__( ) self.projects = resources.ProjectsResource(self) - self.commits = resources.CommitsResource(self) - self.inference_pipelines = resources.InferencePipelinesResource(self) self.with_raw_response = OpenlayerWithRawResponse(self) self.with_streaming_response = OpenlayerWithStreamedResponse(self) @@ -229,8 +225,6 @@ def _make_status_error( class AsyncOpenlayer(AsyncAPIClient): projects: resources.AsyncProjectsResource - commits: resources.AsyncCommitsResource - inference_pipelines: resources.AsyncInferencePipelinesResource with_raw_response: AsyncOpenlayerWithRawResponse with_streaming_response: AsyncOpenlayerWithStreamedResponse @@ -285,8 +279,6 @@ def __init__( ) self.projects = resources.AsyncProjectsResource(self) - self.commits = resources.AsyncCommitsResource(self) - self.inference_pipelines = resources.AsyncInferencePipelinesResource(self) self.with_raw_response = AsyncOpenlayerWithRawResponse(self) self.with_streaming_response = AsyncOpenlayerWithStreamedResponse(self) @@ -411,31 +403,21 @@ def _make_status_error( class OpenlayerWithRawResponse: def __init__(self, client: Openlayer) -> None: self.projects = resources.ProjectsResourceWithRawResponse(client.projects) - self.commits = resources.CommitsResourceWithRawResponse(client.commits) - self.inference_pipelines = resources.InferencePipelinesResourceWithRawResponse(client.inference_pipelines) class AsyncOpenlayerWithRawResponse: def __init__(self, client: AsyncOpenlayer) -> None: self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) - self.commits = resources.AsyncCommitsResourceWithRawResponse(client.commits) - self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithRawResponse(client.inference_pipelines) class OpenlayerWithStreamedResponse: def __init__(self, client: Openlayer) -> None: self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) - self.commits = resources.CommitsResourceWithStreamingResponse(client.commits) - self.inference_pipelines = resources.InferencePipelinesResourceWithStreamingResponse(client.inference_pipelines) class AsyncOpenlayerWithStreamedResponse: def __init__(self, client: AsyncOpenlayer) -> None: self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.commits = resources.AsyncCommitsResourceWithStreamingResponse(client.commits) - self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithStreamingResponse( - client.inference_pipelines - ) Client = Openlayer diff --git a/src/openlayer/resources/__init__.py b/src/openlayer/resources/__init__.py index 28cab671..60721a07 100644 --- a/src/openlayer/resources/__init__.py +++ b/src/openlayer/resources/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .commits import ( - CommitsResource, - AsyncCommitsResource, - CommitsResourceWithRawResponse, - AsyncCommitsResourceWithRawResponse, - CommitsResourceWithStreamingResponse, - AsyncCommitsResourceWithStreamingResponse, -) from .projects import ( ProjectsResource, AsyncProjectsResource, @@ -16,14 +8,6 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) -from .inference_pipelines import ( - InferencePipelinesResource, - AsyncInferencePipelinesResource, - InferencePipelinesResourceWithRawResponse, - AsyncInferencePipelinesResourceWithRawResponse, - InferencePipelinesResourceWithStreamingResponse, - AsyncInferencePipelinesResourceWithStreamingResponse, -) __all__ = [ "ProjectsResource", @@ -32,16 +16,4 @@ "AsyncProjectsResourceWithRawResponse", "ProjectsResourceWithStreamingResponse", "AsyncProjectsResourceWithStreamingResponse", - "CommitsResource", - "AsyncCommitsResource", - "CommitsResourceWithRawResponse", - "AsyncCommitsResourceWithRawResponse", - "CommitsResourceWithStreamingResponse", - "AsyncCommitsResourceWithStreamingResponse", - "InferencePipelinesResource", - "AsyncInferencePipelinesResource", - "InferencePipelinesResourceWithRawResponse", - "AsyncInferencePipelinesResourceWithRawResponse", - "InferencePipelinesResourceWithStreamingResponse", - "AsyncInferencePipelinesResourceWithStreamingResponse", ] diff --git a/src/openlayer/resources/commits/__init__.py b/src/openlayer/resources/commits/__init__.py deleted file mode 100644 index 7ff3a88a..00000000 --- a/src/openlayer/resources/commits/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .commits import ( - CommitsResource, - AsyncCommitsResource, - CommitsResourceWithRawResponse, - AsyncCommitsResourceWithRawResponse, - CommitsResourceWithStreamingResponse, - AsyncCommitsResourceWithStreamingResponse, -) -from .test_results import ( - TestResultsResource, - AsyncTestResultsResource, - TestResultsResourceWithRawResponse, - AsyncTestResultsResourceWithRawResponse, - TestResultsResourceWithStreamingResponse, - AsyncTestResultsResourceWithStreamingResponse, -) - -__all__ = [ - "TestResultsResource", - "AsyncTestResultsResource", - "TestResultsResourceWithRawResponse", - "AsyncTestResultsResourceWithRawResponse", - "TestResultsResourceWithStreamingResponse", - "AsyncTestResultsResourceWithStreamingResponse", - "CommitsResource", - "AsyncCommitsResource", - "CommitsResourceWithRawResponse", - "AsyncCommitsResourceWithRawResponse", - "CommitsResourceWithStreamingResponse", - "AsyncCommitsResourceWithStreamingResponse", -] diff --git a/src/openlayer/resources/commits/commits.py b/src/openlayer/resources/commits/commits.py deleted file mode 100644 index e9c62f89..00000000 --- a/src/openlayer/resources/commits/commits.py +++ /dev/null @@ -1,80 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .test_results import ( - TestResultsResource, - AsyncTestResultsResource, - TestResultsResourceWithRawResponse, - AsyncTestResultsResourceWithRawResponse, - TestResultsResourceWithStreamingResponse, - AsyncTestResultsResourceWithStreamingResponse, -) - -__all__ = ["CommitsResource", "AsyncCommitsResource"] - - -class CommitsResource(SyncAPIResource): - @cached_property - def test_results(self) -> TestResultsResource: - return TestResultsResource(self._client) - - @cached_property - def with_raw_response(self) -> CommitsResourceWithRawResponse: - return CommitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> CommitsResourceWithStreamingResponse: - return CommitsResourceWithStreamingResponse(self) - - -class AsyncCommitsResource(AsyncAPIResource): - @cached_property - def test_results(self) -> AsyncTestResultsResource: - return AsyncTestResultsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncCommitsResourceWithRawResponse: - return AsyncCommitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncCommitsResourceWithStreamingResponse: - return AsyncCommitsResourceWithStreamingResponse(self) - - -class CommitsResourceWithRawResponse: - def __init__(self, commits: CommitsResource) -> None: - self._commits = commits - - @cached_property - def test_results(self) -> TestResultsResourceWithRawResponse: - return TestResultsResourceWithRawResponse(self._commits.test_results) - - -class AsyncCommitsResourceWithRawResponse: - def __init__(self, commits: AsyncCommitsResource) -> None: - self._commits = commits - - @cached_property - def test_results(self) -> AsyncTestResultsResourceWithRawResponse: - return AsyncTestResultsResourceWithRawResponse(self._commits.test_results) - - -class CommitsResourceWithStreamingResponse: - def __init__(self, commits: CommitsResource) -> None: - self._commits = commits - - @cached_property - def test_results(self) -> TestResultsResourceWithStreamingResponse: - return TestResultsResourceWithStreamingResponse(self._commits.test_results) - - -class AsyncCommitsResourceWithStreamingResponse: - def __init__(self, commits: AsyncCommitsResource) -> None: - self._commits = commits - - @cached_property - def test_results(self) -> AsyncTestResultsResourceWithStreamingResponse: - return AsyncTestResultsResourceWithStreamingResponse(self._commits.test_results) diff --git a/src/openlayer/resources/commits/test_results.py b/src/openlayer/resources/commits/test_results.py deleted file mode 100644 index f7aa939a..00000000 --- a/src/openlayer/resources/commits/test_results.py +++ /dev/null @@ -1,216 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import ( - make_request_options, -) -from ...types.commits import test_result_list_params -from ...types.commits.test_result_list_response import TestResultListResponse - -__all__ = ["TestResultsResource", "AsyncTestResultsResource"] - - -class TestResultsResource(SyncAPIResource): - __test__ = False - - @cached_property - def with_raw_response(self) -> TestResultsResourceWithRawResponse: - return TestResultsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TestResultsResourceWithStreamingResponse: - return TestResultsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - include_archived: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["running", "passing", "failing", "skipped", "error"] | NotGiven = NOT_GIVEN, - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TestResultListResponse: - """ - List the test results for a commit (project version). - - Args: - include_archived: Include archived goals. - - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - status: Filter list of test results by status. Available statuses are `running`, - `passing`, `failing`, `skipped`, and `error`. - - type: Filter objects by test type. Available types are `integrity`, `consistency`, - `performance`, `fairness`, and `robustness`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/versions/{id}/results", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_archived": include_archived, - "page": page, - "per_page": per_page, - "status": status, - "type": type, - }, - test_result_list_params.TestResultListParams, - ), - ), - cast_to=TestResultListResponse, - ) - - -class AsyncTestResultsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTestResultsResourceWithRawResponse: - return AsyncTestResultsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTestResultsResourceWithStreamingResponse: - return AsyncTestResultsResourceWithStreamingResponse(self) - - async def list( - self, - id: str, - *, - include_archived: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["running", "passing", "failing", "skipped", "error"] | NotGiven = NOT_GIVEN, - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TestResultListResponse: - """ - List the test results for a commit (project version). - - Args: - include_archived: Include archived goals. - - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - status: Filter list of test results by status. Available statuses are `running`, - `passing`, `failing`, `skipped`, and `error`. - - type: Filter objects by test type. Available types are `integrity`, `consistency`, - `performance`, `fairness`, and `robustness`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/versions/{id}/results", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_archived": include_archived, - "page": page, - "per_page": per_page, - "status": status, - "type": type, - }, - test_result_list_params.TestResultListParams, - ), - ), - cast_to=TestResultListResponse, - ) - - -class TestResultsResourceWithRawResponse: - __test__ = False - - def __init__(self, test_results: TestResultsResource) -> None: - self._test_results = test_results - - self.list = to_raw_response_wrapper( - test_results.list, - ) - - -class AsyncTestResultsResourceWithRawResponse: - def __init__(self, test_results: AsyncTestResultsResource) -> None: - self._test_results = test_results - - self.list = async_to_raw_response_wrapper( - test_results.list, - ) - - -class TestResultsResourceWithStreamingResponse: - __test__ = False - - def __init__(self, test_results: TestResultsResource) -> None: - self._test_results = test_results - - self.list = to_streamed_response_wrapper( - test_results.list, - ) - - -class AsyncTestResultsResourceWithStreamingResponse: - def __init__(self, test_results: AsyncTestResultsResource) -> None: - self._test_results = test_results - - self.list = async_to_streamed_response_wrapper( - test_results.list, - ) diff --git a/src/openlayer/resources/inference_pipelines/__init__.py b/src/openlayer/resources/inference_pipelines/__init__.py deleted file mode 100644 index fada9d79..00000000 --- a/src/openlayer/resources/inference_pipelines/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .data import ( - DataResource, - AsyncDataResource, - DataResourceWithRawResponse, - AsyncDataResourceWithRawResponse, - DataResourceWithStreamingResponse, - AsyncDataResourceWithStreamingResponse, -) -from .test_results import ( - TestResultsResource, - AsyncTestResultsResource, - TestResultsResourceWithRawResponse, - AsyncTestResultsResourceWithRawResponse, - TestResultsResourceWithStreamingResponse, - AsyncTestResultsResourceWithStreamingResponse, -) -from .inference_pipelines import ( - InferencePipelinesResource, - AsyncInferencePipelinesResource, - InferencePipelinesResourceWithRawResponse, - AsyncInferencePipelinesResourceWithRawResponse, - InferencePipelinesResourceWithStreamingResponse, - AsyncInferencePipelinesResourceWithStreamingResponse, -) - -__all__ = [ - "DataResource", - "AsyncDataResource", - "DataResourceWithRawResponse", - "AsyncDataResourceWithRawResponse", - "DataResourceWithStreamingResponse", - "AsyncDataResourceWithStreamingResponse", - "TestResultsResource", - "AsyncTestResultsResource", - "TestResultsResourceWithRawResponse", - "AsyncTestResultsResourceWithRawResponse", - "TestResultsResourceWithStreamingResponse", - "AsyncTestResultsResourceWithStreamingResponse", - "InferencePipelinesResource", - "AsyncInferencePipelinesResource", - "InferencePipelinesResourceWithRawResponse", - "AsyncInferencePipelinesResourceWithRawResponse", - "InferencePipelinesResourceWithStreamingResponse", - "AsyncInferencePipelinesResourceWithStreamingResponse", -] diff --git a/src/openlayer/resources/inference_pipelines/data.py b/src/openlayer/resources/inference_pipelines/data.py deleted file mode 100644 index 00199059..00000000 --- a/src/openlayer/resources/inference_pipelines/data.py +++ /dev/null @@ -1,178 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import ( - make_request_options, -) -from ...types.inference_pipelines import data_stream_params -from ...types.inference_pipelines.data_stream_response import DataStreamResponse - -__all__ = ["DataResource", "AsyncDataResource"] - - -class DataResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DataResourceWithRawResponse: - return DataResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DataResourceWithStreamingResponse: - return DataResourceWithStreamingResponse(self) - - def stream( - self, - id: str, - *, - config: data_stream_params.Config, - rows: Iterable[Dict[str, object]], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DataStreamResponse: - """ - Stream production data to an inference pipeline in Openlayer. - - Args: - config: Configuration for the data stream. Depends on your **Openlayer project task - type**. - - rows: A list of entries that represent rows of a csv file - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/inference-pipelines/{id}/data-stream", - body=maybe_transform( - { - "config": config, - "rows": rows, - }, - data_stream_params.DataStreamParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DataStreamResponse, - ) - - -class AsyncDataResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDataResourceWithRawResponse: - return AsyncDataResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDataResourceWithStreamingResponse: - return AsyncDataResourceWithStreamingResponse(self) - - async def stream( - self, - id: str, - *, - config: data_stream_params.Config, - rows: Iterable[Dict[str, object]], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DataStreamResponse: - """ - Stream production data to an inference pipeline in Openlayer. - - Args: - config: Configuration for the data stream. Depends on your **Openlayer project task - type**. - - rows: A list of entries that represent rows of a csv file - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/inference-pipelines/{id}/data-stream", - body=await async_maybe_transform( - { - "config": config, - "rows": rows, - }, - data_stream_params.DataStreamParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DataStreamResponse, - ) - - -class DataResourceWithRawResponse: - def __init__(self, data: DataResource) -> None: - self._data = data - - self.stream = to_raw_response_wrapper( - data.stream, - ) - - -class AsyncDataResourceWithRawResponse: - def __init__(self, data: AsyncDataResource) -> None: - self._data = data - - self.stream = async_to_raw_response_wrapper( - data.stream, - ) - - -class DataResourceWithStreamingResponse: - def __init__(self, data: DataResource) -> None: - self._data = data - - self.stream = to_streamed_response_wrapper( - data.stream, - ) - - -class AsyncDataResourceWithStreamingResponse: - def __init__(self, data: AsyncDataResource) -> None: - self._data = data - - self.stream = async_to_streamed_response_wrapper( - data.stream, - ) diff --git a/src/openlayer/resources/inference_pipelines/inference_pipelines.py b/src/openlayer/resources/inference_pipelines/inference_pipelines.py deleted file mode 100644 index 10853fe5..00000000 --- a/src/openlayer/resources/inference_pipelines/inference_pipelines.py +++ /dev/null @@ -1,112 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .data import ( - DataResource, - AsyncDataResource, - DataResourceWithRawResponse, - AsyncDataResourceWithRawResponse, - DataResourceWithStreamingResponse, - AsyncDataResourceWithStreamingResponse, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .test_results import ( - TestResultsResource, - AsyncTestResultsResource, - TestResultsResourceWithRawResponse, - AsyncTestResultsResourceWithRawResponse, - TestResultsResourceWithStreamingResponse, - AsyncTestResultsResourceWithStreamingResponse, -) - -__all__ = ["InferencePipelinesResource", "AsyncInferencePipelinesResource"] - - -class InferencePipelinesResource(SyncAPIResource): - @cached_property - def data(self) -> DataResource: - return DataResource(self._client) - - @cached_property - def test_results(self) -> TestResultsResource: - return TestResultsResource(self._client) - - @cached_property - def with_raw_response(self) -> InferencePipelinesResourceWithRawResponse: - return InferencePipelinesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> InferencePipelinesResourceWithStreamingResponse: - return InferencePipelinesResourceWithStreamingResponse(self) - - -class AsyncInferencePipelinesResource(AsyncAPIResource): - @cached_property - def data(self) -> AsyncDataResource: - return AsyncDataResource(self._client) - - @cached_property - def test_results(self) -> AsyncTestResultsResource: - return AsyncTestResultsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncInferencePipelinesResourceWithRawResponse: - return AsyncInferencePipelinesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncInferencePipelinesResourceWithStreamingResponse: - return AsyncInferencePipelinesResourceWithStreamingResponse(self) - - -class InferencePipelinesResourceWithRawResponse: - def __init__(self, inference_pipelines: InferencePipelinesResource) -> None: - self._inference_pipelines = inference_pipelines - - @cached_property - def data(self) -> DataResourceWithRawResponse: - return DataResourceWithRawResponse(self._inference_pipelines.data) - - @cached_property - def test_results(self) -> TestResultsResourceWithRawResponse: - return TestResultsResourceWithRawResponse(self._inference_pipelines.test_results) - - -class AsyncInferencePipelinesResourceWithRawResponse: - def __init__(self, inference_pipelines: AsyncInferencePipelinesResource) -> None: - self._inference_pipelines = inference_pipelines - - @cached_property - def data(self) -> AsyncDataResourceWithRawResponse: - return AsyncDataResourceWithRawResponse(self._inference_pipelines.data) - - @cached_property - def test_results(self) -> AsyncTestResultsResourceWithRawResponse: - return AsyncTestResultsResourceWithRawResponse(self._inference_pipelines.test_results) - - -class InferencePipelinesResourceWithStreamingResponse: - def __init__(self, inference_pipelines: InferencePipelinesResource) -> None: - self._inference_pipelines = inference_pipelines - - @cached_property - def data(self) -> DataResourceWithStreamingResponse: - return DataResourceWithStreamingResponse(self._inference_pipelines.data) - - @cached_property - def test_results(self) -> TestResultsResourceWithStreamingResponse: - return TestResultsResourceWithStreamingResponse(self._inference_pipelines.test_results) - - -class AsyncInferencePipelinesResourceWithStreamingResponse: - def __init__(self, inference_pipelines: AsyncInferencePipelinesResource) -> None: - self._inference_pipelines = inference_pipelines - - @cached_property - def data(self) -> AsyncDataResourceWithStreamingResponse: - return AsyncDataResourceWithStreamingResponse(self._inference_pipelines.data) - - @cached_property - def test_results(self) -> AsyncTestResultsResourceWithStreamingResponse: - return AsyncTestResultsResourceWithStreamingResponse(self._inference_pipelines.test_results) diff --git a/src/openlayer/resources/inference_pipelines/test_results.py b/src/openlayer/resources/inference_pipelines/test_results.py deleted file mode 100644 index fd63ee8a..00000000 --- a/src/openlayer/resources/inference_pipelines/test_results.py +++ /dev/null @@ -1,216 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import ( - make_request_options, -) -from ...types.inference_pipelines import test_result_list_params -from ...types.inference_pipelines.test_result_list_response import TestResultListResponse - -__all__ = ["TestResultsResource", "AsyncTestResultsResource"] - - -class TestResultsResource(SyncAPIResource): - __test__ = False - - @cached_property - def with_raw_response(self) -> TestResultsResourceWithRawResponse: - return TestResultsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TestResultsResourceWithStreamingResponse: - return TestResultsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - include_archived: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["running", "passing", "failing", "skipped", "error"] | NotGiven = NOT_GIVEN, - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TestResultListResponse: - """ - List the test results under an inference pipeline. - - Args: - include_archived: Include archived goals. - - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - status: Filter list of test results by status. Available statuses are `running`, - `passing`, `failing`, `skipped`, and `error`. - - type: Filter objects by test type. Available types are `integrity`, `consistency`, - `performance`, `fairness`, and `robustness`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/inference-pipelines/{id}/results", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_archived": include_archived, - "page": page, - "per_page": per_page, - "status": status, - "type": type, - }, - test_result_list_params.TestResultListParams, - ), - ), - cast_to=TestResultListResponse, - ) - - -class AsyncTestResultsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTestResultsResourceWithRawResponse: - return AsyncTestResultsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTestResultsResourceWithStreamingResponse: - return AsyncTestResultsResourceWithStreamingResponse(self) - - async def list( - self, - id: str, - *, - include_archived: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["running", "passing", "failing", "skipped", "error"] | NotGiven = NOT_GIVEN, - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TestResultListResponse: - """ - List the test results under an inference pipeline. - - Args: - include_archived: Include archived goals. - - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - status: Filter list of test results by status. Available statuses are `running`, - `passing`, `failing`, `skipped`, and `error`. - - type: Filter objects by test type. Available types are `integrity`, `consistency`, - `performance`, `fairness`, and `robustness`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/inference-pipelines/{id}/results", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_archived": include_archived, - "page": page, - "per_page": per_page, - "status": status, - "type": type, - }, - test_result_list_params.TestResultListParams, - ), - ), - cast_to=TestResultListResponse, - ) - - -class TestResultsResourceWithRawResponse: - __test__ = False - - def __init__(self, test_results: TestResultsResource) -> None: - self._test_results = test_results - - self.list = to_raw_response_wrapper( - test_results.list, - ) - - -class AsyncTestResultsResourceWithRawResponse: - def __init__(self, test_results: AsyncTestResultsResource) -> None: - self._test_results = test_results - - self.list = async_to_raw_response_wrapper( - test_results.list, - ) - - -class TestResultsResourceWithStreamingResponse: - __test__ = False - - def __init__(self, test_results: TestResultsResource) -> None: - self._test_results = test_results - - self.list = to_streamed_response_wrapper( - test_results.list, - ) - - -class AsyncTestResultsResourceWithStreamingResponse: - def __init__(self, test_results: AsyncTestResultsResource) -> None: - self._test_results = test_results - - self.list = async_to_streamed_response_wrapper( - test_results.list, - ) diff --git a/src/openlayer/resources/projects/__init__.py b/src/openlayer/resources/projects/__init__.py index b1c3a40b..60721a07 100644 --- a/src/openlayer/resources/projects/__init__.py +++ b/src/openlayer/resources/projects/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .commits import ( - CommitsResource, - AsyncCommitsResource, - CommitsResourceWithRawResponse, - AsyncCommitsResourceWithRawResponse, - CommitsResourceWithStreamingResponse, - AsyncCommitsResourceWithStreamingResponse, -) from .projects import ( ProjectsResource, AsyncProjectsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "CommitsResource", - "AsyncCommitsResource", - "CommitsResourceWithRawResponse", - "AsyncCommitsResourceWithRawResponse", - "CommitsResourceWithStreamingResponse", - "AsyncCommitsResourceWithStreamingResponse", "ProjectsResource", "AsyncProjectsResource", "ProjectsResourceWithRawResponse", diff --git a/src/openlayer/resources/projects/commits.py b/src/openlayer/resources/projects/commits.py deleted file mode 100644 index 0252f17f..00000000 --- a/src/openlayer/resources/projects/commits.py +++ /dev/null @@ -1,180 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import ( - make_request_options, -) -from ...types.projects import commit_list_params -from ...types.projects.commit_list_response import CommitListResponse - -__all__ = ["CommitsResource", "AsyncCommitsResource"] - - -class CommitsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> CommitsResourceWithRawResponse: - return CommitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> CommitsResourceWithStreamingResponse: - return CommitsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CommitListResponse: - """ - List the commits (project versions) under a project. - - Args: - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/projects/{id}/versions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - }, - commit_list_params.CommitListParams, - ), - ), - cast_to=CommitListResponse, - ) - - -class AsyncCommitsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncCommitsResourceWithRawResponse: - return AsyncCommitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncCommitsResourceWithStreamingResponse: - return AsyncCommitsResourceWithStreamingResponse(self) - - async def list( - self, - id: str, - *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CommitListResponse: - """ - List the commits (project versions) under a project. - - Args: - page: The page to return in a paginated query. - - per_page: Maximum number of items to return per page. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/projects/{id}/versions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "page": page, - "per_page": per_page, - }, - commit_list_params.CommitListParams, - ), - ), - cast_to=CommitListResponse, - ) - - -class CommitsResourceWithRawResponse: - def __init__(self, commits: CommitsResource) -> None: - self._commits = commits - - self.list = to_raw_response_wrapper( - commits.list, - ) - - -class AsyncCommitsResourceWithRawResponse: - def __init__(self, commits: AsyncCommitsResource) -> None: - self._commits = commits - - self.list = async_to_raw_response_wrapper( - commits.list, - ) - - -class CommitsResourceWithStreamingResponse: - def __init__(self, commits: CommitsResource) -> None: - self._commits = commits - - self.list = to_streamed_response_wrapper( - commits.list, - ) - - -class AsyncCommitsResourceWithStreamingResponse: - def __init__(self, commits: AsyncCommitsResource) -> None: - self._commits = commits - - self.list = async_to_streamed_response_wrapper( - commits.list, - ) diff --git a/src/openlayer/resources/projects/projects.py b/src/openlayer/resources/projects/projects.py index 341b37d5..d2d73208 100644 --- a/src/openlayer/resources/projects/projects.py +++ b/src/openlayer/resources/projects/projects.py @@ -8,14 +8,6 @@ import httpx from ...types import project_list_params, project_create_params -from .commits import ( - CommitsResource, - AsyncCommitsResource, - CommitsResourceWithRawResponse, - AsyncCommitsResourceWithRawResponse, - CommitsResourceWithStreamingResponse, - AsyncCommitsResourceWithStreamingResponse, -) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -39,10 +31,6 @@ class ProjectsResource(SyncAPIResource): - @cached_property - def commits(self) -> CommitsResource: - return CommitsResource(self._client) - @cached_property def with_raw_response(self) -> ProjectsResourceWithRawResponse: return ProjectsResourceWithRawResponse(self) @@ -58,9 +46,6 @@ def create( task_type: Literal["llm-base", "tabular-classification", "tabular-regression", "text-classification"], description: Optional[str] | NotGiven = NOT_GIVEN, git_repo: Optional[project_create_params.GitRepo] | NotGiven = NOT_GIVEN, - slack_channel_id: Optional[str] | NotGiven = NOT_GIVEN, - slack_channel_name: Optional[str] | NotGiven = NOT_GIVEN, - slack_channel_notifications_enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,12 +63,6 @@ def create( description: The project description. - slack_channel_id: The slack channel id connected to the project. - - slack_channel_name: The slack channel connected to the project. - - slack_channel_notifications_enabled: Whether slack channel notifications are enabled for the project. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -100,9 +79,6 @@ def create( "task_type": task_type, "description": description, "git_repo": git_repo, - "slack_channel_id": slack_channel_id, - "slack_channel_name": slack_channel_name, - "slack_channel_notifications_enabled": slack_channel_notifications_enabled, }, project_create_params.ProjectCreateParams, ), @@ -169,10 +145,6 @@ def list( class AsyncProjectsResource(AsyncAPIResource): - @cached_property - def commits(self) -> AsyncCommitsResource: - return AsyncCommitsResource(self._client) - @cached_property def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: return AsyncProjectsResourceWithRawResponse(self) @@ -188,9 +160,6 @@ async def create( task_type: Literal["llm-base", "tabular-classification", "tabular-regression", "text-classification"], description: Optional[str] | NotGiven = NOT_GIVEN, git_repo: Optional[project_create_params.GitRepo] | NotGiven = NOT_GIVEN, - slack_channel_id: Optional[str] | NotGiven = NOT_GIVEN, - slack_channel_name: Optional[str] | NotGiven = NOT_GIVEN, - slack_channel_notifications_enabled: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -208,12 +177,6 @@ async def create( description: The project description. - slack_channel_id: The slack channel id connected to the project. - - slack_channel_name: The slack channel connected to the project. - - slack_channel_notifications_enabled: Whether slack channel notifications are enabled for the project. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -230,9 +193,6 @@ async def create( "task_type": task_type, "description": description, "git_repo": git_repo, - "slack_channel_id": slack_channel_id, - "slack_channel_name": slack_channel_name, - "slack_channel_notifications_enabled": slack_channel_notifications_enabled, }, project_create_params.ProjectCreateParams, ), @@ -309,10 +269,6 @@ def __init__(self, projects: ProjectsResource) -> None: projects.list, ) - @cached_property - def commits(self) -> CommitsResourceWithRawResponse: - return CommitsResourceWithRawResponse(self._projects.commits) - class AsyncProjectsResourceWithRawResponse: def __init__(self, projects: AsyncProjectsResource) -> None: @@ -325,10 +281,6 @@ def __init__(self, projects: AsyncProjectsResource) -> None: projects.list, ) - @cached_property - def commits(self) -> AsyncCommitsResourceWithRawResponse: - return AsyncCommitsResourceWithRawResponse(self._projects.commits) - class ProjectsResourceWithStreamingResponse: def __init__(self, projects: ProjectsResource) -> None: @@ -341,10 +293,6 @@ def __init__(self, projects: ProjectsResource) -> None: projects.list, ) - @cached_property - def commits(self) -> CommitsResourceWithStreamingResponse: - return CommitsResourceWithStreamingResponse(self._projects.commits) - class AsyncProjectsResourceWithStreamingResponse: def __init__(self, projects: AsyncProjectsResource) -> None: @@ -356,7 +304,3 @@ def __init__(self, projects: AsyncProjectsResource) -> None: self.list = async_to_streamed_response_wrapper( projects.list, ) - - @cached_property - def commits(self) -> AsyncCommitsResourceWithStreamingResponse: - return AsyncCommitsResourceWithStreamingResponse(self._projects.commits) diff --git a/src/openlayer/types/commits/__init__.py b/src/openlayer/types/commits/__init__.py index 3208a274..f8ee8b14 100644 --- a/src/openlayer/types/commits/__init__.py +++ b/src/openlayer/types/commits/__init__.py @@ -1,6 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .test_result_list_params import TestResultListParams as TestResultListParams -from .test_result_list_response import TestResultListResponse as TestResultListResponse diff --git a/src/openlayer/types/commits/test_result_list_params.py b/src/openlayer/types/commits/test_result_list_params.py deleted file mode 100644 index d158bba3..00000000 --- a/src/openlayer/types/commits/test_result_list_params.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TestResultListParams"] - - -class TestResultListParams(TypedDict, total=False): - include_archived: Annotated[bool, PropertyInfo(alias="includeArchived")] - """Include archived goals.""" - - page: int - """The page to return in a paginated query.""" - - per_page: Annotated[int, PropertyInfo(alias="perPage")] - """Maximum number of items to return per page.""" - - status: Literal["running", "passing", "failing", "skipped", "error"] - """Filter list of test results by status. - - Available statuses are `running`, `passing`, `failing`, `skipped`, and `error`. - """ - - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] - """Filter objects by test type. - - Available types are `integrity`, `consistency`, `performance`, `fairness`, and - `robustness`. - """ diff --git a/src/openlayer/types/commits/test_result_list_response.py b/src/openlayer/types/commits/test_result_list_response.py deleted file mode 100644 index b099bfe0..00000000 --- a/src/openlayer/types/commits/test_result_list_response.py +++ /dev/null @@ -1,152 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["TestResultListResponse", "_Meta", "Item", "ItemGoal", "ItemGoalThreshold"] - - -class _Meta(BaseModel): - page: int - """The current page.""" - - per_page: int = FieldInfo(alias="perPage") - """The number of items per page.""" - - total_items: int = FieldInfo(alias="totalItems") - """The total number of items.""" - - total_pages: int = FieldInfo(alias="totalPages") - """The total number of pages.""" - - -class ItemGoalThreshold(BaseModel): - insight_name: Optional[str] = FieldInfo(alias="insightName", default=None) - """The insight name to be evaluated.""" - - insight_parameters: Optional[List[object]] = FieldInfo(alias="insightParameters", default=None) - - measurement: Optional[str] = None - """The measurement to be evaluated.""" - - operator: Optional[str] = None - """The operator to be used for the evaluation.""" - - value: Union[float, bool, str, List[str], None] = None - """The value to be compared.""" - - -class ItemGoal(BaseModel): - id: str - """The test id.""" - - comment_count: int = FieldInfo(alias="commentCount") - """The number of comments on the test.""" - - creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None) - """The test creator id.""" - - date_archived: Optional[datetime] = FieldInfo(alias="dateArchived", default=None) - """The date the test was archived.""" - - date_created: datetime = FieldInfo(alias="dateCreated") - """The creation date.""" - - date_updated: datetime = FieldInfo(alias="dateUpdated") - """The last updated date.""" - - description: Optional[object] = None - """The test description.""" - - name: str - """The test name.""" - - number: int - """The test number.""" - - origin_project_version_id: Optional[str] = FieldInfo(alias="originProjectVersionId", default=None) - """The project version (commit) id where the test was created.""" - - subtype: str - """The test subtype.""" - - suggested: bool - """Whether the test is suggested or user-created.""" - - thresholds: List[ItemGoalThreshold] - - type: str - """The test type.""" - - archived: Optional[bool] = None - """Whether the test is archived.""" - - delay_window: Optional[float] = FieldInfo(alias="delayWindow", default=None) - """The delay window in seconds. Only applies to tests that use production data.""" - - evaluation_window: Optional[float] = FieldInfo(alias="evaluationWindow", default=None) - """The evaluation window in seconds. - - Only applies to tests that use production data. - """ - - uses_ml_model: Optional[bool] = FieldInfo(alias="usesMlModel", default=None) - """Whether the test uses an ML model.""" - - uses_production_data: Optional[bool] = FieldInfo(alias="usesProductionData", default=None) - """Whether the test uses production data (monitoring mode only).""" - - uses_reference_dataset: Optional[bool] = FieldInfo(alias="usesReferenceDataset", default=None) - """Whether the test uses a reference dataset (monitoring mode only).""" - - uses_training_dataset: Optional[bool] = FieldInfo(alias="usesTrainingDataset", default=None) - """Whether the test uses a training dataset.""" - - uses_validation_dataset: Optional[bool] = FieldInfo(alias="usesValidationDataset", default=None) - """Whether the test uses a validation dataset.""" - - -class Item(BaseModel): - id: str - """Project version (commit) id.""" - - date_created: datetime = FieldInfo(alias="dateCreated") - """The creation date.""" - - date_data_ends: Optional[datetime] = FieldInfo(alias="dateDataEnds", default=None) - """The data end date.""" - - date_data_starts: Optional[datetime] = FieldInfo(alias="dateDataStarts", default=None) - """The data start date.""" - - date_updated: datetime = FieldInfo(alias="dateUpdated") - """The last updated date.""" - - inference_pipeline_id: Optional[str] = FieldInfo(alias="inferencePipelineId", default=None) - """The inference pipeline id.""" - - project_version_id: Optional[str] = FieldInfo(alias="projectVersionId", default=None) - """The project version (commit) id.""" - - status: Literal["running", "passing", "failing", "skipped", "error"] - """The status of the test.""" - - status_message: Optional[str] = FieldInfo(alias="statusMessage", default=None) - """The status message.""" - - goal: Optional[ItemGoal] = None - - goal_id: Optional[str] = FieldInfo(alias="goalId", default=None) - """The test id.""" - - -class TestResultListResponse(BaseModel): - __test__ = False - api_meta: _Meta = FieldInfo(alias="_meta") - - items: List[Item] diff --git a/src/openlayer/types/inference_pipelines/__init__.py b/src/openlayer/types/inference_pipelines/__init__.py index 69717a48..f8ee8b14 100644 --- a/src/openlayer/types/inference_pipelines/__init__.py +++ b/src/openlayer/types/inference_pipelines/__init__.py @@ -1,8 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .data_stream_params import DataStreamParams as DataStreamParams -from .data_stream_response import DataStreamResponse as DataStreamResponse -from .test_result_list_params import TestResultListParams as TestResultListParams -from .test_result_list_response import TestResultListResponse as TestResultListResponse diff --git a/src/openlayer/types/inference_pipelines/data_stream_params.py b/src/openlayer/types/inference_pipelines/data_stream_params.py deleted file mode 100644 index b452cb35..00000000 --- a/src/openlayer/types/inference_pipelines/data_stream_params.py +++ /dev/null @@ -1,231 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = [ - "DataStreamParams", - "Config", - "ConfigLlmData", - "ConfigLlmDataPrompt", - "ConfigTabularClassificationData", - "ConfigTabularRegressionData", - "ConfigTextClassificationData", -] - - -class DataStreamParams(TypedDict, total=False): - config: Required[Config] - """Configuration for the data stream. - - Depends on your **Openlayer project task type**. - """ - - rows: Required[Iterable[Dict[str, object]]] - """A list of entries that represent rows of a csv file""" - - -class ConfigLlmDataPrompt(TypedDict, total=False): - content: str - """Content of the prompt.""" - - role: str - """Role of the prompt.""" - - -class ConfigLlmData(TypedDict, total=False): - output_column_name: Required[Annotated[str, PropertyInfo(alias="outputColumnName")]] - """Name of the column with the model outputs.""" - - context_column_name: Annotated[str, PropertyInfo(alias="contextColumnName")] - """Name of the column with the context retrieved. - - Applies to RAG use cases. Providing the context enables RAG-specific metrics. - """ - - cost_column_name: Annotated[str, PropertyInfo(alias="costColumnName")] - """Name of the column with the cost associated with each row.""" - - ground_truth_column_name: Annotated[str, PropertyInfo(alias="groundTruthColumnName")] - """Name of the column with the ground truths.""" - - inference_id_column_name: Annotated[str, PropertyInfo(alias="inferenceIdColumnName")] - """Name of the column with the inference ids. - - This is useful if you want to update rows at a later point in time. If not - provided, a unique id is generated by Openlayer. - """ - - input_variable_names: Annotated[List[str], PropertyInfo(alias="inputVariableNames")] - """Array of input variable names. Each input variable should be a dataset column.""" - - latency_column_name: Annotated[str, PropertyInfo(alias="latencyColumnName")] - """Name of the column with the latencies.""" - - metadata: object - """Object with metadata.""" - - num_of_token_column_name: Annotated[Optional[str], PropertyInfo(alias="numOfTokenColumnName")] - """Name of the column with the total number of tokens.""" - - prompt: Iterable[ConfigLlmDataPrompt] - """Prompt for the LLM.""" - - question_column_name: Annotated[str, PropertyInfo(alias="questionColumnName")] - """Name of the column with the questions. - - Applies to RAG use cases. Providing the question enables RAG-specific metrics. - """ - - timestamp_column_name: Annotated[str, PropertyInfo(alias="timestampColumnName")] - """Name of the column with the timestamps. - - Timestamps must be in UNIX sec format. If not provided, the upload timestamp is - used. - """ - - -class ConfigTabularClassificationData(TypedDict, total=False): - class_names: Required[Annotated[List[str], PropertyInfo(alias="classNames")]] - """List of class names indexed by label integer in the dataset. - - E.g. ["Retained", "Exited"] when 0, 1 are in your label column. - """ - - categorical_feature_names: Annotated[List[str], PropertyInfo(alias="categoricalFeatureNames")] - """Array with the names of all categorical features in the dataset. - - E.g. ["Gender", "Geography"]. - """ - - feature_names: Annotated[List[str], PropertyInfo(alias="featureNames")] - """Array with all input feature names.""" - - inference_id_column_name: Annotated[str, PropertyInfo(alias="inferenceIdColumnName")] - """Name of the column with the inference ids. - - This is useful if you want to update rows at a later point in time. If not - provided, a unique id is generated by Openlayer. - """ - - label_column_name: Annotated[str, PropertyInfo(alias="labelColumnName")] - """Name of the column with the labels. - - The data in this column must be **zero-indexed integers**, matching the list - provided in `classNames`. - """ - - latency_column_name: Annotated[str, PropertyInfo(alias="latencyColumnName")] - """Name of the column with the latencies.""" - - metadata: object - """Object with metadata.""" - - predictions_column_name: Annotated[str, PropertyInfo(alias="predictionsColumnName")] - """Name of the column with the model's predictions as **zero-indexed integers**.""" - - prediction_scores_column_name: Annotated[str, PropertyInfo(alias="predictionScoresColumnName")] - """ - Name of the column with the model's predictions as **lists of class - probabilities**. - """ - - timestamp_column_name: Annotated[str, PropertyInfo(alias="timestampColumnName")] - """Name of the column with the timestamps. - - Timestamps must be in UNIX sec format. If not provided, the upload timestamp is - used. - """ - - -class ConfigTabularRegressionData(TypedDict, total=False): - categorical_feature_names: Annotated[List[str], PropertyInfo(alias="categoricalFeatureNames")] - """Array with the names of all categorical features in the dataset. - - E.g. ["Gender", "Geography"]. - """ - - feature_names: Annotated[List[str], PropertyInfo(alias="featureNames")] - """Array with all input feature names.""" - - inference_id_column_name: Annotated[str, PropertyInfo(alias="inferenceIdColumnName")] - """Name of the column with the inference ids. - - This is useful if you want to update rows at a later point in time. If not - provided, a unique id is generated by Openlayer. - """ - - latency_column_name: Annotated[str, PropertyInfo(alias="latencyColumnName")] - """Name of the column with the latencies.""" - - metadata: object - """Object with metadata.""" - - predictions_column_name: Annotated[str, PropertyInfo(alias="predictionsColumnName")] - """Name of the column with the model's predictions.""" - - target_column_name: Annotated[str, PropertyInfo(alias="targetColumnName")] - """Name of the column with the targets (ground truth values).""" - - timestamp_column_name: Annotated[str, PropertyInfo(alias="timestampColumnName")] - """Name of the column with the timestamps. - - Timestamps must be in UNIX sec format. If not provided, the upload timestamp is - used. - """ - - -class ConfigTextClassificationData(TypedDict, total=False): - class_names: Required[Annotated[List[str], PropertyInfo(alias="classNames")]] - """List of class names indexed by label integer in the dataset. - - E.g. ["Retained", "Exited"] when 0, 1 are in your label column. - """ - - inference_id_column_name: Annotated[str, PropertyInfo(alias="inferenceIdColumnName")] - """Name of the column with the inference ids. - - This is useful if you want to update rows at a later point in time. If not - provided, a unique id is generated by Openlayer. - """ - - label_column_name: Annotated[str, PropertyInfo(alias="labelColumnName")] - """Name of the column with the labels. - - The data in this column must be **zero-indexed integers**, matching the list - provided in `classNames`. - """ - - latency_column_name: Annotated[str, PropertyInfo(alias="latencyColumnName")] - """Name of the column with the latencies.""" - - metadata: object - """Object with metadata.""" - - predictions_column_name: Annotated[str, PropertyInfo(alias="predictionsColumnName")] - """Name of the column with the model's predictions as **zero-indexed integers**.""" - - prediction_scores_column_name: Annotated[str, PropertyInfo(alias="predictionScoresColumnName")] - """ - Name of the column with the model's predictions as **lists of class - probabilities**. - """ - - text_column_name: Annotated[str, PropertyInfo(alias="textColumnName")] - """Name of the column with the text data.""" - - timestamp_column_name: Annotated[str, PropertyInfo(alias="timestampColumnName")] - """Name of the column with the timestamps. - - Timestamps must be in UNIX sec format. If not provided, the upload timestamp is - used. - """ - - -Config = Union[ - ConfigLlmData, ConfigTabularClassificationData, ConfigTabularRegressionData, ConfigTextClassificationData -] diff --git a/src/openlayer/types/inference_pipelines/data_stream_response.py b/src/openlayer/types/inference_pipelines/data_stream_response.py deleted file mode 100644 index 3863d3ff..00000000 --- a/src/openlayer/types/inference_pipelines/data_stream_response.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["DataStreamResponse"] - - -class DataStreamResponse(BaseModel): - success: Literal[True] diff --git a/src/openlayer/types/inference_pipelines/test_result_list_params.py b/src/openlayer/types/inference_pipelines/test_result_list_params.py deleted file mode 100644 index d158bba3..00000000 --- a/src/openlayer/types/inference_pipelines/test_result_list_params.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["TestResultListParams"] - - -class TestResultListParams(TypedDict, total=False): - include_archived: Annotated[bool, PropertyInfo(alias="includeArchived")] - """Include archived goals.""" - - page: int - """The page to return in a paginated query.""" - - per_page: Annotated[int, PropertyInfo(alias="perPage")] - """Maximum number of items to return per page.""" - - status: Literal["running", "passing", "failing", "skipped", "error"] - """Filter list of test results by status. - - Available statuses are `running`, `passing`, `failing`, `skipped`, and `error`. - """ - - type: Literal["integrity", "consistency", "performance", "fairness", "robustness"] - """Filter objects by test type. - - Available types are `integrity`, `consistency`, `performance`, `fairness`, and - `robustness`. - """ diff --git a/src/openlayer/types/inference_pipelines/test_result_list_response.py b/src/openlayer/types/inference_pipelines/test_result_list_response.py deleted file mode 100644 index b099bfe0..00000000 --- a/src/openlayer/types/inference_pipelines/test_result_list_response.py +++ /dev/null @@ -1,152 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["TestResultListResponse", "_Meta", "Item", "ItemGoal", "ItemGoalThreshold"] - - -class _Meta(BaseModel): - page: int - """The current page.""" - - per_page: int = FieldInfo(alias="perPage") - """The number of items per page.""" - - total_items: int = FieldInfo(alias="totalItems") - """The total number of items.""" - - total_pages: int = FieldInfo(alias="totalPages") - """The total number of pages.""" - - -class ItemGoalThreshold(BaseModel): - insight_name: Optional[str] = FieldInfo(alias="insightName", default=None) - """The insight name to be evaluated.""" - - insight_parameters: Optional[List[object]] = FieldInfo(alias="insightParameters", default=None) - - measurement: Optional[str] = None - """The measurement to be evaluated.""" - - operator: Optional[str] = None - """The operator to be used for the evaluation.""" - - value: Union[float, bool, str, List[str], None] = None - """The value to be compared.""" - - -class ItemGoal(BaseModel): - id: str - """The test id.""" - - comment_count: int = FieldInfo(alias="commentCount") - """The number of comments on the test.""" - - creator_id: Optional[str] = FieldInfo(alias="creatorId", default=None) - """The test creator id.""" - - date_archived: Optional[datetime] = FieldInfo(alias="dateArchived", default=None) - """The date the test was archived.""" - - date_created: datetime = FieldInfo(alias="dateCreated") - """The creation date.""" - - date_updated: datetime = FieldInfo(alias="dateUpdated") - """The last updated date.""" - - description: Optional[object] = None - """The test description.""" - - name: str - """The test name.""" - - number: int - """The test number.""" - - origin_project_version_id: Optional[str] = FieldInfo(alias="originProjectVersionId", default=None) - """The project version (commit) id where the test was created.""" - - subtype: str - """The test subtype.""" - - suggested: bool - """Whether the test is suggested or user-created.""" - - thresholds: List[ItemGoalThreshold] - - type: str - """The test type.""" - - archived: Optional[bool] = None - """Whether the test is archived.""" - - delay_window: Optional[float] = FieldInfo(alias="delayWindow", default=None) - """The delay window in seconds. Only applies to tests that use production data.""" - - evaluation_window: Optional[float] = FieldInfo(alias="evaluationWindow", default=None) - """The evaluation window in seconds. - - Only applies to tests that use production data. - """ - - uses_ml_model: Optional[bool] = FieldInfo(alias="usesMlModel", default=None) - """Whether the test uses an ML model.""" - - uses_production_data: Optional[bool] = FieldInfo(alias="usesProductionData", default=None) - """Whether the test uses production data (monitoring mode only).""" - - uses_reference_dataset: Optional[bool] = FieldInfo(alias="usesReferenceDataset", default=None) - """Whether the test uses a reference dataset (monitoring mode only).""" - - uses_training_dataset: Optional[bool] = FieldInfo(alias="usesTrainingDataset", default=None) - """Whether the test uses a training dataset.""" - - uses_validation_dataset: Optional[bool] = FieldInfo(alias="usesValidationDataset", default=None) - """Whether the test uses a validation dataset.""" - - -class Item(BaseModel): - id: str - """Project version (commit) id.""" - - date_created: datetime = FieldInfo(alias="dateCreated") - """The creation date.""" - - date_data_ends: Optional[datetime] = FieldInfo(alias="dateDataEnds", default=None) - """The data end date.""" - - date_data_starts: Optional[datetime] = FieldInfo(alias="dateDataStarts", default=None) - """The data start date.""" - - date_updated: datetime = FieldInfo(alias="dateUpdated") - """The last updated date.""" - - inference_pipeline_id: Optional[str] = FieldInfo(alias="inferencePipelineId", default=None) - """The inference pipeline id.""" - - project_version_id: Optional[str] = FieldInfo(alias="projectVersionId", default=None) - """The project version (commit) id.""" - - status: Literal["running", "passing", "failing", "skipped", "error"] - """The status of the test.""" - - status_message: Optional[str] = FieldInfo(alias="statusMessage", default=None) - """The status message.""" - - goal: Optional[ItemGoal] = None - - goal_id: Optional[str] = FieldInfo(alias="goalId", default=None) - """The test id.""" - - -class TestResultListResponse(BaseModel): - __test__ = False - api_meta: _Meta = FieldInfo(alias="_meta") - - items: List[Item] diff --git a/src/openlayer/types/project_create_params.py b/src/openlayer/types/project_create_params.py index d0247453..3dc3932d 100644 --- a/src/openlayer/types/project_create_params.py +++ b/src/openlayer/types/project_create_params.py @@ -27,15 +27,6 @@ class ProjectCreateParams(TypedDict, total=False): git_repo: Annotated[Optional[GitRepo], PropertyInfo(alias="gitRepo")] - slack_channel_id: Annotated[Optional[str], PropertyInfo(alias="slackChannelId")] - """The slack channel id connected to the project.""" - - slack_channel_name: Annotated[Optional[str], PropertyInfo(alias="slackChannelName")] - """The slack channel connected to the project.""" - - slack_channel_notifications_enabled: Annotated[bool, PropertyInfo(alias="slackChannelNotificationsEnabled")] - """Whether slack channel notifications are enabled for the project.""" - class GitRepo(TypedDict, total=False): git_account_id: Required[Annotated[str, PropertyInfo(alias="gitAccountId")]] diff --git a/src/openlayer/types/project_create_response.py b/src/openlayer/types/project_create_response.py index 647dda44..e6cb64c9 100644 --- a/src/openlayer/types/project_create_response.py +++ b/src/openlayer/types/project_create_response.py @@ -72,9 +72,6 @@ class ProjectCreateResponse(BaseModel): name: str """The project name.""" - sample: bool - """Whether the project is a sample project or a user-created project.""" - source: Optional[Literal["web", "api", "null"]] = None """The source of the project.""" @@ -93,17 +90,3 @@ class ProjectCreateResponse(BaseModel): """The project description.""" git_repo: Optional[GitRepo] = FieldInfo(alias="gitRepo", default=None) - - slack_channel_id: Optional[str] = FieldInfo(alias="slackChannelId", default=None) - """The slack channel id connected to the project.""" - - slack_channel_name: Optional[str] = FieldInfo(alias="slackChannelName", default=None) - """The slack channel connected to the project.""" - - slack_channel_notifications_enabled: Optional[bool] = FieldInfo( - alias="slackChannelNotificationsEnabled", default=None - ) - """Whether slack channel notifications are enabled for the project.""" - - unread_notification_count: Optional[int] = FieldInfo(alias="unreadNotificationCount", default=None) - """The number of unread notifications in the project.""" diff --git a/src/openlayer/types/project_list_response.py b/src/openlayer/types/project_list_response.py index 3bc1c5a9..976a68b9 100644 --- a/src/openlayer/types/project_list_response.py +++ b/src/openlayer/types/project_list_response.py @@ -86,9 +86,6 @@ class Item(BaseModel): name: str """The project name.""" - sample: bool - """Whether the project is a sample project or a user-created project.""" - source: Optional[Literal["web", "api", "null"]] = None """The source of the project.""" @@ -108,20 +105,6 @@ class Item(BaseModel): git_repo: Optional[ItemGitRepo] = FieldInfo(alias="gitRepo", default=None) - slack_channel_id: Optional[str] = FieldInfo(alias="slackChannelId", default=None) - """The slack channel id connected to the project.""" - - slack_channel_name: Optional[str] = FieldInfo(alias="slackChannelName", default=None) - """The slack channel connected to the project.""" - - slack_channel_notifications_enabled: Optional[bool] = FieldInfo( - alias="slackChannelNotificationsEnabled", default=None - ) - """Whether slack channel notifications are enabled for the project.""" - - unread_notification_count: Optional[int] = FieldInfo(alias="unreadNotificationCount", default=None) - """The number of unread notifications in the project.""" - class ProjectListResponse(BaseModel): api_meta: _Meta = FieldInfo(alias="_meta") diff --git a/src/openlayer/types/projects/__init__.py b/src/openlayer/types/projects/__init__.py index 3095393f..f8ee8b14 100644 --- a/src/openlayer/types/projects/__init__.py +++ b/src/openlayer/types/projects/__init__.py @@ -1,6 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .commit_list_params import CommitListParams as CommitListParams -from .commit_list_response import CommitListResponse as CommitListResponse diff --git a/src/openlayer/types/projects/commit_list_params.py b/src/openlayer/types/projects/commit_list_params.py deleted file mode 100644 index 45e9fcaa..00000000 --- a/src/openlayer/types/projects/commit_list_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["CommitListParams"] - - -class CommitListParams(TypedDict, total=False): - page: int - """The page to return in a paginated query.""" - - per_page: Annotated[int, PropertyInfo(alias="perPage")] - """Maximum number of items to return per page.""" diff --git a/src/openlayer/types/projects/commit_list_response.py b/src/openlayer/types/projects/commit_list_response.py deleted file mode 100644 index d89b9006..00000000 --- a/src/openlayer/types/projects/commit_list_response.py +++ /dev/null @@ -1,126 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CommitListResponse", "_Meta", "Item", "ItemCommit", "ItemLinks"] - - -class _Meta(BaseModel): - page: int - """The current page.""" - - per_page: int = FieldInfo(alias="perPage") - """The number of items per page.""" - - total_items: int = FieldInfo(alias="totalItems") - """The total number of items.""" - - total_pages: int = FieldInfo(alias="totalPages") - """The total number of pages.""" - - -class ItemCommit(BaseModel): - id: str - """The commit id.""" - - author_id: str = FieldInfo(alias="authorId") - """The author id of the commit.""" - - file_size: Optional[int] = FieldInfo(alias="fileSize", default=None) - """The size of the commit bundle in bytes.""" - - message: str - """The commit message.""" - - ml_model_id: Optional[str] = FieldInfo(alias="mlModelId", default=None) - """The model id.""" - - storage_uri: str = FieldInfo(alias="storageUri") - """The storage URI where the commit bundle is stored.""" - - training_dataset_id: Optional[str] = FieldInfo(alias="trainingDatasetId", default=None) - """The training dataset id.""" - - validation_dataset_id: Optional[str] = FieldInfo(alias="validationDatasetId", default=None) - """The validation dataset id.""" - - date_created: Optional[datetime] = FieldInfo(alias="dateCreated", default=None) - """The commit creation date.""" - - git_commit_ref: Optional[str] = FieldInfo(alias="gitCommitRef", default=None) - """The ref of the corresponding git commit.""" - - git_commit_sha: Optional[int] = FieldInfo(alias="gitCommitSha", default=None) - """The SHA of the corresponding git commit.""" - - git_commit_url: Optional[str] = FieldInfo(alias="gitCommitUrl", default=None) - """The URL of the corresponding git commit.""" - - -class ItemLinks(BaseModel): - app: str - - -class Item(BaseModel): - id: str - """The project version (commit) id.""" - - commit: ItemCommit - """The details of a commit (project version).""" - - date_archived: Optional[datetime] = FieldInfo(alias="dateArchived", default=None) - """The commit archive date.""" - - date_created: datetime = FieldInfo(alias="dateCreated") - """The project version (commit) creation date.""" - - failing_goal_count: int = FieldInfo(alias="failingGoalCount") - """The number of tests that are failing for the commit.""" - - ml_model_id: Optional[str] = FieldInfo(alias="mlModelId", default=None) - """The model id.""" - - passing_goal_count: int = FieldInfo(alias="passingGoalCount") - """The number of tests that are passing for the commit.""" - - project_id: str = FieldInfo(alias="projectId") - """The project id.""" - - status: Literal["queued", "running", "paused", "failed", "completed", "unknown"] - """The commit status. - - Initially, the commit is `queued`, then, it switches to `running`. Finally, it - can be `paused`, `failed`, or `completed`. - """ - - status_message: Optional[str] = FieldInfo(alias="statusMessage", default=None) - """The commit status message.""" - - total_goal_count: int = FieldInfo(alias="totalGoalCount") - """The total number of tests for the commit.""" - - training_dataset_id: Optional[str] = FieldInfo(alias="trainingDatasetId", default=None) - """The training dataset id.""" - - validation_dataset_id: Optional[str] = FieldInfo(alias="validationDatasetId", default=None) - """The validation dataset id.""" - - archived: Optional[bool] = None - """Whether the commit is archived.""" - - deployment_status: Optional[str] = FieldInfo(alias="deploymentStatus", default=None) - """The deployment status associated with the commit's model.""" - - links: Optional[ItemLinks] = None - - -class CommitListResponse(BaseModel): - api_meta: _Meta = FieldInfo(alias="_meta") - - items: List[Item] diff --git a/tests/api_resources/commits/__init__.py b/tests/api_resources/commits/__init__.py deleted file mode 100644 index fd8019a9..00000000 --- a/tests/api_resources/commits/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/commits/test_test_results.py b/tests/api_resources/commits/test_test_results.py deleted file mode 100644 index e22aff80..00000000 --- a/tests/api_resources/commits/test_test_results.py +++ /dev/null @@ -1,122 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from openlayer import Openlayer, AsyncOpenlayer -from tests.utils import assert_matches_type -from openlayer.types.commits import TestResultListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTestResults: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Openlayer) -> None: - test_result = client.commits.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Openlayer) -> None: - test_result = client.commits.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - include_archived=True, - page=1, - per_page=1, - status="passing", - type="integrity", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Openlayer) -> None: - response = client.commits.test_results.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - test_result = response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Openlayer) -> None: - with client.commits.test_results.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - test_result = response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Openlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.commits.test_results.with_raw_response.list( - "", - ) - - -class TestAsyncTestResults: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncOpenlayer) -> None: - test_result = await async_client.commits.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncOpenlayer) -> None: - test_result = await async_client.commits.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - include_archived=True, - page=1, - per_page=1, - status="passing", - type="integrity", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncOpenlayer) -> None: - response = await async_client.commits.test_results.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - test_result = await response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncOpenlayer) -> None: - async with async_client.commits.test_results.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - test_result = await response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncOpenlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.commits.test_results.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/inference_pipelines/__init__.py b/tests/api_resources/inference_pipelines/__init__.py deleted file mode 100644 index fd8019a9..00000000 --- a/tests/api_resources/inference_pipelines/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/inference_pipelines/test_data.py b/tests/api_resources/inference_pipelines/test_data.py deleted file mode 100644 index 1e070c1b..00000000 --- a/tests/api_resources/inference_pipelines/test_data.py +++ /dev/null @@ -1,248 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from openlayer import Openlayer, AsyncOpenlayer -from tests.utils import assert_matches_type -from openlayer.types.inference_pipelines import DataStreamResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestData: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_stream(self, client: Openlayer) -> None: - data = client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - def test_method_stream_with_all_params(self, client: Openlayer) -> None: - data = client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "num_of_token_column_name": "tokens", - "context_column_name": "context", - "cost_column_name": "cost", - "ground_truth_column_name": "ground_truth", - "inference_id_column_name": "id", - "input_variable_names": ["user_query"], - "latency_column_name": "latency", - "metadata": {}, - "output_column_name": "output", - "prompt": [ - { - "role": "user", - "content": "{{ user_query }}", - } - ], - "question_column_name": "question", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - def test_raw_response_stream(self, client: Openlayer) -> None: - response = client.inference_pipelines.data.with_raw_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - data = response.parse() - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - def test_streaming_response_stream(self, client: Openlayer) -> None: - with client.inference_pipelines.data.with_streaming_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - data = response.parse() - assert_matches_type(DataStreamResponse, data, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_stream(self, client: Openlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.inference_pipelines.data.with_raw_response.stream( - "", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - - -class TestAsyncData: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_stream(self, async_client: AsyncOpenlayer) -> None: - data = await async_client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - async def test_method_stream_with_all_params(self, async_client: AsyncOpenlayer) -> None: - data = await async_client.inference_pipelines.data.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={ - "num_of_token_column_name": "tokens", - "context_column_name": "context", - "cost_column_name": "cost", - "ground_truth_column_name": "ground_truth", - "inference_id_column_name": "id", - "input_variable_names": ["user_query"], - "latency_column_name": "latency", - "metadata": {}, - "output_column_name": "output", - "prompt": [ - { - "role": "user", - "content": "{{ user_query }}", - } - ], - "question_column_name": "question", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - async def test_raw_response_stream(self, async_client: AsyncOpenlayer) -> None: - response = await async_client.inference_pipelines.data.with_raw_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - data = await response.parse() - assert_matches_type(DataStreamResponse, data, path=["response"]) - - @parametrize - async def test_streaming_response_stream(self, async_client: AsyncOpenlayer) -> None: - async with async_client.inference_pipelines.data.with_streaming_response.stream( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - data = await response.parse() - assert_matches_type(DataStreamResponse, data, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_stream(self, async_client: AsyncOpenlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.inference_pipelines.data.with_raw_response.stream( - "", - config={"output_column_name": "output"}, - rows=[ - { - "user_query": "bar", - "output": "bar", - "tokens": "bar", - "cost": "bar", - "timestamp": "bar", - } - ], - ) diff --git a/tests/api_resources/inference_pipelines/test_test_results.py b/tests/api_resources/inference_pipelines/test_test_results.py deleted file mode 100644 index 2098230a..00000000 --- a/tests/api_resources/inference_pipelines/test_test_results.py +++ /dev/null @@ -1,122 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from openlayer import Openlayer, AsyncOpenlayer -from tests.utils import assert_matches_type -from openlayer.types.inference_pipelines import TestResultListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTestResults: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Openlayer) -> None: - test_result = client.inference_pipelines.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Openlayer) -> None: - test_result = client.inference_pipelines.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - include_archived=True, - page=1, - per_page=1, - status="passing", - type="integrity", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Openlayer) -> None: - response = client.inference_pipelines.test_results.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - test_result = response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Openlayer) -> None: - with client.inference_pipelines.test_results.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - test_result = response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Openlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.inference_pipelines.test_results.with_raw_response.list( - "", - ) - - -class TestAsyncTestResults: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncOpenlayer) -> None: - test_result = await async_client.inference_pipelines.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncOpenlayer) -> None: - test_result = await async_client.inference_pipelines.test_results.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - include_archived=True, - page=1, - per_page=1, - status="passing", - type="integrity", - ) - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncOpenlayer) -> None: - response = await async_client.inference_pipelines.test_results.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - test_result = await response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncOpenlayer) -> None: - async with async_client.inference_pipelines.test_results.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - test_result = await response.parse() - assert_matches_type(TestResultListResponse, test_result, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncOpenlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.inference_pipelines.test_results.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/projects/test_commits.py b/tests/api_resources/projects/test_commits.py deleted file mode 100644 index ab353674..00000000 --- a/tests/api_resources/projects/test_commits.py +++ /dev/null @@ -1,116 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from openlayer import Openlayer, AsyncOpenlayer -from tests.utils import assert_matches_type -from openlayer.types.projects import CommitListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestCommits: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Openlayer) -> None: - commit = client.projects.commits.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Openlayer) -> None: - commit = client.projects.commits.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - page=1, - per_page=1, - ) - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Openlayer) -> None: - response = client.projects.commits.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - commit = response.parse() - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Openlayer) -> None: - with client.projects.commits.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - commit = response.parse() - assert_matches_type(CommitListResponse, commit, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Openlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.projects.commits.with_raw_response.list( - "", - ) - - -class TestAsyncCommits: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncOpenlayer) -> None: - commit = await async_client.projects.commits.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncOpenlayer) -> None: - commit = await async_client.projects.commits.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - page=1, - per_page=1, - ) - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncOpenlayer) -> None: - response = await async_client.projects.commits.with_raw_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - commit = await response.parse() - assert_matches_type(CommitListResponse, commit, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncOpenlayer) -> None: - async with async_client.projects.commits.with_streaming_response.list( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - commit = await response.parse() - assert_matches_type(CommitListResponse, commit, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncOpenlayer) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.projects.commits.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 57c81874..66054743 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -37,9 +37,6 @@ def test_method_create_with_all_params(self, client: Openlayer) -> None: "root_dir": "string", "git_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, - slack_channel_id="C01B2PZQX1Z", - slack_channel_name="#my-project", - slack_channel_notifications_enabled=True, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) @@ -128,9 +125,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenlayer) "root_dir": "string", "git_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", }, - slack_channel_id="C01B2PZQX1Z", - slack_channel_name="#my-project", - slack_channel_notifications_enabled=True, ) assert_matches_type(ProjectCreateResponse, project, path=["response"]) diff --git a/tests/test_client.py b/tests/test_client.py index bc8b3c26..a55b66ef 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -714,34 +714,12 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("openlayer._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream").mock( - side_effect=httpx.TimeoutException("Test timeout error") - ) + respx_mock.post("/projects").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): self.client.post( - "/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream", - body=cast( - object, - dict( - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], - ), - ), + "/projects", + body=cast(object, dict(name="My Project", task_type="llm-base")), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -751,34 +729,12 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No @mock.patch("openlayer._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream").mock( - return_value=httpx.Response(500) - ) + respx_mock.post("/projects").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): self.client.post( - "/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream", - body=cast( - object, - dict( - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], - ), - ), + "/projects", + body=cast(object, dict(name="My Project", task_type="llm-base")), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1464,34 +1420,12 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("openlayer._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream").mock( - side_effect=httpx.TimeoutException("Test timeout error") - ) + respx_mock.post("/projects").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): await self.client.post( - "/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream", - body=cast( - object, - dict( - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], - ), - ), + "/projects", + body=cast(object, dict(name="My Project", task_type="llm-base")), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1501,34 +1435,12 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("openlayer._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream").mock( - return_value=httpx.Response(500) - ) + respx_mock.post("/projects").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): await self.client.post( - "/inference-pipelines/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/data-stream", - body=cast( - object, - dict( - config={ - "input_variable_names": ["user_query"], - "output_column_name": "output", - "num_of_token_column_name": "tokens", - "cost_column_name": "cost", - "timestamp_column_name": "timestamp", - }, - rows=[ - { - "user_query": "what's the meaning of life?", - "output": "42", - "tokens": 7, - "cost": 0.02, - "timestamp": 1620000000, - } - ], - ), - ), + "/projects", + body=cast(object, dict(name="My Project", task_type="llm-base")), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, )