Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.26"
".": "0.1.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/whop_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -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
64 changes: 59 additions & 5 deletions src/whop_sdk/resources/ai_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Iterable, Optional

import httpx

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
),
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
),
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
),
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
),
Expand Down
25 changes: 22 additions & 3 deletions src/whop_sdk/types/ai_chat_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
3 changes: 3 additions & 0 deletions src/whop_sdk/types/ai_chat_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
32 changes: 26 additions & 6 deletions tests/api_resources/test_ai_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,28 @@ 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"])

@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"
Expand All @@ -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"

Expand Down Expand Up @@ -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"])
Expand Down Expand Up @@ -241,21 +251,28 @@ 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"])

@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"
Expand All @@ -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"

Expand Down Expand Up @@ -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"])
Expand Down