diff --git a/sdk-endpoints.txt b/sdk-endpoints.txt index c1c72770..6c86366b 100644 --- a/sdk-endpoints.txt +++ b/sdk-endpoints.txt @@ -96,6 +96,9 @@ POST /api/v1/systemone # alias of /api/v1/decisions for TypeSa # which this one delegates to. POST /api/v1/playground/chat/completions # session-authorized, not an SDK surface GET /api/v1/playground/tools # session-authorized, not an SDK surface +POST /api/v1/playground/files # session-authorized, not an SDK surface +GET /api/v1/playground/files # session-authorized, not an SDK surface +DELETE /api/v1/playground/files/{file_id} # session-authorized, not an SDK surface GET /api/v1/playground/consent # session-authorized, not an SDK surface PUT /api/v1/playground/consent # session-authorized, not an SDK surface GET /api/v1/playground/conversations # session-authorized, not an SDK surface diff --git a/src/otari/_client/__init__.py b/src/otari/_client/__init__.py index b01db2bb..d65d3e23 100644 --- a/src/otari/_client/__init__.py +++ b/src/otari/_client/__init__.py @@ -522,6 +522,7 @@ "PasswordResponse", "PendingOrganizationInvitationPublic", "PendingOrganizationInvitationsPublic", + "PlaygroundAttachment", "PlaygroundComparisonCreate", "PlaygroundComparisonSummary", "PlaygroundComparisonsPublic", @@ -1208,6 +1209,7 @@ from otari._client.models.password_response import PasswordResponse as PasswordResponse from otari._client.models.pending_organization_invitation_public import PendingOrganizationInvitationPublic as PendingOrganizationInvitationPublic from otari._client.models.pending_organization_invitations_public import PendingOrganizationInvitationsPublic as PendingOrganizationInvitationsPublic +from otari._client.models.playground_attachment import PlaygroundAttachment as PlaygroundAttachment from otari._client.models.playground_comparison_create import PlaygroundComparisonCreate as PlaygroundComparisonCreate from otari._client.models.playground_comparison_summary import PlaygroundComparisonSummary as PlaygroundComparisonSummary from otari._client.models.playground_comparisons_public import PlaygroundComparisonsPublic as PlaygroundComparisonsPublic diff --git a/src/otari/_client/api/playground_api.py b/src/otari/_client/api/playground_api.py index 7998aecb..ca0e074f 100644 --- a/src/otari/_client/api/playground_api.py +++ b/src/otari/_client/api/playground_api.py @@ -15,11 +15,14 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictStr from typing import Any, Optional from typing_extensions import Annotated from uuid import UUID from otari._client.models.chat_completion_request import ChatCompletionRequest +from otari._client.models.open_ai_file_deleted import OpenAIFileDeleted +from otari._client.models.open_ai_file_list import OpenAIFileList +from otari._client.models.open_ai_file_object import OpenAIFileObject from otari._client.models.playground_comparison_create import PlaygroundComparisonCreate from otari._client.models.playground_comparison_summary import PlaygroundComparisonSummary from otari._client.models.playground_comparisons_public import PlaygroundComparisonsPublic @@ -582,8 +585,9 @@ def _playground_delete_playground_conversation_serialize( @validate_call - def playground_list_playground_comparisons( + def playground_delete_playground_file( self, + file_id: StrictStr, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -597,11 +601,13 @@ def playground_list_playground_comparisons( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundComparisonsPublic: - """List Playground Comparisons + ) -> OpenAIFileDeleted: + """Delete Playground File - The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. + Delete one of the caller's files. Another identity's answers 404, as a nonexistent one does. A saved transcript that attached the file keeps its record of the attachment, but the file is gone, so sending that turn again does not send its contents. + :param file_id: (required) + :type file_id: str :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -626,7 +632,8 @@ def playground_list_playground_comparisons( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_comparisons_serialize( + _param = self._playground_delete_playground_file_serialize( + file_id=file_id, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -635,7 +642,7 @@ def playground_list_playground_comparisons( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundComparisonsPublic", + '200': "OpenAIFileDeleted", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -650,8 +657,9 @@ def playground_list_playground_comparisons( @validate_call - def playground_list_playground_comparisons_with_http_info( + def playground_delete_playground_file_with_http_info( self, + file_id: StrictStr, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -665,11 +673,13 @@ def playground_list_playground_comparisons_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundComparisonsPublic]: - """List Playground Comparisons + ) -> ApiResponse[OpenAIFileDeleted]: + """Delete Playground File - The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. + Delete one of the caller's files. Another identity's answers 404, as a nonexistent one does. A saved transcript that attached the file keeps its record of the attachment, but the file is gone, so sending that turn again does not send its contents. + :param file_id: (required) + :type file_id: str :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -694,7 +704,8 @@ def playground_list_playground_comparisons_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_comparisons_serialize( + _param = self._playground_delete_playground_file_serialize( + file_id=file_id, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -703,7 +714,7 @@ def playground_list_playground_comparisons_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundComparisonsPublic", + '200': "OpenAIFileDeleted", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -718,8 +729,9 @@ def playground_list_playground_comparisons_with_http_info( @validate_call - def playground_list_playground_comparisons_without_preload_content( + def playground_delete_playground_file_without_preload_content( self, + file_id: StrictStr, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -734,10 +746,12 @@ def playground_list_playground_comparisons_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Playground Comparisons + """Delete Playground File - The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. + Delete one of the caller's files. Another identity's answers 404, as a nonexistent one does. A saved transcript that attached the file keeps its record of the attachment, but the file is gone, so sending that turn again does not send its contents. + :param file_id: (required) + :type file_id: str :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -762,7 +776,8 @@ def playground_list_playground_comparisons_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_comparisons_serialize( + _param = self._playground_delete_playground_file_serialize( + file_id=file_id, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -771,7 +786,7 @@ def playground_list_playground_comparisons_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundComparisonsPublic", + '200': "OpenAIFileDeleted", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -781,8 +796,9 @@ def playground_list_playground_comparisons_without_preload_content( return response_data.response - def _playground_list_playground_comparisons_serialize( + def _playground_delete_playground_file_serialize( self, + file_id, workspace_id, _request_auth, _content_type, @@ -805,6 +821,8 @@ def _playground_list_playground_comparisons_serialize( _body_params: Optional[bytes] = None # process the path parameters + if file_id is not None: + _path_params['file_id'] = file_id # process the query parameters if workspace_id is not None: @@ -831,8 +849,8 @@ def _playground_list_playground_comparisons_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/playground/comparisons', + method='DELETE', + resource_path='/api/v1/playground/files/{file_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -849,7 +867,7 @@ def _playground_list_playground_comparisons_serialize( @validate_call - def playground_list_playground_conversations( + def playground_list_playground_comparisons( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -864,10 +882,10 @@ def playground_list_playground_conversations( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundConversationsPublic: - """List Playground Conversations + ) -> PlaygroundComparisonsPublic: + """List Playground Comparisons - The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. + The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -893,7 +911,7 @@ def playground_list_playground_conversations( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_conversations_serialize( + _param = self._playground_list_playground_comparisons_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -902,7 +920,7 @@ def playground_list_playground_conversations( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConversationsPublic", + '200': "PlaygroundComparisonsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -917,7 +935,7 @@ def playground_list_playground_conversations( @validate_call - def playground_list_playground_conversations_with_http_info( + def playground_list_playground_comparisons_with_http_info( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -932,10 +950,10 @@ def playground_list_playground_conversations_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundConversationsPublic]: - """List Playground Conversations + ) -> ApiResponse[PlaygroundComparisonsPublic]: + """List Playground Comparisons - The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. + The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -961,7 +979,7 @@ def playground_list_playground_conversations_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_conversations_serialize( + _param = self._playground_list_playground_comparisons_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -970,7 +988,7 @@ def playground_list_playground_conversations_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConversationsPublic", + '200': "PlaygroundComparisonsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -985,7 +1003,7 @@ def playground_list_playground_conversations_with_http_info( @validate_call - def playground_list_playground_conversations_without_preload_content( + def playground_list_playground_comparisons_without_preload_content( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -1001,9 +1019,9 @@ def playground_list_playground_conversations_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Playground Conversations + """List Playground Comparisons - The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. + The caller's own rated comparisons in one workspace, newest first. Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -1029,7 +1047,7 @@ def playground_list_playground_conversations_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_list_playground_conversations_serialize( + _param = self._playground_list_playground_comparisons_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1038,7 +1056,7 @@ def playground_list_playground_conversations_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConversationsPublic", + '200': "PlaygroundComparisonsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1048,7 +1066,7 @@ def playground_list_playground_conversations_without_preload_content( return response_data.response - def _playground_list_playground_conversations_serialize( + def _playground_list_playground_comparisons_serialize( self, workspace_id, _request_auth, @@ -1099,7 +1117,7 @@ def _playground_list_playground_conversations_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/playground/conversations', + resource_path='/api/v1/playground/comparisons', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1116,9 +1134,8 @@ def _playground_list_playground_conversations_serialize( @validate_call - def playground_playground_chat_completions( + def playground_list_playground_conversations( self, - chat_completion_request: ChatCompletionRequest, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -1132,13 +1149,11 @@ def playground_playground_chat_completions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: - """Playground Chat Completions + ) -> PlaygroundConversationsPublic: + """List Playground Conversations - Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. + The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. - :param chat_completion_request: (required) - :type chat_completion_request: ChatCompletionRequest :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -1163,8 +1178,7 @@ def playground_playground_chat_completions( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_playground_chat_completions_serialize( - chat_completion_request=chat_completion_request, + _param = self._playground_list_playground_conversations_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1173,7 +1187,7 @@ def playground_playground_chat_completions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "PlaygroundConversationsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1188,9 +1202,8 @@ def playground_playground_chat_completions( @validate_call - def playground_playground_chat_completions_with_http_info( + def playground_list_playground_conversations_with_http_info( self, - chat_completion_request: ChatCompletionRequest, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -1204,13 +1217,11 @@ def playground_playground_chat_completions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: - """Playground Chat Completions + ) -> ApiResponse[PlaygroundConversationsPublic]: + """List Playground Conversations - Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. + The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. - :param chat_completion_request: (required) - :type chat_completion_request: ChatCompletionRequest :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -1235,8 +1246,7 @@ def playground_playground_chat_completions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_playground_chat_completions_serialize( - chat_completion_request=chat_completion_request, + _param = self._playground_list_playground_conversations_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1245,7 +1255,7 @@ def playground_playground_chat_completions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "PlaygroundConversationsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1260,9 +1270,8 @@ def playground_playground_chat_completions_with_http_info( @validate_call - def playground_playground_chat_completions_without_preload_content( + def playground_list_playground_conversations_without_preload_content( self, - chat_completion_request: ChatCompletionRequest, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -1277,12 +1286,10 @@ def playground_playground_chat_completions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Playground Chat Completions + """List Playground Conversations - Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. + The caller's own saved transcripts in one workspace, newest first. Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner. - :param chat_completion_request: (required) - :type chat_completion_request: ChatCompletionRequest :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -1307,8 +1314,7 @@ def playground_playground_chat_completions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_playground_chat_completions_serialize( - chat_completion_request=chat_completion_request, + _param = self._playground_list_playground_conversations_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1317,7 +1323,7 @@ def playground_playground_chat_completions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "PlaygroundConversationsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1327,9 +1333,8 @@ def playground_playground_chat_completions_without_preload_content( return response_data.response - def _playground_playground_chat_completions_serialize( + def _playground_list_playground_conversations_serialize( self, - chat_completion_request, workspace_id, _request_auth, _content_type, @@ -1360,8 +1365,6 @@ def _playground_playground_chat_completions_serialize( # process the header parameters # process the form parameters # process the body parameter - if chat_completion_request is not None: - _body_params = chat_completion_request # set the HTTP header `Accept` @@ -1372,19 +1375,6 @@ def _playground_playground_chat_completions_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1393,8 +1383,8 @@ def _playground_playground_chat_completions_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/playground/chat/completions', + method='GET', + resource_path='/api/v1/playground/conversations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1411,8 +1401,11 @@ def _playground_playground_chat_completions_serialize( @validate_call - def playground_read_playground_consent( + def playground_list_playground_files( self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = None, + after: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1425,11 +1418,17 @@ def playground_read_playground_consent( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundConsentPublic: - """Read Playground Consent + ) -> OpenAIFileList: + """List Playground Files - What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + The caller's own files in one workspace, newest first, in OpenAI's list shape. Every file the caller owns there is listed, including one uploaded with an API key of theirs in the same workspace, because a message here can attach it. + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param limit: + :type limit: int + :param after: + :type after: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1452,7 +1451,10 @@ def playground_read_playground_consent( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_consent_serialize( + _param = self._playground_list_playground_files_serialize( + workspace_id=workspace_id, + limit=limit, + after=after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1460,7 +1462,8 @@ def playground_read_playground_consent( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileList", + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1474,8 +1477,11 @@ def playground_read_playground_consent( @validate_call - def playground_read_playground_consent_with_http_info( + def playground_list_playground_files_with_http_info( self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = None, + after: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1488,11 +1494,17 @@ def playground_read_playground_consent_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundConsentPublic]: - """Read Playground Consent + ) -> ApiResponse[OpenAIFileList]: + """List Playground Files - What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + The caller's own files in one workspace, newest first, in OpenAI's list shape. Every file the caller owns there is listed, including one uploaded with an API key of theirs in the same workspace, because a message here can attach it. + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param limit: + :type limit: int + :param after: + :type after: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1515,7 +1527,10 @@ def playground_read_playground_consent_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_consent_serialize( + _param = self._playground_list_playground_files_serialize( + workspace_id=workspace_id, + limit=limit, + after=after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1523,7 +1538,8 @@ def playground_read_playground_consent_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileList", + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1537,8 +1553,11 @@ def playground_read_playground_consent_with_http_info( @validate_call - def playground_read_playground_consent_without_preload_content( + def playground_list_playground_files_without_preload_content( self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + limit: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = None, + after: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1552,10 +1571,16 @@ def playground_read_playground_consent_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Read Playground Consent + """List Playground Files - What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + The caller's own files in one workspace, newest first, in OpenAI's list shape. Every file the caller owns there is listed, including one uploaded with an API key of theirs in the same workspace, because a message here can attach it. + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param limit: + :type limit: int + :param after: + :type after: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1578,7 +1603,10 @@ def playground_read_playground_consent_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_consent_serialize( + _param = self._playground_list_playground_files_serialize( + workspace_id=workspace_id, + limit=limit, + after=after, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1586,7 +1614,8 @@ def playground_read_playground_consent_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileList", + '422': "HTTPValidationError", } response_data = self.api_client.call_api( *_param, @@ -1595,8 +1624,11 @@ def playground_read_playground_consent_without_preload_content( return response_data.response - def _playground_read_playground_consent_serialize( + def _playground_list_playground_files_serialize( self, + workspace_id, + limit, + after, _request_auth, _content_type, _headers, @@ -1619,6 +1651,18 @@ def _playground_read_playground_consent_serialize( # process the path parameters # process the query parameters + if workspace_id is not None: + + _query_params.append(('workspace_id', workspace_id)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if after is not None: + + _query_params.append(('after', after)) + # process the header parameters # process the form parameters # process the body parameter @@ -1641,7 +1685,7 @@ def _playground_read_playground_consent_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/playground/consent', + resource_path='/api/v1/playground/files', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1658,9 +1702,10 @@ def _playground_read_playground_consent_serialize( @validate_call - def playground_read_playground_conversation_messages( + def playground_playground_chat_completions( self, - conversation_id: UUID, + chat_completion_request: ChatCompletionRequest, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1673,13 +1718,15 @@ def playground_read_playground_conversation_messages( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundMessagesPublic: - """Read Playground Conversation Messages + ) -> object: + """Playground Chat Completions - One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. - :param conversation_id: (required) - :type conversation_id: UUID + :param chat_completion_request: (required) + :type chat_completion_request: ChatCompletionRequest + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1702,8 +1749,9 @@ def playground_read_playground_conversation_messages( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_conversation_messages_serialize( - conversation_id=conversation_id, + _param = self._playground_playground_chat_completions_serialize( + chat_completion_request=chat_completion_request, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1711,7 +1759,7 @@ def playground_read_playground_conversation_messages( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundMessagesPublic", + '200': "object", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1726,9 +1774,10 @@ def playground_read_playground_conversation_messages( @validate_call - def playground_read_playground_conversation_messages_with_http_info( + def playground_playground_chat_completions_with_http_info( self, - conversation_id: UUID, + chat_completion_request: ChatCompletionRequest, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1741,13 +1790,15 @@ def playground_read_playground_conversation_messages_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundMessagesPublic]: - """Read Playground Conversation Messages + ) -> ApiResponse[object]: + """Playground Chat Completions - One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. - :param conversation_id: (required) - :type conversation_id: UUID + :param chat_completion_request: (required) + :type chat_completion_request: ChatCompletionRequest + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1770,8 +1821,9 @@ def playground_read_playground_conversation_messages_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_conversation_messages_serialize( - conversation_id=conversation_id, + _param = self._playground_playground_chat_completions_serialize( + chat_completion_request=chat_completion_request, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1779,7 +1831,7 @@ def playground_read_playground_conversation_messages_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundMessagesPublic", + '200': "object", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1794,9 +1846,10 @@ def playground_read_playground_conversation_messages_with_http_info( @validate_call - def playground_read_playground_conversation_messages_without_preload_content( + def playground_playground_chat_completions_without_preload_content( self, - conversation_id: UUID, + chat_completion_request: ChatCompletionRequest, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1810,12 +1863,14 @@ def playground_read_playground_conversation_messages_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Read Playground Conversation Messages + """Playground Chat Completions - One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + Run one chat completion for the signed-in caller. Streaming and non-streaming both, identically to ``POST /api/v1/chat/completions``: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no ``api_key_id``, because there was no key. The body is ``ChatCompletionRequest`` unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg. ``user`` in the body is the one field the pipeline will not read here: spend binds to the session's own attribution user, derived and never accepted. On a hosted control plane there is no local pipeline to call, so the same principal is forwarded to the data-plane gateway instead (:func:`_dispatch_to_data_plane`). The request and the response are the same either way. - :param conversation_id: (required) - :type conversation_id: UUID + :param chat_completion_request: (required) + :type chat_completion_request: ChatCompletionRequest + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1838,8 +1893,9 @@ def playground_read_playground_conversation_messages_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_conversation_messages_serialize( - conversation_id=conversation_id, + _param = self._playground_playground_chat_completions_serialize( + chat_completion_request=chat_completion_request, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1847,7 +1903,7 @@ def playground_read_playground_conversation_messages_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundMessagesPublic", + '200': "object", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1857,9 +1913,10 @@ def playground_read_playground_conversation_messages_without_preload_content( return response_data.response - def _playground_read_playground_conversation_messages_serialize( + def _playground_playground_chat_completions_serialize( self, - conversation_id, + chat_completion_request, + workspace_id, _request_auth, _content_type, _headers, @@ -1881,12 +1938,16 @@ def _playground_read_playground_conversation_messages_serialize( _body_params: Optional[bytes] = None # process the path parameters - if conversation_id is not None: - _path_params['conversation_id'] = conversation_id # process the query parameters + if workspace_id is not None: + + _query_params.append(('workspace_id', workspace_id)) + # process the header parameters # process the form parameters # process the body parameter + if chat_completion_request is not None: + _body_params = chat_completion_request # set the HTTP header `Accept` @@ -1897,16 +1958,808 @@ def _playground_read_playground_conversation_messages_serialize( ] ) - - # authentication setting - _auth_settings: List[str] = [ + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/playground/chat/completions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def playground_read_playground_consent( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaygroundConsentPublic: + """Read Playground Consent + + What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_consent_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundConsentPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playground_read_playground_consent_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaygroundConsentPublic]: + """Read Playground Consent + + What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_consent_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundConsentPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playground_read_playground_consent_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Read Playground Consent + + What the caller has agreed the Playground may store. Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_consent_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundConsentPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _playground_read_playground_consent_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/playground/consent', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def playground_read_playground_conversation_messages( + self, + conversation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaygroundMessagesPublic: + """Read Playground Conversation Messages + + One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + + :param conversation_id: (required) + :type conversation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_conversation_messages_serialize( + conversation_id=conversation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundMessagesPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playground_read_playground_conversation_messages_with_http_info( + self, + conversation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaygroundMessagesPublic]: + """Read Playground Conversation Messages + + One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + + :param conversation_id: (required) + :type conversation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_conversation_messages_serialize( + conversation_id=conversation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundMessagesPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playground_read_playground_conversation_messages_without_preload_content( + self, + conversation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Read Playground Conversation Messages + + One saved transcript's turns, in order. 404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller. + + :param conversation_id: (required) + :type conversation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_conversation_messages_serialize( + conversation_id=conversation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundMessagesPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _playground_read_playground_conversation_messages_serialize( + self, + conversation_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if conversation_id is not None: + _path_params['conversation_id'] = conversation_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/playground/conversations/{conversation_id}/messages', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def playground_read_playground_favorite_models( + self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaygroundFavoriteModelsPublic: + """Read Playground Favorite Models + + The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_favorite_models_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundFavoriteModelsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def playground_read_playground_favorite_models_with_http_info( + self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaygroundFavoriteModelsPublic]: + """Read Playground Favorite Models + + The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_favorite_models_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundFavoriteModelsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def playground_read_playground_favorite_models_without_preload_content( + self, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Read Playground Favorite Models + + The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._playground_read_playground_favorite_models_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlaygroundFavoriteModelsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _playground_read_playground_favorite_models_serialize( + self, + workspace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if workspace_id is not None: + + _query_params.append(('workspace_id', workspace_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ 'XApiKeyAuth', 'ApiKeyAuth' ] return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/playground/conversations/{conversation_id}/messages', + resource_path='/api/v1/playground/favorite-models', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1923,7 +2776,7 @@ def _playground_read_playground_conversation_messages_serialize( @validate_call - def playground_read_playground_favorite_models( + def playground_read_playground_tools( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -1938,10 +2791,10 @@ def playground_read_playground_favorite_models( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundFavoriteModelsPublic: - """Read Playground Favorite Models + ) -> PlaygroundToolsResponse: + """Read Playground Tools - The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -1967,7 +2820,7 @@ def playground_read_playground_favorite_models( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_favorite_models_serialize( + _param = self._playground_read_playground_tools_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1976,7 +2829,7 @@ def playground_read_playground_favorite_models( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '200': "PlaygroundToolsResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -1991,7 +2844,7 @@ def playground_read_playground_favorite_models( @validate_call - def playground_read_playground_favorite_models_with_http_info( + def playground_read_playground_tools_with_http_info( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -2006,10 +2859,10 @@ def playground_read_playground_favorite_models_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundFavoriteModelsPublic]: - """Read Playground Favorite Models + ) -> ApiResponse[PlaygroundToolsResponse]: + """Read Playground Tools - The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -2035,7 +2888,7 @@ def playground_read_playground_favorite_models_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_favorite_models_serialize( + _param = self._playground_read_playground_tools_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2044,7 +2897,7 @@ def playground_read_playground_favorite_models_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '200': "PlaygroundToolsResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2059,7 +2912,7 @@ def playground_read_playground_favorite_models_with_http_info( @validate_call - def playground_read_playground_favorite_models_without_preload_content( + def playground_read_playground_tools_without_preload_content( self, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ @@ -2075,9 +2928,9 @@ def playground_read_playground_favorite_models_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Read Playground Favorite Models + """Read Playground Tools - The caller's pinned model keys in one workspace, in pinned order. Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having. + The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID @@ -2103,7 +2956,7 @@ def playground_read_playground_favorite_models_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_favorite_models_serialize( + _param = self._playground_read_playground_tools_serialize( workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2112,7 +2965,7 @@ def playground_read_playground_favorite_models_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '200': "PlaygroundToolsResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2122,7 +2975,7 @@ def playground_read_playground_favorite_models_without_preload_content( return response_data.response - def _playground_read_playground_favorite_models_serialize( + def _playground_read_playground_tools_serialize( self, workspace_id, _request_auth, @@ -2173,7 +3026,7 @@ def _playground_read_playground_favorite_models_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/playground/favorite-models', + resource_path='/api/v1/playground/tools', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2190,8 +3043,9 @@ def _playground_read_playground_favorite_models_serialize( @validate_call - def playground_read_playground_tools( + def playground_replace_playground_favorite_models( self, + playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -2205,11 +3059,13 @@ def playground_read_playground_tools( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundToolsResponse: - """Read Playground Tools + ) -> PlaygroundFavoriteModelsPublic: + """Replace Playground Favorite Models - The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. + Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + :param playground_favorite_models_update: (required) + :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -2234,7 +3090,8 @@ def playground_read_playground_tools( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_tools_serialize( + _param = self._playground_replace_playground_favorite_models_serialize( + playground_favorite_models_update=playground_favorite_models_update, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2243,7 +3100,7 @@ def playground_read_playground_tools( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundToolsResponse", + '200': "PlaygroundFavoriteModelsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2258,8 +3115,9 @@ def playground_read_playground_tools( @validate_call - def playground_read_playground_tools_with_http_info( + def playground_replace_playground_favorite_models_with_http_info( self, + playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -2273,11 +3131,13 @@ def playground_read_playground_tools_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundToolsResponse]: - """Read Playground Tools + ) -> ApiResponse[PlaygroundFavoriteModelsPublic]: + """Replace Playground Favorite Models - The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. + Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + :param playground_favorite_models_update: (required) + :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -2302,7 +3162,8 @@ def playground_read_playground_tools_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_tools_serialize( + _param = self._playground_replace_playground_favorite_models_serialize( + playground_favorite_models_update=playground_favorite_models_update, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2311,7 +3172,7 @@ def playground_read_playground_tools_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundToolsResponse", + '200': "PlaygroundFavoriteModelsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2326,8 +3187,9 @@ def playground_read_playground_tools_with_http_info( @validate_call - def playground_read_playground_tools_without_preload_content( + def playground_replace_playground_favorite_models_without_preload_content( self, + playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, @@ -2342,10 +3204,12 @@ def playground_read_playground_tools_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Read Playground Tools + """Replace Playground Favorite Models - The gateway-run tools the caller's workspace may attach to a message. One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse. + Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + :param playground_favorite_models_update: (required) + :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one @@ -2370,7 +3234,8 @@ def playground_read_playground_tools_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_read_playground_tools_serialize( + _param = self._playground_replace_playground_favorite_models_serialize( + playground_favorite_models_update=playground_favorite_models_update, workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -2379,7 +3244,7 @@ def playground_read_playground_tools_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundToolsResponse", + '200': "PlaygroundFavoriteModelsPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2389,8 +3254,9 @@ def playground_read_playground_tools_without_preload_content( return response_data.response - def _playground_read_playground_tools_serialize( + def _playground_replace_playground_favorite_models_serialize( self, + playground_favorite_models_update, workspace_id, _request_auth, _content_type, @@ -2421,6 +3287,8 @@ def _playground_read_playground_tools_serialize( # process the header parameters # process the form parameters # process the body parameter + if playground_favorite_models_update is not None: + _body_params = playground_favorite_models_update # set the HTTP header `Accept` @@ -2431,6 +3299,19 @@ def _playground_read_playground_tools_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2439,8 +3320,8 @@ def _playground_read_playground_tools_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/playground/tools', + method='PUT', + resource_path='/api/v1/playground/favorite-models', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2457,10 +3338,9 @@ def _playground_read_playground_tools_serialize( @validate_call - def playground_replace_playground_favorite_models( + def playground_save_playground_comparison( self, - playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, - workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + playground_comparison_create: PlaygroundComparisonCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2473,15 +3353,13 @@ def playground_replace_playground_favorite_models( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundFavoriteModelsPublic: - """Replace Playground Favorite Models + ) -> PlaygroundComparisonSummary: + """Save Playground Comparison - Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. - :param playground_favorite_models_update: (required) - :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate - :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. - :type workspace_id: UUID + :param playground_comparison_create: (required) + :type playground_comparison_create: PlaygroundComparisonCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2504,9 +3382,8 @@ def playground_replace_playground_favorite_models( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_replace_playground_favorite_models_serialize( - playground_favorite_models_update=playground_favorite_models_update, - workspace_id=workspace_id, + _param = self._playground_save_playground_comparison_serialize( + playground_comparison_create=playground_comparison_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2514,7 +3391,7 @@ def playground_replace_playground_favorite_models( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '201': "PlaygroundComparisonSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2529,10 +3406,9 @@ def playground_replace_playground_favorite_models( @validate_call - def playground_replace_playground_favorite_models_with_http_info( + def playground_save_playground_comparison_with_http_info( self, - playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, - workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + playground_comparison_create: PlaygroundComparisonCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2545,15 +3421,13 @@ def playground_replace_playground_favorite_models_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundFavoriteModelsPublic]: - """Replace Playground Favorite Models + ) -> ApiResponse[PlaygroundComparisonSummary]: + """Save Playground Comparison - Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. - :param playground_favorite_models_update: (required) - :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate - :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. - :type workspace_id: UUID + :param playground_comparison_create: (required) + :type playground_comparison_create: PlaygroundComparisonCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2576,9 +3450,8 @@ def playground_replace_playground_favorite_models_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_replace_playground_favorite_models_serialize( - playground_favorite_models_update=playground_favorite_models_update, - workspace_id=workspace_id, + _param = self._playground_save_playground_comparison_serialize( + playground_comparison_create=playground_comparison_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2586,7 +3459,7 @@ def playground_replace_playground_favorite_models_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '201': "PlaygroundComparisonSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2601,10 +3474,9 @@ def playground_replace_playground_favorite_models_with_http_info( @validate_call - def playground_replace_playground_favorite_models_without_preload_content( + def playground_save_playground_comparison_without_preload_content( self, - playground_favorite_models_update: PlaygroundFavoriteModelsUpdate, - workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, + playground_comparison_create: PlaygroundComparisonCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2618,14 +3490,12 @@ def playground_replace_playground_favorite_models_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Replace Playground Favorite Models + """Save Playground Comparison - Replace the caller's pin list for one workspace. A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable. + Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. - :param playground_favorite_models_update: (required) - :type playground_favorite_models_update: PlaygroundFavoriteModelsUpdate - :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. - :type workspace_id: UUID + :param playground_comparison_create: (required) + :type playground_comparison_create: PlaygroundComparisonCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2648,9 +3518,8 @@ def playground_replace_playground_favorite_models_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_replace_playground_favorite_models_serialize( - playground_favorite_models_update=playground_favorite_models_update, - workspace_id=workspace_id, + _param = self._playground_save_playground_comparison_serialize( + playground_comparison_create=playground_comparison_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2658,7 +3527,7 @@ def playground_replace_playground_favorite_models_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundFavoriteModelsPublic", + '201': "PlaygroundComparisonSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2668,10 +3537,9 @@ def playground_replace_playground_favorite_models_without_preload_content( return response_data.response - def _playground_replace_playground_favorite_models_serialize( + def _playground_save_playground_comparison_serialize( self, - playground_favorite_models_update, - workspace_id, + playground_comparison_create, _request_auth, _content_type, _headers, @@ -2694,15 +3562,11 @@ def _playground_replace_playground_favorite_models_serialize( # process the path parameters # process the query parameters - if workspace_id is not None: - - _query_params.append(('workspace_id', workspace_id)) - # process the header parameters # process the form parameters # process the body parameter - if playground_favorite_models_update is not None: - _body_params = playground_favorite_models_update + if playground_comparison_create is not None: + _body_params = playground_comparison_create # set the HTTP header `Accept` @@ -2734,8 +3598,8 @@ def _playground_replace_playground_favorite_models_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/playground/favorite-models', + method='POST', + resource_path='/api/v1/playground/comparisons', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2752,9 +3616,9 @@ def _playground_replace_playground_favorite_models_serialize( @validate_call - def playground_save_playground_comparison( + def playground_save_playground_conversation( self, - playground_comparison_create: PlaygroundComparisonCreate, + playground_conversation_create: PlaygroundConversationCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2767,13 +3631,13 @@ def playground_save_playground_comparison( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundComparisonSummary: - """Save Playground Comparison + ) -> PlaygroundConversationSummary: + """Save Playground Conversation - Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. + Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. - :param playground_comparison_create: (required) - :type playground_comparison_create: PlaygroundComparisonCreate + :param playground_conversation_create: (required) + :type playground_conversation_create: PlaygroundConversationCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2796,8 +3660,8 @@ def playground_save_playground_comparison( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_comparison_serialize( - playground_comparison_create=playground_comparison_create, + _param = self._playground_save_playground_conversation_serialize( + playground_conversation_create=playground_conversation_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2805,7 +3669,7 @@ def playground_save_playground_comparison( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundComparisonSummary", + '201': "PlaygroundConversationSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2820,9 +3684,9 @@ def playground_save_playground_comparison( @validate_call - def playground_save_playground_comparison_with_http_info( + def playground_save_playground_conversation_with_http_info( self, - playground_comparison_create: PlaygroundComparisonCreate, + playground_conversation_create: PlaygroundConversationCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2835,13 +3699,13 @@ def playground_save_playground_comparison_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundComparisonSummary]: - """Save Playground Comparison + ) -> ApiResponse[PlaygroundConversationSummary]: + """Save Playground Conversation - Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. + Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. - :param playground_comparison_create: (required) - :type playground_comparison_create: PlaygroundComparisonCreate + :param playground_conversation_create: (required) + :type playground_conversation_create: PlaygroundConversationCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2864,8 +3728,8 @@ def playground_save_playground_comparison_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_comparison_serialize( - playground_comparison_create=playground_comparison_create, + _param = self._playground_save_playground_conversation_serialize( + playground_conversation_create=playground_conversation_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2873,7 +3737,7 @@ def playground_save_playground_comparison_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundComparisonSummary", + '201': "PlaygroundConversationSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2888,9 +3752,9 @@ def playground_save_playground_comparison_with_http_info( @validate_call - def playground_save_playground_comparison_without_preload_content( + def playground_save_playground_conversation_without_preload_content( self, - playground_comparison_create: PlaygroundComparisonCreate, + playground_conversation_create: PlaygroundConversationCreate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2904,12 +3768,12 @@ def playground_save_playground_comparison_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Save Playground Comparison + """Save Playground Conversation - Record which of two models answered a question better. 403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers. + Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. - :param playground_comparison_create: (required) - :type playground_comparison_create: PlaygroundComparisonCreate + :param playground_conversation_create: (required) + :type playground_conversation_create: PlaygroundConversationCreate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2932,8 +3796,8 @@ def playground_save_playground_comparison_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_comparison_serialize( - playground_comparison_create=playground_comparison_create, + _param = self._playground_save_playground_conversation_serialize( + playground_conversation_create=playground_conversation_create, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2941,7 +3805,7 @@ def playground_save_playground_comparison_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundComparisonSummary", + '201': "PlaygroundConversationSummary", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2951,9 +3815,9 @@ def playground_save_playground_comparison_without_preload_content( return response_data.response - def _playground_save_playground_comparison_serialize( + def _playground_save_playground_conversation_serialize( self, - playground_comparison_create, + playground_conversation_create, _request_auth, _content_type, _headers, @@ -2979,8 +3843,8 @@ def _playground_save_playground_comparison_serialize( # process the header parameters # process the form parameters # process the body parameter - if playground_comparison_create is not None: - _body_params = playground_comparison_create + if playground_conversation_create is not None: + _body_params = playground_conversation_create # set the HTTP header `Accept` @@ -3013,7 +3877,7 @@ def _playground_save_playground_comparison_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/playground/comparisons', + resource_path='/api/v1/playground/conversations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3030,9 +3894,9 @@ def _playground_save_playground_comparison_serialize( @validate_call - def playground_save_playground_conversation( + def playground_update_playground_consent( self, - playground_conversation_create: PlaygroundConversationCreate, + playground_consent_update: PlaygroundConsentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3045,13 +3909,13 @@ def playground_save_playground_conversation( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundConversationSummary: - """Save Playground Conversation + ) -> PlaygroundConsentPublic: + """Update Playground Consent - Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. + Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. - :param playground_conversation_create: (required) - :type playground_conversation_create: PlaygroundConversationCreate + :param playground_consent_update: (required) + :type playground_consent_update: PlaygroundConsentUpdate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3074,8 +3938,8 @@ def playground_save_playground_conversation( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_conversation_serialize( - playground_conversation_create=playground_conversation_create, + _param = self._playground_update_playground_consent_serialize( + playground_consent_update=playground_consent_update, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3083,7 +3947,7 @@ def playground_save_playground_conversation( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundConversationSummary", + '200': "PlaygroundConsentPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3098,9 +3962,9 @@ def playground_save_playground_conversation( @validate_call - def playground_save_playground_conversation_with_http_info( + def playground_update_playground_consent_with_http_info( self, - playground_conversation_create: PlaygroundConversationCreate, + playground_consent_update: PlaygroundConsentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3113,13 +3977,13 @@ def playground_save_playground_conversation_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundConversationSummary]: - """Save Playground Conversation + ) -> ApiResponse[PlaygroundConsentPublic]: + """Update Playground Consent - Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. + Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. - :param playground_conversation_create: (required) - :type playground_conversation_create: PlaygroundConversationCreate + :param playground_consent_update: (required) + :type playground_consent_update: PlaygroundConsentUpdate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3142,8 +4006,8 @@ def playground_save_playground_conversation_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_conversation_serialize( - playground_conversation_create=playground_conversation_create, + _param = self._playground_update_playground_consent_serialize( + playground_consent_update=playground_consent_update, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3151,7 +4015,7 @@ def playground_save_playground_conversation_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundConversationSummary", + '200': "PlaygroundConsentPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3166,9 +4030,9 @@ def playground_save_playground_conversation_with_http_info( @validate_call - def playground_save_playground_conversation_without_preload_content( + def playground_update_playground_consent_without_preload_content( self, - playground_conversation_create: PlaygroundConversationCreate, + playground_consent_update: PlaygroundConsentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3182,12 +4046,12 @@ def playground_save_playground_conversation_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Save Playground Conversation + """Update Playground Consent - Save one transcript whole, for the caller, in a workspace they belong to. 403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate. + Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. - :param playground_conversation_create: (required) - :type playground_conversation_create: PlaygroundConversationCreate + :param playground_consent_update: (required) + :type playground_consent_update: PlaygroundConsentUpdate :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3210,8 +4074,8 @@ def playground_save_playground_conversation_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_save_playground_conversation_serialize( - playground_conversation_create=playground_conversation_create, + _param = self._playground_update_playground_consent_serialize( + playground_consent_update=playground_consent_update, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3219,7 +4083,7 @@ def playground_save_playground_conversation_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "PlaygroundConversationSummary", + '200': "PlaygroundConsentPublic", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3229,9 +4093,9 @@ def playground_save_playground_conversation_without_preload_content( return response_data.response - def _playground_save_playground_conversation_serialize( + def _playground_update_playground_consent_serialize( self, - playground_conversation_create, + playground_consent_update, _request_auth, _content_type, _headers, @@ -3257,8 +4121,8 @@ def _playground_save_playground_conversation_serialize( # process the header parameters # process the form parameters # process the body parameter - if playground_conversation_create is not None: - _body_params = playground_conversation_create + if playground_consent_update is not None: + _body_params = playground_consent_update # set the HTTP header `Accept` @@ -3290,8 +4154,8 @@ def _playground_save_playground_conversation_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/playground/conversations', + method='PUT', + resource_path='/api/v1/playground/consent', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3308,9 +4172,10 @@ def _playground_save_playground_conversation_serialize( @validate_call - def playground_update_playground_consent( + def playground_upload_playground_file( self, - playground_consent_update: PlaygroundConsentUpdate, + file: StrictStr, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3323,13 +4188,15 @@ def playground_update_playground_consent( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaygroundConsentPublic: - """Update Playground Consent + ) -> OpenAIFileObject: + """Upload Playground File - Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. + Upload a file for the caller, in a workspace they belong to. The row is owned by the same principal a Playground completion runs as, so a ``file_id`` returned here resolves in the caller's own messages and in nobody else's. ``POST /api/v1/files`` takes an API key, which a dashboard session does not hold; this is the session's way in. - :param playground_consent_update: (required) - :type playground_consent_update: PlaygroundConsentUpdate + :param file: (required) + :type file: str + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3352,8 +4219,9 @@ def playground_update_playground_consent( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_update_playground_consent_serialize( - playground_consent_update=playground_consent_update, + _param = self._playground_upload_playground_file_serialize( + file=file, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3361,7 +4229,7 @@ def playground_update_playground_consent( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileObject", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3376,9 +4244,10 @@ def playground_update_playground_consent( @validate_call - def playground_update_playground_consent_with_http_info( + def playground_upload_playground_file_with_http_info( self, - playground_consent_update: PlaygroundConsentUpdate, + file: StrictStr, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3391,13 +4260,15 @@ def playground_update_playground_consent_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaygroundConsentPublic]: - """Update Playground Consent + ) -> ApiResponse[OpenAIFileObject]: + """Upload Playground File - Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. + Upload a file for the caller, in a workspace they belong to. The row is owned by the same principal a Playground completion runs as, so a ``file_id`` returned here resolves in the caller's own messages and in nobody else's. ``POST /api/v1/files`` takes an API key, which a dashboard session does not hold; this is the session's way in. - :param playground_consent_update: (required) - :type playground_consent_update: PlaygroundConsentUpdate + :param file: (required) + :type file: str + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3420,8 +4291,9 @@ def playground_update_playground_consent_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_update_playground_consent_serialize( - playground_consent_update=playground_consent_update, + _param = self._playground_upload_playground_file_serialize( + file=file, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3429,7 +4301,7 @@ def playground_update_playground_consent_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileObject", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3444,9 +4316,10 @@ def playground_update_playground_consent_with_http_info( @validate_call - def playground_update_playground_consent_without_preload_content( + def playground_upload_playground_file_without_preload_content( self, - playground_consent_update: PlaygroundConsentUpdate, + file: StrictStr, + workspace_id: Annotated[Optional[UUID], Field(description="Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3460,12 +4333,14 @@ def playground_update_playground_consent_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Playground Consent + """Upload Playground File - Grant or withdraw content retention, one flag at a time. An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for. + Upload a file for the caller, in a workspace they belong to. The row is owned by the same principal a Playground completion runs as, so a ``file_id`` returned here resolves in the caller's own messages and in nobody else's. ``POST /api/v1/files`` takes an API key, which a dashboard session does not hold; this is the session's way in. - :param playground_consent_update: (required) - :type playground_consent_update: PlaygroundConsentUpdate + :param file: (required) + :type file: str + :param workspace_id: Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does. + :type workspace_id: UUID :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3488,8 +4363,9 @@ def playground_update_playground_consent_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._playground_update_playground_consent_serialize( - playground_consent_update=playground_consent_update, + _param = self._playground_upload_playground_file_serialize( + file=file, + workspace_id=workspace_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3497,7 +4373,7 @@ def playground_update_playground_consent_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PlaygroundConsentPublic", + '200': "OpenAIFileObject", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -3507,9 +4383,10 @@ def playground_update_playground_consent_without_preload_content( return response_data.response - def _playground_update_playground_consent_serialize( + def _playground_upload_playground_file_serialize( self, - playground_consent_update, + file, + workspace_id, _request_auth, _content_type, _headers, @@ -3532,11 +4409,15 @@ def _playground_update_playground_consent_serialize( # process the path parameters # process the query parameters + if workspace_id is not None: + + _query_params.append(('workspace_id', workspace_id)) + # process the header parameters # process the form parameters + if file is not None: + _form_params.append(('file', file)) # process the body parameter - if playground_consent_update is not None: - _body_params = playground_consent_update # set the HTTP header `Accept` @@ -3554,7 +4435,7 @@ def _playground_update_playground_consent_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'application/json' + 'multipart/form-data' ] ) ) @@ -3568,8 +4449,8 @@ def _playground_update_playground_consent_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/api/v1/playground/consent', + method='POST', + resource_path='/api/v1/playground/files', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/src/otari/_client/models/__init__.py b/src/otari/_client/models/__init__.py index f7a4b2d8..6ec1e9a9 100644 --- a/src/otari/_client/models/__init__.py +++ b/src/otari/_client/models/__init__.py @@ -453,6 +453,7 @@ from otari._client.models.password_response import PasswordResponse from otari._client.models.pending_organization_invitation_public import PendingOrganizationInvitationPublic from otari._client.models.pending_organization_invitations_public import PendingOrganizationInvitationsPublic +from otari._client.models.playground_attachment import PlaygroundAttachment from otari._client.models.playground_comparison_create import PlaygroundComparisonCreate from otari._client.models.playground_comparison_summary import PlaygroundComparisonSummary from otari._client.models.playground_comparisons_public import PlaygroundComparisonsPublic diff --git a/src/otari/_client/models/playground_attachment.py b/src/otari/_client/models/playground_attachment.py new file mode 100644 index 00000000..77c4e495 --- /dev/null +++ b/src/otari/_client/models/playground_attachment.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PlaygroundAttachment(BaseModel): + """ + A file one turn sent, as the page draws its chip and sends it again. A record of the attachment rather than a reference the gateway keeps alive: the file can be deleted after the save, and a resumed turn that sends it then does not send its contents. + """ # noqa: E501 + bytes: Annotated[int, Field(strict=True, ge=0)] + file_id: Annotated[str, Field(strict=True, max_length=64)] + filename: Annotated[str, Field(strict=True, max_length=255)] + __properties: ClassVar[List[str]] = ["bytes", "file_id", "filename"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PlaygroundAttachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlaygroundAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bytes": obj.get("bytes"), + "file_id": obj.get("file_id"), + "filename": obj.get("filename") + }) + return _obj + + diff --git a/src/otari/_client/models/playground_message_create.py b/src/otari/_client/models/playground_message_create.py index 48b39211..6f438b62 100644 --- a/src/otari/_client/models/playground_message_create.py +++ b/src/otari/_client/models/playground_message_create.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from otari._client.models.playground_attachment import PlaygroundAttachment from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,10 +29,11 @@ class PlaygroundMessageCreate(BaseModel): """ One turn in a transcript being saved. """ # noqa: E501 + attachments: Optional[Annotated[List[PlaygroundAttachment], Field(max_length=10)]] = None content: Annotated[str, Field(strict=True, max_length=200000)] reasoning: Optional[Annotated[str, Field(strict=True, max_length=200000)]] = None role: StrictStr - __properties: ClassVar[List[str]] = ["content", "reasoning", "role"] + __properties: ClassVar[List[str]] = ["attachments", "content", "reasoning", "role"] @field_validator('role') def role_validate_enum(cls, value): @@ -79,6 +81,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items # set to None if reasoning (nullable) is None # and model_fields_set contains the field if self.reasoning is None and "reasoning" in self.model_fields_set: @@ -96,6 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "attachments": [PlaygroundAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "content": obj.get("content"), "reasoning": obj.get("reasoning"), "role": obj.get("role") diff --git a/src/otari/_client/models/playground_message_public.py b/src/otari/_client/models/playground_message_public.py index 7df3713b..9c22129d 100644 --- a/src/otari/_client/models/playground_message_public.py +++ b/src/otari/_client/models/playground_message_public.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.playground_attachment import PlaygroundAttachment from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -27,10 +28,11 @@ class PlaygroundMessagePublic(BaseModel): """ One stored turn, in the order it was saved. No usage figures, matching what the save accepts: tokens, cost and timing describe the request that ran rather than the conversation, and a resumed transcript reporting an old request's latency as this session's would be lying. The billing record for that request is its ``usage_logs`` row. """ # noqa: E501 + attachments: Optional[List[PlaygroundAttachment]] = None content: StrictStr reasoning: Optional[StrictStr] = None role: StrictStr - __properties: ClassVar[List[str]] = ["content", "reasoning", "role"] + __properties: ClassVar[List[str]] = ["attachments", "content", "reasoning", "role"] model_config = ConfigDict( validate_by_name=True, @@ -71,6 +73,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items # set to None if reasoning (nullable) is None # and model_fields_set contains the field if self.reasoning is None and "reasoning" in self.model_fields_set: @@ -88,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "attachments": [PlaygroundAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "content": obj.get("content"), "reasoning": obj.get("reasoning"), "role": obj.get("role") diff --git a/src/otari/_client/models/playground_tools_response.py b/src/otari/_client/models/playground_tools_response.py index 19719fd1..17ccf0ef 100644 --- a/src/otari/_client/models/playground_tools_response.py +++ b/src/otari/_client/models/playground_tools_response.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List from otari._client.models.playground_mcp_server import PlaygroundMcpServer from otari._client.models.playground_tool_status import PlaygroundToolStatus @@ -30,9 +30,10 @@ class PlaygroundToolsResponse(BaseModel): What the caller's workspace may attach to a Playground message. """ # noqa: E501 code_execution: PlaygroundToolStatus + files: PlaygroundToolStatus = Field(description="Whether a message may attach a file uploaded here.") mcp_servers: List[PlaygroundMcpServer] web_search: PlaygroundToolStatus - __properties: ClassVar[List[str]] = ["code_execution", "mcp_servers", "web_search"] + __properties: ClassVar[List[str]] = ["code_execution", "files", "mcp_servers", "web_search"] model_config = ConfigDict( validate_by_name=True, @@ -76,6 +77,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of code_execution if self.code_execution: _dict['code_execution'] = self.code_execution.to_dict() + # override the default output from pydantic by calling `to_dict()` of files + if self.files: + _dict['files'] = self.files.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in mcp_servers (list) _items = [] if self.mcp_servers: @@ -99,6 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "code_execution": PlaygroundToolStatus.from_dict(obj["code_execution"]) if obj.get("code_execution") is not None else None, + "files": PlaygroundToolStatus.from_dict(obj["files"]) if obj.get("files") is not None else None, "mcp_servers": [PlaygroundMcpServer.from_dict(_item) for _item in obj["mcp_servers"]] if obj.get("mcp_servers") is not None else None, "web_search": PlaygroundToolStatus.from_dict(obj["web_search"]) if obj.get("web_search") is not None else None })