├── .devcontainer
├── README.md
├── devcontainer.json
└── setup.sh
├── .gitattributes
├── .github
└── workflows
│ ├── sdk_generation.yaml
│ └── sdk_publish.yaml
├── .gitignore
├── .speakeasy
├── gen.lock
├── gen.yaml
├── workflow.lock
└── workflow.yaml
├── .vscode
└── settings.json
├── CONTRIBUTING.md
├── README-PYPI.md
├── README.md
├── RELEASES.md
├── USAGE.md
├── docs
├── models
│ ├── audiomodalitydata.md
│ ├── connection.md
│ ├── connectionbase.md
│ ├── connectionbasemetadata.md
│ ├── connectionlimitparams.md
│ ├── connectionlist.md
│ ├── connectionmetadata.md
│ ├── connectionstats.md
│ ├── connectorsource.md
│ ├── connectorsourcetypeinfo.md
│ ├── createdocumentfromurlparams.md
│ ├── createdocumentfromurlparamsmetadata.md
│ ├── createdocumentfromurlparamsmode.md
│ ├── createdocumentparams.md
│ ├── createdocumentrawparams.md
│ ├── createdocumentrawparamsmetadata.md
│ ├── createinstructionparams.md
│ ├── createinstructionparamsscope.md
│ ├── createpartitionparams.md
│ ├── data.md
│ ├── deleteconnectionconnectionsconnectioniddeletepostrequest.md
│ ├── deleteconnectionpayload.md
│ ├── deletedocumentrequest.md
│ ├── deleteinstructionrequest.md
│ ├── deletepartitionpartitionspartitioniddeleterequest.md
│ ├── disabledbysystemreason.md
│ ├── document.md
│ ├── documentchunk.md
│ ├── documentchunkdetail.md
│ ├── documentchunklist.md
│ ├── documentdelete.md
│ ├── documentfileupdate.md
│ ├── documentget.md
│ ├── documentgetmetadata.md
│ ├── documentlist.md
│ ├── documentmetadata.md
│ ├── documentmetadataupdate.md
│ ├── documentmetadataupdatemetadata.md
│ ├── documentrawupdate.md
│ ├── documentsummary.md
│ ├── documenturlupdate.md
│ ├── documentwithcontent.md
│ ├── documentwithcontentmetadata.md
│ ├── entity.md
│ ├── entitylist.md
│ ├── errormessage.md
│ ├── file.md
│ ├── getconnectionconnectionsconnectionidgetrequest.md
│ ├── getconnectionstatsconnectionsconnectionidstatsgetrequest.md
│ ├── getdocumentchunkcontentrequest.md
│ ├── getdocumentchunkrequest.md
│ ├── getdocumentchunksrequest.md
│ ├── getdocumentcontentrequest.md
│ ├── getdocumentrequest.md
│ ├── getdocumentsourcerequest.md
│ ├── getdocumentsummaryrequest.md
│ ├── getpartitionpartitionspartitionidgetrequest.md
│ ├── httpvalidationerror.md
│ ├── instruction.md
│ ├── link.md
│ ├── listconnectionsconnectionsgetrequest.md
│ ├── listconnectionsconnectionsgetresponse.md
│ ├── listconnectorsourcetypeinfo.md
│ ├── listdocumentsrequest.md
│ ├── listdocumentsresponse.md
│ ├── listentitiesbydocumentrequest.md
│ ├── listentitiesbydocumentresponse.md
│ ├── listentitiesbyinstructionrequest.md
│ ├── listentitiesbyinstructionresponse.md
│ ├── listpartitionspartitionsgetrequest.md
│ ├── listpartitionspartitionsgetresponse.md
│ ├── loc.md
│ ├── mediamodeparam.md
│ ├── mediatype.md
│ ├── metadata.md
│ ├── modalitydata.md
│ ├── mode.md
│ ├── mode1.md
│ ├── mode2.md
│ ├── modestatic.md
│ ├── modevideo.md
│ ├── oauthurlcreate.md
│ ├── oauthurlcreatemetadata.md
│ ├── oauthurlcreatemode.md
│ ├── oauthurlcreatemode1.md
│ ├── oauthurlresponse.md
│ ├── one.md
│ ├── one1.md
│ ├── one2.md
│ ├── pagination.md
│ ├── partition.md
│ ├── partitiondetail.md
│ ├── partitionlimitparams.md
│ ├── partitionlimits.md
│ ├── partitionlist.md
│ ├── partitionstats.md
│ ├── partitionstrategy.md
│ ├── partitionstrategy1.md
│ ├── patchdocumentmetadataparams.md
│ ├── patchdocumentmetadatarequest.md
│ ├── queryparam1.md
│ ├── queryparammediatype.md
│ ├── reason.md
│ ├── responseok.md
│ ├── retrieval.md
│ ├── retrieveparams.md
│ ├── scope.md
│ ├── scoredchunk.md
│ ├── security.md
│ ├── setconnectionenabledconnectionsconnectionidenabledputrequest.md
│ ├── setconnectionenabledpayload.md
│ ├── setconnectionlimitsconnectionsconnectionidlimitputrequest.md
│ ├── setpartitionlimitspartitionspartitionidlimitsputrequest.md
│ ├── source.md
│ ├── static.md
│ ├── syncconnectionrequest.md
│ ├── theme.md
│ ├── two.md
│ ├── updateconnectionconnectionsconnectionidputrequest.md
│ ├── updatedocumentfileparams.md
│ ├── updatedocumentfileparams11.md
│ ├── updatedocumentfileparams12.md
│ ├── updatedocumentfileparamsfile.md
│ ├── updatedocumentfileparamsmode.md
│ ├── updatedocumentfileparamsmode1.md
│ ├── updatedocumentfileparamsmodestatic.md
│ ├── updatedocumentfileparamsmodevideo.md
│ ├── updatedocumentfilerequest.md
│ ├── updatedocumentfromurlparams.md
│ ├── updatedocumentfromurlparamsmode.md
│ ├── updatedocumentfromurlparamsmode1.md
│ ├── updatedocumentfromurlrequest.md
│ ├── updatedocumentrawparams.md
│ ├── updatedocumentrawparamsdata.md
│ ├── updatedocumentrawrequest.md
│ ├── updateinstructionparams.md
│ ├── updateinstructionrequest.md
│ ├── utils
│ │ └── retryconfig.md
│ ├── validationerror.md
│ ├── video.md
│ ├── videomodalitydata.md
│ └── wordtimestamp.md
└── sdks
│ ├── connections
│ └── README.md
│ ├── documents
│ └── README.md
│ ├── entities
│ └── README.md
│ ├── partitions
│ └── README.md
│ ├── ragie
│ └── README.md
│ └── retrievals
│ └── README.md
├── poetry.lock
├── poetry.toml
├── py.typed
├── pylintrc
├── pyproject.toml
├── scripts
├── prepare_readme.py
└── publish.sh
└── src
└── ragie
├── __init__.py
├── _hooks
├── __init__.py
├── sdkhooks.py
└── types.py
├── _version.py
├── basesdk.py
├── connections.py
├── documents.py
├── entities.py
├── httpclient.py
├── models
├── __init__.py
├── audiomodalitydata.py
├── connection.py
├── connectionbase.py
├── connectionlimitparams.py
├── connectionlist.py
├── connectionstats.py
├── connectorsource.py
├── connectorsourcetypeinfo.py
├── createdocumentfromurlparams.py
├── createdocumentparams.py
├── createdocumentrawparams.py
├── createinstructionparams.py
├── createpartitionparams.py
├── delete_connection_connections_connection_id_delete_postop.py
├── delete_partition_partitions_partition_id_deleteop.py
├── deleteconnectionpayload.py
├── deletedocumentop.py
├── deleteinstructionop.py
├── document.py
├── documentchunk.py
├── documentchunkdetail.py
├── documentchunklist.py
├── documentdelete.py
├── documentfileupdate.py
├── documentget.py
├── documentlist.py
├── documentmetadataupdate.py
├── documentrawupdate.py
├── documentsummary.py
├── documenturlupdate.py
├── documentwithcontent.py
├── entity.py
├── entitylist.py
├── errormessage.py
├── get_connection_connections_connection_id_getop.py
├── get_connection_stats_connections_connection_id_stats_getop.py
├── get_partition_partitions_partition_id_getop.py
├── getdocumentchunkcontentop.py
├── getdocumentchunkop.py
├── getdocumentchunksop.py
├── getdocumentcontentop.py
├── getdocumentop.py
├── getdocumentsourceop.py
├── getdocumentsummaryop.py
├── httpvalidationerror.py
├── instruction.py
├── link.py
├── list_connections_connections_getop.py
├── list_partitions_partitions_getop.py
├── listconnectorsourcetypeinfo.py
├── listdocumentsop.py
├── listentitiesbydocumentop.py
├── listentitiesbyinstructionop.py
├── mediamodeparam.py
├── oauthurlcreate.py
├── oauthurlresponse.py
├── pagination.py
├── partition.py
├── partitiondetail.py
├── partitionlimitparams.py
├── partitionlimits.py
├── partitionlist.py
├── partitionstats.py
├── patchdocumentmetadataop.py
├── patchdocumentmetadataparams.py
├── responseok.py
├── retrieval.py
├── retrieveparams.py
├── scoredchunk.py
├── sdkerror.py
├── security.py
├── set_connection_enabled_connections_connection_id_enabled_putop.py
├── set_connection_limits_connections_connection_id_limit_putop.py
├── set_partition_limits_partitions_partition_id_limits_putop.py
├── setconnectionenabledpayload.py
├── syncconnectionop.py
├── update_connection_connections_connection_id_putop.py
├── updatedocumentfileop.py
├── updatedocumentfileparams.py
├── updatedocumentfromurlop.py
├── updatedocumentfromurlparams.py
├── updatedocumentrawop.py
├── updatedocumentrawparams.py
├── updateinstructionop.py
├── updateinstructionparams.py
├── validationerror.py
├── videomodalitydata.py
└── wordtimestamp.py
├── partitions.py
├── py.typed
├── retrievals.py
├── sdk.py
├── sdkconfiguration.py
├── types
├── __init__.py
└── basemodel.py
└── utils
├── __init__.py
├── annotations.py
├── datetimes.py
├── enums.py
├── eventstreaming.py
├── forms.py
├── headers.py
├── logger.py
├── metadata.py
├── queryparams.py
├── requestbodies.py
├── retries.py
├── security.py
├── serializers.py
├── url.py
└── values.py
/.devcontainer/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 | > **Remember to shutdown a GitHub Codespace when it is not in use!**
8 |
9 | # Dev Containers Quick Start
10 |
11 | The default location for usage snippets is the `samples` directory.
12 |
13 | ## Running a Usage Sample
14 |
15 | A sample usage example has been provided in a `root.py` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
16 |
17 | ```
18 | python root.py
19 | ```
20 |
21 | ## Generating Additional Usage Samples
22 |
23 | The speakeasy CLI allows you to generate more usage snippets. Here's how:
24 |
25 | - To generate a sample for a specific operation by providing an operation ID, use:
26 |
27 | ```
28 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l python -i {INPUT_OPERATION_ID} -o ./samples
29 | ```
30 |
31 | - To generate samples for an entire namespace (like a tag or group name), use:
32 |
33 | ```
34 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l python -n {INPUT_TAG_NAME} -o ./samples
35 | ```
36 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2 | // README at: https://github.com/devcontainers/images/tree/main/src/python
3 | {
4 | "name": "Python",
5 | "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
6 | // Features to add to the dev container. More info: https://containers.dev/features.
7 | // "features": {},
8 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
9 | // "forwardPorts": [],
10 | // Use 'postCreateCommand' to run commands after the container is created.
11 | "postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12 | "customizations": {
13 | "vscode": {
14 | "extensions": [
15 | "ms-python.python",
16 | "ms-python.vscode-pylance",
17 | "github.vscode-pull-request-github"
18 | ],
19 | "settings": {
20 | "files.eol": "\n",
21 | "editor.formatOnSave": true,
22 | "python.formatting.provider": "black",
23 | "python.linting.enabled": true,
24 | "python.linting.pylintEnabled": true,
25 | "python.linting.flake8Enabled": true,
26 | "python.linting.banditEnabled": true,
27 | "python.testing.pytestEnabled": true
28 | }
29 | },
30 | "codespaces": {
31 | "openFiles": [
32 | ".devcontainer/README.md"
33 | ]
34 | }
35 | }
36 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37 | // "remoteUser": "root"
38 | }
39 |
--------------------------------------------------------------------------------
/.devcontainer/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Install the speakeasy CLI
4 | curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5 |
6 | # Setup samples directory
7 | rmdir samples || true
8 | mkdir samples
9 |
10 | python -m pip install --upgrade pip
11 | pip install -e .
12 |
13 | # Generate starter usage sample with speakeasy
14 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l python -o samples/root.py
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # This allows generated code to be indexed correctly
2 | *.py linguist-generated=false
--------------------------------------------------------------------------------
/.github/workflows/sdk_generation.yaml:
--------------------------------------------------------------------------------
1 | name: Generate
2 | permissions:
3 | checks: write
4 | contents: write
5 | pull-requests: write
6 | statuses: write
7 | "on":
8 | workflow_dispatch:
9 | inputs:
10 | force:
11 | description: Force generation of SDKs
12 | type: boolean
13 | default: false
14 | set_version:
15 | description: optionally set a specific SDK version
16 | type: string
17 | schedule:
18 | - cron: 0 0 * * *
19 | jobs:
20 | generate:
21 | uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
22 | with:
23 | force: ${{ github.event.inputs.force }}
24 | mode: pr
25 | set_version: ${{ github.event.inputs.set_version }}
26 | speakeasy_version: latest
27 | secrets:
28 | github_access_token: ${{ secrets.GITHUB_TOKEN }}
29 | pypi_token: ${{ secrets.PYPI_TOKEN }}
30 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
31 |
--------------------------------------------------------------------------------
/.github/workflows/sdk_publish.yaml:
--------------------------------------------------------------------------------
1 | name: Publish
2 | permissions:
3 | checks: write
4 | contents: write
5 | pull-requests: write
6 | statuses: write
7 | "on":
8 | push:
9 | branches:
10 | - main
11 | paths:
12 | - RELEASES.md
13 | - '*/RELEASES.md'
14 | jobs:
15 | publish:
16 | uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
17 | secrets:
18 | github_access_token: ${{ secrets.GITHUB_TOKEN }}
19 | pypi_token: ${{ secrets.PYPI_TOKEN }}
20 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/__pycache__/
2 | **/.speakeasy/temp/
3 | **/.speakeasy/logs/
4 | .speakeasy/temp/
5 | .speakeasy/reports
6 | README-PYPI.md
7 | .venv/
8 | venv/
9 | src/*.egg-info/
10 | __pycache__/
11 | .pytest_cache/
12 | .python-version
13 | .DS_Store
14 | pyrightconfig.json
15 | # README-PYPI.md
16 |
--------------------------------------------------------------------------------
/.speakeasy/gen.yaml:
--------------------------------------------------------------------------------
1 | configVersion: 2.0.0
2 | generation:
3 | devContainers:
4 | enabled: true
5 | schemaPath: https://api.ragie.ai/openapi.json
6 | sdkClassName: Ragie
7 | maintainOpenAPIOrder: true
8 | usageSnippets:
9 | optionalPropertyRendering: withExample
10 | useClassNamesForArrayFields: true
11 | fixes:
12 | nameResolutionDec2023: true
13 | nameResolutionFeb2025: false
14 | parameterOrderingFeb2024: true
15 | requestResponseComponentNamesFeb2024: true
16 | securityFeb2025: false
17 | sharedErrorComponentsApr2025: false
18 | auth:
19 | oAuth2ClientCredentialsEnabled: false
20 | oAuth2PasswordEnabled: false
21 | python:
22 | version: 1.9.0
23 | additionalDependencies:
24 | dev: {}
25 | main: {}
26 | authors:
27 | - Speakeasy
28 | clientServerStatusCodesAsErrors: true
29 | defaultErrorName: SDKError
30 | description: Python Client SDK Generated by Speakeasy.
31 | enableCustomCodeRegions: false
32 | enumFormat: enum
33 | fixFlags:
34 | responseRequiredSep2024: false
35 | flattenGlobalSecurity: true
36 | flattenRequests: false
37 | flatteningOrder: parameters-first
38 | imports:
39 | option: openapi
40 | paths:
41 | callbacks: ""
42 | errors: ""
43 | operations: ""
44 | shared: ""
45 | webhooks: ""
46 | inputModelSuffix: input
47 | maxMethodParams: 4
48 | methodArguments: infer-optional-args
49 | moduleName: ""
50 | outputModelSuffix: output
51 | packageName: ragie
52 | pytestFilterWarnings: []
53 | pytestTimeout: 0
54 | responseFormat: flat
55 | templateVersion: v2
56 |
--------------------------------------------------------------------------------
/.speakeasy/workflow.lock:
--------------------------------------------------------------------------------
1 | speakeasyVersion: 1.546.1
2 | sources:
3 | Ragie-OAS:
4 | sourceNamespace: ragie-oas
5 | sourceRevisionDigest: sha256:8f8d8211fac3e8e963eaa25ab0bbee3967324027a69bb64355a08248156076a0
6 | sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17
7 | tags:
8 | - latest
9 | - speakeasy-sdk-regen-1745626047
10 | - 1.0.0
11 | targets:
12 | ragie:
13 | source: Ragie-OAS
14 | sourceNamespace: ragie-oas
15 | sourceRevisionDigest: sha256:8f8d8211fac3e8e963eaa25ab0bbee3967324027a69bb64355a08248156076a0
16 | sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17
17 | codeSamplesNamespace: ragie-oas-python-code-samples
18 | codeSamplesRevisionDigest: sha256:80c686b1c222974b9042938c41c807402e911425de2c1f7785ea9586825d07d8
19 | workflow:
20 | workflowVersion: 1.0.0
21 | speakeasyVersion: latest
22 | sources:
23 | Ragie-OAS:
24 | inputs:
25 | - location: https://api.ragie.ai/openapi.json
26 | registry:
27 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-oas
28 | targets:
29 | ragie:
30 | target: python
31 | source: Ragie-OAS
32 | publish:
33 | pypi:
34 | token: $pypi_token
35 | codeSamples:
36 | registry:
37 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-oas-python-code-samples
38 | blocking: false
39 |
--------------------------------------------------------------------------------
/.speakeasy/workflow.yaml:
--------------------------------------------------------------------------------
1 | workflowVersion: 1.0.0
2 | speakeasyVersion: latest
3 | sources:
4 | Ragie-OAS:
5 | inputs:
6 | - location: https://api.ragie.ai/openapi.json
7 | registry:
8 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-oas
9 | targets:
10 | ragie:
11 | target: python
12 | source: Ragie-OAS
13 | publish:
14 | pypi:
15 | token: $pypi_token
16 | codeSamples:
17 | registry:
18 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-oas-python-code-samples
19 | blocking: false
20 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "python.testing.pytestArgs": ["tests", "-vv"],
3 | "python.testing.unittestEnabled": false,
4 | "python.testing.pytestEnabled": true,
5 | "pylint.args": ["--rcfile=pylintrc"]
6 | }
7 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to This Repository
2 |
3 | Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
4 |
5 | ## How to Report Issues
6 |
7 | If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
8 |
9 | - A clear and descriptive title
10 | - Steps to reproduce the issue
11 | - Expected and actual behavior
12 | - Any relevant logs, screenshots, or error messages
13 | - Information about your environment (e.g., operating system, software versions)
14 | - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
15 |
16 | ## Issue Triage and Upstream Fixes
17 |
18 | We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
19 |
20 | ## Contact
21 |
22 | If you have any questions or need further assistance, please feel free to reach out by opening an issue.
23 |
24 | Thank you for your understanding and cooperation!
25 |
26 | The Maintainers
27 |
--------------------------------------------------------------------------------
/USAGE.md:
--------------------------------------------------------------------------------
1 |
2 | ```python
3 | # Synchronous Example
4 | from ragie import Ragie
5 |
6 |
7 | with Ragie(
8 | auth="",
9 | ) as r_client:
10 |
11 | res = r_client.documents.create(request={
12 | "file": {
13 | "file_name": "example.file",
14 | "content": open("example.file", "rb"),
15 | },
16 | })
17 |
18 | assert res is not None
19 |
20 | # Handle response
21 | print(res)
22 | ```
23 |
24 |
25 |
26 | The same SDK client can also be used to make asychronous requests by importing asyncio.
27 | ```python
28 | # Asynchronous Example
29 | import asyncio
30 | from ragie import Ragie
31 |
32 | async def main():
33 |
34 | async with Ragie(
35 | auth="",
36 | ) as r_client:
37 |
38 | res = await r_client.documents.create_async(request={
39 | "file": {
40 | "file_name": "example.file",
41 | "content": open("example.file", "rb"),
42 | },
43 | })
44 |
45 | assert res is not None
46 |
47 | # Handle response
48 | print(res)
49 |
50 | asyncio.run(main())
51 | ```
52 |
--------------------------------------------------------------------------------
/docs/models/audiomodalitydata.md:
--------------------------------------------------------------------------------
1 | # AudioModalityData
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
8 | | `type` | *Optional[Literal["audio"]]* | :heavy_minus_sign: | N/A |
9 | | `word_timestamps` | List[[models.WordTimestamp](../models/wordtimestamp.md)] | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/connectionbasemetadata.md:
--------------------------------------------------------------------------------
1 | # ConnectionBaseMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/connectionlist.md:
--------------------------------------------------------------------------------
1 | # ConnectionList
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
8 | | `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A |
9 | | `connections` | List[[models.Connection](../models/connection.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/connectionmetadata.md:
--------------------------------------------------------------------------------
1 | # ConnectionMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/connectionstats.md:
--------------------------------------------------------------------------------
1 | # ConnectionStats
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `document_count` | *int* | :heavy_check_mark: | N/A |
9 | | `page_count` | *float* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/connectorsource.md:
--------------------------------------------------------------------------------
1 | # ConnectorSource
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------------- | -------------- |
8 | | `BACKBLAZE` | backblaze |
9 | | `CONFLUENCE` | confluence |
10 | | `DROPBOX` | dropbox |
11 | | `FRESHDESK` | freshdesk |
12 | | `ONEDRIVE` | onedrive |
13 | | `GOOGLE_DRIVE` | google_drive |
14 | | `GMAIL` | gmail |
15 | | `INTERCOM` | intercom |
16 | | `NOTION` | notion |
17 | | `SALESFORCE` | salesforce |
18 | | `SHAREPOINT` | sharepoint |
19 | | `JIRA` | jira |
20 | | `SLACK` | slack |
21 | | `S3` | s3 |
22 | | `GCS` | gcs |
23 | | `HUBSPOT` | hubspot |
24 | | `ZENDESK` | zendesk |
--------------------------------------------------------------------------------
/docs/models/connectorsourcetypeinfo.md:
--------------------------------------------------------------------------------
1 | # ConnectorSourceTypeInfo
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
8 | | `source_type` | [models.ConnectorSource](../models/connectorsource.md) | :heavy_check_mark: | N/A |
9 | | `display_name` | *str* | :heavy_check_mark: | N/A |
10 | | `icon_url` | *str* | :heavy_check_mark: | N/A |
11 | | `docs_url` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/createdocumentfromurlparamsmetadata.md:
--------------------------------------------------------------------------------
1 | # CreateDocumentFromURLParamsMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/createdocumentfromurlparamsmode.md:
--------------------------------------------------------------------------------
1 | # CreateDocumentFromURLParamsMode
2 |
3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true }
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `models.Mode1`
9 |
10 | ```python
11 | value: models.Mode1 = /* values here */
12 | ```
13 |
14 | ### `models.MediaModeParam`
15 |
16 | ```python
17 | value: models.MediaModeParam = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/createdocumentrawparamsmetadata.md:
--------------------------------------------------------------------------------
1 | # CreateDocumentRawParamsMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/createinstructionparamsscope.md:
--------------------------------------------------------------------------------
1 | # CreateInstructionParamsScope
2 |
3 | The scope of the instruction. Determines whether the instruction is applied to the entire document or to each chunk of the document. Options are `'document'` or `'chunk'`. Generally `'document'` should be used when analyzing the full document is desired, such as when generating a summary or determining sentiment, and `'chunk'` should be used when a fine grained search over a document is desired.
4 |
5 |
6 | ## Values
7 |
8 | | Name | Value |
9 | | ---------- | ---------- |
10 | | `DOCUMENT` | document |
11 | | `CHUNK` | chunk |
--------------------------------------------------------------------------------
/docs/models/createpartitionparams.md:
--------------------------------------------------------------------------------
1 | # CreatePartitionParams
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
8 | | `name` | *str* | :heavy_check_mark: | N/A | |
9 | | `pages_hosted_limit_monthly` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
10 | | `pages_processed_limit_monthly` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
11 | | `pages_hosted_limit_max` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
12 | | `pages_processed_limit_max` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
--------------------------------------------------------------------------------
/docs/models/data.md:
--------------------------------------------------------------------------------
1 | # Data
2 |
3 | Document data in a text or JSON format.
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `str`
9 |
10 | ```python
11 | value: str = /* values here */
12 | ```
13 |
14 | ### `Dict[str, Any]`
15 |
16 | ```python
17 | value: Dict[str, Any] = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/deleteconnectionconnectionsconnectioniddeletepostrequest.md:
--------------------------------------------------------------------------------
1 | # DeleteConnectionConnectionsConnectionIDDeletePostRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
9 | | `delete_connection_payload` | [models.DeleteConnectionPayload](../models/deleteconnectionpayload.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/deleteconnectionpayload.md:
--------------------------------------------------------------------------------
1 | # DeleteConnectionPayload
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `keep_files` | *bool* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/deleteinstructionrequest.md:
--------------------------------------------------------------------------------
1 | # DeleteInstructionRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
8 | | `instruction_id` | *str* | :heavy_check_mark: | The ID of the instruction. | 00000000-0000-0000-0000-000000000000 |
--------------------------------------------------------------------------------
/docs/models/deletepartitionpartitionspartitioniddeleterequest.md:
--------------------------------------------------------------------------------
1 | # DeletePartitionPartitionsPartitionIDDeleteRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `partition_id` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/disabledbysystemreason.md:
--------------------------------------------------------------------------------
1 | # DisabledBySystemReason
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ---------------------------------- | ---------------------------------- |
8 | | `CONNECTION_OVER_TOTAL_PAGE_LIMIT` | connection_over_total_page_limit |
9 | | `AUTHENTICATION_FAILED` | authentication_failed |
--------------------------------------------------------------------------------
/docs/models/documentchunk.md:
--------------------------------------------------------------------------------
1 | # DocumentChunk
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
8 | | `id` | *str* | :heavy_check_mark: | N/A |
9 | | `index` | *Optional[int]* | :heavy_minus_sign: | N/A |
10 | | `text` | *str* | :heavy_check_mark: | N/A |
11 | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
12 | | `links` | Dict[str, [models.Link](../models/link.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentchunklist.md:
--------------------------------------------------------------------------------
1 | # DocumentChunkList
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
8 | | `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A |
9 | | `chunks` | List[[models.DocumentChunk](../models/documentchunk.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentdelete.md:
--------------------------------------------------------------------------------
1 | # DocumentDelete
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `status` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentfileupdate.md:
--------------------------------------------------------------------------------
1 | # DocumentFileUpdate
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `status` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentgetmetadata.md:
--------------------------------------------------------------------------------
1 | # DocumentGetMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/documentlist.md:
--------------------------------------------------------------------------------
1 | # DocumentList
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
8 | | `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A |
9 | | `documents` | List[[models.Document](../models/document.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentmetadata.md:
--------------------------------------------------------------------------------
1 | # DocumentMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/documentmetadataupdate.md:
--------------------------------------------------------------------------------
1 | # DocumentMetadataUpdate
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
8 | | `metadata` | Dict[str, [models.DocumentMetadataUpdateMetadata](../models/documentmetadataupdatemetadata.md)] | :heavy_check_mark: | The full document metadata inclusive of the update. | {
"editors": [
"Alice",
"Bob"
],
"title": "declassified report",
"unchanged_key": "unchanged_value",
"updated_at": 1714491736216
} |
--------------------------------------------------------------------------------
/docs/models/documentmetadataupdatemetadata.md:
--------------------------------------------------------------------------------
1 | # DocumentMetadataUpdateMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/documentrawupdate.md:
--------------------------------------------------------------------------------
1 | # DocumentRawUpdate
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `status` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentsummary.md:
--------------------------------------------------------------------------------
1 | # DocumentSummary
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `document_id` | *str* | :heavy_check_mark: | N/A |
9 | | `summary` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documenturlupdate.md:
--------------------------------------------------------------------------------
1 | # DocumentURLUpdate
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `status` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/documentwithcontentmetadata.md:
--------------------------------------------------------------------------------
1 | # DocumentWithContentMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/entity.md:
--------------------------------------------------------------------------------
1 | # Entity
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
8 | | `id` | *str* | :heavy_check_mark: | N/A |
9 | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
10 | | `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
11 | | `instruction_id` | *str* | :heavy_check_mark: | The ID of the instruction which generated the entity. |
12 | | `document_id` | *str* | :heavy_check_mark: | The ID of the document which the entity was produced from. |
13 | | `chunk_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
14 | | `data` | Dict[str, *Any*] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/entitylist.md:
--------------------------------------------------------------------------------
1 | # EntityList
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8 | | `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A |
9 | | `entities` | List[[models.Entity](../models/entity.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/errormessage.md:
--------------------------------------------------------------------------------
1 | # ErrorMessage
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `detail` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/file.md:
--------------------------------------------------------------------------------
1 | # File
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8 | | `file_name` | *str* | :heavy_check_mark: | N/A |
9 | | `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A |
10 | | `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/getconnectionconnectionsconnectionidgetrequest.md:
--------------------------------------------------------------------------------
1 | # GetConnectionConnectionsConnectionIDGetRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/getconnectionstatsconnectionsconnectionidstatsgetrequest.md:
--------------------------------------------------------------------------------
1 | # GetConnectionStatsConnectionsConnectionIDStatsGetRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/getpartitionpartitionspartitionidgetrequest.md:
--------------------------------------------------------------------------------
1 | # GetPartitionPartitionsPartitionIDGetRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `partition_id` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/httpvalidationerror.md:
--------------------------------------------------------------------------------
1 | # HTTPValidationError
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
8 | | `detail` | List[[models.ValidationError](../models/validationerror.md)] | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/link.md:
--------------------------------------------------------------------------------
1 | # Link
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `href` | *str* | :heavy_check_mark: | N/A |
9 | | `type` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listconnectionsconnectionsgetresponse.md:
--------------------------------------------------------------------------------
1 | # ListConnectionsConnectionsGetResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
8 | | `result` | [models.ConnectionList](../models/connectionlist.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listconnectorsourcetypeinfo.md:
--------------------------------------------------------------------------------
1 | # ListConnectorSourceTypeInfo
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
8 | | `connectors` | List[[models.ConnectorSourceTypeInfo](../models/connectorsourcetypeinfo.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listdocumentsresponse.md:
--------------------------------------------------------------------------------
1 | # ListDocumentsResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
8 | | `result` | [models.DocumentList](../models/documentlist.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listentitiesbydocumentresponse.md:
--------------------------------------------------------------------------------
1 | # ListEntitiesByDocumentResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8 | | `result` | [models.EntityList](../models/entitylist.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listentitiesbyinstructionresponse.md:
--------------------------------------------------------------------------------
1 | # ListEntitiesByInstructionResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8 | | `result` | [models.EntityList](../models/entitylist.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/listpartitionspartitionsgetrequest.md:
--------------------------------------------------------------------------------
1 | # ListPartitionsPartitionsGetRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
8 | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | An opaque cursor for pagination |
9 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | The number of items per page (must be greater than 0 and less than or equal to 100) |
--------------------------------------------------------------------------------
/docs/models/listpartitionspartitionsgetresponse.md:
--------------------------------------------------------------------------------
1 | # ListPartitionsPartitionsGetResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
8 | | `result` | [models.PartitionList](../models/partitionlist.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/loc.md:
--------------------------------------------------------------------------------
1 | # Loc
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/mediamodeparam.md:
--------------------------------------------------------------------------------
1 | # MediaModeParam
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
8 | | `static` | [OptionalNullable[models.Static]](../models/static.md) | :heavy_minus_sign: | N/A |
9 | | `audio` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
10 | | `video` | [OptionalNullable[models.Video]](../models/video.md) | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/mediatype.md:
--------------------------------------------------------------------------------
1 | # MediaType
2 |
3 | The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the chunk's document type.
4 |
5 |
6 | ## Values
7 |
8 | | Name | Value |
9 | | ------------ | ------------ |
10 | | `TEXT_PLAIN` | text/plain |
11 | | `AUDIO_MPEG` | audio/mpeg |
12 | | `VIDEO_MP4` | video/mp4 |
--------------------------------------------------------------------------------
/docs/models/metadata.md:
--------------------------------------------------------------------------------
1 | # Metadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `float`
13 |
14 | ```python
15 | value: float = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/modalitydata.md:
--------------------------------------------------------------------------------
1 | # ModalityData
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `models.AudioModalityData`
7 |
8 | ```python
9 | value: models.AudioModalityData = /* values here */
10 | ```
11 |
12 | ### `models.VideoModalityData`
13 |
14 | ```python
15 | value: models.VideoModalityData = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/mode.md:
--------------------------------------------------------------------------------
1 | # Mode
2 |
3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true }
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `models.One`
9 |
10 | ```python
11 | value: models.One = /* values here */
12 | ```
13 |
14 | ### `models.Two`
15 |
16 | ```python
17 | value: models.Two = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/mode1.md:
--------------------------------------------------------------------------------
1 | # Mode1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/mode2.md:
--------------------------------------------------------------------------------
1 | # Mode2
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
8 | | `static` | [OptionalNullable[models.UpdateDocumentFileParamsModeStatic]](../models/updatedocumentfileparamsmodestatic.md) | :heavy_minus_sign: | N/A |
9 | | `audio` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
10 | | `video` | [OptionalNullable[models.UpdateDocumentFileParamsModeVideo]](../models/updatedocumentfileparamsmodevideo.md) | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/modestatic.md:
--------------------------------------------------------------------------------
1 | # ModeStatic
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/modevideo.md:
--------------------------------------------------------------------------------
1 | # ModeVideo
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ------------- | ------------- |
8 | | `AUDIO_ONLY` | audio_only |
9 | | `VIDEO_ONLY` | video_only |
10 | | `AUDIO_VIDEO` | audio_video |
--------------------------------------------------------------------------------
/docs/models/oauthurlcreatemetadata.md:
--------------------------------------------------------------------------------
1 | # OAuthURLCreateMetadata
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `int`
13 |
14 | ```python
15 | value: int = /* values here */
16 | ```
17 |
18 | ### `bool`
19 |
20 | ```python
21 | value: bool = /* values here */
22 | ```
23 |
24 | ### `List[str]`
25 |
26 | ```python
27 | value: List[str] = /* values here */
28 | ```
29 |
30 |
--------------------------------------------------------------------------------
/docs/models/oauthurlcreatemode.md:
--------------------------------------------------------------------------------
1 | # OAuthURLCreateMode
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `models.OAuthURLCreateMode1`
7 |
8 | ```python
9 | value: models.OAuthURLCreateMode1 = /* values here */
10 | ```
11 |
12 | ### `models.MediaModeParam`
13 |
14 | ```python
15 | value: models.MediaModeParam = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/oauthurlcreatemode1.md:
--------------------------------------------------------------------------------
1 | # OAuthURLCreateMode1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/oauthurlresponse.md:
--------------------------------------------------------------------------------
1 | # OAuthURLResponse
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `url` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/one.md:
--------------------------------------------------------------------------------
1 | # One
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `models.One1`
7 |
8 | ```python
9 | value: models.One1 = /* values here */
10 | ```
11 |
12 | ### `models.One2`
13 |
14 | ```python
15 | value: models.One2 = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/one1.md:
--------------------------------------------------------------------------------
1 | # One1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/one2.md:
--------------------------------------------------------------------------------
1 | # One2
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ----------- | ----------- | ----------- | ----------- |
--------------------------------------------------------------------------------
/docs/models/pagination.md:
--------------------------------------------------------------------------------
1 | # Pagination
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
8 | | `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
9 | | `total_count` | *int* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partition.md:
--------------------------------------------------------------------------------
1 | # Partition
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
8 | | `name` | *str* | :heavy_check_mark: | N/A |
9 | | `is_default` | *bool* | :heavy_check_mark: | N/A |
10 | | `limit_exceeded_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
11 | | `limits` | [models.PartitionLimits](../models/partitionlimits.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partitiondetail.md:
--------------------------------------------------------------------------------
1 | # PartitionDetail
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
8 | | `name` | *str* | :heavy_check_mark: | N/A |
9 | | `is_default` | *bool* | :heavy_check_mark: | N/A |
10 | | `limit_exceeded_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
11 | | `limits` | [models.PartitionLimits](../models/partitionlimits.md) | :heavy_check_mark: | N/A |
12 | | `stats` | [models.PartitionStats](../models/partitionstats.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partitionlimitparams.md:
--------------------------------------------------------------------------------
1 | # PartitionLimitParams
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
8 | | `pages_hosted_limit_monthly` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
9 | | `pages_processed_limit_monthly` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
10 | | `pages_hosted_limit_max` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
11 | | `pages_processed_limit_max` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | 1000 |
--------------------------------------------------------------------------------
/docs/models/partitionlimits.md:
--------------------------------------------------------------------------------
1 | # PartitionLimits
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
8 | | `pages_processed_limit_monthly` | *Nullable[float]* | :heavy_check_mark: | N/A |
9 | | `pages_hosted_limit_monthly` | *Nullable[float]* | :heavy_check_mark: | N/A |
10 | | `pages_processed_limit_max` | *Nullable[float]* | :heavy_check_mark: | N/A |
11 | | `pages_hosted_limit_max` | *Nullable[float]* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partitionlist.md:
--------------------------------------------------------------------------------
1 | # PartitionList
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
8 | | `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A |
9 | | `partitions` | List[[models.Partition](../models/partition.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partitionstats.md:
--------------------------------------------------------------------------------
1 | # PartitionStats
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
8 | | `pages_processed_monthly` | *float* | :heavy_check_mark: | N/A |
9 | | `pages_hosted_monthly` | *float* | :heavy_check_mark: | N/A |
10 | | `pages_processed_total` | *float* | :heavy_check_mark: | N/A |
11 | | `pages_hosted_total` | *float* | :heavy_check_mark: | N/A |
12 | | `document_count` | *int* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/partitionstrategy.md:
--------------------------------------------------------------------------------
1 | # PartitionStrategy
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `models.PartitionStrategy1`
7 |
8 | ```python
9 | value: models.PartitionStrategy1 = /* values here */
10 | ```
11 |
12 | ### `models.MediaModeParam`
13 |
14 | ```python
15 | value: models.MediaModeParam = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/partitionstrategy1.md:
--------------------------------------------------------------------------------
1 | # PartitionStrategy1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/queryparam1.md:
--------------------------------------------------------------------------------
1 | # QueryParam1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ------------ | ------------ |
8 | | `TEXT_PLAIN` | text/plain |
9 | | `AUDIO_MPEG` | audio/mpeg |
10 | | `VIDEO_MP4` | video/mp4 |
--------------------------------------------------------------------------------
/docs/models/queryparammediatype.md:
--------------------------------------------------------------------------------
1 | # QueryParamMediaType
2 |
3 | The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document's type.
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `models.QueryParam1`
9 |
10 | ```python
11 | value: models.QueryParam1 = /* values here */
12 | ```
13 |
14 | ### `str`
15 |
16 | ```python
17 | value: str = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/reason.md:
--------------------------------------------------------------------------------
1 | # Reason
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ---------------------------------- | ---------------------------------- |
8 | | `CONNECTION_OVER_TOTAL_PAGE_LIMIT` | connection_over_total_page_limit |
9 | | `AUTHENTICATION_FAILED` | authentication_failed |
--------------------------------------------------------------------------------
/docs/models/responseok.md:
--------------------------------------------------------------------------------
1 | # ResponseOK
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `message` | *Optional[str]* | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/retrieval.md:
--------------------------------------------------------------------------------
1 | # Retrieval
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
8 | | `scored_chunks` | List[[models.ScoredChunk](../models/scoredchunk.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/scope.md:
--------------------------------------------------------------------------------
1 | # Scope
2 |
3 | The scope of the instruction. Determines whether the instruction is applied to the entire document or to each chunk of the document. Options are `'document'` or `'chunk'`. Generally `'document'` should be used when analyzing the full document is desired, such as when generating a summary or determining sentiment, and `'chunk'` should be used when a fine grained search over a document is desired.
4 |
5 |
6 | ## Values
7 |
8 | | Name | Value |
9 | | ---------- | ---------- |
10 | | `DOCUMENT` | document |
11 | | `CHUNK` | chunk |
--------------------------------------------------------------------------------
/docs/models/scoredchunk.md:
--------------------------------------------------------------------------------
1 | # ScoredChunk
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
8 | | `text` | *str* | :heavy_check_mark: | N/A |
9 | | `score` | *float* | :heavy_check_mark: | N/A |
10 | | `id` | *str* | :heavy_check_mark: | N/A |
11 | | `index` | *int* | :heavy_check_mark: | N/A |
12 | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
13 | | `document_id` | *str* | :heavy_check_mark: | N/A |
14 | | `document_name` | *str* | :heavy_check_mark: | N/A |
15 | | `document_metadata` | Dict[str, *Any*] | :heavy_check_mark: | N/A |
16 | | `links` | Dict[str, [models.Link](../models/link.md)] | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/security.md:
--------------------------------------------------------------------------------
1 | # Security
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `auth` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/setconnectionenabledconnectionsconnectionidenabledputrequest.md:
--------------------------------------------------------------------------------
1 | # SetConnectionEnabledConnectionsConnectionIDEnabledPutRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
9 | | `set_connection_enabled_payload` | [models.SetConnectionEnabledPayload](../models/setconnectionenabledpayload.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/setconnectionenabledpayload.md:
--------------------------------------------------------------------------------
1 | # SetConnectionEnabledPayload
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
8 | | `enabled` | *bool* | :heavy_check_mark: | N/A |
9 | | `reason` | [OptionalNullable[models.Reason]](../models/reason.md) | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/setconnectionlimitsconnectionsconnectionidlimitputrequest.md:
--------------------------------------------------------------------------------
1 | # SetConnectionLimitsConnectionsConnectionIDLimitPutRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
9 | | `connection_limit_params` | [models.ConnectionLimitParams](../models/connectionlimitparams.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/setpartitionlimitspartitionspartitionidlimitsputrequest.md:
--------------------------------------------------------------------------------
1 | # SetPartitionLimitsPartitionsPartitionIDLimitsPutRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
8 | | `partition_id` | *str* | :heavy_check_mark: | N/A |
9 | | `partition_limit_params` | [models.PartitionLimitParams](../models/partitionlimitparams.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/source.md:
--------------------------------------------------------------------------------
1 | # Source
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `str`
7 |
8 | ```python
9 | value: str = /* values here */
10 | ```
11 |
12 | ### `List[str]`
13 |
14 | ```python
15 | value: List[str] = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/static.md:
--------------------------------------------------------------------------------
1 | # Static
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/syncconnectionrequest.md:
--------------------------------------------------------------------------------
1 | # SyncConnectionRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/theme.md:
--------------------------------------------------------------------------------
1 | # Theme
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `LIGHT` | light |
9 | | `DARK` | dark |
10 | | `SYSTEM` | system |
--------------------------------------------------------------------------------
/docs/models/two.md:
--------------------------------------------------------------------------------
1 | # Two
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
8 | | `static` | [OptionalNullable[models.ModeStatic]](../models/modestatic.md) | :heavy_minus_sign: | N/A |
9 | | `audio` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
10 | | `video` | [OptionalNullable[models.ModeVideo]](../models/modevideo.md) | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/updateconnectionconnectionsconnectionidputrequest.md:
--------------------------------------------------------------------------------
1 | # UpdateConnectionConnectionsConnectionIDPutRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
8 | | `connection_id` | *str* | :heavy_check_mark: | N/A |
9 | | `connection_base` | [models.ConnectionBase](../models/connectionbase.md) | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparams11.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParams11
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparams12.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParams12
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ----------- | ----------- | ----------- | ----------- |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparamsfile.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParamsFile
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
8 | | `file_name` | *str* | :heavy_check_mark: | N/A |
9 | | `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A |
10 | | `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparamsmode.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParamsMode
2 |
3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true }
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `models.UpdateDocumentFileParamsMode1`
9 |
10 | ```python
11 | value: models.UpdateDocumentFileParamsMode1 = /* values here */
12 | ```
13 |
14 | ### `models.Mode2`
15 |
16 | ```python
17 | value: models.Mode2 = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparamsmode1.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParamsMode1
2 |
3 |
4 | ## Supported Types
5 |
6 | ### `models.UpdateDocumentFileParams11`
7 |
8 | ```python
9 | value: models.UpdateDocumentFileParams11 = /* values here */
10 | ```
11 |
12 | ### `models.UpdateDocumentFileParams12`
13 |
14 | ```python
15 | value: models.UpdateDocumentFileParams12 = /* values here */
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparamsmodestatic.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParamsModeStatic
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfileparamsmodevideo.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFileParamsModeVideo
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ------------- | ------------- |
8 | | `AUDIO_ONLY` | audio_only |
9 | | `VIDEO_ONLY` | video_only |
10 | | `AUDIO_VIDEO` | audio_video |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfromurlparamsmode.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFromURLParamsMode
2 |
3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true }
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `models.UpdateDocumentFromURLParamsMode1`
9 |
10 | ```python
11 | value: models.UpdateDocumentFromURLParamsMode1 = /* values here */
12 | ```
13 |
14 | ### `models.MediaModeParam`
15 |
16 | ```python
17 | value: models.MediaModeParam = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/updatedocumentfromurlparamsmode1.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentFromURLParamsMode1
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | -------- | -------- |
8 | | `HI_RES` | hi_res |
9 | | `FAST` | fast |
--------------------------------------------------------------------------------
/docs/models/updatedocumentrawparams.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentRawParams
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
8 | | `data` | [models.UpdateDocumentRawParamsData](../models/updatedocumentrawparamsdata.md) | :heavy_check_mark: | Document data in a text or JSON format. |
--------------------------------------------------------------------------------
/docs/models/updatedocumentrawparamsdata.md:
--------------------------------------------------------------------------------
1 | # UpdateDocumentRawParamsData
2 |
3 | Document data in a text or JSON format.
4 |
5 |
6 | ## Supported Types
7 |
8 | ### `str`
9 |
10 | ```python
11 | value: str = /* values here */
12 | ```
13 |
14 | ### `Dict[str, Any]`
15 |
16 | ```python
17 | value: Dict[str, Any] = /* values here */
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/docs/models/updateinstructionparams.md:
--------------------------------------------------------------------------------
1 | # UpdateInstructionParams
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
8 | | `active` | *bool* | :heavy_check_mark: | Whether the instruction is active. Active instructions are applied to documents when they're created or when their file is updated. | true |
--------------------------------------------------------------------------------
/docs/models/updateinstructionrequest.md:
--------------------------------------------------------------------------------
1 | # UpdateInstructionRequest
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description | Example |
7 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
8 | | `instruction_id` | *str* | :heavy_check_mark: | The ID of the instruction. | 00000000-0000-0000-0000-000000000000 |
9 | | `update_instruction_params` | [models.UpdateInstructionParams](../models/updateinstructionparams.md) | :heavy_check_mark: | N/A | |
--------------------------------------------------------------------------------
/docs/models/utils/retryconfig.md:
--------------------------------------------------------------------------------
1 | # RetryConfig
2 |
3 | Allows customizing the default retry configuration. Only usable with methods that mention they support retries.
4 |
5 | ## Fields
6 |
7 | | Name | Type | Description | Example |
8 | | ------------------------- | ----------------------------------- | --------------------------------------- | --------- |
9 | | `strategy` | `*str*` | The retry strategy to use. | `backoff` |
10 | | `backoff` | [BackoffStrategy](#backoffstrategy) | Configuration for the backoff strategy. | |
11 | | `retry_connection_errors` | `*bool*` | Whether to retry on connection errors. | `true` |
12 |
13 | ## BackoffStrategy
14 |
15 | The backoff strategy allows retrying a request with an exponential backoff between each retry.
16 |
17 | ### Fields
18 |
19 | | Name | Type | Description | Example |
20 | | ------------------ | --------- | ----------------------------------------- | -------- |
21 | | `initial_interval` | `*int*` | The initial interval in milliseconds. | `500` |
22 | | `max_interval` | `*int*` | The maximum interval in milliseconds. | `60000` |
23 | | `exponent` | `*float*` | The exponent to use for the backoff. | `1.5` |
24 | | `max_elapsed_time` | `*int*` | The maximum elapsed time in milliseconds. | `300000` |
--------------------------------------------------------------------------------
/docs/models/validationerror.md:
--------------------------------------------------------------------------------
1 | # ValidationError
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ |
8 | | `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A |
9 | | `msg` | *str* | :heavy_check_mark: | N/A |
10 | | `type` | *str* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/models/video.md:
--------------------------------------------------------------------------------
1 | # Video
2 |
3 |
4 | ## Values
5 |
6 | | Name | Value |
7 | | ------------- | ------------- |
8 | | `AUDIO_ONLY` | audio_only |
9 | | `VIDEO_ONLY` | video_only |
10 | | `AUDIO_VIDEO` | audio_video |
--------------------------------------------------------------------------------
/docs/models/videomodalitydata.md:
--------------------------------------------------------------------------------
1 | # VideoModalityData
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
8 | | `type` | *Optional[Literal["video"]]* | :heavy_minus_sign: | N/A |
9 | | `word_timestamps` | List[[models.WordTimestamp](../models/wordtimestamp.md)] | :heavy_minus_sign: | N/A |
--------------------------------------------------------------------------------
/docs/models/wordtimestamp.md:
--------------------------------------------------------------------------------
1 | # WordTimestamp
2 |
3 |
4 | ## Fields
5 |
6 | | Field | Type | Required | Description |
7 | | ------------------ | ------------------ | ------------------ | ------------------ |
8 | | `start_time` | *float* | :heavy_check_mark: | N/A |
9 | | `end_time` | *float* | :heavy_check_mark: | N/A |
10 | | `word` | *str* | :heavy_check_mark: | N/A |
11 | | `probability` | *float* | :heavy_check_mark: | N/A |
--------------------------------------------------------------------------------
/docs/sdks/ragie/README.md:
--------------------------------------------------------------------------------
1 | # Ragie SDK
2 |
3 | ## Overview
4 |
5 | ### Available Operations
6 |
--------------------------------------------------------------------------------
/docs/sdks/retrievals/README.md:
--------------------------------------------------------------------------------
1 | # Retrievals
2 | (*retrievals*)
3 |
4 | ## Overview
5 |
6 | ### Available Operations
7 |
8 | * [retrieve](#retrieve) - Retrieve
9 |
10 | ## retrieve
11 |
12 | Retrieve
13 |
14 | ### Example Usage
15 |
16 | ```python
17 | from ragie import Ragie
18 |
19 |
20 | with Ragie(
21 | auth="",
22 | ) as r_client:
23 |
24 | res = r_client.retrievals.retrieve(request={
25 | "query": "What is the best pizza place in SF?",
26 | "max_chunks_per_document": 0,
27 | "partition": "",
28 | })
29 |
30 | assert res is not None
31 |
32 | # Handle response
33 | print(res)
34 |
35 | ```
36 |
37 | ### Parameters
38 |
39 | | Parameter | Type | Required | Description |
40 | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
41 | | `request` | [models.RetrieveParams](../../models/retrieveparams.md) | :heavy_check_mark: | The request object to use for the request. |
42 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
43 |
44 | ### Response
45 |
46 | **[models.Retrieval](../../models/retrieval.md)**
47 |
48 | ### Errors
49 |
50 | | Error Type | Status Code | Content Type |
51 | | -------------------------- | -------------------------- | -------------------------- |
52 | | models.HTTPValidationError | 422 | application/json |
53 | | models.ErrorMessage | 401, 402, 429 | application/json |
54 | | models.SDKError | 4XX, 5XX | \*/\* |
--------------------------------------------------------------------------------
/poetry.toml:
--------------------------------------------------------------------------------
1 | [virtualenvs]
2 | in-project = true
3 |
--------------------------------------------------------------------------------
/py.typed:
--------------------------------------------------------------------------------
1 | # Marker file for PEP 561. The package enables type hints.
2 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [project]
2 | name = "ragie"
3 | version = "1.9.0"
4 | description = "Python Client SDK Generated by Speakeasy."
5 | authors = [{ name = "Speakeasy" },]
6 | readme = "README-PYPI.md"
7 | requires-python = ">=3.9.2"
8 | dependencies = [
9 | "httpx >=0.28.1",
10 | "jsonpath-python >=1.0.6",
11 | "pydantic >=2.11.2",
12 | ]
13 |
14 | [tool.poetry]
15 | repository = "https://github.com/ragieai/ragie-python.git"
16 | packages = [
17 | { include = "ragie", from = "src" }
18 | ]
19 | include = ["py.typed", "src/ragie/py.typed"]
20 |
21 | [tool.setuptools.package-data]
22 | "*" = ["py.typed", "src/ragie/py.typed"]
23 |
24 | [virtualenvs]
25 | in-project = true
26 |
27 | [tool.poetry.group.dev.dependencies]
28 | mypy = "==1.15.0"
29 | pylint = "==3.2.3"
30 |
31 | [build-system]
32 | requires = ["poetry-core"]
33 | build-backend = "poetry.core.masonry.api"
34 |
35 | [tool.pytest.ini_options]
36 | asyncio_default_fixture_loop_scope = "function"
37 | pythonpath = ["src"]
38 |
39 | [tool.mypy]
40 | disable_error_code = "misc"
41 |
42 | [[tool.mypy.overrides]]
43 | module = "typing_inspect"
44 | ignore_missing_imports = true
45 |
46 | [[tool.mypy.overrides]]
47 | module = "jsonpath"
48 | ignore_missing_imports = true
49 |
50 | [tool.pyright]
51 | venvPath = "."
52 | venv = ".venv"
53 |
54 |
55 |
--------------------------------------------------------------------------------
/scripts/prepare_readme.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import re
4 | import shutil
5 |
6 | try:
7 | with open("README.md", "r", encoding="utf-8") as rh:
8 | readme_contents = rh.read()
9 | GITHUB_URL = "https://github.com/ragieai/ragie-python.git"
10 | GITHUB_URL = (
11 | GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL
12 | )
13 | # links on PyPI should have absolute URLs
14 | readme_contents = re.sub(
15 | r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))",
16 | lambda m: m.group(1)
17 | + GITHUB_URL
18 | + "/blob/master/"
19 | + m.group(2)
20 | + m.group(3),
21 | readme_contents,
22 | )
23 |
24 | with open("README-PYPI.md", "w", encoding="utf-8") as wh:
25 | wh.write(readme_contents)
26 | except Exception as e:
27 | try:
28 | print("Failed to rewrite README.md to README-PYPI.md, copying original instead")
29 | print(e)
30 | shutil.copyfile("README.md", "README-PYPI.md")
31 | except Exception as ie:
32 | print("Failed to copy README.md to README-PYPI.md")
33 | print(ie)
34 |
--------------------------------------------------------------------------------
/scripts/publish.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN}
4 |
5 | poetry run python scripts/prepare_readme.py
6 |
7 | poetry publish --build --skip-existing
8 |
--------------------------------------------------------------------------------
/src/ragie/__init__.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from ._version import (
4 | __title__,
5 | __version__,
6 | __openapi_doc_version__,
7 | __gen_version__,
8 | __user_agent__,
9 | )
10 | from .sdk import *
11 | from .sdkconfiguration import *
12 | from .models import *
13 |
14 |
15 | VERSION: str = __version__
16 | OPENAPI_DOC_VERSION = __openapi_doc_version__
17 | SPEAKEASY_GENERATOR_VERSION = __gen_version__
18 | USER_AGENT = __user_agent__
19 |
--------------------------------------------------------------------------------
/src/ragie/_hooks/__init__.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from .sdkhooks import *
4 | from .types import *
5 |
--------------------------------------------------------------------------------
/src/ragie/_hooks/sdkhooks.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import httpx
4 | from .types import (
5 | SDKInitHook,
6 | BeforeRequestContext,
7 | BeforeRequestHook,
8 | AfterSuccessContext,
9 | AfterSuccessHook,
10 | AfterErrorContext,
11 | AfterErrorHook,
12 | Hooks,
13 | )
14 | from typing import List, Optional, Tuple
15 | from ragie.httpclient import HttpClient
16 |
17 |
18 | class SDKHooks(Hooks):
19 | def __init__(self) -> None:
20 | self.sdk_init_hooks: List[SDKInitHook] = []
21 | self.before_request_hooks: List[BeforeRequestHook] = []
22 | self.after_success_hooks: List[AfterSuccessHook] = []
23 | self.after_error_hooks: List[AfterErrorHook] = []
24 |
25 | def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
26 | self.sdk_init_hooks.append(hook)
27 |
28 | def register_before_request_hook(self, hook: BeforeRequestHook) -> None:
29 | self.before_request_hooks.append(hook)
30 |
31 | def register_after_success_hook(self, hook: AfterSuccessHook) -> None:
32 | self.after_success_hooks.append(hook)
33 |
34 | def register_after_error_hook(self, hook: AfterErrorHook) -> None:
35 | self.after_error_hooks.append(hook)
36 |
37 | def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]:
38 | for hook in self.sdk_init_hooks:
39 | base_url, client = hook.sdk_init(base_url, client)
40 | return base_url, client
41 |
42 | def before_request(
43 | self, hook_ctx: BeforeRequestContext, request: httpx.Request
44 | ) -> httpx.Request:
45 | for hook in self.before_request_hooks:
46 | out = hook.before_request(hook_ctx, request)
47 | if isinstance(out, Exception):
48 | raise out
49 | request = out
50 |
51 | return request
52 |
53 | def after_success(
54 | self, hook_ctx: AfterSuccessContext, response: httpx.Response
55 | ) -> httpx.Response:
56 | for hook in self.after_success_hooks:
57 | out = hook.after_success(hook_ctx, response)
58 | if isinstance(out, Exception):
59 | raise out
60 | response = out
61 | return response
62 |
63 | def after_error(
64 | self,
65 | hook_ctx: AfterErrorContext,
66 | response: Optional[httpx.Response],
67 | error: Optional[Exception],
68 | ) -> Tuple[Optional[httpx.Response], Optional[Exception]]:
69 | for hook in self.after_error_hooks:
70 | result = hook.after_error(hook_ctx, response, error)
71 | if isinstance(result, Exception):
72 | raise result
73 | response, error = result
74 | return response, error
75 |
--------------------------------------------------------------------------------
/src/ragie/_version.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import importlib.metadata
4 |
5 | __title__: str = "ragie"
6 | __version__: str = "1.9.0"
7 | __openapi_doc_version__: str = "1.0.0"
8 | __gen_version__: str = "2.604.2"
9 | __user_agent__: str = "speakeasy-sdk/python 1.9.0 2.604.2 1.0.0 ragie"
10 |
11 | try:
12 | if __package__ is not None:
13 | __version__ = importlib.metadata.version(__package__)
14 | except importlib.metadata.PackageNotFoundError:
15 | pass
16 |
--------------------------------------------------------------------------------
/src/ragie/models/audiomodalitydata.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .wordtimestamp import WordTimestamp, WordTimestampTypedDict
5 | import pydantic
6 | from pydantic.functional_validators import AfterValidator
7 | from ragie.types import BaseModel
8 | from ragie.utils import validate_const
9 | from typing import List, Literal, Optional
10 | from typing_extensions import Annotated, NotRequired, TypedDict
11 |
12 |
13 | class AudioModalityDataTypedDict(TypedDict):
14 | type: Literal["audio"]
15 | word_timestamps: NotRequired[List[WordTimestampTypedDict]]
16 |
17 |
18 | class AudioModalityData(BaseModel):
19 | TYPE: Annotated[
20 | Annotated[Optional[Literal["audio"]], AfterValidator(validate_const("audio"))],
21 | pydantic.Field(alias="type"),
22 | ] = "audio"
23 |
24 | word_timestamps: Optional[List[WordTimestamp]] = None
25 |
--------------------------------------------------------------------------------
/src/ragie/models/connectionlimitparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from typing_extensions import NotRequired, TypedDict
7 |
8 |
9 | class ConnectionLimitParamsTypedDict(TypedDict):
10 | page_limit: NotRequired[Nullable[int]]
11 | r"""The maximum number of pages a connection will sync. The connection will be disabled after this limit is reached. Some in process documents may continue processing. Remove the limit by setting to `null`."""
12 |
13 |
14 | class ConnectionLimitParams(BaseModel):
15 | page_limit: OptionalNullable[int] = UNSET
16 | r"""The maximum number of pages a connection will sync. The connection will be disabled after this limit is reached. Some in process documents may continue processing. Remove the limit by setting to `null`."""
17 |
18 | @model_serializer(mode="wrap")
19 | def serialize_model(self, handler):
20 | optional_fields = ["page_limit"]
21 | nullable_fields = ["page_limit"]
22 | null_default_fields = []
23 |
24 | serialized = handler(self)
25 |
26 | m = {}
27 |
28 | for n, f in type(self).model_fields.items():
29 | k = f.alias or n
30 | val = serialized.get(k)
31 | serialized.pop(k, None)
32 |
33 | optional_nullable = k in optional_fields and k in nullable_fields
34 | is_set = (
35 | self.__pydantic_fields_set__.intersection({n})
36 | or k in null_default_fields
37 | ) # pylint: disable=no-member
38 |
39 | if val is not None and val != UNSET_SENTINEL:
40 | m[k] = val
41 | elif val != UNSET_SENTINEL and (
42 | not k in optional_fields or (optional_nullable and is_set)
43 | ):
44 | m[k] = val
45 |
46 | return m
47 |
--------------------------------------------------------------------------------
/src/ragie/models/connectionlist.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .connection import Connection, ConnectionTypedDict
5 | from .pagination import Pagination, PaginationTypedDict
6 | from ragie.types import BaseModel
7 | from typing import List
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class ConnectionListTypedDict(TypedDict):
12 | pagination: PaginationTypedDict
13 | connections: List[ConnectionTypedDict]
14 |
15 |
16 | class ConnectionList(BaseModel):
17 | pagination: Pagination
18 |
19 | connections: List[Connection]
20 |
--------------------------------------------------------------------------------
/src/ragie/models/connectionstats.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class ConnectionStatsTypedDict(TypedDict):
9 | document_count: int
10 | page_count: float
11 |
12 |
13 | class ConnectionStats(BaseModel):
14 | document_count: int
15 |
16 | page_count: float
17 |
--------------------------------------------------------------------------------
/src/ragie/models/connectorsource.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from enum import Enum
5 |
6 |
7 | class ConnectorSource(str, Enum):
8 | BACKBLAZE = "backblaze"
9 | CONFLUENCE = "confluence"
10 | DROPBOX = "dropbox"
11 | FRESHDESK = "freshdesk"
12 | ONEDRIVE = "onedrive"
13 | GOOGLE_DRIVE = "google_drive"
14 | GMAIL = "gmail"
15 | INTERCOM = "intercom"
16 | NOTION = "notion"
17 | SALESFORCE = "salesforce"
18 | SHAREPOINT = "sharepoint"
19 | JIRA = "jira"
20 | SLACK = "slack"
21 | S3 = "s3"
22 | GCS = "gcs"
23 | HUBSPOT = "hubspot"
24 | ZENDESK = "zendesk"
25 |
--------------------------------------------------------------------------------
/src/ragie/models/connectorsourcetypeinfo.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .connectorsource import ConnectorSource
5 | from ragie.types import BaseModel
6 | from typing_extensions import TypedDict
7 |
8 |
9 | class ConnectorSourceTypeInfoTypedDict(TypedDict):
10 | source_type: ConnectorSource
11 | display_name: str
12 | icon_url: str
13 | docs_url: str
14 |
15 |
16 | class ConnectorSourceTypeInfo(BaseModel):
17 | source_type: ConnectorSource
18 |
19 | display_name: str
20 |
21 | icon_url: str
22 |
23 | docs_url: str
24 |
--------------------------------------------------------------------------------
/src/ragie/models/createpartitionparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from typing_extensions import NotRequired, TypedDict
7 |
8 |
9 | class CreatePartitionParamsTypedDict(TypedDict):
10 | name: str
11 | pages_hosted_limit_monthly: NotRequired[Nullable[int]]
12 | pages_processed_limit_monthly: NotRequired[Nullable[int]]
13 | pages_hosted_limit_max: NotRequired[Nullable[int]]
14 | pages_processed_limit_max: NotRequired[Nullable[int]]
15 |
16 |
17 | class CreatePartitionParams(BaseModel):
18 | name: str
19 |
20 | pages_hosted_limit_monthly: OptionalNullable[int] = UNSET
21 |
22 | pages_processed_limit_monthly: OptionalNullable[int] = UNSET
23 |
24 | pages_hosted_limit_max: OptionalNullable[int] = UNSET
25 |
26 | pages_processed_limit_max: OptionalNullable[int] = UNSET
27 |
28 | @model_serializer(mode="wrap")
29 | def serialize_model(self, handler):
30 | optional_fields = [
31 | "pages_hosted_limit_monthly",
32 | "pages_processed_limit_monthly",
33 | "pages_hosted_limit_max",
34 | "pages_processed_limit_max",
35 | ]
36 | nullable_fields = [
37 | "pages_hosted_limit_monthly",
38 | "pages_processed_limit_monthly",
39 | "pages_hosted_limit_max",
40 | "pages_processed_limit_max",
41 | ]
42 | null_default_fields = []
43 |
44 | serialized = handler(self)
45 |
46 | m = {}
47 |
48 | for n, f in type(self).model_fields.items():
49 | k = f.alias or n
50 | val = serialized.get(k)
51 | serialized.pop(k, None)
52 |
53 | optional_nullable = k in optional_fields and k in nullable_fields
54 | is_set = (
55 | self.__pydantic_fields_set__.intersection({n})
56 | or k in null_default_fields
57 | ) # pylint: disable=no-member
58 |
59 | if val is not None and val != UNSET_SENTINEL:
60 | m[k] = val
61 | elif val != UNSET_SENTINEL and (
62 | not k in optional_fields or (optional_nullable and is_set)
63 | ):
64 | m[k] = val
65 |
66 | return m
67 |
--------------------------------------------------------------------------------
/src/ragie/models/delete_connection_connections_connection_id_delete_postop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .deleteconnectionpayload import (
5 | DeleteConnectionPayload,
6 | DeleteConnectionPayloadTypedDict,
7 | )
8 | from ragie.types import BaseModel
9 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
10 | from typing_extensions import Annotated, TypedDict
11 |
12 |
13 | class DeleteConnectionConnectionsConnectionIDDeletePostRequestTypedDict(TypedDict):
14 | connection_id: str
15 | delete_connection_payload: DeleteConnectionPayloadTypedDict
16 |
17 |
18 | class DeleteConnectionConnectionsConnectionIDDeletePostRequest(BaseModel):
19 | connection_id: Annotated[
20 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
21 | ]
22 |
23 | delete_connection_payload: Annotated[
24 | DeleteConnectionPayload,
25 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
26 | ]
27 |
--------------------------------------------------------------------------------
/src/ragie/models/delete_partition_partitions_partition_id_deleteop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class DeletePartitionPartitionsPartitionIDDeleteRequestTypedDict(TypedDict):
10 | partition_id: str
11 |
12 |
13 | class DeletePartitionPartitionsPartitionIDDeleteRequest(BaseModel):
14 | partition_id: Annotated[
15 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16 | ]
17 |
--------------------------------------------------------------------------------
/src/ragie/models/deleteconnectionpayload.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DeleteConnectionPayloadTypedDict(TypedDict):
9 | keep_files: bool
10 |
11 |
12 | class DeleteConnectionPayload(BaseModel):
13 | keep_files: bool
14 |
--------------------------------------------------------------------------------
/src/ragie/models/deletedocumentop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from ragie.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class DeleteDocumentRequestTypedDict(TypedDict):
11 | document_id: str
12 | r"""The id of the document."""
13 | partition: NotRequired[Nullable[str]]
14 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
15 |
16 |
17 | class DeleteDocumentRequest(BaseModel):
18 | document_id: Annotated[
19 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
20 | ]
21 | r"""The id of the document."""
22 |
23 | partition: Annotated[
24 | OptionalNullable[str],
25 | FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
26 | ] = UNSET
27 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
28 |
29 | @model_serializer(mode="wrap")
30 | def serialize_model(self, handler):
31 | optional_fields = ["partition"]
32 | nullable_fields = ["partition"]
33 | null_default_fields = []
34 |
35 | serialized = handler(self)
36 |
37 | m = {}
38 |
39 | for n, f in type(self).model_fields.items():
40 | k = f.alias or n
41 | val = serialized.get(k)
42 | serialized.pop(k, None)
43 |
44 | optional_nullable = k in optional_fields and k in nullable_fields
45 | is_set = (
46 | self.__pydantic_fields_set__.intersection({n})
47 | or k in null_default_fields
48 | ) # pylint: disable=no-member
49 |
50 | if val is not None and val != UNSET_SENTINEL:
51 | m[k] = val
52 | elif val != UNSET_SENTINEL and (
53 | not k in optional_fields or (optional_nullable and is_set)
54 | ):
55 | m[k] = val
56 |
57 | return m
58 |
--------------------------------------------------------------------------------
/src/ragie/models/deleteinstructionop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class DeleteInstructionRequestTypedDict(TypedDict):
10 | instruction_id: str
11 | r"""The ID of the instruction."""
12 |
13 |
14 | class DeleteInstructionRequest(BaseModel):
15 | instruction_id: Annotated[
16 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
17 | ]
18 | r"""The ID of the instruction."""
19 |
--------------------------------------------------------------------------------
/src/ragie/models/document.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from datetime import datetime
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing import Dict, List, Union
8 | from typing_extensions import NotRequired, TypeAliasType, TypedDict
9 |
10 |
11 | DocumentMetadataTypedDict = TypeAliasType(
12 | "DocumentMetadataTypedDict", Union[str, int, bool, List[str]]
13 | )
14 |
15 |
16 | DocumentMetadata = TypeAliasType("DocumentMetadata", Union[str, int, bool, List[str]])
17 |
18 |
19 | class DocumentTypedDict(TypedDict):
20 | status: str
21 | id: str
22 | created_at: datetime
23 | updated_at: datetime
24 | name: str
25 | metadata: Dict[str, DocumentMetadataTypedDict]
26 | partition: str
27 | chunk_count: NotRequired[Nullable[int]]
28 | external_id: NotRequired[Nullable[str]]
29 | page_count: NotRequired[Nullable[float]]
30 |
31 |
32 | class Document(BaseModel):
33 | status: str
34 |
35 | id: str
36 |
37 | created_at: datetime
38 |
39 | updated_at: datetime
40 |
41 | name: str
42 |
43 | metadata: Dict[str, DocumentMetadata]
44 |
45 | partition: str
46 |
47 | chunk_count: OptionalNullable[int] = UNSET
48 |
49 | external_id: OptionalNullable[str] = UNSET
50 |
51 | page_count: OptionalNullable[float] = UNSET
52 |
53 | @model_serializer(mode="wrap")
54 | def serialize_model(self, handler):
55 | optional_fields = ["chunk_count", "external_id", "page_count"]
56 | nullable_fields = ["chunk_count", "external_id", "page_count"]
57 | null_default_fields = []
58 |
59 | serialized = handler(self)
60 |
61 | m = {}
62 |
63 | for n, f in type(self).model_fields.items():
64 | k = f.alias or n
65 | val = serialized.get(k)
66 | serialized.pop(k, None)
67 |
68 | optional_nullable = k in optional_fields and k in nullable_fields
69 | is_set = (
70 | self.__pydantic_fields_set__.intersection({n})
71 | or k in null_default_fields
72 | ) # pylint: disable=no-member
73 |
74 | if val is not None and val != UNSET_SENTINEL:
75 | m[k] = val
76 | elif val != UNSET_SENTINEL and (
77 | not k in optional_fields or (optional_nullable and is_set)
78 | ):
79 | m[k] = val
80 |
81 | return m
82 |
--------------------------------------------------------------------------------
/src/ragie/models/documentchunk.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .link import Link, LinkTypedDict
5 | from ragie.types import BaseModel
6 | from typing import Any, Dict, Optional
7 | from typing_extensions import NotRequired, TypedDict
8 |
9 |
10 | class DocumentChunkTypedDict(TypedDict):
11 | id: str
12 | text: str
13 | links: Dict[str, LinkTypedDict]
14 | index: NotRequired[int]
15 | metadata: NotRequired[Dict[str, Any]]
16 |
17 |
18 | class DocumentChunk(BaseModel):
19 | id: str
20 |
21 | text: str
22 |
23 | links: Dict[str, Link]
24 |
25 | index: Optional[int] = -1
26 |
27 | metadata: Optional[Dict[str, Any]] = None
28 |
--------------------------------------------------------------------------------
/src/ragie/models/documentchunkdetail.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .audiomodalitydata import AudioModalityData, AudioModalityDataTypedDict
5 | from .link import Link, LinkTypedDict
6 | from .videomodalitydata import VideoModalityData, VideoModalityDataTypedDict
7 | from pydantic import Discriminator, Tag, model_serializer
8 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
9 | from ragie.utils import get_discriminator
10 | from typing import Any, Dict, Optional, Union
11 | from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
12 |
13 |
14 | ModalityDataTypedDict = TypeAliasType(
15 | "ModalityDataTypedDict",
16 | Union[AudioModalityDataTypedDict, VideoModalityDataTypedDict],
17 | )
18 |
19 |
20 | ModalityData = Annotated[
21 | Union[
22 | Annotated[AudioModalityData, Tag("audio")],
23 | Annotated[VideoModalityData, Tag("video")],
24 | ],
25 | Discriminator(lambda m: get_discriminator(m, "type", "type")),
26 | ]
27 |
28 |
29 | class DocumentChunkDetailTypedDict(TypedDict):
30 | id: str
31 | text: str
32 | links: Dict[str, LinkTypedDict]
33 | index: NotRequired[int]
34 | metadata: NotRequired[Dict[str, Any]]
35 | modality_data: NotRequired[Nullable[ModalityDataTypedDict]]
36 | r"""Additional data specific to the modality of the chunk's source file, such as word level timestamps for chunks extracted from audio files."""
37 |
38 |
39 | class DocumentChunkDetail(BaseModel):
40 | id: str
41 |
42 | text: str
43 |
44 | links: Dict[str, Link]
45 |
46 | index: Optional[int] = -1
47 |
48 | metadata: Optional[Dict[str, Any]] = None
49 |
50 | modality_data: OptionalNullable[ModalityData] = UNSET
51 | r"""Additional data specific to the modality of the chunk's source file, such as word level timestamps for chunks extracted from audio files."""
52 |
53 | @model_serializer(mode="wrap")
54 | def serialize_model(self, handler):
55 | optional_fields = ["index", "metadata", "modality_data"]
56 | nullable_fields = ["modality_data"]
57 | null_default_fields = []
58 |
59 | serialized = handler(self)
60 |
61 | m = {}
62 |
63 | for n, f in type(self).model_fields.items():
64 | k = f.alias or n
65 | val = serialized.get(k)
66 | serialized.pop(k, None)
67 |
68 | optional_nullable = k in optional_fields and k in nullable_fields
69 | is_set = (
70 | self.__pydantic_fields_set__.intersection({n})
71 | or k in null_default_fields
72 | ) # pylint: disable=no-member
73 |
74 | if val is not None and val != UNSET_SENTINEL:
75 | m[k] = val
76 | elif val != UNSET_SENTINEL and (
77 | not k in optional_fields or (optional_nullable and is_set)
78 | ):
79 | m[k] = val
80 |
81 | return m
82 |
--------------------------------------------------------------------------------
/src/ragie/models/documentchunklist.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .documentchunk import DocumentChunk, DocumentChunkTypedDict
5 | from .pagination import Pagination, PaginationTypedDict
6 | from ragie.types import BaseModel
7 | from typing import List
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class DocumentChunkListTypedDict(TypedDict):
12 | pagination: PaginationTypedDict
13 | chunks: List[DocumentChunkTypedDict]
14 |
15 |
16 | class DocumentChunkList(BaseModel):
17 | pagination: Pagination
18 |
19 | chunks: List[DocumentChunk]
20 |
--------------------------------------------------------------------------------
/src/ragie/models/documentdelete.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DocumentDeleteTypedDict(TypedDict):
9 | status: str
10 |
11 |
12 | class DocumentDelete(BaseModel):
13 | status: str
14 |
--------------------------------------------------------------------------------
/src/ragie/models/documentfileupdate.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DocumentFileUpdateTypedDict(TypedDict):
9 | status: str
10 |
11 |
12 | class DocumentFileUpdate(BaseModel):
13 | status: str
14 |
--------------------------------------------------------------------------------
/src/ragie/models/documentget.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from datetime import datetime
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing import Dict, List, Union
8 | from typing_extensions import NotRequired, TypeAliasType, TypedDict
9 |
10 |
11 | DocumentGetMetadataTypedDict = TypeAliasType(
12 | "DocumentGetMetadataTypedDict", Union[str, int, bool, List[str]]
13 | )
14 |
15 |
16 | DocumentGetMetadata = TypeAliasType(
17 | "DocumentGetMetadata", Union[str, int, bool, List[str]]
18 | )
19 |
20 |
21 | class DocumentGetTypedDict(TypedDict):
22 | status: str
23 | id: str
24 | created_at: datetime
25 | updated_at: datetime
26 | name: str
27 | metadata: Dict[str, DocumentGetMetadataTypedDict]
28 | partition: str
29 | errors: List[str]
30 | chunk_count: NotRequired[Nullable[int]]
31 | external_id: NotRequired[Nullable[str]]
32 | page_count: NotRequired[Nullable[float]]
33 |
34 |
35 | class DocumentGet(BaseModel):
36 | status: str
37 |
38 | id: str
39 |
40 | created_at: datetime
41 |
42 | updated_at: datetime
43 |
44 | name: str
45 |
46 | metadata: Dict[str, DocumentGetMetadata]
47 |
48 | partition: str
49 |
50 | errors: List[str]
51 |
52 | chunk_count: OptionalNullable[int] = UNSET
53 |
54 | external_id: OptionalNullable[str] = UNSET
55 |
56 | page_count: OptionalNullable[float] = UNSET
57 |
58 | @model_serializer(mode="wrap")
59 | def serialize_model(self, handler):
60 | optional_fields = ["chunk_count", "external_id", "page_count"]
61 | nullable_fields = ["chunk_count", "external_id", "page_count"]
62 | null_default_fields = []
63 |
64 | serialized = handler(self)
65 |
66 | m = {}
67 |
68 | for n, f in type(self).model_fields.items():
69 | k = f.alias or n
70 | val = serialized.get(k)
71 | serialized.pop(k, None)
72 |
73 | optional_nullable = k in optional_fields and k in nullable_fields
74 | is_set = (
75 | self.__pydantic_fields_set__.intersection({n})
76 | or k in null_default_fields
77 | ) # pylint: disable=no-member
78 |
79 | if val is not None and val != UNSET_SENTINEL:
80 | m[k] = val
81 | elif val != UNSET_SENTINEL and (
82 | not k in optional_fields or (optional_nullable and is_set)
83 | ):
84 | m[k] = val
85 |
86 | return m
87 |
--------------------------------------------------------------------------------
/src/ragie/models/documentlist.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .document import Document, DocumentTypedDict
5 | from .pagination import Pagination, PaginationTypedDict
6 | from ragie.types import BaseModel
7 | from typing import List
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class DocumentListTypedDict(TypedDict):
12 | pagination: PaginationTypedDict
13 | documents: List[DocumentTypedDict]
14 |
15 |
16 | class DocumentList(BaseModel):
17 | pagination: Pagination
18 |
19 | documents: List[Document]
20 |
--------------------------------------------------------------------------------
/src/ragie/models/documentmetadataupdate.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing import Dict, List, Union
6 | from typing_extensions import TypeAliasType, TypedDict
7 |
8 |
9 | DocumentMetadataUpdateMetadataTypedDict = TypeAliasType(
10 | "DocumentMetadataUpdateMetadataTypedDict", Union[str, int, bool, List[str]]
11 | )
12 |
13 |
14 | DocumentMetadataUpdateMetadata = TypeAliasType(
15 | "DocumentMetadataUpdateMetadata", Union[str, int, bool, List[str]]
16 | )
17 |
18 |
19 | class DocumentMetadataUpdateTypedDict(TypedDict):
20 | metadata: Dict[str, DocumentMetadataUpdateMetadataTypedDict]
21 | r"""The full document metadata inclusive of the update."""
22 |
23 |
24 | class DocumentMetadataUpdate(BaseModel):
25 | metadata: Dict[str, DocumentMetadataUpdateMetadata]
26 | r"""The full document metadata inclusive of the update."""
27 |
--------------------------------------------------------------------------------
/src/ragie/models/documentrawupdate.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DocumentRawUpdateTypedDict(TypedDict):
9 | status: str
10 |
11 |
12 | class DocumentRawUpdate(BaseModel):
13 | status: str
14 |
--------------------------------------------------------------------------------
/src/ragie/models/documentsummary.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DocumentSummaryTypedDict(TypedDict):
9 | document_id: str
10 | summary: str
11 |
12 |
13 | class DocumentSummary(BaseModel):
14 | document_id: str
15 |
16 | summary: str
17 |
--------------------------------------------------------------------------------
/src/ragie/models/documenturlupdate.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class DocumentURLUpdateTypedDict(TypedDict):
9 | status: str
10 |
11 |
12 | class DocumentURLUpdate(BaseModel):
13 | status: str
14 |
--------------------------------------------------------------------------------
/src/ragie/models/documentwithcontent.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from datetime import datetime
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing import Dict, List, Union
8 | from typing_extensions import NotRequired, TypeAliasType, TypedDict
9 |
10 |
11 | DocumentWithContentMetadataTypedDict = TypeAliasType(
12 | "DocumentWithContentMetadataTypedDict", Union[str, int, bool, List[str]]
13 | )
14 |
15 |
16 | DocumentWithContentMetadata = TypeAliasType(
17 | "DocumentWithContentMetadata", Union[str, int, bool, List[str]]
18 | )
19 |
20 |
21 | class DocumentWithContentTypedDict(TypedDict):
22 | status: str
23 | id: str
24 | created_at: datetime
25 | updated_at: datetime
26 | name: str
27 | metadata: Dict[str, DocumentWithContentMetadataTypedDict]
28 | partition: str
29 | content: str
30 | chunk_count: NotRequired[Nullable[int]]
31 | external_id: NotRequired[Nullable[str]]
32 | page_count: NotRequired[Nullable[float]]
33 |
34 |
35 | class DocumentWithContent(BaseModel):
36 | status: str
37 |
38 | id: str
39 |
40 | created_at: datetime
41 |
42 | updated_at: datetime
43 |
44 | name: str
45 |
46 | metadata: Dict[str, DocumentWithContentMetadata]
47 |
48 | partition: str
49 |
50 | content: str
51 |
52 | chunk_count: OptionalNullable[int] = UNSET
53 |
54 | external_id: OptionalNullable[str] = UNSET
55 |
56 | page_count: OptionalNullable[float] = UNSET
57 |
58 | @model_serializer(mode="wrap")
59 | def serialize_model(self, handler):
60 | optional_fields = ["chunk_count", "external_id", "page_count"]
61 | nullable_fields = ["chunk_count", "external_id", "page_count"]
62 | null_default_fields = []
63 |
64 | serialized = handler(self)
65 |
66 | m = {}
67 |
68 | for n, f in type(self).model_fields.items():
69 | k = f.alias or n
70 | val = serialized.get(k)
71 | serialized.pop(k, None)
72 |
73 | optional_nullable = k in optional_fields and k in nullable_fields
74 | is_set = (
75 | self.__pydantic_fields_set__.intersection({n})
76 | or k in null_default_fields
77 | ) # pylint: disable=no-member
78 |
79 | if val is not None and val != UNSET_SENTINEL:
80 | m[k] = val
81 | elif val != UNSET_SENTINEL and (
82 | not k in optional_fields or (optional_nullable and is_set)
83 | ):
84 | m[k] = val
85 |
86 | return m
87 |
--------------------------------------------------------------------------------
/src/ragie/models/entity.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from datetime import datetime
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing import Any, Dict
8 | from typing_extensions import NotRequired, TypedDict
9 |
10 |
11 | class EntityTypedDict(TypedDict):
12 | id: str
13 | created_at: datetime
14 | updated_at: datetime
15 | instruction_id: str
16 | r"""The ID of the instruction which generated the entity."""
17 | document_id: str
18 | r"""The ID of the document which the entity was produced from."""
19 | data: Dict[str, Any]
20 | chunk_id: NotRequired[Nullable[str]]
21 |
22 |
23 | class Entity(BaseModel):
24 | id: str
25 |
26 | created_at: datetime
27 |
28 | updated_at: datetime
29 |
30 | instruction_id: str
31 | r"""The ID of the instruction which generated the entity."""
32 |
33 | document_id: str
34 | r"""The ID of the document which the entity was produced from."""
35 |
36 | data: Dict[str, Any]
37 |
38 | chunk_id: OptionalNullable[str] = UNSET
39 |
40 | @model_serializer(mode="wrap")
41 | def serialize_model(self, handler):
42 | optional_fields = ["chunk_id"]
43 | nullable_fields = ["chunk_id"]
44 | null_default_fields = []
45 |
46 | serialized = handler(self)
47 |
48 | m = {}
49 |
50 | for n, f in type(self).model_fields.items():
51 | k = f.alias or n
52 | val = serialized.get(k)
53 | serialized.pop(k, None)
54 |
55 | optional_nullable = k in optional_fields and k in nullable_fields
56 | is_set = (
57 | self.__pydantic_fields_set__.intersection({n})
58 | or k in null_default_fields
59 | ) # pylint: disable=no-member
60 |
61 | if val is not None and val != UNSET_SENTINEL:
62 | m[k] = val
63 | elif val != UNSET_SENTINEL and (
64 | not k in optional_fields or (optional_nullable and is_set)
65 | ):
66 | m[k] = val
67 |
68 | return m
69 |
--------------------------------------------------------------------------------
/src/ragie/models/entitylist.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .entity import Entity, EntityTypedDict
5 | from .pagination import Pagination, PaginationTypedDict
6 | from ragie.types import BaseModel
7 | from typing import List
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class EntityListTypedDict(TypedDict):
12 | pagination: PaginationTypedDict
13 | entities: List[EntityTypedDict]
14 |
15 |
16 | class EntityList(BaseModel):
17 | pagination: Pagination
18 |
19 | entities: List[Entity]
20 |
--------------------------------------------------------------------------------
/src/ragie/models/errormessage.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie import utils
5 | from ragie.types import BaseModel
6 |
7 |
8 | class ErrorMessageData(BaseModel):
9 | detail: str
10 |
11 |
12 | class ErrorMessage(Exception):
13 | data: ErrorMessageData
14 |
15 | def __init__(self, data: ErrorMessageData):
16 | self.data = data
17 |
18 | def __str__(self) -> str:
19 | return utils.marshal_json(self.data, ErrorMessageData)
20 |
--------------------------------------------------------------------------------
/src/ragie/models/get_connection_connections_connection_id_getop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class GetConnectionConnectionsConnectionIDGetRequestTypedDict(TypedDict):
10 | connection_id: str
11 |
12 |
13 | class GetConnectionConnectionsConnectionIDGetRequest(BaseModel):
14 | connection_id: Annotated[
15 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16 | ]
17 |
--------------------------------------------------------------------------------
/src/ragie/models/get_connection_stats_connections_connection_id_stats_getop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class GetConnectionStatsConnectionsConnectionIDStatsGetRequestTypedDict(TypedDict):
10 | connection_id: str
11 |
12 |
13 | class GetConnectionStatsConnectionsConnectionIDStatsGetRequest(BaseModel):
14 | connection_id: Annotated[
15 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16 | ]
17 |
--------------------------------------------------------------------------------
/src/ragie/models/get_partition_partitions_partition_id_getop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class GetPartitionPartitionsPartitionIDGetRequestTypedDict(TypedDict):
10 | partition_id: str
11 |
12 |
13 | class GetPartitionPartitionsPartitionIDGetRequest(BaseModel):
14 | partition_id: Annotated[
15 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16 | ]
17 |
--------------------------------------------------------------------------------
/src/ragie/models/getdocumentchunkop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from ragie.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class GetDocumentChunkRequestTypedDict(TypedDict):
11 | document_id: str
12 | r"""The id of the document."""
13 | chunk_id: str
14 | r"""The ID of the chunk."""
15 | partition: NotRequired[Nullable[str]]
16 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
17 |
18 |
19 | class GetDocumentChunkRequest(BaseModel):
20 | document_id: Annotated[
21 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
22 | ]
23 | r"""The id of the document."""
24 |
25 | chunk_id: Annotated[
26 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
27 | ]
28 | r"""The ID of the chunk."""
29 |
30 | partition: Annotated[
31 | OptionalNullable[str],
32 | FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
33 | ] = UNSET
34 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
35 |
36 | @model_serializer(mode="wrap")
37 | def serialize_model(self, handler):
38 | optional_fields = ["partition"]
39 | nullable_fields = ["partition"]
40 | null_default_fields = []
41 |
42 | serialized = handler(self)
43 |
44 | m = {}
45 |
46 | for n, f in type(self).model_fields.items():
47 | k = f.alias or n
48 | val = serialized.get(k)
49 | serialized.pop(k, None)
50 |
51 | optional_nullable = k in optional_fields and k in nullable_fields
52 | is_set = (
53 | self.__pydantic_fields_set__.intersection({n})
54 | or k in null_default_fields
55 | ) # pylint: disable=no-member
56 |
57 | if val is not None and val != UNSET_SENTINEL:
58 | m[k] = val
59 | elif val != UNSET_SENTINEL and (
60 | not k in optional_fields or (optional_nullable and is_set)
61 | ):
62 | m[k] = val
63 |
64 | return m
65 |
--------------------------------------------------------------------------------
/src/ragie/models/getdocumentop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from ragie.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class GetDocumentRequestTypedDict(TypedDict):
11 | document_id: str
12 | r"""The id of the document."""
13 | partition: NotRequired[Nullable[str]]
14 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
15 |
16 |
17 | class GetDocumentRequest(BaseModel):
18 | document_id: Annotated[
19 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
20 | ]
21 | r"""The id of the document."""
22 |
23 | partition: Annotated[
24 | OptionalNullable[str],
25 | FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
26 | ] = UNSET
27 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
28 |
29 | @model_serializer(mode="wrap")
30 | def serialize_model(self, handler):
31 | optional_fields = ["partition"]
32 | nullable_fields = ["partition"]
33 | null_default_fields = []
34 |
35 | serialized = handler(self)
36 |
37 | m = {}
38 |
39 | for n, f in type(self).model_fields.items():
40 | k = f.alias or n
41 | val = serialized.get(k)
42 | serialized.pop(k, None)
43 |
44 | optional_nullable = k in optional_fields and k in nullable_fields
45 | is_set = (
46 | self.__pydantic_fields_set__.intersection({n})
47 | or k in null_default_fields
48 | ) # pylint: disable=no-member
49 |
50 | if val is not None and val != UNSET_SENTINEL:
51 | m[k] = val
52 | elif val != UNSET_SENTINEL and (
53 | not k in optional_fields or (optional_nullable and is_set)
54 | ):
55 | m[k] = val
56 |
57 | return m
58 |
--------------------------------------------------------------------------------
/src/ragie/models/getdocumentsourceop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from ragie.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class GetDocumentSourceRequestTypedDict(TypedDict):
11 | document_id: str
12 | r"""The id of the document."""
13 | partition: NotRequired[Nullable[str]]
14 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
15 |
16 |
17 | class GetDocumentSourceRequest(BaseModel):
18 | document_id: Annotated[
19 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
20 | ]
21 | r"""The id of the document."""
22 |
23 | partition: Annotated[
24 | OptionalNullable[str],
25 | FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
26 | ] = UNSET
27 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
28 |
29 | @model_serializer(mode="wrap")
30 | def serialize_model(self, handler):
31 | optional_fields = ["partition"]
32 | nullable_fields = ["partition"]
33 | null_default_fields = []
34 |
35 | serialized = handler(self)
36 |
37 | m = {}
38 |
39 | for n, f in type(self).model_fields.items():
40 | k = f.alias or n
41 | val = serialized.get(k)
42 | serialized.pop(k, None)
43 |
44 | optional_nullable = k in optional_fields and k in nullable_fields
45 | is_set = (
46 | self.__pydantic_fields_set__.intersection({n})
47 | or k in null_default_fields
48 | ) # pylint: disable=no-member
49 |
50 | if val is not None and val != UNSET_SENTINEL:
51 | m[k] = val
52 | elif val != UNSET_SENTINEL and (
53 | not k in optional_fields or (optional_nullable and is_set)
54 | ):
55 | m[k] = val
56 |
57 | return m
58 |
--------------------------------------------------------------------------------
/src/ragie/models/getdocumentsummaryop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from ragie.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class GetDocumentSummaryRequestTypedDict(TypedDict):
11 | document_id: str
12 | r"""The id of the document."""
13 | partition: NotRequired[Nullable[str]]
14 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
15 |
16 |
17 | class GetDocumentSummaryRequest(BaseModel):
18 | document_id: Annotated[
19 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
20 | ]
21 | r"""The id of the document."""
22 |
23 | partition: Annotated[
24 | OptionalNullable[str],
25 | FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
26 | ] = UNSET
27 | r"""An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition."""
28 |
29 | @model_serializer(mode="wrap")
30 | def serialize_model(self, handler):
31 | optional_fields = ["partition"]
32 | nullable_fields = ["partition"]
33 | null_default_fields = []
34 |
35 | serialized = handler(self)
36 |
37 | m = {}
38 |
39 | for n, f in type(self).model_fields.items():
40 | k = f.alias or n
41 | val = serialized.get(k)
42 | serialized.pop(k, None)
43 |
44 | optional_nullable = k in optional_fields and k in nullable_fields
45 | is_set = (
46 | self.__pydantic_fields_set__.intersection({n})
47 | or k in null_default_fields
48 | ) # pylint: disable=no-member
49 |
50 | if val is not None and val != UNSET_SENTINEL:
51 | m[k] = val
52 | elif val != UNSET_SENTINEL and (
53 | not k in optional_fields or (optional_nullable and is_set)
54 | ):
55 | m[k] = val
56 |
57 | return m
58 |
--------------------------------------------------------------------------------
/src/ragie/models/httpvalidationerror.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .validationerror import ValidationError
5 | from ragie import utils
6 | from ragie.types import BaseModel
7 | from typing import List, Optional
8 |
9 |
10 | class HTTPValidationErrorData(BaseModel):
11 | detail: Optional[List[ValidationError]] = None
12 |
13 |
14 | class HTTPValidationError(Exception):
15 | data: HTTPValidationErrorData
16 |
17 | def __init__(self, data: HTTPValidationErrorData):
18 | self.data = data
19 |
20 | def __str__(self) -> str:
21 | return utils.marshal_json(self.data, HTTPValidationErrorData)
22 |
--------------------------------------------------------------------------------
/src/ragie/models/link.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class LinkTypedDict(TypedDict):
9 | href: str
10 | type: str
11 |
12 |
13 | class Link(BaseModel):
14 | href: str
15 |
16 | type: str
17 |
--------------------------------------------------------------------------------
/src/ragie/models/list_partitions_partitions_getop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .partitionlist import PartitionList, PartitionListTypedDict
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from ragie.utils import FieldMetadata, QueryParamMetadata
8 | from typing import Callable, Optional
9 | from typing_extensions import Annotated, NotRequired, TypedDict
10 |
11 |
12 | class ListPartitionsPartitionsGetRequestTypedDict(TypedDict):
13 | cursor: NotRequired[Nullable[str]]
14 | r"""An opaque cursor for pagination"""
15 | page_size: NotRequired[int]
16 | r"""The number of items per page (must be greater than 0 and less than or equal to 100)"""
17 |
18 |
19 | class ListPartitionsPartitionsGetRequest(BaseModel):
20 | cursor: Annotated[
21 | OptionalNullable[str],
22 | FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
23 | ] = UNSET
24 | r"""An opaque cursor for pagination"""
25 |
26 | page_size: Annotated[
27 | Optional[int],
28 | FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
29 | ] = 10
30 | r"""The number of items per page (must be greater than 0 and less than or equal to 100)"""
31 |
32 | @model_serializer(mode="wrap")
33 | def serialize_model(self, handler):
34 | optional_fields = ["cursor", "page_size"]
35 | nullable_fields = ["cursor"]
36 | null_default_fields = []
37 |
38 | serialized = handler(self)
39 |
40 | m = {}
41 |
42 | for n, f in type(self).model_fields.items():
43 | k = f.alias or n
44 | val = serialized.get(k)
45 | serialized.pop(k, None)
46 |
47 | optional_nullable = k in optional_fields and k in nullable_fields
48 | is_set = (
49 | self.__pydantic_fields_set__.intersection({n})
50 | or k in null_default_fields
51 | ) # pylint: disable=no-member
52 |
53 | if val is not None and val != UNSET_SENTINEL:
54 | m[k] = val
55 | elif val != UNSET_SENTINEL and (
56 | not k in optional_fields or (optional_nullable and is_set)
57 | ):
58 | m[k] = val
59 |
60 | return m
61 |
62 |
63 | class ListPartitionsPartitionsGetResponseTypedDict(TypedDict):
64 | result: PartitionListTypedDict
65 |
66 |
67 | class ListPartitionsPartitionsGetResponse(BaseModel):
68 | next: Callable[[], Optional[ListPartitionsPartitionsGetResponse]]
69 |
70 | result: PartitionList
71 |
--------------------------------------------------------------------------------
/src/ragie/models/listconnectorsourcetypeinfo.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .connectorsourcetypeinfo import (
5 | ConnectorSourceTypeInfo,
6 | ConnectorSourceTypeInfoTypedDict,
7 | )
8 | from ragie.types import BaseModel
9 | from typing import List
10 | from typing_extensions import TypedDict
11 |
12 |
13 | class ListConnectorSourceTypeInfoTypedDict(TypedDict):
14 | connectors: List[ConnectorSourceTypeInfoTypedDict]
15 |
16 |
17 | class ListConnectorSourceTypeInfo(BaseModel):
18 | connectors: List[ConnectorSourceTypeInfo]
19 |
--------------------------------------------------------------------------------
/src/ragie/models/mediamodeparam.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from enum import Enum
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing_extensions import NotRequired, TypedDict
8 |
9 |
10 | class Static(str, Enum):
11 | HI_RES = "hi_res"
12 | FAST = "fast"
13 |
14 |
15 | class Video(str, Enum):
16 | AUDIO_ONLY = "audio_only"
17 | VIDEO_ONLY = "video_only"
18 | AUDIO_VIDEO = "audio_video"
19 |
20 |
21 | class MediaModeParamTypedDict(TypedDict):
22 | static: NotRequired[Nullable[Static]]
23 | audio: NotRequired[Nullable[bool]]
24 | video: NotRequired[Nullable[Video]]
25 |
26 |
27 | class MediaModeParam(BaseModel):
28 | static: OptionalNullable[Static] = UNSET
29 |
30 | audio: OptionalNullable[bool] = UNSET
31 |
32 | video: OptionalNullable[Video] = UNSET
33 |
34 | @model_serializer(mode="wrap")
35 | def serialize_model(self, handler):
36 | optional_fields = ["static", "audio", "video"]
37 | nullable_fields = ["static", "audio", "video"]
38 | null_default_fields = []
39 |
40 | serialized = handler(self)
41 |
42 | m = {}
43 |
44 | for n, f in type(self).model_fields.items():
45 | k = f.alias or n
46 | val = serialized.get(k)
47 | serialized.pop(k, None)
48 |
49 | optional_nullable = k in optional_fields and k in nullable_fields
50 | is_set = (
51 | self.__pydantic_fields_set__.intersection({n})
52 | or k in null_default_fields
53 | ) # pylint: disable=no-member
54 |
55 | if val is not None and val != UNSET_SENTINEL:
56 | m[k] = val
57 | elif val != UNSET_SENTINEL and (
58 | not k in optional_fields or (optional_nullable and is_set)
59 | ):
60 | m[k] = val
61 |
62 | return m
63 |
--------------------------------------------------------------------------------
/src/ragie/models/oauthurlresponse.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class OAuthURLResponseTypedDict(TypedDict):
9 | url: str
10 |
11 |
12 | class OAuthURLResponse(BaseModel):
13 | url: str
14 |
--------------------------------------------------------------------------------
/src/ragie/models/pagination.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from typing_extensions import NotRequired, TypedDict
7 |
8 |
9 | class PaginationTypedDict(TypedDict):
10 | total_count: int
11 | next_cursor: NotRequired[Nullable[str]]
12 |
13 |
14 | class Pagination(BaseModel):
15 | total_count: int
16 |
17 | next_cursor: OptionalNullable[str] = UNSET
18 |
19 | @model_serializer(mode="wrap")
20 | def serialize_model(self, handler):
21 | optional_fields = ["next_cursor"]
22 | nullable_fields = ["next_cursor"]
23 | null_default_fields = []
24 |
25 | serialized = handler(self)
26 |
27 | m = {}
28 |
29 | for n, f in type(self).model_fields.items():
30 | k = f.alias or n
31 | val = serialized.get(k)
32 | serialized.pop(k, None)
33 |
34 | optional_nullable = k in optional_fields and k in nullable_fields
35 | is_set = (
36 | self.__pydantic_fields_set__.intersection({n})
37 | or k in null_default_fields
38 | ) # pylint: disable=no-member
39 |
40 | if val is not None and val != UNSET_SENTINEL:
41 | m[k] = val
42 | elif val != UNSET_SENTINEL and (
43 | not k in optional_fields or (optional_nullable and is_set)
44 | ):
45 | m[k] = val
46 |
47 | return m
48 |
--------------------------------------------------------------------------------
/src/ragie/models/partition.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .partitionlimits import PartitionLimits, PartitionLimitsTypedDict
5 | from datetime import datetime
6 | from pydantic import model_serializer
7 | from ragie.types import BaseModel, Nullable, UNSET_SENTINEL
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class PartitionTypedDict(TypedDict):
12 | name: str
13 | is_default: bool
14 | limit_exceeded_at: Nullable[datetime]
15 | limits: PartitionLimitsTypedDict
16 |
17 |
18 | class Partition(BaseModel):
19 | name: str
20 |
21 | is_default: bool
22 |
23 | limit_exceeded_at: Nullable[datetime]
24 |
25 | limits: PartitionLimits
26 |
27 | @model_serializer(mode="wrap")
28 | def serialize_model(self, handler):
29 | optional_fields = []
30 | nullable_fields = ["limit_exceeded_at"]
31 | null_default_fields = []
32 |
33 | serialized = handler(self)
34 |
35 | m = {}
36 |
37 | for n, f in type(self).model_fields.items():
38 | k = f.alias or n
39 | val = serialized.get(k)
40 | serialized.pop(k, None)
41 |
42 | optional_nullable = k in optional_fields and k in nullable_fields
43 | is_set = (
44 | self.__pydantic_fields_set__.intersection({n})
45 | or k in null_default_fields
46 | ) # pylint: disable=no-member
47 |
48 | if val is not None and val != UNSET_SENTINEL:
49 | m[k] = val
50 | elif val != UNSET_SENTINEL and (
51 | not k in optional_fields or (optional_nullable and is_set)
52 | ):
53 | m[k] = val
54 |
55 | return m
56 |
--------------------------------------------------------------------------------
/src/ragie/models/partitiondetail.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .partitionlimits import PartitionLimits, PartitionLimitsTypedDict
5 | from .partitionstats import PartitionStats, PartitionStatsTypedDict
6 | from datetime import datetime
7 | from pydantic import model_serializer
8 | from ragie.types import BaseModel, Nullable, UNSET_SENTINEL
9 | from typing_extensions import TypedDict
10 |
11 |
12 | class PartitionDetailTypedDict(TypedDict):
13 | name: str
14 | is_default: bool
15 | limit_exceeded_at: Nullable[datetime]
16 | limits: PartitionLimitsTypedDict
17 | stats: PartitionStatsTypedDict
18 |
19 |
20 | class PartitionDetail(BaseModel):
21 | name: str
22 |
23 | is_default: bool
24 |
25 | limit_exceeded_at: Nullable[datetime]
26 |
27 | limits: PartitionLimits
28 |
29 | stats: PartitionStats
30 |
31 | @model_serializer(mode="wrap")
32 | def serialize_model(self, handler):
33 | optional_fields = []
34 | nullable_fields = ["limit_exceeded_at"]
35 | null_default_fields = []
36 |
37 | serialized = handler(self)
38 |
39 | m = {}
40 |
41 | for n, f in type(self).model_fields.items():
42 | k = f.alias or n
43 | val = serialized.get(k)
44 | serialized.pop(k, None)
45 |
46 | optional_nullable = k in optional_fields and k in nullable_fields
47 | is_set = (
48 | self.__pydantic_fields_set__.intersection({n})
49 | or k in null_default_fields
50 | ) # pylint: disable=no-member
51 |
52 | if val is not None and val != UNSET_SENTINEL:
53 | m[k] = val
54 | elif val != UNSET_SENTINEL and (
55 | not k in optional_fields or (optional_nullable and is_set)
56 | ):
57 | m[k] = val
58 |
59 | return m
60 |
--------------------------------------------------------------------------------
/src/ragie/models/partitionlimitparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6 | from typing_extensions import NotRequired, TypedDict
7 |
8 |
9 | class PartitionLimitParamsTypedDict(TypedDict):
10 | pages_hosted_limit_monthly: NotRequired[Nullable[int]]
11 | pages_processed_limit_monthly: NotRequired[Nullable[int]]
12 | pages_hosted_limit_max: NotRequired[Nullable[int]]
13 | pages_processed_limit_max: NotRequired[Nullable[int]]
14 |
15 |
16 | class PartitionLimitParams(BaseModel):
17 | pages_hosted_limit_monthly: OptionalNullable[int] = UNSET
18 |
19 | pages_processed_limit_monthly: OptionalNullable[int] = UNSET
20 |
21 | pages_hosted_limit_max: OptionalNullable[int] = UNSET
22 |
23 | pages_processed_limit_max: OptionalNullable[int] = UNSET
24 |
25 | @model_serializer(mode="wrap")
26 | def serialize_model(self, handler):
27 | optional_fields = [
28 | "pages_hosted_limit_monthly",
29 | "pages_processed_limit_monthly",
30 | "pages_hosted_limit_max",
31 | "pages_processed_limit_max",
32 | ]
33 | nullable_fields = [
34 | "pages_hosted_limit_monthly",
35 | "pages_processed_limit_monthly",
36 | "pages_hosted_limit_max",
37 | "pages_processed_limit_max",
38 | ]
39 | null_default_fields = []
40 |
41 | serialized = handler(self)
42 |
43 | m = {}
44 |
45 | for n, f in type(self).model_fields.items():
46 | k = f.alias or n
47 | val = serialized.get(k)
48 | serialized.pop(k, None)
49 |
50 | optional_nullable = k in optional_fields and k in nullable_fields
51 | is_set = (
52 | self.__pydantic_fields_set__.intersection({n})
53 | or k in null_default_fields
54 | ) # pylint: disable=no-member
55 |
56 | if val is not None and val != UNSET_SENTINEL:
57 | m[k] = val
58 | elif val != UNSET_SENTINEL and (
59 | not k in optional_fields or (optional_nullable and is_set)
60 | ):
61 | m[k] = val
62 |
63 | return m
64 |
--------------------------------------------------------------------------------
/src/ragie/models/partitionlimits.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from pydantic import model_serializer
5 | from ragie.types import BaseModel, Nullable, UNSET_SENTINEL
6 | from typing_extensions import TypedDict
7 |
8 |
9 | class PartitionLimitsTypedDict(TypedDict):
10 | pages_processed_limit_monthly: Nullable[float]
11 | pages_hosted_limit_monthly: Nullable[float]
12 | pages_processed_limit_max: Nullable[float]
13 | pages_hosted_limit_max: Nullable[float]
14 |
15 |
16 | class PartitionLimits(BaseModel):
17 | pages_processed_limit_monthly: Nullable[float]
18 |
19 | pages_hosted_limit_monthly: Nullable[float]
20 |
21 | pages_processed_limit_max: Nullable[float]
22 |
23 | pages_hosted_limit_max: Nullable[float]
24 |
25 | @model_serializer(mode="wrap")
26 | def serialize_model(self, handler):
27 | optional_fields = []
28 | nullable_fields = [
29 | "pages_processed_limit_monthly",
30 | "pages_hosted_limit_monthly",
31 | "pages_processed_limit_max",
32 | "pages_hosted_limit_max",
33 | ]
34 | null_default_fields = []
35 |
36 | serialized = handler(self)
37 |
38 | m = {}
39 |
40 | for n, f in type(self).model_fields.items():
41 | k = f.alias or n
42 | val = serialized.get(k)
43 | serialized.pop(k, None)
44 |
45 | optional_nullable = k in optional_fields and k in nullable_fields
46 | is_set = (
47 | self.__pydantic_fields_set__.intersection({n})
48 | or k in null_default_fields
49 | ) # pylint: disable=no-member
50 |
51 | if val is not None and val != UNSET_SENTINEL:
52 | m[k] = val
53 | elif val != UNSET_SENTINEL and (
54 | not k in optional_fields or (optional_nullable and is_set)
55 | ):
56 | m[k] = val
57 |
58 | return m
59 |
--------------------------------------------------------------------------------
/src/ragie/models/partitionlist.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .pagination import Pagination, PaginationTypedDict
5 | from .partition import Partition, PartitionTypedDict
6 | from ragie.types import BaseModel
7 | from typing import List
8 | from typing_extensions import TypedDict
9 |
10 |
11 | class PartitionListTypedDict(TypedDict):
12 | pagination: PaginationTypedDict
13 | partitions: List[PartitionTypedDict]
14 |
15 |
16 | class PartitionList(BaseModel):
17 | pagination: Pagination
18 |
19 | partitions: List[Partition]
20 |
--------------------------------------------------------------------------------
/src/ragie/models/partitionstats.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class PartitionStatsTypedDict(TypedDict):
9 | pages_processed_monthly: float
10 | pages_hosted_monthly: float
11 | pages_processed_total: float
12 | pages_hosted_total: float
13 | document_count: int
14 |
15 |
16 | class PartitionStats(BaseModel):
17 | pages_processed_monthly: float
18 |
19 | pages_hosted_monthly: float
20 |
21 | pages_processed_total: float
22 |
23 | pages_hosted_total: float
24 |
25 | document_count: int
26 |
--------------------------------------------------------------------------------
/src/ragie/models/patchdocumentmetadataparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing import Any, Dict
6 | from typing_extensions import TypedDict
7 |
8 |
9 | class PatchDocumentMetadataParamsTypedDict(TypedDict):
10 | metadata: Dict[str, Any]
11 | r"""The metadata to update on the document. Performs a partial update of the document's metadata. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. Keys set to `null` are deleted. 1000 total values are allowed, inclusive of existing metadata. Each item in an array counts towards the total. The following keys are reserved for internal use: `document_id`, `document_type`, `document_source`, `document_name`, `document_uploaded_at`. If the document is managed by a connection, this operation will extend a metadata overlay which is applied to the document any time the connection syncs the document."""
12 |
13 |
14 | class PatchDocumentMetadataParams(BaseModel):
15 | metadata: Dict[str, Any]
16 | r"""The metadata to update on the document. Performs a partial update of the document's metadata. Keys must be strings. Values may be strings, numbers, booleans, or lists of strings. Numbers may be integers or floating point and will be converted to 64 bit floating point. Keys set to `null` are deleted. 1000 total values are allowed, inclusive of existing metadata. Each item in an array counts towards the total. The following keys are reserved for internal use: `document_id`, `document_type`, `document_source`, `document_name`, `document_uploaded_at`. If the document is managed by a connection, this operation will extend a metadata overlay which is applied to the document any time the connection syncs the document."""
17 |
--------------------------------------------------------------------------------
/src/ragie/models/responseok.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing import Optional
6 | from typing_extensions import NotRequired, TypedDict
7 |
8 |
9 | class ResponseOKTypedDict(TypedDict):
10 | message: NotRequired[str]
11 |
12 |
13 | class ResponseOK(BaseModel):
14 | message: Optional[str] = "ok"
15 |
--------------------------------------------------------------------------------
/src/ragie/models/retrieval.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .scoredchunk import ScoredChunk, ScoredChunkTypedDict
5 | from ragie.types import BaseModel
6 | from typing import List
7 | from typing_extensions import TypedDict
8 |
9 |
10 | class RetrievalTypedDict(TypedDict):
11 | scored_chunks: List[ScoredChunkTypedDict]
12 |
13 |
14 | class Retrieval(BaseModel):
15 | scored_chunks: List[ScoredChunk]
16 |
--------------------------------------------------------------------------------
/src/ragie/models/retrieveparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | import pydantic
5 | from ragie.types import BaseModel
6 | from typing import Any, Dict, Optional
7 | from typing_extensions import Annotated, NotRequired, TypedDict
8 |
9 |
10 | class RetrieveParamsTypedDict(TypedDict):
11 | query: str
12 | r"""The query to search with when retrieving document chunks."""
13 | top_k: NotRequired[int]
14 | r"""The maximum number of chunks to return. Defaults to 8."""
15 | filter_: NotRequired[Dict[str, Any]]
16 | rerank: NotRequired[bool]
17 | r"""Reranks the chunks for semantic relevancy post cosine similarity. Will be slower but returns a subset of highly relevant chunks. Best for reducing hallucinations and improving accuracy for LLM generation."""
18 | max_chunks_per_document: NotRequired[int]
19 | r"""Maximum number of chunks to retrieve per document. Use this to increase the number of documents the final chunks are retrieved from. This feature is in beta and may change in the future."""
20 | partition: NotRequired[str]
21 | r"""The partition to scope a retrieval to. If omitted, the retrieval will be scoped to the default partition, which includes any documents that have not been created in a partition."""
22 | recency_bias: NotRequired[bool]
23 | r"""Enables recency bias which will favor more recent documents vs older documents. https://docs.ragie.ai/docs/retrievals-recency-bias"""
24 |
25 |
26 | class RetrieveParams(BaseModel):
27 | query: str
28 | r"""The query to search with when retrieving document chunks."""
29 |
30 | top_k: Optional[int] = 8
31 | r"""The maximum number of chunks to return. Defaults to 8."""
32 |
33 | filter_: Annotated[Optional[Dict[str, Any]], pydantic.Field(alias="filter")] = None
34 |
35 | rerank: Optional[bool] = False
36 | r"""Reranks the chunks for semantic relevancy post cosine similarity. Will be slower but returns a subset of highly relevant chunks. Best for reducing hallucinations and improving accuracy for LLM generation."""
37 |
38 | max_chunks_per_document: Optional[int] = None
39 | r"""Maximum number of chunks to retrieve per document. Use this to increase the number of documents the final chunks are retrieved from. This feature is in beta and may change in the future."""
40 |
41 | partition: Optional[str] = None
42 | r"""The partition to scope a retrieval to. If omitted, the retrieval will be scoped to the default partition, which includes any documents that have not been created in a partition."""
43 |
44 | recency_bias: Optional[bool] = False
45 | r"""Enables recency bias which will favor more recent documents vs older documents. https://docs.ragie.ai/docs/retrievals-recency-bias"""
46 |
--------------------------------------------------------------------------------
/src/ragie/models/scoredchunk.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .link import Link, LinkTypedDict
5 | from ragie.types import BaseModel
6 | from typing import Any, Dict, Optional
7 | from typing_extensions import NotRequired, TypedDict
8 |
9 |
10 | class ScoredChunkTypedDict(TypedDict):
11 | text: str
12 | score: float
13 | id: str
14 | index: int
15 | document_id: str
16 | document_name: str
17 | document_metadata: Dict[str, Any]
18 | links: Dict[str, LinkTypedDict]
19 | metadata: NotRequired[Dict[str, Any]]
20 |
21 |
22 | class ScoredChunk(BaseModel):
23 | text: str
24 |
25 | score: float
26 |
27 | id: str
28 |
29 | index: int
30 |
31 | document_id: str
32 |
33 | document_name: str
34 |
35 | document_metadata: Dict[str, Any]
36 |
37 | links: Dict[str, Link]
38 |
39 | metadata: Optional[Dict[str, Any]] = None
40 |
--------------------------------------------------------------------------------
/src/ragie/models/sdkerror.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from dataclasses import dataclass
4 | from typing import Optional
5 | import httpx
6 |
7 |
8 | @dataclass
9 | class SDKError(Exception):
10 | """Represents an error returned by the API."""
11 |
12 | message: str
13 | status_code: int = -1
14 | body: str = ""
15 | raw_response: Optional[httpx.Response] = None
16 |
17 | def __str__(self):
18 | body = ""
19 | if len(self.body) > 0:
20 | body = f"\n{self.body}"
21 |
22 | return f"{self.message}: Status {self.status_code}{body}"
23 |
--------------------------------------------------------------------------------
/src/ragie/models/security.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, SecurityMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class SecurityTypedDict(TypedDict):
10 | auth: str
11 |
12 |
13 | class Security(BaseModel):
14 | auth: Annotated[
15 | str,
16 | FieldMetadata(
17 | security=SecurityMetadata(
18 | scheme=True,
19 | scheme_type="http",
20 | sub_type="bearer",
21 | field_name="Authorization",
22 | )
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/ragie/models/set_connection_enabled_connections_connection_id_enabled_putop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .setconnectionenabledpayload import (
5 | SetConnectionEnabledPayload,
6 | SetConnectionEnabledPayloadTypedDict,
7 | )
8 | from ragie.types import BaseModel
9 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
10 | from typing_extensions import Annotated, TypedDict
11 |
12 |
13 | class SetConnectionEnabledConnectionsConnectionIDEnabledPutRequestTypedDict(TypedDict):
14 | connection_id: str
15 | set_connection_enabled_payload: SetConnectionEnabledPayloadTypedDict
16 |
17 |
18 | class SetConnectionEnabledConnectionsConnectionIDEnabledPutRequest(BaseModel):
19 | connection_id: Annotated[
20 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
21 | ]
22 |
23 | set_connection_enabled_payload: Annotated[
24 | SetConnectionEnabledPayload,
25 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
26 | ]
27 |
--------------------------------------------------------------------------------
/src/ragie/models/set_connection_limits_connections_connection_id_limit_putop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .connectionlimitparams import ConnectionLimitParams, ConnectionLimitParamsTypedDict
5 | from ragie.types import BaseModel
6 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7 | from typing_extensions import Annotated, TypedDict
8 |
9 |
10 | class SetConnectionLimitsConnectionsConnectionIDLimitPutRequestTypedDict(TypedDict):
11 | connection_id: str
12 | connection_limit_params: ConnectionLimitParamsTypedDict
13 |
14 |
15 | class SetConnectionLimitsConnectionsConnectionIDLimitPutRequest(BaseModel):
16 | connection_id: Annotated[
17 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18 | ]
19 |
20 | connection_limit_params: Annotated[
21 | ConnectionLimitParams,
22 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
23 | ]
24 |
--------------------------------------------------------------------------------
/src/ragie/models/set_partition_limits_partitions_partition_id_limits_putop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .partitionlimitparams import PartitionLimitParams, PartitionLimitParamsTypedDict
5 | from ragie.types import BaseModel
6 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7 | from typing_extensions import Annotated, TypedDict
8 |
9 |
10 | class SetPartitionLimitsPartitionsPartitionIDLimitsPutRequestTypedDict(TypedDict):
11 | partition_id: str
12 | partition_limit_params: PartitionLimitParamsTypedDict
13 |
14 |
15 | class SetPartitionLimitsPartitionsPartitionIDLimitsPutRequest(BaseModel):
16 | partition_id: Annotated[
17 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18 | ]
19 |
20 | partition_limit_params: Annotated[
21 | PartitionLimitParams,
22 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
23 | ]
24 |
--------------------------------------------------------------------------------
/src/ragie/models/setconnectionenabledpayload.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from enum import Enum
5 | from pydantic import model_serializer
6 | from ragie.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7 | from typing_extensions import NotRequired, TypedDict
8 |
9 |
10 | class Reason(str, Enum):
11 | CONNECTION_OVER_TOTAL_PAGE_LIMIT = "connection_over_total_page_limit"
12 | AUTHENTICATION_FAILED = "authentication_failed"
13 |
14 |
15 | class SetConnectionEnabledPayloadTypedDict(TypedDict):
16 | enabled: bool
17 | reason: NotRequired[Nullable[Reason]]
18 |
19 |
20 | class SetConnectionEnabledPayload(BaseModel):
21 | enabled: bool
22 |
23 | reason: OptionalNullable[Reason] = UNSET
24 |
25 | @model_serializer(mode="wrap")
26 | def serialize_model(self, handler):
27 | optional_fields = ["reason"]
28 | nullable_fields = ["reason"]
29 | null_default_fields = []
30 |
31 | serialized = handler(self)
32 |
33 | m = {}
34 |
35 | for n, f in type(self).model_fields.items():
36 | k = f.alias or n
37 | val = serialized.get(k)
38 | serialized.pop(k, None)
39 |
40 | optional_nullable = k in optional_fields and k in nullable_fields
41 | is_set = (
42 | self.__pydantic_fields_set__.intersection({n})
43 | or k in null_default_fields
44 | ) # pylint: disable=no-member
45 |
46 | if val is not None and val != UNSET_SENTINEL:
47 | m[k] = val
48 | elif val != UNSET_SENTINEL and (
49 | not k in optional_fields or (optional_nullable and is_set)
50 | ):
51 | m[k] = val
52 |
53 | return m
54 |
--------------------------------------------------------------------------------
/src/ragie/models/syncconnectionop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from ragie.utils import FieldMetadata, PathParamMetadata
6 | from typing_extensions import Annotated, TypedDict
7 |
8 |
9 | class SyncConnectionRequestTypedDict(TypedDict):
10 | connection_id: str
11 |
12 |
13 | class SyncConnectionRequest(BaseModel):
14 | connection_id: Annotated[
15 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16 | ]
17 |
--------------------------------------------------------------------------------
/src/ragie/models/update_connection_connections_connection_id_putop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .connectionbase import ConnectionBase, ConnectionBaseTypedDict
5 | from ragie.types import BaseModel
6 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7 | from typing_extensions import Annotated, TypedDict
8 |
9 |
10 | class UpdateConnectionConnectionsConnectionIDPutRequestTypedDict(TypedDict):
11 | connection_id: str
12 | connection_base: ConnectionBaseTypedDict
13 |
14 |
15 | class UpdateConnectionConnectionsConnectionIDPutRequest(BaseModel):
16 | connection_id: Annotated[
17 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18 | ]
19 |
20 | connection_base: Annotated[
21 | ConnectionBase,
22 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
23 | ]
24 |
--------------------------------------------------------------------------------
/src/ragie/models/updatedocumentrawparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing import Any, Dict, Union
6 | from typing_extensions import TypeAliasType, TypedDict
7 |
8 |
9 | UpdateDocumentRawParamsDataTypedDict = TypeAliasType(
10 | "UpdateDocumentRawParamsDataTypedDict", Union[str, Dict[str, Any]]
11 | )
12 | r"""Document data in a text or JSON format."""
13 |
14 |
15 | UpdateDocumentRawParamsData = TypeAliasType(
16 | "UpdateDocumentRawParamsData", Union[str, Dict[str, Any]]
17 | )
18 | r"""Document data in a text or JSON format."""
19 |
20 |
21 | class UpdateDocumentRawParamsTypedDict(TypedDict):
22 | data: UpdateDocumentRawParamsDataTypedDict
23 | r"""Document data in a text or JSON format."""
24 |
25 |
26 | class UpdateDocumentRawParams(BaseModel):
27 | data: UpdateDocumentRawParamsData
28 | r"""Document data in a text or JSON format."""
29 |
--------------------------------------------------------------------------------
/src/ragie/models/updateinstructionop.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .updateinstructionparams import (
5 | UpdateInstructionParams,
6 | UpdateInstructionParamsTypedDict,
7 | )
8 | from ragie.types import BaseModel
9 | from ragie.utils import FieldMetadata, PathParamMetadata, RequestMetadata
10 | from typing_extensions import Annotated, TypedDict
11 |
12 |
13 | class UpdateInstructionRequestTypedDict(TypedDict):
14 | instruction_id: str
15 | r"""The ID of the instruction."""
16 | update_instruction_params: UpdateInstructionParamsTypedDict
17 |
18 |
19 | class UpdateInstructionRequest(BaseModel):
20 | instruction_id: Annotated[
21 | str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
22 | ]
23 | r"""The ID of the instruction."""
24 |
25 | update_instruction_params: Annotated[
26 | UpdateInstructionParams,
27 | FieldMetadata(request=RequestMetadata(media_type="application/json")),
28 | ]
29 |
--------------------------------------------------------------------------------
/src/ragie/models/updateinstructionparams.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class UpdateInstructionParamsTypedDict(TypedDict):
9 | active: bool
10 | r"""Whether the instruction is active. Active instructions are applied to documents when they're created or when their file is updated."""
11 |
12 |
13 | class UpdateInstructionParams(BaseModel):
14 | active: bool
15 | r"""Whether the instruction is active. Active instructions are applied to documents when they're created or when their file is updated."""
16 |
--------------------------------------------------------------------------------
/src/ragie/models/validationerror.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing import List, Union
6 | from typing_extensions import TypeAliasType, TypedDict
7 |
8 |
9 | LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int])
10 |
11 |
12 | Loc = TypeAliasType("Loc", Union[str, int])
13 |
14 |
15 | class ValidationErrorTypedDict(TypedDict):
16 | loc: List[LocTypedDict]
17 | msg: str
18 | type: str
19 |
20 |
21 | class ValidationError(BaseModel):
22 | loc: List[Loc]
23 |
24 | msg: str
25 |
26 | type: str
27 |
--------------------------------------------------------------------------------
/src/ragie/models/videomodalitydata.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from .wordtimestamp import WordTimestamp, WordTimestampTypedDict
5 | import pydantic
6 | from pydantic.functional_validators import AfterValidator
7 | from ragie.types import BaseModel
8 | from ragie.utils import validate_const
9 | from typing import List, Literal, Optional
10 | from typing_extensions import Annotated, NotRequired, TypedDict
11 |
12 |
13 | class VideoModalityDataTypedDict(TypedDict):
14 | type: Literal["video"]
15 | word_timestamps: NotRequired[List[WordTimestampTypedDict]]
16 |
17 |
18 | class VideoModalityData(BaseModel):
19 | TYPE: Annotated[
20 | Annotated[Optional[Literal["video"]], AfterValidator(validate_const("video"))],
21 | pydantic.Field(alias="type"),
22 | ] = "video"
23 |
24 | word_timestamps: Optional[List[WordTimestamp]] = None
25 |
--------------------------------------------------------------------------------
/src/ragie/models/wordtimestamp.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from __future__ import annotations
4 | from ragie.types import BaseModel
5 | from typing_extensions import TypedDict
6 |
7 |
8 | class WordTimestampTypedDict(TypedDict):
9 | start_time: float
10 | end_time: float
11 | word: str
12 | probability: float
13 |
14 |
15 | class WordTimestamp(BaseModel):
16 | start_time: float
17 |
18 | end_time: float
19 |
20 | word: str
21 |
22 | probability: float
23 |
--------------------------------------------------------------------------------
/src/ragie/py.typed:
--------------------------------------------------------------------------------
1 | # Marker file for PEP 561. The package enables type hints.
2 |
--------------------------------------------------------------------------------
/src/ragie/sdkconfiguration.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from ._hooks import SDKHooks
4 | from ._version import (
5 | __gen_version__,
6 | __openapi_doc_version__,
7 | __user_agent__,
8 | __version__,
9 | )
10 | from .httpclient import AsyncHttpClient, HttpClient
11 | from .utils import Logger, RetryConfig, remove_suffix
12 | from dataclasses import dataclass
13 | from pydantic import Field
14 | from ragie import models
15 | from ragie.types import OptionalNullable, UNSET
16 | from typing import Callable, Dict, Optional, Tuple, Union
17 |
18 |
19 | SERVERS = [
20 | "https://api.ragie.ai",
21 | ]
22 | """Contains the list of servers available to the SDK"""
23 |
24 |
25 | @dataclass
26 | class SDKConfiguration:
27 | client: Union[HttpClient, None]
28 | client_supplied: bool
29 | async_client: Union[AsyncHttpClient, None]
30 | async_client_supplied: bool
31 | debug_logger: Logger
32 | security: Optional[Union[models.Security, Callable[[], models.Security]]] = None
33 | server_url: Optional[str] = ""
34 | server_idx: Optional[int] = 0
35 | language: str = "python"
36 | openapi_doc_version: str = __openapi_doc_version__
37 | sdk_version: str = __version__
38 | gen_version: str = __gen_version__
39 | user_agent: str = __user_agent__
40 | retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
41 | timeout_ms: Optional[int] = None
42 |
43 | def __post_init__(self):
44 | self._hooks = SDKHooks()
45 |
46 | def get_server_details(self) -> Tuple[str, Dict[str, str]]:
47 | if self.server_url is not None and self.server_url:
48 | return remove_suffix(self.server_url, "/"), {}
49 | if self.server_idx is None:
50 | self.server_idx = 0
51 |
52 | return SERVERS[self.server_idx], {}
53 |
54 | def get_hooks(self) -> SDKHooks:
55 | return self._hooks
56 |
--------------------------------------------------------------------------------
/src/ragie/types/__init__.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from .basemodel import (
4 | BaseModel,
5 | Nullable,
6 | OptionalNullable,
7 | UnrecognizedInt,
8 | UnrecognizedStr,
9 | UNSET,
10 | UNSET_SENTINEL,
11 | )
12 |
13 | __all__ = [
14 | "BaseModel",
15 | "Nullable",
16 | "OptionalNullable",
17 | "UnrecognizedInt",
18 | "UnrecognizedStr",
19 | "UNSET",
20 | "UNSET_SENTINEL",
21 | ]
22 |
--------------------------------------------------------------------------------
/src/ragie/types/basemodel.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from pydantic import ConfigDict, model_serializer
4 | from pydantic import BaseModel as PydanticBaseModel
5 | from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union
6 | from typing_extensions import TypeAliasType, TypeAlias
7 |
8 |
9 | class BaseModel(PydanticBaseModel):
10 | model_config = ConfigDict(
11 | populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=()
12 | )
13 |
14 |
15 | class Unset(BaseModel):
16 | @model_serializer(mode="plain")
17 | def serialize_model(self):
18 | return UNSET_SENTINEL
19 |
20 | def __bool__(self) -> Literal[False]:
21 | return False
22 |
23 |
24 | UNSET = Unset()
25 | UNSET_SENTINEL = "~?~unset~?~sentinel~?~"
26 |
27 |
28 | T = TypeVar("T")
29 | if TYPE_CHECKING:
30 | Nullable: TypeAlias = Union[T, None]
31 | OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset]
32 | else:
33 | Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,))
34 | OptionalNullable = TypeAliasType(
35 | "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,)
36 | )
37 |
38 | UnrecognizedInt: TypeAlias = int
39 | UnrecognizedStr: TypeAlias = str
40 |
--------------------------------------------------------------------------------
/src/ragie/utils/__init__.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from .annotations import get_discriminator
4 | from .datetimes import parse_datetime
5 | from .enums import OpenEnumMeta
6 | from .headers import get_headers, get_response_headers
7 | from .metadata import (
8 | FieldMetadata,
9 | find_metadata,
10 | FormMetadata,
11 | HeaderMetadata,
12 | MultipartFormMetadata,
13 | PathParamMetadata,
14 | QueryParamMetadata,
15 | RequestMetadata,
16 | SecurityMetadata,
17 | )
18 | from .queryparams import get_query_params
19 | from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig
20 | from .requestbodies import serialize_request_body, SerializedRequestBody
21 | from .security import get_security
22 | from .serializers import (
23 | get_pydantic_model,
24 | marshal_json,
25 | unmarshal,
26 | unmarshal_json,
27 | serialize_decimal,
28 | serialize_float,
29 | serialize_int,
30 | stream_to_text,
31 | stream_to_text_async,
32 | stream_to_bytes,
33 | stream_to_bytes_async,
34 | validate_const,
35 | validate_decimal,
36 | validate_float,
37 | validate_int,
38 | validate_open_enum,
39 | )
40 | from .url import generate_url, template_url, remove_suffix
41 | from .values import (
42 | get_global_from_env,
43 | match_content_type,
44 | match_status_codes,
45 | match_response,
46 | cast_partial,
47 | )
48 | from .logger import Logger, get_body_content, get_default_logger
49 |
50 | __all__ = [
51 | "BackoffStrategy",
52 | "FieldMetadata",
53 | "find_metadata",
54 | "FormMetadata",
55 | "generate_url",
56 | "get_body_content",
57 | "get_default_logger",
58 | "get_discriminator",
59 | "get_global_from_env",
60 | "get_headers",
61 | "get_pydantic_model",
62 | "get_query_params",
63 | "get_response_headers",
64 | "get_security",
65 | "HeaderMetadata",
66 | "Logger",
67 | "marshal_json",
68 | "match_content_type",
69 | "match_status_codes",
70 | "match_response",
71 | "MultipartFormMetadata",
72 | "OpenEnumMeta",
73 | "PathParamMetadata",
74 | "QueryParamMetadata",
75 | "remove_suffix",
76 | "Retries",
77 | "retry",
78 | "retry_async",
79 | "RetryConfig",
80 | "RequestMetadata",
81 | "SecurityMetadata",
82 | "serialize_decimal",
83 | "serialize_float",
84 | "serialize_int",
85 | "serialize_request_body",
86 | "SerializedRequestBody",
87 | "stream_to_text",
88 | "stream_to_text_async",
89 | "stream_to_bytes",
90 | "stream_to_bytes_async",
91 | "template_url",
92 | "unmarshal",
93 | "unmarshal_json",
94 | "validate_decimal",
95 | "validate_const",
96 | "validate_float",
97 | "validate_int",
98 | "validate_open_enum",
99 | "cast_partial",
100 | ]
101 |
--------------------------------------------------------------------------------
/src/ragie/utils/annotations.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from enum import Enum
4 | from typing import Any, Optional
5 |
6 | def get_discriminator(model: Any, fieldname: str, key: str) -> str:
7 | """
8 | Recursively search for the discriminator attribute in a model.
9 |
10 | Args:
11 | model (Any): The model to search within.
12 | fieldname (str): The name of the field to search for.
13 | key (str): The key to search for in dictionaries.
14 |
15 | Returns:
16 | str: The name of the discriminator attribute.
17 |
18 | Raises:
19 | ValueError: If the discriminator attribute is not found.
20 | """
21 | upper_fieldname = fieldname.upper()
22 |
23 | def get_field_discriminator(field: Any) -> Optional[str]:
24 | """Search for the discriminator attribute in a given field."""
25 |
26 | if isinstance(field, dict):
27 | if key in field:
28 | return f'{field[key]}'
29 |
30 | if hasattr(field, fieldname):
31 | attr = getattr(field, fieldname)
32 | if isinstance(attr, Enum):
33 | return f'{attr.value}'
34 | return f'{attr}'
35 |
36 | if hasattr(field, upper_fieldname):
37 | attr = getattr(field, upper_fieldname)
38 | if isinstance(attr, Enum):
39 | return f'{attr.value}'
40 | return f'{attr}'
41 |
42 | return None
43 |
44 |
45 | if isinstance(model, list):
46 | for field in model:
47 | discriminator = get_field_discriminator(field)
48 | if discriminator is not None:
49 | return discriminator
50 |
51 | discriminator = get_field_discriminator(model)
52 | if discriminator is not None:
53 | return discriminator
54 |
55 | raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
56 |
--------------------------------------------------------------------------------
/src/ragie/utils/datetimes.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | from datetime import datetime
4 | import sys
5 |
6 |
7 | def parse_datetime(datetime_string: str) -> datetime:
8 | """
9 | Convert a RFC 3339 / ISO 8601 formatted string into a datetime object.
10 | Python versions 3.11 and later support parsing RFC 3339 directly with
11 | datetime.fromisoformat(), but for earlier versions, this function
12 | encapsulates the necessary extra logic.
13 | """
14 | # Python 3.11 and later can parse RFC 3339 directly
15 | if sys.version_info >= (3, 11):
16 | return datetime.fromisoformat(datetime_string)
17 |
18 | # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix,
19 | # so fix that upfront.
20 | if datetime_string.endswith("Z"):
21 | datetime_string = datetime_string[:-1] + "+00:00"
22 |
23 | return datetime.fromisoformat(datetime_string)
24 |
--------------------------------------------------------------------------------
/src/ragie/utils/enums.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import enum
4 | import sys
5 |
6 | class OpenEnumMeta(enum.EnumMeta):
7 | # The __call__ method `boundary` kwarg was added in 3.11 and must be present
8 | # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622
9 | # pylint: disable=unexpected-keyword-arg
10 | # The __call__ method `values` varg must be named for pyright.
11 | # pylint: disable=keyword-arg-before-vararg
12 |
13 | if sys.version_info >= (3, 11):
14 | def __call__(
15 | cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None
16 | ):
17 | # The `type` kwarg also happens to be a built-in that pylint flags as
18 | # redeclared. Safe to ignore this lint rule with this scope.
19 | # pylint: disable=redefined-builtin
20 |
21 | if names is not None:
22 | return super().__call__(
23 | value,
24 | names=names,
25 | *values,
26 | module=module,
27 | qualname=qualname,
28 | type=type,
29 | start=start,
30 | boundary=boundary,
31 | )
32 |
33 | try:
34 | return super().__call__(
35 | value,
36 | names=names, # pyright: ignore[reportArgumentType]
37 | *values,
38 | module=module,
39 | qualname=qualname,
40 | type=type,
41 | start=start,
42 | boundary=boundary,
43 | )
44 | except ValueError:
45 | return value
46 | else:
47 | def __call__(
48 | cls, value, names=None, *, module=None, qualname=None, type=None, start=1
49 | ):
50 | # The `type` kwarg also happens to be a built-in that pylint flags as
51 | # redeclared. Safe to ignore this lint rule with this scope.
52 | # pylint: disable=redefined-builtin
53 |
54 | if names is not None:
55 | return super().__call__(
56 | value,
57 | names=names,
58 | module=module,
59 | qualname=qualname,
60 | type=type,
61 | start=start,
62 | )
63 |
64 | try:
65 | return super().__call__(
66 | value,
67 | names=names, # pyright: ignore[reportArgumentType]
68 | module=module,
69 | qualname=qualname,
70 | type=type,
71 | start=start,
72 | )
73 | except ValueError:
74 | return value
75 |
--------------------------------------------------------------------------------
/src/ragie/utils/logger.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import httpx
4 | from typing import Any, Protocol
5 |
6 |
7 | class Logger(Protocol):
8 | def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
9 | pass
10 |
11 |
12 | class NoOpLogger:
13 | def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
14 | pass
15 |
16 |
17 | def get_body_content(req: httpx.Request) -> str:
18 | return "" if not hasattr(req, "_content") else str(req.content)
19 |
20 |
21 | def get_default_logger() -> Logger:
22 | return NoOpLogger()
23 |
--------------------------------------------------------------------------------
/src/ragie/utils/requestbodies.py:
--------------------------------------------------------------------------------
1 | """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2 |
3 | import io
4 | from dataclasses import dataclass
5 | import re
6 | from typing import (
7 | Any,
8 | Optional,
9 | )
10 |
11 | from .forms import serialize_form_data, serialize_multipart_form
12 |
13 | from .serializers import marshal_json
14 |
15 | SERIALIZATION_METHOD_TO_CONTENT_TYPE = {
16 | "json": "application/json",
17 | "form": "application/x-www-form-urlencoded",
18 | "multipart": "multipart/form-data",
19 | "raw": "application/octet-stream",
20 | "string": "text/plain",
21 | }
22 |
23 |
24 | @dataclass
25 | class SerializedRequestBody:
26 | media_type: Optional[str] = None
27 | content: Optional[Any] = None
28 | data: Optional[Any] = None
29 | files: Optional[Any] = None
30 |
31 |
32 | def serialize_request_body(
33 | request_body: Any,
34 | nullable: bool,
35 | optional: bool,
36 | serialization_method: str,
37 | request_body_type,
38 | ) -> Optional[SerializedRequestBody]:
39 | if request_body is None:
40 | if not nullable and optional:
41 | return None
42 |
43 | media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method]
44 |
45 | serialized_request_body = SerializedRequestBody(media_type)
46 |
47 | if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None:
48 | serialized_request_body.content = marshal_json(request_body, request_body_type)
49 | elif re.match(r"multipart\/.*", media_type) is not None:
50 | (
51 | serialized_request_body.media_type,
52 | serialized_request_body.data,
53 | serialized_request_body.files,
54 | ) = serialize_multipart_form(media_type, request_body)
55 | elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None:
56 | serialized_request_body.data = serialize_form_data(request_body)
57 | elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)):
58 | serialized_request_body.content = request_body
59 | elif isinstance(request_body, str):
60 | serialized_request_body.content = request_body
61 | else:
62 | raise TypeError(
63 | f"invalid request body type {type(request_body)} for mediaType {media_type}"
64 | )
65 |
66 | return serialized_request_body
67 |
--------------------------------------------------------------------------------