Skip to content

Commit c0a9bf9

Browse files
SDK regeneration (#57)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent f6b33e0 commit c0a9bf9

File tree

4 files changed

+375
-3
lines changed

4 files changed

+375
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "credal"
33

44
[tool.poetry]
55
name = "credal"
6-
version = "0.1.9"
6+
version = "0.1.10"
77
description = ""
88
readme = "README.md"
99
authors = []

src/credal/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def __init__(
2222

2323
def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
25-
"User-Agent": "credal/0.1.9",
25+
"User-Agent": "credal/0.1.10",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "credal",
28-
"X-Fern-SDK-Version": "0.1.9",
28+
"X-Fern-SDK-Version": "0.1.10",
2929
**(self.get_custom_headers() or {}),
3030
}
3131
headers["Authorization"] = f"Bearer {self._get_api_key()}"

src/credal/document_catalog/client.py

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import typing
44

5+
from .. import core
56
from ..common.types.custom_metadata_value import CustomMetadataValue
67
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
78
from ..core.request_options import RequestOptions
@@ -119,6 +120,88 @@ def upload_document_contents(
119120
)
120121
return _response.data
121122

123+
def upload_file(
124+
self,
125+
*,
126+
file: core.File,
127+
upload_as_user_email: str,
128+
document_external_id: str,
129+
document_name: typing.Optional[str] = OMIT,
130+
allowed_users_email_addresses: typing.Optional[str] = OMIT,
131+
document_external_url: typing.Optional[str] = OMIT,
132+
custom_metadata: typing.Optional[str] = OMIT,
133+
collection_id: typing.Optional[str] = OMIT,
134+
force_update: typing.Optional[str] = OMIT,
135+
internal_public: typing.Optional[str] = OMIT,
136+
source_system_updated: typing.Optional[str] = OMIT,
137+
await_vector_store_sync: typing.Optional[str] = OMIT,
138+
request_options: typing.Optional[RequestOptions] = None,
139+
) -> UploadDocumentResponse:
140+
"""
141+
Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
142+
143+
Parameters
144+
----------
145+
file : core.File
146+
See core.File for more documentation
147+
148+
upload_as_user_email : str
149+
[Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses.
150+
151+
document_external_id : str
152+
The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal.
153+
154+
document_name : typing.Optional[str]
155+
The name of the document you want to upload. If not provided, the original filename will be used.
156+
157+
allowed_users_email_addresses : typing.Optional[str]
158+
Users allowed to access the document. Can be provided as a JSON array string (e.g., ["[email protected]","[email protected]"]) or comma-separated list (e.g., "[email protected],[email protected]"). Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public.
159+
160+
document_external_url : typing.Optional[str]
161+
The external URL of the document you want to upload. If provided Credal will link to this URL.
162+
163+
custom_metadata : typing.Optional[str]
164+
Optional JSON string representing any custom metadata for this document (e.g., '{"key1":"value1","key2":"value2"}').
165+
166+
collection_id : typing.Optional[str]
167+
If specified, the document will also be added to the provided document collection. This operation is eventually consistent, meaning the document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To achieve strong consistency use the `awaitVectorStoreSync` parameter.
168+
169+
force_update : typing.Optional[str]
170+
If set to "true", document contents will be re-uploaded and re-embedded even if the document already exists in Credal.
171+
172+
internal_public : typing.Optional[str]
173+
If set to "true", document will be accessible to everyone within the organization of the uploader.
174+
175+
source_system_updated : typing.Optional[str]
176+
ISO 8601 date string indicating when the document was last updated in the source system (e.g., "2025-11-03T21:15:00Z").
177+
178+
await_vector_store_sync : typing.Optional[str]
179+
Document uploads are eventually consistent by default. If set to "true" the API will wait for the vector store to be updated before returning. This is useful if you want to ensure that the document is immediately searchable after this call returns.
180+
181+
request_options : typing.Optional[RequestOptions]
182+
Request-specific configuration.
183+
184+
Returns
185+
-------
186+
UploadDocumentResponse
187+
"""
188+
_response = self._raw_client.upload_file(
189+
file=file,
190+
upload_as_user_email=upload_as_user_email,
191+
document_external_id=document_external_id,
192+
document_name=document_name,
193+
allowed_users_email_addresses=allowed_users_email_addresses,
194+
document_external_url=document_external_url,
195+
custom_metadata=custom_metadata,
196+
collection_id=collection_id,
197+
force_update=force_update,
198+
internal_public=internal_public,
199+
source_system_updated=source_system_updated,
200+
await_vector_store_sync=await_vector_store_sync,
201+
request_options=request_options,
202+
)
203+
return _response.data
204+
122205
def sync_source_by_url(
123206
self, *, upload_as_user_email: str, source_url: str, request_options: typing.Optional[RequestOptions] = None
124207
) -> SyncSourceByUrlResponse:
@@ -326,6 +409,88 @@ async def main() -> None:
326409
)
327410
return _response.data
328411

