unique-sdk 2026.50.0.dev11__tar.gz → 2026.50.0.dev13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/PKG-INFO +1 -1
  2. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/pyproject.toml +1 -1
  3. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/__init__.py +4 -0
  4. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_object_classes.py +2 -0
  5. unique_sdk-2026.50.0.dev13/unique_sdk/api_resources/_project_chat.py +486 -0
  6. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_space.py +56 -0
  7. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/README.md +0 -0
  8. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_api_requestor.py +0 -0
  9. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_api_resource.py +0 -0
  10. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_api_version.py +0 -0
  11. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_error.py +0 -0
  12. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_http_client.py +0 -0
  13. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_list_object.py +0 -0
  14. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_request_options.py +0 -0
  15. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_unique_object.py +0 -0
  16. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_unique_ql.py +0 -0
  17. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_unique_response.py +0 -0
  18. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_util.py +0 -0
  19. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_version.py +0 -0
  20. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/_webhook.py +0 -0
  21. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/__init__.py +0 -0
  22. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_acronyms.py +0 -0
  23. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_agentic_table.py +0 -0
  24. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_analytics_order.py +0 -0
  25. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_benchmarking.py +0 -0
  26. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_briefing.py +0 -0
  27. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_chat_completion.py +0 -0
  28. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_content.py +0 -0
  29. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_context_memory.py +0 -0
  30. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_elicitation.py +0 -0
  31. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_embedding.py +0 -0
  32. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_event.py +0 -0
  33. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_folder.py +0 -0
  34. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_group.py +0 -0
  35. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_integrated.py +0 -0
  36. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_llm_models.py +0 -0
  37. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_mcp.py +0 -0
  38. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_message.py +0 -0
  39. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_message_assessment.py +0 -0
  40. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_message_execution.py +0 -0
  41. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_message_log.py +0 -0
  42. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_message_tool.py +0 -0
  43. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_module.py +0 -0
  44. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_project_memory.py +0 -0
  45. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_scheduled_task.py +0 -0
  46. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_search.py +0 -0
  47. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_search_string.py +0 -0
  48. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  49. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_user.py +0 -0
  50. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/api_resources/_web_search.py +0 -0
  51. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/__init__.py +0 -0
  52. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/__main__.py +0 -0
  53. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/cli.py +0 -0
  54. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/__init__.py +0 -0
  55. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/_citation_manifest.py +0 -0
  56. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/agentic_table.py +0 -0
  57. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/agentic_table_write.py +0 -0
  58. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/browser.py +0 -0
  59. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/cite_file.py +0 -0
  60. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/elicitation.py +0 -0
  61. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/files.py +0 -0
  62. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/folders.py +0 -0
  63. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/mcp.py +0 -0
  64. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/navigation.py +0 -0
  65. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/read.py +0 -0
  66. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/scheduled_tasks.py +0 -0
  67. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/search.py +0 -0
  68. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/subagent.py +0 -0
  69. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/web_search.py +0 -0
  70. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/commands/web_search_config.py +0 -0
  71. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/config.py +0 -0
  72. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/formatting.py +0 -0
  73. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/identity.py +0 -0
  74. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/metadata_filter.py +0 -0
  75. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/paths.py +0 -0
  76. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/shell.py +0 -0
  77. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-agentic-table/SKILL.md +0 -0
  78. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-elicitation/SKILL.md +0 -0
  79. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-file-management/SKILL.md +0 -0
  80. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-mcp/SKILL.md +0 -0
  81. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-scheduled-tasks/SKILL.md +0 -0
  82. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-search/SKILL.md +0 -0
  83. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-subagent/SKILL.md +0 -0
  84. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-uploaded-search/SKILL.md +0 -0
  85. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/skills/unique-cli-web-search/SKILL.md +0 -0
  86. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/state.py +0 -0
  87. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/subagent_turns.py +0 -0
  88. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/cli/workspace.py +0 -0
  89. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/analytics_order_run.py +0 -0
  90. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/benchmarking_run.py +0 -0
  91. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/chat_history.py +0 -0
  92. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/chat_in_space.py +0 -0
  93. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/file_io.py +0 -0
  94. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/sources.py +0 -0
  95. {unique_sdk-2026.50.0.dev11 → unique_sdk-2026.50.0.dev13}/unique_sdk/utils/token.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-sdk
3
- Version: 2026.50.0.dev11
3
+ Version: 2026.50.0.dev13
4
4
  Summary:
