diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f391d416..27d2fbbc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.6.0" + ".": "3.7.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index af483f0a..f8627752 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-cb3bf9b21459cad24410206c27a32fd31ef6cf86711700597549dbbd0d634002.yml -openapi_spec_hash: 6a9149a81ba15e7c5c5c1f4d77daad92 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml +openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289 config_hash: bad49c3bf949d5168ec3896bedff253a diff --git a/CHANGELOG.md b/CHANGELOG.md index b8cc8f24..078258e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 3.7.0 (2025-10-30) + +Full Changelog: [v3.6.0...v3.7.0](https://github.com/digitalocean/gradient-python/compare/v3.6.0...v3.7.0) + +### Features + +* add wait_for_completion method to IndexingJobs resource with sy… ([#49](https://github.com/digitalocean/gradient-python/issues/49)) ([9edc2a6](https://github.com/digitalocean/gradient-python/commit/9edc2a60f5aa49749e151477615bbecb3a79e92b)) +* Add wait_until_ready() method for agent deployment polling ([#56](https://github.com/digitalocean/gradient-python/issues/56)) ([dcef3d5](https://github.com/digitalocean/gradient-python/commit/dcef3d5ebb4ef903c0c91aa4008853bb978f5544)) +* **api:** add inference errors ([d61d495](https://github.com/digitalocean/gradient-python/commit/d61d4955f596d9ac1bebc9387a6573989e823022)) + + +### Bug Fixes + +* **client:** close streams without requiring full consumption ([33fe04b](https://github.com/digitalocean/gradient-python/commit/33fe04b2e4ab71094ee13e7b83d4c04867e7d485)) + + +### Chores + +* bump `httpx-aiohttp` version to 0.1.9 ([db39cc6](https://github.com/digitalocean/gradient-python/commit/db39cc63fb126ac81edfe2cb991493d10a2d0936)) + ## 3.6.0 (2025-10-16) Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0) diff --git a/pyproject.toml b/pyproject.toml index 0e83a25b..6d40f8aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.6.0" +version = "3.7.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" @@ -37,7 +37,7 @@ Homepage = "https://github.com/digitalocean/gradient-python" Repository = "https://github.com/digitalocean/gradient-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 896c8c3a..e5307af8 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via gradient # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gradient idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index 1fce47a6..8c60e6c5 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gradient # via httpx-aiohttp -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gradient idna==3.4 # via anyio diff --git a/src/gradient/_streaming.py b/src/gradient/_streaming.py index eb9be89d..df2a5870 100644 --- a/src/gradient/_streaming.py +++ b/src/gradient/_streaming.py @@ -76,9 +76,8 @@ def __stream__(self) -> Iterator[_T]: yield process_data(data=data, cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + response.close() def __enter__(self) -> Self: return self @@ -158,9 +157,8 @@ async def __stream__(self) -> AsyncIterator[_T]: yield process_data(data=data, cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - async for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + await response.aclose() async def __aenter__(self) -> Self: return self diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 0190d688..6e29a000 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.6.0" # x-release-please-version +__version__ = "3.7.0" # x-release-please-version diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 686678ba..33a59788 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -185,12 +185,14 @@ def create( description: str | Omit = omit, instruction: str | Omit = omit, knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, project_id: str | Omit = omit, region: str | Omit = omit, tags: SequenceNotStr[str] | Omit = omit, + workspace_uuid: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -227,6 +229,8 @@ def create( tags: Agent tag to organize related resources + workspace_uuid: Identifier for the workspace + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -245,12 +249,14 @@ def create( "description": description, "instruction": instruction, "knowledge_base_uuid": knowledge_base_uuid, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, "project_id": project_id, "region": region, "tags": tags, + "workspace_uuid": workspace_uuid, }, agent_create_params.AgentCreateParams, ), @@ -302,12 +308,14 @@ def update( path_uuid: str, *, agent_log_insights_enabled: bool | Omit = omit, + allowed_domains: SequenceNotStr[str] | Omit = omit, anthropic_key_uuid: str | Omit = omit, conversation_logs_enabled: bool | Omit = omit, description: str | Omit = omit, instruction: str | Omit = omit, k: int | Omit = omit, max_tokens: int | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, @@ -331,6 +339,9 @@ def update( response body is a JSON object containing the agent. Args: + allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models conversation_logs_enabled: Optional update of conversation logs enabled @@ -348,6 +359,8 @@ def update( or output, set as a number between 1 and 512. This determines the length of each response. + model_provider_key_uuid: Optional Model Provider uuid for use with provider models + model_uuid: Identifier for the foundation model. name: Agent name @@ -391,12 +404,14 @@ def update( body=maybe_transform( { "agent_log_insights_enabled": agent_log_insights_enabled, + "allowed_domains": allowed_domains, "anthropic_key_uuid": anthropic_key_uuid, "conversation_logs_enabled": conversation_logs_enabled, "description": description, "instruction": instruction, "k": k, "max_tokens": max_tokens, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, @@ -767,12 +782,14 @@ async def create( description: str | Omit = omit, instruction: str | Omit = omit, knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, project_id: str | Omit = omit, region: str | Omit = omit, tags: SequenceNotStr[str] | Omit = omit, + workspace_uuid: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -809,6 +826,8 @@ async def create( tags: Agent tag to organize related resources + workspace_uuid: Identifier for the workspace + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -827,12 +846,14 @@ async def create( "description": description, "instruction": instruction, "knowledge_base_uuid": knowledge_base_uuid, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, "project_id": project_id, "region": region, "tags": tags, + "workspace_uuid": workspace_uuid, }, agent_create_params.AgentCreateParams, ), @@ -884,12 +905,14 @@ async def update( path_uuid: str, *, agent_log_insights_enabled: bool | Omit = omit, + allowed_domains: SequenceNotStr[str] | Omit = omit, anthropic_key_uuid: str | Omit = omit, conversation_logs_enabled: bool | Omit = omit, description: str | Omit = omit, instruction: str | Omit = omit, k: int | Omit = omit, max_tokens: int | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, @@ -913,6 +936,9 @@ async def update( response body is a JSON object containing the agent. Args: + allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models conversation_logs_enabled: Optional update of conversation logs enabled @@ -930,6 +956,8 @@ async def update( or output, set as a number between 1 and 512. This determines the length of each response. + model_provider_key_uuid: Optional Model Provider uuid for use with provider models + model_uuid: Identifier for the foundation model. name: Agent name @@ -973,12 +1001,14 @@ async def update( body=await async_maybe_transform( { "agent_log_insights_enabled": agent_log_insights_enabled, + "allowed_domains": allowed_domains, "anthropic_key_uuid": anthropic_key_uuid, "conversation_logs_enabled": conversation_logs_enabled, "description": description, "instruction": instruction, "k": k, "max_tokens": max_tokens, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, diff --git a/src/gradient/types/agent_create_params.py b/src/gradient/types/agent_create_params.py index db84a258..343c5d70 100644 --- a/src/gradient/types/agent_create_params.py +++ b/src/gradient/types/agent_create_params.py @@ -28,6 +28,8 @@ class AgentCreateParams(TypedDict, total=False): knowledge_base_uuid: SequenceNotStr[str] """Ids of the knowledge base(s) to attach to the agent""" + model_provider_key_uuid: str + model_uuid: str """Identifier for the foundation model.""" @@ -45,3 +47,6 @@ class AgentCreateParams(TypedDict, total=False): tags: SequenceNotStr[str] """Agent tag to organize related resources""" + + workspace_uuid: str + """Identifier for the workspace""" diff --git a/src/gradient/types/agent_list_response.py b/src/gradient/types/agent_list_response.py index 7a64c66e..c461f152 100644 --- a/src/gradient/types/agent_list_response.py +++ b/src/gradient/types/agent_list_response.py @@ -24,6 +24,8 @@ class AgentChatbot(BaseModel): + allowed_domains: Optional[List[str]] = None + button_background_color: Optional[str] = None logo: Optional[str] = None @@ -61,6 +63,7 @@ class AgentDeployment(BaseModel): "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED", + "STATUS_BUILDING", ] ] = None diff --git a/src/gradient/types/agent_update_params.py b/src/gradient/types/agent_update_params.py index 75c30cba..5026beaa 100644 --- a/src/gradient/types/agent_update_params.py +++ b/src/gradient/types/agent_update_params.py @@ -14,6 +14,12 @@ class AgentUpdateParams(TypedDict, total=False): agent_log_insights_enabled: bool + allowed_domains: SequenceNotStr[str] + """ + Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + """ + anthropic_key_uuid: str """Optional anthropic key uuid for use with anthropic models""" @@ -41,6 +47,9 @@ class AgentUpdateParams(TypedDict, total=False): response. """ + model_provider_key_uuid: str + """Optional Model Provider uuid for use with provider models""" + model_uuid: str """Identifier for the foundation model.""" diff --git a/src/gradient/types/api_agent.py b/src/gradient/types/api_agent.py index abfbe828..f52e44c8 100644 --- a/src/gradient/types/api_agent.py +++ b/src/gradient/types/api_agent.py @@ -6,6 +6,8 @@ from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel from .api_agent_model import APIAgentModel from .api_knowledge_base import APIKnowledgeBase @@ -24,6 +26,7 @@ "Function", "Guardrail", "LoggingConfig", + "ModelProviderKey", "Template", "TemplateGuardrail", ] @@ -35,6 +38,8 @@ class APIKey(BaseModel): class Chatbot(BaseModel): + allowed_domains: Optional[List[str]] = None + button_background_color: Optional[str] = None logo: Optional[str] = None @@ -72,6 +77,7 @@ class Deployment(BaseModel): "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED", + "STATUS_BUILDING", ] ] = None @@ -186,6 +192,33 @@ class LoggingConfig(BaseModel): """Name of the log stream""" +class ModelProviderKey(BaseModel): + api_key_uuid: Optional[str] = None + """API key ID""" + + created_at: Optional[datetime] = None + """Key creation date""" + + created_by: Optional[str] = None + """Created by user id from DO""" + + deleted_at: Optional[datetime] = None + """Key deleted date""" + + models: Optional[List[APIAgentModel]] = None + """Models supported by the openAI api key""" + + name: Optional[str] = None + """Name of the key""" + + provider: Optional[Literal["MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", "MODEL_PROVIDER_OPENAI"]] = ( + None + ) + + updated_at: Optional[datetime] = None + """Key last updated date""" + + class TemplateGuardrail(BaseModel): priority: Optional[int] = None """Priority of the guardrail""" @@ -311,6 +344,8 @@ class APIAgent(BaseModel): model: Optional[APIAgentModel] = None """Description of a Model""" + api_model_provider_key: Optional[ModelProviderKey] = FieldInfo(alias="model_provider_key", default=None) + name: Optional[str] = None """Agent name""" @@ -372,6 +407,11 @@ class APIAgent(BaseModel): version_hash: Optional[str] = None """The latest version of the agent""" + vpc_egress_ips: Optional[List[str]] = None + """VPC Egress IPs""" + + vpc_uuid: Optional[str] = None + workspace: Optional["APIWorkspace"] = None diff --git a/src/gradient/types/knowledge_base_create_params.py b/src/gradient/types/knowledge_base_create_params.py index e40bd598..4dc42098 100644 --- a/src/gradient/types/knowledge_base_create_params.py +++ b/src/gradient/types/knowledge_base_create_params.py @@ -11,7 +11,7 @@ from .knowledge_bases.api_file_upload_data_source_param import APIFileUploadDataSourceParam from .knowledge_bases.api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam -__all__ = ["KnowledgeBaseCreateParams", "Datasource", "DatasourceDropboxDataSource"] +__all__ = ["KnowledgeBaseCreateParams", "Datasource", "DatasourceDropboxDataSource", "DatasourceGoogleDriveDataSource"] class KnowledgeBaseCreateParams(TypedDict, total=False): @@ -63,6 +63,17 @@ class DatasourceDropboxDataSource(TypedDict, total=False): """ +class DatasourceGoogleDriveDataSource(TypedDict, total=False): + folder_id: str + + refresh_token: str + """Refresh token. + + you can obrain a refresh token by following the oauth2 flow. see + /v2/gen-ai/oauth2/google/tokens for reference. + """ + + class Datasource(TypedDict, total=False): aws_data_source: AwsDataSourceParam """AWS S3 Data Source""" @@ -79,6 +90,9 @@ class Datasource(TypedDict, total=False): file_upload_data_source: APIFileUploadDataSourceParam """File to upload as data source for knowledge base.""" + google_drive_data_source: DatasourceGoogleDriveDataSource + """Google Drive Data Source""" + item_path: str spaces_data_source: APISpacesDataSourceParam diff --git a/src/gradient/types/knowledge_bases/api_indexed_data_source.py b/src/gradient/types/knowledge_bases/api_indexed_data_source.py index 151b29de..3f011582 100644 --- a/src/gradient/types/knowledge_bases/api_indexed_data_source.py +++ b/src/gradient/types/knowledge_bases/api_indexed_data_source.py @@ -48,6 +48,7 @@ class APIIndexedDataSource(BaseModel): "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", "DATA_SOURCE_STATUS_NOT_UPDATED", "DATA_SOURCE_STATUS_FAILED", + "DATA_SOURCE_STATUS_CANCELLED", ] ] = None diff --git a/src/gradient/types/knowledge_bases/api_indexing_job.py b/src/gradient/types/knowledge_bases/api_indexing_job.py index 312e465c..93124cf8 100644 --- a/src/gradient/types/knowledge_bases/api_indexing_job.py +++ b/src/gradient/types/knowledge_bases/api_indexing_job.py @@ -5,6 +5,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from .api_indexed_data_source import APIIndexedDataSource __all__ = ["APIIndexingJob"] @@ -16,10 +17,16 @@ class APIIndexingJob(BaseModel): created_at: Optional[datetime] = None """Creation date / time""" + data_source_jobs: Optional[List[APIIndexedDataSource]] = None + """Details on Data Sources included in the Indexing Job""" + data_source_uuids: Optional[List[str]] = None finished_at: Optional[datetime] = None + is_report_available: Optional[bool] = None + """Boolean value to determine if the indexing job details are available""" + knowledge_base_uuid: Optional[str] = None """Knowledge base id""" @@ -50,7 +57,7 @@ class APIIndexingJob(BaseModel): ] = None tokens: Optional[int] = None - """Number of tokens""" + """Number of tokens [This field is deprecated]""" total_datasources: Optional[int] = None """Number of datasources being indexed""" @@ -61,9 +68,15 @@ class APIIndexingJob(BaseModel): total_items_indexed: Optional[str] = None """Total Items Indexed""" + total_items_removed: Optional[str] = None + """Total Items Removed""" + total_items_skipped: Optional[str] = None """Total Items Skipped""" + total_tokens: Optional[str] = None + """Total Tokens Consumed By the Indexing Job""" + updated_at: Optional[datetime] = None """Last modified""" diff --git a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py index ed370eb5..223797c7 100644 --- a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py +++ b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py @@ -10,7 +10,7 @@ from .api_file_upload_data_source import APIFileUploadDataSource from .api_web_crawler_data_source import APIWebCrawlerDataSource -__all__ = ["APIKnowledgeBaseDataSource", "AwsDataSource", "DropboxDataSource"] +__all__ = ["APIKnowledgeBaseDataSource", "AwsDataSource", "DropboxDataSource", "GoogleDriveDataSource"] class AwsDataSource(BaseModel): @@ -27,6 +27,13 @@ class DropboxDataSource(BaseModel): folder: Optional[str] = None +class GoogleDriveDataSource(BaseModel): + folder_id: Optional[str] = None + + folder_name: Optional[str] = None + """Name of the selected folder if available""" + + class APIKnowledgeBaseDataSource(BaseModel): aws_data_source: Optional[AwsDataSource] = None """AWS S3 Data Source for Display""" @@ -43,6 +50,9 @@ class APIKnowledgeBaseDataSource(BaseModel): file_upload_data_source: Optional[APIFileUploadDataSource] = None """File to upload as data source for knowledge base.""" + google_drive_data_source: Optional[GoogleDriveDataSource] = None + """Google Drive Data Source for Display""" + item_path: Optional[str] = None """Path of folder or object in bucket - Deprecated, moved to data_source_details""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py index 4690c607..63c9111a 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel @@ -24,3 +24,6 @@ class APIWebCrawlerDataSource(BaseModel): embed_media: Optional[bool] = None """Whether to ingest and index media (images, etc.) on web pages.""" + + exclude_tags: Optional[List[str]] = None + """Declaring which tags to exclude in web pages while webcrawling""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py index 2345ed3a..17988e73 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py @@ -4,6 +4,8 @@ from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["APIWebCrawlerDataSourceParam"] @@ -23,3 +25,6 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False): embed_media: bool """Whether to ingest and index media (images, etc.) on web pages.""" + + exclude_tags: SequenceNotStr[str] + """Declaring which tags to exclude in web pages while webcrawling""" diff --git a/tests/api_resources/knowledge_bases/test_data_sources.py b/tests/api_resources/knowledge_bases/test_data_sources.py index 4214f880..ca721d93 100644 --- a/tests/api_resources/knowledge_bases/test_data_sources.py +++ b/tests/api_resources/knowledge_bases/test_data_sources.py @@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) @@ -273,6 +274,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 1ba3e093..c9e59e32 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -40,12 +40,14 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', knowledge_base_uuid=["example string"], + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My Agent"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', project_id='"12345678-1234-1234-1234-123456789012"', region='"tor1"', tags=["example string"], + workspace_uuid="123e4567-e89b-12d3-a456-426614174000", ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) @@ -127,12 +129,14 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: agent = client.agents.update( path_uuid='"123e4567-e89b-12d3-a456-426614174000"', agent_log_insights_enabled=True, + allowed_domains=["example string"], anthropic_key_uuid='"12345678-1234-1234-1234-123456789012"', conversation_logs_enabled=True, description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', k=5, max_tokens=100, + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My New Agent Name"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', @@ -483,12 +487,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', knowledge_base_uuid=["example string"], + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My Agent"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', project_id='"12345678-1234-1234-1234-123456789012"', region='"tor1"', tags=["example string"], + workspace_uuid="123e4567-e89b-12d3-a456-426614174000", ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) @@ -570,12 +576,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) agent = await async_client.agents.update( path_uuid='"123e4567-e89b-12d3-a456-426614174000"', agent_log_insights_enabled=True, + allowed_domains=["example string"], anthropic_key_uuid='"12345678-1234-1234-1234-123456789012"', conversation_logs_enabled=True, description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', k=5, max_tokens=100, + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My New Agent Name"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index a42277e4..145d3f7f 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -54,6 +54,10 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "size_in_bytes": "12345", "stored_object_key": "example string", }, + "google_drive_data_source": { + "folder_id": "123e4567-e89b-12d3-a456-426614174000", + "refresh_token": "example string", + }, "item_path": "example string", "spaces_data_source": { "bucket_name": "example name", @@ -64,6 +68,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, } ], @@ -408,6 +413,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "size_in_bytes": "12345", "stored_object_key": "example string", }, + "google_drive_data_source": { + "folder_id": "123e4567-e89b-12d3-a456-426614174000", + "refresh_token": "example string", + }, "item_path": "example string", "spaces_data_source": { "bucket_name": "example name", @@ -418,6 +427,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, } ],