412+
async def upload_file(
413+
self,
414+
*,
415+
file: core.File,
416+
upload_as_user_email: str,
417+
document_external_id: str,
418+
document_name: typing.Optional[str] = OMIT,
419+
allowed_users_email_addresses: typing.Optional[str] = OMIT,
420+
document_external_url: typing.Optional[str] = OMIT,
421+
custom_metadata: typing.Optional[str] = OMIT,
422+
collection_id: typing.Optional[str] = OMIT,
423+
force_update: typing.Optional[str] = OMIT,
424+
internal_public: typing.Optional[str] = OMIT,
425+
source_system_updated: typing.Optional[str] = OMIT,
426+
await_vector_store_sync: typing.Optional[str] = OMIT,
427+
request_options: typing.Optional[RequestOptions] = None,
428+
) -> UploadDocumentResponse:
429+
"""
430+
Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
431+
432+
Parameters
433+
----------
434+
file : core.File
435+
See core.File for more documentation
436+
437+
upload_as_user_email : str
438+
[Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses.
439+
440+
document_external_id : str
441+
The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal.
442+
443+
document_name : typing.Optional[str]
444+
The name of the document you want to upload. If not provided, the original filename will be used.
445+
446+
allowed_users_email_addresses : typing.Optional[str]
447+
Users allowed to access the document. Can be provided as a JSON array string (e.g., ["[email protected]","[email protected]"]) or comma-separated list (e.g., "[email protected],[email protected]"). Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public.
448+
449+
document_external_url : typing.Optional[str]
450+
The external URL of the document you want to upload. If provided Credal will link to this URL.
451+
452+
custom_metadata : typing.Optional[str]
453+
Optional JSON string representing any custom metadata for this document (e.g., '{"key1":"value1","key2":"value2"}').
454+
455+
collection_id : typing.Optional[str]
456+
If specified, the document will also be added to the provided document collection. This operation is eventually consistent, meaning the document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To achieve strong consistency use the `awaitVectorStoreSync` parameter.
457+
458+
force_update : typing.Optional[str]
459+
If set to "true", document contents will be re-uploaded and re-embedded even if the document already exists in Credal.
460+
461+
internal_public : typing.Optional[str]
462+
If set to "true", document will be accessible to everyone within the organization of the uploader.
463+
464+
source_system_updated : typing.Optional[str]
465+
ISO 8601 date string indicating when the document was last updated in the source system (e.g., "2025-11-03T21:15:00Z").
466+
467+
await_vector_store_sync : typing.Optional[str]
468+
Document uploads are eventually consistent by default. If set to "true" the API will wait for the vector store to be updated before returning. This is useful if you want to ensure that the document is immediately searchable after this call returns.
469+
470+
request_options : typing.Optional[RequestOptions]
471+
Request-specific configuration.
472+
473+
Returns
474+
-------
475+
UploadDocumentResponse
476+
"""
477+
_response = await self._raw_client.upload_file(
478+
file=file,
479+
upload_as_user_email=upload_as_user_email,
480+
document_external_id=document_external_id,
481+
document_name=document_name,
482+
allowed_users_email_addresses=allowed_users_email_addresses,
483+
document_external_url=document_external_url,
484+
custom_metadata=custom_metadata,
485+
collection_id=collection_id,
486+
force_update=force_update,
487+
internal_public=internal_public,
488+
source_system_updated=source_system_updated,
489+
await_vector_store_sync=await_vector_store_sync,
490+
request_options=request_options,
491+
)
492+
return _response.data
493+
329494
async def sync_source_by_url(
330495
self, *, upload_as_user_email: str, source_url: str, request_options: typing.Optional[RequestOptions] = None
331496
) -> SyncSourceByUrlResponse:

0 commit comments

Comments
 (0)