5
5
  Author: Martin Fadler, Konstantin Krauss, Andreas Hauri
6
6
  Author-email: Martin Fadler <martin.fadler@unique.ch>, Konstantin Krauss <konstantin@unique.ch>, Andreas Hauri <andreas@unique.ch>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "unique_sdk"
3
- version = "2026.50.0.dev11"
3
+ version = "2026.50.0.dev13"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -88,6 +88,10 @@ from unique_sdk.api_resources._short_term_memory import (
88
88
  )
89
89
  from unique_sdk.api_resources._context_memory import ContextMemory as ContextMemory
90
90
  from unique_sdk.api_resources._project_memory import ProjectMemory as ProjectMemory
91
+ from unique_sdk.api_resources._project_chat import (
92
+ ProjectChat as ProjectChat,
93
+ ProjectChatChunk as ProjectChatChunk,
94
+ )
91
95
  from unique_sdk.api_resources._folder import Folder as Folder
92
96
  from unique_sdk.api_resources._embedding import Embeddings as Embeddings
93
97
  from unique_sdk.api_resources._acronyms import Acronyms as Acronyms
@@ -12,4 +12,6 @@ OBJECT_CLASSES = {
12
12
  unique_sdk.WebSearchReview.OBJECT_NAME: unique_sdk.WebSearchReview,
13
13
  unique_sdk.WebCrawl.OBJECT_NAME: unique_sdk.WebCrawl,
14
14
  unique_sdk.ProjectMemory.OBJECT_NAME: unique_sdk.ProjectMemory,
15
+ unique_sdk.ProjectChat.OBJECT_NAME: unique_sdk.ProjectChat,
16
+ unique_sdk.ProjectChatChunk.OBJECT_NAME: unique_sdk.ProjectChatChunk,
15
17
  }
