diff --git a/.stats.yml b/.stats.yml index b7a5bc0e5..256219cc3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-778b6e08d43e3ffe57654335fe785cace2a54b805a2c2b31421d40beabc44386.yml +configured_endpoints: 18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml diff --git a/api.md b/api.md index e8481caca..f9f3180d4 100644 --- a/api.md +++ b/api.md @@ -55,8 +55,6 @@ from runloop.types import FunctionList Methods: - client.functions.list() -> FunctionList -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail ## Invocations @@ -154,7 +152,3 @@ Types: ```python from runloop.types.sessions.sessions import SessionKv ``` - -Methods: - -- client.sessions.sessions.kv.list(session_id, \*\*params) -> SessionKv diff --git a/src/runloop/resources/functions/functions.py b/src/runloop/resources/functions/functions.py index cde41d28c..862a02546 100644 --- a/src/runloop/resources/functions/functions.py +++ b/src/runloop/resources/functions/functions.py @@ -4,7 +4,6 @@ import httpx -from ...types import function_invoke_sync_params, function_invoke_async_params from .openapi import ( OpenAPIResource, AsyncOpenAPIResource, @@ -14,10 +13,6 @@ AsyncOpenAPIResourceWithStreamingResponse, ) 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 ( @@ -39,7 +34,6 @@ ) from ...types.function_list import FunctionList from .invocations.invocations import InvocationsResource, AsyncInvocationsResource -from ...types.shared.function_invocation_detail import FunctionInvocationDetail __all__ = ["FunctionsResource", "AsyncFunctionsResource"] @@ -80,105 +74,6 @@ def list( cast_to=FunctionList, ) - def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | 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, - ) -> FunctionInvocationDetail: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - 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 project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - - def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | 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, - ) -> FunctionInvocationDetail: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - 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 project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - class AsyncFunctionsResource(AsyncAPIResource): @cached_property @@ -216,105 +111,6 @@ async def list( cast_to=FunctionList, ) - async def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | 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, - ) -> FunctionInvocationDetail: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - 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 project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - - async def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | 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, - ) -> FunctionInvocationDetail: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - 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 project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - class FunctionsResourceWithRawResponse: def __init__(self, functions: FunctionsResource) -> None: @@ -323,12 +119,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_raw_response_wrapper( functions.list, ) - self.invoke_async = to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_raw_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> InvocationsResourceWithRawResponse: @@ -346,12 +136,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_raw_response_wrapper( functions.list, ) - self.invoke_async = async_to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_raw_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithRawResponse: @@ -369,12 +153,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_streamed_response_wrapper( functions.list, ) - self.invoke_async = to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_streamed_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> InvocationsResourceWithStreamingResponse: @@ -392,12 +170,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_streamed_response_wrapper( functions.list, ) - self.invoke_async = async_to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_streamed_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: diff --git a/src/runloop/resources/sessions/sessions/__init__.py b/src/runloop/resources/sessions/sessions/__init__.py index b6be412e3..cc3467b66 100644 --- a/src/runloop/resources/sessions/sessions/__init__.py +++ b/src/runloop/resources/sessions/sessions/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .kv import ( - KvResource, - AsyncKvResource, - KvResourceWithRawResponse, - AsyncKvResourceWithRawResponse, - KvResourceWithStreamingResponse, - AsyncKvResourceWithStreamingResponse, -) from .sessions import ( SessionsResource, AsyncSessionsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "KvResource", - "AsyncKvResource", - "KvResourceWithRawResponse", - "AsyncKvResourceWithRawResponse", - "KvResourceWithStreamingResponse", - "AsyncKvResourceWithStreamingResponse", "SessionsResource", "AsyncSessionsResource", "SessionsResourceWithRawResponse", diff --git a/src/runloop/resources/sessions/sessions/kv.py b/src/runloop/resources/sessions/sessions/kv.py deleted file mode 100644 index a5e6c3e19..000000000 --- a/src/runloop/resources/sessions/sessions/kv.py +++ /dev/null @@ -1,162 +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.sessions.sessions import kv_list_params -from ....types.sessions.sessions.session_kv import SessionKv - -__all__ = ["KvResource", "AsyncKvResource"] - - -class KvResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> KvResourceWithRawResponse: - return KvResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> KvResourceWithStreamingResponse: - return KvResourceWithStreamingResponse(self) - - def list( - self, - session_id: str, - *, - keys: str | 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, - ) -> SessionKv: - """ - List the sessions associated with your application. - - Args: - keys: Filter KV to specific keys. - - 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 session_id: - raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") - return self._get( - f"/v1/sessions/sessions/{session_id}/kv", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"keys": keys}, kv_list_params.KvListParams), - ), - cast_to=SessionKv, - ) - - -class AsyncKvResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncKvResourceWithRawResponse: - return AsyncKvResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncKvResourceWithStreamingResponse: - return AsyncKvResourceWithStreamingResponse(self) - - async def list( - self, - session_id: str, - *, - keys: str | 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, - ) -> SessionKv: - """ - List the sessions associated with your application. - - Args: - keys: Filter KV to specific keys. - - 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 session_id: - raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") - return await self._get( - f"/v1/sessions/sessions/{session_id}/kv", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"keys": keys}, kv_list_params.KvListParams), - ), - cast_to=SessionKv, - ) - - -class KvResourceWithRawResponse: - def __init__(self, kv: KvResource) -> None: - self._kv = kv - - self.list = to_raw_response_wrapper( - kv.list, - ) - - -class AsyncKvResourceWithRawResponse: - def __init__(self, kv: AsyncKvResource) -> None: - self._kv = kv - - self.list = async_to_raw_response_wrapper( - kv.list, - ) - - -class KvResourceWithStreamingResponse: - def __init__(self, kv: KvResource) -> None: - self._kv = kv - - self.list = to_streamed_response_wrapper( - kv.list, - ) - - -class AsyncKvResourceWithStreamingResponse: - def __init__(self, kv: AsyncKvResource) -> None: - self._kv = kv - - self.list = async_to_streamed_response_wrapper( - kv.list, - ) diff --git a/src/runloop/resources/sessions/sessions/sessions.py b/src/runloop/resources/sessions/sessions/sessions.py index ee454119a..bc88d75b3 100644 --- a/src/runloop/resources/sessions/sessions/sessions.py +++ b/src/runloop/resources/sessions/sessions/sessions.py @@ -4,14 +4,6 @@ import httpx -from .kv import ( - KvResource, - AsyncKvResource, - KvResourceWithRawResponse, - AsyncKvResourceWithRawResponse, - KvResourceWithStreamingResponse, - AsyncKvResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -31,10 +23,6 @@ class SessionsResource(SyncAPIResource): - @cached_property - def kv(self) -> KvResource: - return KvResource(self._client) - @cached_property def with_raw_response(self) -> SessionsResourceWithRawResponse: return SessionsResourceWithRawResponse(self) @@ -87,10 +75,6 @@ def list( class AsyncSessionsResource(AsyncAPIResource): - @cached_property - def kv(self) -> AsyncKvResource: - return AsyncKvResource(self._client) - @cached_property def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: return AsyncSessionsResourceWithRawResponse(self) @@ -153,10 +137,6 @@ def __init__(self, sessions: SessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> KvResourceWithRawResponse: - return KvResourceWithRawResponse(self._sessions.kv) - class AsyncSessionsResourceWithRawResponse: def __init__(self, sessions: AsyncSessionsResource) -> None: @@ -169,10 +149,6 @@ def __init__(self, sessions: AsyncSessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> AsyncKvResourceWithRawResponse: - return AsyncKvResourceWithRawResponse(self._sessions.kv) - class SessionsResourceWithStreamingResponse: def __init__(self, sessions: SessionsResource) -> None: @@ -185,10 +161,6 @@ def __init__(self, sessions: SessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> KvResourceWithStreamingResponse: - return KvResourceWithStreamingResponse(self._sessions.kv) - class AsyncSessionsResourceWithStreamingResponse: def __init__(self, sessions: AsyncSessionsResource) -> None: @@ -200,7 +172,3 @@ def __init__(self, sessions: AsyncSessionsResource) -> None: self.list = async_to_streamed_response_wrapper( sessions.list, ) - - @cached_property - def kv(self) -> AsyncKvResourceWithStreamingResponse: - return AsyncKvResourceWithStreamingResponse(self._sessions.kv) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py index 61884524c..6a44d4dcf 100644 --- a/src/runloop/types/__init__.py +++ b/src/runloop/types/__init__.py @@ -14,5 +14,3 @@ from .latch_fulfill_params import LatchFulfillParams as LatchFulfillParams from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams -from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/function_invoke_async_params.py b/src/runloop/types/function_invoke_async_params.py deleted file mode 100644 index a20bdf7a9..000000000 --- a/src/runloop/types/function_invoke_async_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeAsyncParams", "RunloopMeta"] - - -class FunctionInvokeAsyncParams(TypedDict, total=False): - project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: Annotated[str, PropertyInfo(alias="sessionId")] - """Json of the request""" diff --git a/src/runloop/types/function_invoke_sync_params.py b/src/runloop/types/function_invoke_sync_params.py deleted file mode 100644 index e8673db05..000000000 --- a/src/runloop/types/function_invoke_sync_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeSyncParams", "RunloopMeta"] - - -class FunctionInvokeSyncParams(TypedDict, total=False): - project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: Annotated[str, PropertyInfo(alias="sessionId")] - """Json of the request""" diff --git a/src/runloop/types/function_list.py b/src/runloop/types/function_list.py index 3c896443a..e21c2f693 100644 --- a/src/runloop/types/function_list.py +++ b/src/runloop/types/function_list.py @@ -2,8 +2,6 @@ from typing import List, Optional -from pydantic import Field as FieldInfo - from .._models import BaseModel __all__ = ["FunctionList", "Function"] @@ -13,7 +11,7 @@ class Function(BaseModel): name: Optional[str] = None """Unique name of the function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Unique name of the project.""" diff --git a/src/runloop/types/functions/function_invocation_list.py b/src/runloop/types/functions/function_invocation_list.py index 58f9a48ba..cc5063520 100644 --- a/src/runloop/types/functions/function_invocation_list.py +++ b/src/runloop/types/functions/function_invocation_list.py @@ -3,8 +3,6 @@ from typing import List, Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["FunctionInvocationList", "Invocation"] @@ -17,7 +15,7 @@ class Invocation(BaseModel): name: Optional[str] = None """Name of the invoked function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Project name associated with invoked function.""" status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop/types/project_list.py b/src/runloop/types/project_list.py index 7ec67b8b3..d9c977f2d 100644 --- a/src/runloop/types/project_list.py +++ b/src/runloop/types/project_list.py @@ -26,6 +26,12 @@ class ProjectActiveDeploy(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" @@ -56,6 +62,12 @@ class ProjectInProgressDeploy(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" @@ -86,6 +98,12 @@ class ProjectRecentDeployment(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" diff --git a/src/runloop/types/projects/project_logs.py b/src/runloop/types/projects/project_logs.py index b3aa893d3..6b10e46c9 100644 --- a/src/runloop/types/projects/project_logs.py +++ b/src/runloop/types/projects/project_logs.py @@ -12,6 +12,8 @@ class Log(BaseModel): message: Optional[str] = None + source: Optional[str] = None + timestamp: Optional[str] = None diff --git a/src/runloop/types/sessions/sessions/__init__.py b/src/runloop/types/sessions/sessions/__init__.py index 8a4429d53..f8ee8b14b 100644 --- a/src/runloop/types/sessions/sessions/__init__.py +++ b/src/runloop/types/sessions/sessions/__init__.py @@ -1,6 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .session_kv import SessionKv as SessionKv -from .kv_list_params import KvListParams as KvListParams diff --git a/src/runloop/types/sessions/sessions/kv_list_params.py b/src/runloop/types/sessions/sessions/kv_list_params.py deleted file mode 100644 index 8e60228f6..000000000 --- a/src/runloop/types/sessions/sessions/kv_list_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["KvListParams"] - - -class KvListParams(TypedDict, total=False): - keys: str - """Filter KV to specific keys.""" diff --git a/src/runloop/types/sessions/sessions/session_kv.py b/src/runloop/types/sessions/sessions/session_kv.py deleted file mode 100644 index d1e90041f..000000000 --- a/src/runloop/types/sessions/sessions/session_kv.py +++ /dev/null @@ -1,66 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["SessionKv", "Kv"] - - -class Kv(BaseModel): - array: bool - - big_decimal: bool = FieldInfo(alias="bigDecimal") - - big_integer: bool = FieldInfo(alias="bigInteger") - - binary: bool - - boolean: bool - - container_node: bool = FieldInfo(alias="containerNode") - - double: bool - - empty: bool - - float: bool - - floating_point_number: bool = FieldInfo(alias="floatingPointNumber") - - int: bool - - integral_number: bool = FieldInfo(alias="integralNumber") - - long: bool - - missing_node: bool = FieldInfo(alias="missingNode") - - null: bool - - number: bool - - object: bool - - pojo: bool - - short: bool - - textual: bool - - value_node: bool = FieldInfo(alias="valueNode") - - node_type: Optional[ - Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"] - ] = FieldInfo(alias="nodeType", default=None) - - -class SessionKv(BaseModel): - id: Optional[str] = None - """The ID of the session.""" - - kv: Optional[Dict[str, Kv]] = None - """The session key value storage.""" diff --git a/src/runloop/types/shared/function_invocation_detail.py b/src/runloop/types/shared/function_invocation_detail.py index 03982e19e..ef644462c 100644 --- a/src/runloop/types/shared/function_invocation_detail.py +++ b/src/runloop/types/shared/function_invocation_detail.py @@ -3,8 +3,6 @@ from typing import Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["FunctionInvocationDetail"] @@ -16,10 +14,10 @@ class FunctionInvocationDetail(BaseModel): error: Optional[str] = None - function_name: Optional[str] = FieldInfo(alias="functionName", default=None) + function_name: Optional[str] = None """Unique name of the function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Unique name of the project associated with function.""" result: Optional[object] = None diff --git a/tests/api_resources/sessions/sessions/test_kv.py b/tests/api_resources/sessions/sessions/test_kv.py deleted file mode 100644 index 13a721cb8..000000000 --- a/tests/api_resources/sessions/sessions/test_kv.py +++ /dev/null @@ -1,114 +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 runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type -from runloop.types.sessions.sessions import SessionKv - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestKv: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - kv = client.sessions.sessions.kv.list( - "string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - kv = client.sessions.sessions.kv.list( - "string", - keys="string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.sessions.sessions.kv.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kv = response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.sessions.sessions.kv.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kv = response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): - client.sessions.sessions.kv.with_raw_response.list( - "", - ) - - -class TestAsyncKv: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - kv = await async_client.sessions.sessions.kv.list( - "string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - kv = await async_client.sessions.sessions.kv.list( - "string", - keys="string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.sessions.sessions.kv.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kv = await response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.sessions.sessions.kv.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kv = await response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): - await async_client.sessions.sessions.kv.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 5ba11633a..1b824e109 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -10,7 +10,6 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type from runloop.types import FunctionList -from runloop.types.shared import FunctionInvocationDetail base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -43,132 +42,6 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_invoke_async(self, client: Runloop) -> None: - function = client.functions.invoke_async( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_async( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_async(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_async( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_async(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_async( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_async( - "", - project_name="string", - request={}, - ) - - @parametrize - def test_method_invoke_sync(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_sync(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_sync(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - "", - project_name="string", - request={}, - ) - class TestAsyncFunctions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -197,129 +70,3 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert_matches_type(FunctionList, function, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_async( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - "", - project_name="string", - request={}, - ) - - @parametrize - async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - "", - project_name="string", - request={}, - )