diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de46504..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.26" + ".": "0.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2b6db4a..6e452b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-333c68cc8619caa2ffdfed588a7d2b2c263f8910b7b682698da92c826932e7c7.yml -openapi_spec_hash: 8e2cc20f1e06b43ea220edbdf16eddbe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c6ec2aa283e833b7fc1e98f6d4c8e9a4b1c0010e6dbad75d33f7d56abdd8bd2c.yml +openapi_spec_hash: ef503f4771f3e00ee5d092cc252184b2 config_hash: 48e5bec0f5659595abb38814aa0d9cc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5597e72..2052a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.1.0 (2026-02-04) + +Full Changelog: [v0.0.26...v0.1.0](https://github.com/whopio/whopsdk-python/compare/v0.0.26...v0.1.0) + +### Features + +* **api:** api update ([d5bba43](https://github.com/whopio/whopsdk-python/commit/d5bba4315347bc2f62ea5fae86e4bd9584143f5e)) +* **api:** api update ([74d602a](https://github.com/whopio/whopsdk-python/commit/74d602ab4ac90e2f40d0f72d3a8fba5295b0cd19)) + ## 0.0.26 (2026-02-03) Full Changelog: [v0.1.0...v0.0.26](https://github.com/whopio/whopsdk-python/compare/v0.1.0...v0.0.26) diff --git a/pyproject.toml b/pyproject.toml index c4c0f96..56574b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "whop-sdk" -version = "0.0.26" +version = "0.1.0" description = "The official Python library for the Whop API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/whop_sdk/_version.py b/src/whop_sdk/_version.py index 37853b3..162053b 100644 --- a/src/whop_sdk/_version.py +++ b/src/whop_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "whop_sdk" -__version__ = "0.0.26" # x-release-please-version +__version__ = "0.1.0" # x-release-please-version diff --git a/src/whop_sdk/resources/ai_chats.py b/src/whop_sdk/resources/ai_chats.py index d91d676..6b894c0 100644 --- a/src/whop_sdk/resources/ai_chats.py +++ b/src/whop_sdk/resources/ai_chats.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Iterable, Optional import httpx @@ -49,6 +49,9 @@ def with_streaming_response(self) -> AIChatsResourceWithStreamingResponse: def create( self, *, + message_text: str, + current_company_id: Optional[str] | Omit = omit, + message_attachments: Optional[Iterable[ai_chat_create_params.MessageAttachment]] | Omit = omit, title: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -65,6 +68,13 @@ def create( - `ai_chat:create` Args: + message_text: The text content of the first message sent in the chat + + current_company_id: The ID of the company to set as the current company in context for the AI chat + + message_attachments: The IDs of existing uploaded attachments to include in the first message to the + agent + title: The title of the AI chat extra_headers: Send extra headers @@ -77,7 +87,15 @@ def create( """ return self._post( "/ai_chats", - body=maybe_transform({"title": title}, ai_chat_create_params.AIChatCreateParams), + body=maybe_transform( + { + "message_text": message_text, + "current_company_id": current_company_id, + "message_attachments": message_attachments, + "title": title, + }, + ai_chat_create_params.AIChatCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -121,6 +139,7 @@ def update( self, id: str, *, + current_company_id: Optional[str] | Omit = omit, title: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -137,6 +156,8 @@ def update( - `ai_chat:update` Args: + current_company_id: The ID of the company to set as the current company in context for the AI chat + title: The new title for the AI chat extra_headers: Send extra headers @@ -151,7 +172,13 @@ def update( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._patch( f"/ai_chats/{id}", - body=maybe_transform({"title": title}, ai_chat_update_params.AIChatUpdateParams), + body=maybe_transform( + { + "current_company_id": current_company_id, + "title": title, + }, + ai_chat_update_params.AIChatUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -274,6 +301,9 @@ def with_streaming_response(self) -> AsyncAIChatsResourceWithStreamingResponse: async def create( self, *, + message_text: str, + current_company_id: Optional[str] | Omit = omit, + message_attachments: Optional[Iterable[ai_chat_create_params.MessageAttachment]] | Omit = omit, title: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -290,6 +320,13 @@ async def create( - `ai_chat:create` Args: + message_text: The text content of the first message sent in the chat + + current_company_id: The ID of the company to set as the current company in context for the AI chat + + message_attachments: The IDs of existing uploaded attachments to include in the first message to the + agent + title: The title of the AI chat extra_headers: Send extra headers @@ -302,7 +339,15 @@ async def create( """ return await self._post( "/ai_chats", - body=await async_maybe_transform({"title": title}, ai_chat_create_params.AIChatCreateParams), + body=await async_maybe_transform( + { + "message_text": message_text, + "current_company_id": current_company_id, + "message_attachments": message_attachments, + "title": title, + }, + ai_chat_create_params.AIChatCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -346,6 +391,7 @@ async def update( self, id: str, *, + current_company_id: Optional[str] | Omit = omit, title: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -362,6 +408,8 @@ async def update( - `ai_chat:update` Args: + current_company_id: The ID of the company to set as the current company in context for the AI chat + title: The new title for the AI chat extra_headers: Send extra headers @@ -376,7 +424,13 @@ async def update( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._patch( f"/ai_chats/{id}", - body=await async_maybe_transform({"title": title}, ai_chat_update_params.AIChatUpdateParams), + body=await async_maybe_transform( + { + "current_company_id": current_company_id, + "title": title, + }, + ai_chat_update_params.AIChatUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/whop_sdk/types/ai_chat_create_params.py b/src/whop_sdk/types/ai_chat_create_params.py index da2e778..992e766 100644 --- a/src/whop_sdk/types/ai_chat_create_params.py +++ b/src/whop_sdk/types/ai_chat_create_params.py @@ -2,12 +2,31 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import TypedDict +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict -__all__ = ["AIChatCreateParams"] +__all__ = ["AIChatCreateParams", "MessageAttachment"] class AIChatCreateParams(TypedDict, total=False): + message_text: Required[str] + """The text content of the first message sent in the chat""" + + current_company_id: Optional[str] + """The ID of the company to set as the current company in context for the AI chat""" + + message_attachments: Optional[Iterable[MessageAttachment]] + """ + The IDs of existing uploaded attachments to include in the first message to the + agent + """ + title: Optional[str] """The title of the AI chat""" + + +class MessageAttachment(TypedDict, total=False): + """Input for an attachment""" + + id: Required[str] + """The ID of an existing file object.""" diff --git a/src/whop_sdk/types/ai_chat_update_params.py b/src/whop_sdk/types/ai_chat_update_params.py index 963426a..31e84b5 100644 --- a/src/whop_sdk/types/ai_chat_update_params.py +++ b/src/whop_sdk/types/ai_chat_update_params.py @@ -9,5 +9,8 @@ class AIChatUpdateParams(TypedDict, total=False): + current_company_id: Optional[str] + """The ID of the company to set as the current company in context for the AI chat""" + title: Optional[str] """The new title for the AI chat""" diff --git a/tests/api_resources/test_ai_chats.py b/tests/api_resources/test_ai_chats.py index 1db2d94..2ff7d81 100644 --- a/tests/api_resources/test_ai_chats.py +++ b/tests/api_resources/test_ai_chats.py @@ -25,13 +25,18 @@ class TestAIChats: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Whop) -> None: - ai_chat = client.ai_chats.create() + ai_chat = client.ai_chats.create( + message_text="message_text", + ) assert_matches_type(AIChat, ai_chat, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Whop) -> None: ai_chat = client.ai_chats.create( + message_text="message_text", + current_company_id="current_company_id", + message_attachments=[{"id": "id"}], title="title", ) assert_matches_type(AIChat, ai_chat, path=["response"]) @@ -39,7 +44,9 @@ def test_method_create_with_all_params(self, client: Whop) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Whop) -> None: - response = client.ai_chats.with_raw_response.create() + response = client.ai_chats.with_raw_response.create( + message_text="message_text", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,7 +56,9 @@ def test_raw_response_create(self, client: Whop) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Whop) -> None: - with client.ai_chats.with_streaming_response.create() as response: + with client.ai_chats.with_streaming_response.create( + message_text="message_text", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,6 +122,7 @@ def test_method_update(self, client: Whop) -> None: def test_method_update_with_all_params(self, client: Whop) -> None: ai_chat = client.ai_chats.update( id="aich_xxxxxxxxxxxxx", + current_company_id="current_company_id", title="title", ) assert_matches_type(AIChat, ai_chat, path=["response"]) @@ -241,13 +251,18 @@ class TestAsyncAIChats: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncWhop) -> None: - ai_chat = await async_client.ai_chats.create() + ai_chat = await async_client.ai_chats.create( + message_text="message_text", + ) assert_matches_type(AIChat, ai_chat, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncWhop) -> None: ai_chat = await async_client.ai_chats.create( + message_text="message_text", + current_company_id="current_company_id", + message_attachments=[{"id": "id"}], title="title", ) assert_matches_type(AIChat, ai_chat, path=["response"]) @@ -255,7 +270,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncWhop) -> N @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncWhop) -> None: - response = await async_client.ai_chats.with_raw_response.create() + response = await async_client.ai_chats.with_raw_response.create( + message_text="message_text", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -265,7 +282,9 @@ async def test_raw_response_create(self, async_client: AsyncWhop) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncWhop) -> None: - async with async_client.ai_chats.with_streaming_response.create() as response: + async with async_client.ai_chats.with_streaming_response.create( + message_text="message_text", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -329,6 +348,7 @@ async def test_method_update(self, async_client: AsyncWhop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncWhop) -> None: ai_chat = await async_client.ai_chats.update( id="aich_xxxxxxxxxxxxx", + current_company_id="current_company_id", title="title", ) assert_matches_type(AIChat, ai_chat, path=["response"])