@@ -0,0 +1,486 @@
1
+ """Project chat search: find and read the earlier chats of a user's project.
2
+
3
+ Wraps the public endpoints under ``/search/project-chats``. Chats of a project
4
+ are indexed in chunks of consecutive question and answer pairs:
5
+
6
+ - ``POST /search/project-chats`` returns the chunks that best match a query.
7
+ - ``POST /search/project-chats/chunks`` returns the chunks of one chat in
8
+ order, one page at a time.
9
+ - ``POST /search/project-chats/recent`` lists the chats of the project, most
10
+ recently active first.
11
+
12
+ Only the project's owner can call them, and the Projects feature must be on
13
+ for the company. Search returns an empty list while project chat indexing is
14
+ off for the company.
15
+ """
16
+
17
+ from datetime import datetime
18
+ from typing import Any, Literal, TypedDict, cast
19
+
20
+ from unique_sdk._api_resource import APIResource
21
+ from unique_sdk._unique_object import UniqueObject
22
+ from unique_sdk._util import classproperty
23
+
24
+ _SEARCH_URL = "/search/project-chats"
25
+ _CHUNKS_URL = "/search/project-chats/chunks"
26
+ _RECENT_URL = "/search/project-chats/recent"
27
+
28
+
29
+ def _body(**fields: Any) -> dict[str, Any]:
30
+ # Keyword-only fields: request options such as api_key or headers never
31
+ # reach the body. None is left out so the endpoint applies its defaults.
32
+ body: dict[str, Any] = {}
33
+ for key, value in fields.items():
34
+ if value is None:
35
+ continue
36
+ body[key] = value.isoformat() if isinstance(value, datetime) else value
37
+ return body
38
+
39
+
40
+ class ProjectChatChunk(UniqueObject):
41
+ """A chunk of an earlier project chat: consecutive question and answer pairs.
42
+
43
+ Attributes:
44
+ chatId (str): Chat the chunk belongs to.
45
+ chatTitle (str | None): Title of the chat.
46
+ chunkIndex (int): Position of the chunk in its chat, from 0.
47
+ pairIndexStart (int): First question and answer pair in the chunk,
48
+ from 1.
49
+ pairIndexEnd (int): Last question and answer pair in the chunk.
50
+ messageIds (list[str]): Messages in the chunk.
51
+ text (str): Text of the chunk.
52
+ tokenCount (int): Number of tokens in ``text``.
53
+ isOpen (bool): ``True`` for the last chunk of the chat, which can
54
+ still grow.
55
+ createdAt (str): Time of the first message in the chunk, ISO 8601.
56
+ updatedAt (str): Time of the last message in the chunk, ISO 8601.
57
+ score (float | None): Relevance score. Set by search only.
58
+ highlights (list[str] | None): Highlighted passages. Set by search
59
+ only.
60
+ object (Literal["search.project-chat-chunk"]): Object type identifier.
61
+ """
62
+
63
+ @classproperty
64
+ def OBJECT_NAME(cls) -> Literal["search.project-chat-chunk"]:
65
+ return "search.project-chat-chunk"
66
+
67
+ chatId: str
68
+ chatTitle: str | None
69
+ chunkIndex: int
70
+ pairIndexStart: int
71
+ pairIndexEnd: int
72
+ messageIds: list[str]
73
+ text: str
74
+ tokenCount: int
75
+ isOpen: bool
76
+ createdAt: str
77
+ updatedAt: str
78
+ score: float | None
79
+ highlights: list[str] | None
80
+ object: Literal["search.project-chat-chunk"]
81
+
82
+
83
+ class ProjectChat(APIResource["ProjectChat"]):
84
+ """An earlier chat of a user's project, as listed by ``list_recent``.
85
+
86
+ The class also holds the three project chat search calls: ``search``,
87
+ ``list_chunks`` and ``list_recent``, each with an ``_async`` variant.
88
+
89
+ Attributes:
90
+ chatId (str): Chat identifier.
91
+ chatTitle (str | None): Title of the chat.
92
+ chatCreatedAt (str): Creation time of the chat, ISO 8601.
93
+ updatedAt (str): Time of the last message, ISO 8601.
94
+ chunkCount (int): Number of indexed chunks in the chat.
95
+ object (Literal["search.project-chat"]): Object type identifier.
96
+ """
97
+
98
+ @classproperty
99
+ def OBJECT_NAME(cls) -> Literal["search.project-chat"]:
100
+ return "search.project-chat"
101
+
102
+ class ChatStats(TypedDict):
103
+ """Chunk and token totals of one chat.
104
+
105
+ Attributes:
106
+ chatId (str): Chat identifier.
107
+ chunkCount (int): Number of chunks in the chat.
108
+ tokenCount (int): Number of tokens in the chat.
109
+ """
110
+
111
+ chatId: str
112
+ chunkCount: int
113
+ tokenCount: int
114
+
115
+ class ChunkList(TypedDict):
116
+ """Response of ``search`` and ``list_chunks``.
117
+
118
+ Attributes:
119
+ object (Literal["list"]): Object type identifier.
120
+ data (list[ProjectChatChunk]): The chunks.
121
+ chatStats (list[ProjectChat.ChatStats]): Totals of the chats in
122
+ ``data``. Empty unless ``include_chat_stats`` is set.
123
+ nextCursor (str | None): Pass as ``after`` to get the next page.
124
+ ``None`` on the last page and always for search.
125
+ """
126
+
127
+ object: Literal["list"]
128
+ data: list[ProjectChatChunk]
129
+ chatStats: list["ProjectChat.ChatStats"]
130
+ nextCursor: str | None
131
+
132
+ class ChatList(TypedDict):
133
+ """Response of ``list_recent``.
134
+
135
+ Attributes:
136
+ object (Literal["list"]): Object type identifier.
137
+ data (list[ProjectChat]): The chats, most recently active first.
138
+ nextCursor (str | None): Pass as ``after`` to get the next page.
139
+ ``None`` on the last page.
140
+ """
141
+
142
+ object: Literal["list"]
143
+ data: list["ProjectChat"]
144
+ nextCursor: str | None
145
+
146
+ chatId: str
147
+ chatTitle: str | None
148
+ chatCreatedAt: str
149
+ updatedAt: str
150
+ chunkCount: int
151
+ object: Literal["search.project-chat"]
152
+
153
+ @staticmethod
154
+ def _search_body(
155
+ project_id: str,
156
+ query: str,
157
+ chat_ids: list[str] | None,
158
+ exclude_chat_ids: list[str] | None,
159
+ created_after: datetime | str | None,
160
+ created_before: datetime | str | None,
161
+ limit: int | None,
162
+ include_chat_stats: bool | None,
163
+ ) -> dict[str, Any]:
164
+ return _body(
165
+ projectId=project_id,
166
+ query=query,
167
+ chatIds=chat_ids,
168
+ excludeChatIds=exclude_chat_ids,
169
+ createdAfter=created_after,
170
+ createdBefore=created_before,
171
+ limit=limit,
172
+ includeChatStats=include_chat_stats,
173
+ )
174
+
175
+ @staticmethod
176
+ def _chunks_body(
177
+ project_id: str,
178
+ chat_id: str,
179
+ limit: int | None,
180
+ after: str | None,
181
+ include_chat_stats: bool | None,
182
+ ) -> dict[str, Any]:
183
+ return _body(
184
+ projectId=project_id,
185
+ chatId=chat_id,
186
+ limit=limit,
187
+ after=after,
188
+ includeChatStats=include_chat_stats,
189
+ )
190
+
191
+ @staticmethod
192
+ def _recent_body(
193
+ project_id: str,
194
+ exclude_chat_ids: list[str] | None,
195
+ updated_after: datetime | str | None,
196
+ updated_before: datetime | str | None,
197
+ limit: int | None,
198
+ after: str | None,
199
+ ) -> dict[str, Any]:
200
+ return _body(
201
+ projectId=project_id,
202
+ excludeChatIds=exclude_chat_ids,
203
+ updatedAfter=updated_after,
204
+ updatedBefore=updated_before,
205
+ limit=limit,
206
+ after=after,
207
+ )
208
+
209
+ @classmethod
210
+ def search(
211
+ cls,
212
+ user_id: str,
213
+ company_id: str,
214
+ *,
215
+ project_id: str,
216
+ query: str,
217
+ chat_ids: list[str] | None = None,
218
+ exclude_chat_ids: list[str] | None = None,
219
+ created_after: datetime | str | None = None,
220
+ created_before: datetime | str | None = None,
221
+ limit: int | None = None,
222
+ include_chat_stats: bool | None = None,
223
+ ) -> "ProjectChat.ChunkList":
224
+ """Search the earlier chats of a project the user owns.
225
+
226
+ Args:
227
+ user_id (str): The user who owns the project.
228
+ company_id (str): The user's company.
229
+ project_id (str): The project to search.
230
+ query (str): What to look for, at most 2000 characters.
231
+ chat_ids (list[str] | None): Only search these chats, at most 200.
232
+ exclude_chat_ids (list[str] | None): Leave out these chats, at
233
+ most 200, for example the current one.
234
+ created_after (datetime | str | None): Only chunks whose first
235
+ message is at or after this time. Use a timezone-aware
236
+ datetime or an ISO 8601 string.
237
+ created_before (datetime | str | None): Only chunks whose first
238
+ message is at or before this time.
239
+ limit (int | None): Number of chunks, 1 to 50. The endpoint
240
+ defaults to 20.
241
+ include_chat_stats (bool | None): Also return chunk and token
242
+ totals of the chats in the result.
243
+
244
+ Returns:
245
+ ProjectChat.ChunkList: The best matching chunks, with ``score``
246
+ and ``highlights`` set. ``nextCursor`` is always ``None``.
247
+
248
+ Raises:
249
+ InvalidRequestError: The project does not exist or belongs to
250
+ another user (404), or a parameter is invalid (400).
251
+ AuthenticationError: The API key is missing or invalid (401).
252
+ PermissionError: Projects are off for the company, or the user
253
+ may not read chats (403).
254
+ APIError: Any other API failure.
255
+ """
256
+ return cast(
257
+ "ProjectChat.ChunkList",
258
+ cls._static_request(
259
+ "post",
260
+ _SEARCH_URL,
261
+ user_id,
262
+ company_id,
263
+ params=cls._search_body(
264
+ project_id,
265
+ query,
266
+ chat_ids,
267
+ exclude_chat_ids,
268
+ created_after,
269
+ created_before,
270
+ limit,
271
+ include_chat_stats,
272
+ ),
273
+ ),
274
+ )
275
+
276
+ @classmethod
277
+ async def search_async(
278
+ cls,
279
+ user_id: str,
280
+ company_id: str,
281
+ *,
282
+ project_id: str,
283
+ query: str,
284
+ chat_ids: list[str] | None = None,
285
+ exclude_chat_ids: list[str] | None = None,
286
+ created_after: datetime | str | None = None,
287
+ created_before: datetime | str | None = None,
288
+ limit: int | None = None,
289
+ include_chat_stats: bool | None = None,
290
+ ) -> "ProjectChat.ChunkList":
291
+ """Search the earlier chats of a project the user owns.
292
+
293
+ See ``search`` for the arguments, return value and errors.
294
+ """
295
+ return cast(
296
+ "ProjectChat.ChunkList",
297
+ await cls._static_request_async(
298
+ "post",
299
+ _SEARCH_URL,
300
+ user_id,
301
+ company_id,
302
+ params=cls._search_body(
303
+ project_id,
304
+ query,
305
+ chat_ids,
306
+ exclude_chat_ids,
307
+ created_after,
308
+ created_before,
309
+ limit,
310
+ include_chat_stats,
311
+ ),
312
+ ),
313
+ )
314
+
315
+ @classmethod
316
+ def list_chunks(
317
+ cls,
318
+ user_id: str,
319
+ company_id: str,
320
+ *,
321
+ project_id: str,
322
+ chat_id: str,
323
+ limit: int | None = None,
324
+ after: str | None = None,
325
+ include_chat_stats: bool | None = None,
326
+ ) -> "ProjectChat.ChunkList":
327
+ """Read one chat of a project the user owns, in order.
328
+
329
+ Args:
330
+ user_id (str): The user who owns the project.
331
+ company_id (str): The user's company.
332
+ project_id (str): The project of the chat.
333
+ chat_id (str): The chat to read.
334
+ limit (int | None): Number of chunks per page, 1 to 50. The
335
+ endpoint defaults to 20.
336
+ after (str | None): ``nextCursor`` of the previous page.
337
+ include_chat_stats (bool | None): Also return the chunk and token
338
+ totals of the chat.
339
+
340
+ Returns:
341
+ ProjectChat.ChunkList: One page of chunks, ordered by
342
+ ``chunkIndex``. ``score`` and ``highlights`` are ``None``.
343
+
344
+ Raises:
345
+ InvalidRequestError: The project does not exist or belongs to
346
+ another user (404), or a parameter is invalid (400).
347
+ AuthenticationError: The API key is missing or invalid (401).
348
+ PermissionError: Projects are off for the company, or the user
349
+ may not read chats (403).
350
+ APIError: Any other API failure.
351
+ """
352
+ return cast(
353
+ "ProjectChat.ChunkList",
354
+ cls._static_request(
355
+ "post",
356
+ _CHUNKS_URL,
357
+ user_id,
358
+ company_id,
359
+ params=cls._chunks_body(
360
+ project_id, chat_id, limit, after, include_chat_stats
361
+ ),
362
+ ),
363
+ )
364
+
365
+ @classmethod
366
+ async def list_chunks_async(
367
+ cls,
368
+ user_id: str,
369
+ company_id: str,
370
+ *,
371
+ project_id: str,
372
+ chat_id: str,
373
+ limit: int | None = None,
374
+ after: str | None = None,
375
+ include_chat_stats: bool | None = None,
376
+ ) -> "ProjectChat.ChunkList":
377
+ """Read one chat of a project the user owns, in order.
378
+
379
+ See ``list_chunks`` for the arguments, return value and errors.
380
+ """
381
+ return cast(
382
+ "ProjectChat.ChunkList",
383
+ await cls._static_request_async(
384
+ "post",
385
+ _CHUNKS_URL,
386
+ user_id,
387
+ company_id,
388
+ params=cls._chunks_body(
389
+ project_id, chat_id, limit, after, include_chat_stats
390
+ ),
391
+ ),
392
+ )
393
+
394
+ @classmethod
395
+ def list_recent(
396
+ cls,
397
+ user_id: str,
398
+ company_id: str,
399
+ *,
400
+ project_id: str,
401
+ exclude_chat_ids: list[str] | None = None,
402
+ updated_after: datetime | str | None = None,
403
+ updated_before: datetime | str | None = None,
404
+ limit: int | None = None,
405
+ after: str | None = None,
406
+ ) -> "ProjectChat.ChatList":
407
+ """List the chats of a project the user owns, most recently active first.
408
+
409
+ Args:
410
+ user_id (str): The user who owns the project.
411
+ company_id (str): The user's company.
412
+ project_id (str): The project to list.
413
+ exclude_chat_ids (list[str] | None): Leave out these chats, at
414
+ most 200.
415
+ updated_after (datetime | str | None): Only chats active at or
416
+ after this time. Use a timezone-aware datetime or an ISO 8601
417
+ string.
418
+ updated_before (datetime | str | None): Only chats last active at
419
+ or before this time.
420
+ limit (int | None): Number of chats per page, 1 to 20. The
421
+ endpoint defaults to 20.
422
+ after (str | None): ``nextCursor`` of the previous page.
423
+
424
+ Returns:
425
+ ProjectChat.ChatList: One page of chats.
426
+
427
+ Raises:
428
+ InvalidRequestError: The project does not exist or belongs to
429
+ another user (404), or a parameter is invalid (400).
430
+ AuthenticationError: The API key is missing or invalid (401).
431
+ PermissionError: Projects are off for the company, or the user
432
+ may not read chats (403).
433
+ APIError: Any other API failure.
434
+ """
435
+ return cast(
436
+ "ProjectChat.ChatList",
437
+ cls._static_request(
438
+ "post",
439
+ _RECENT_URL,
440
+ user_id,
441
+ company_id,
442
+ params=cls._recent_body(
443
+ project_id,
444
+ exclude_chat_ids,
445
+ updated_after,
446
+ updated_before,
447
+ limit,
448
+ after,
449
+ ),
450
+ ),
451
+ )
452
+
453
+ @classmethod
454
+ async def list_recent_async(
455
+ cls,
456
+ user_id: str,
457
+ company_id: str,
458
+ *,
459
+ project_id: str,
460
+ exclude_chat_ids: list[str] | None = None,
461
+ updated_after: datetime | str | None = None,
462
+ updated_before: datetime | str | None = None,
463
+ limit: int | None = None,
464
+ after: str | None = None,
465
+ ) -> "ProjectChat.ChatList":
466
+ """List the chats of a project the user owns, most recently active first.
467
+
468
+ See ``list_recent`` for the arguments, return value and errors.
469
+ """
470
+ return cast(
471
+ "ProjectChat.ChatList",
472
+ await cls._static_request_async(
473
+ "post",
474
+ _RECENT_URL,
475
+ user_id,
476
+ company_id,
477
+ params=cls._recent_body(
478
+ project_id,
479
+ exclude_chat_ids,
480
+ updated_after,
481
+ updated_before,
482
+ limit,
483
+ after,
484
+ ),
485
+ ),
486
+ )
@@ -327,6 +327,20 @@ class Space(APIResource["Space"]):
327
327
  spaceId: str
328
328
  mcpServers: list["Space.McpServerStatus"]
329
329
 
330
+ class Skill(TypedDict):
331
+ """
332
+ A skill of a space that the calling user can read.
333
+ """
334
+
335
+ contentId: str
336
+ scopeId: str
337
+ name: str
338
+ updatedAt: str | None
339
+
340
+ class SkillsResponse(TypedDict):
341
+ spaceId: str
342
+ skills: list["Space.Skill"]
343
+
330
344
  class Module(TypedDict):
331
345
  """
332
346
  Represents a module configured for a space.
@@ -965,6 +979,48 @@ class Space(APIResource["Space"]):
965
979
  ),
966
980
  )
967
981
 
982
+ @classmethod
983
+ def get_skills(
984
+ cls,
985
+ user_id: str,
986
+ company_id: str,
987
+ space_id: str,
988
+ ) -> "Space.SkillsResponse":
989
+ """
990
+ Get the skills of a space that the calling user can read, each with the
991
+ last-modified time of its skill file (``updatedAt``).
992
+ """
993
+ return cast(
994
+ "Space.SkillsResponse",
995
+ cls._static_request(
996
+ "get",
997
+ f"/space/{space_id}/skills",
998
+ user_id,
999
+ company_id,
1000
+ ),
1001
+ )
1002
+
1003
+ @classmethod
1004
+ async def get_skills_async(
1005
+ cls,
1006
+ user_id: str,
1007
+ company_id: str,
1008
+ space_id: str,
1009
+ ) -> "Space.SkillsResponse":
1010
+ """
1011
+ Async get the skills of a space that the calling user can read, each with
1012
+ the last-modified time of its skill file (``updatedAt``).
1013
+ """
1014
+ return cast(
1015
+ "Space.SkillsResponse",
1016
+ await cls._static_request_async(
1017
+ "get",
1018
+ f"/space/{space_id}/skills",
1019
+ user_id,
1020
+ company_id,
1021
+ ),
1022
+ )
1023
+
968
1024
  @classmethod
969
1025
  def get_mcp_server_status(
970
1026
  cls,