From a4e8202123ecb6a054eec104d5404ad4e3c07193 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:19:12 +0000 Subject: [PATCH 1/4] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a88a788..cf1adf0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 58 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-46d484b69bce8b655b4cb2741903af321088ee25d778dd1f9974925b75ae0c76.yml -openapi_spec_hash: e4c1f68f0083d3b13501f3c85d29b4f4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-5ef0df6e581135bd5d4ee9544b2504dc075bf7eb13684112aff5017caf5b3ee9.yml +openapi_spec_hash: 4221dbdb017148418ab6ccebbaa97506 config_hash: 2a7bb5e7a725315963e311126f1f7e4c From eb7a6d1eb27a62f0dcb852b287f2dfb64dcce1b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 19:05:28 +0000 Subject: [PATCH 2/4] feat(api): api update --- .stats.yml | 4 ++-- src/nimble_python/resources/agents/agents.py | 16 ++++++++-------- src/nimble_python/types/agent_create_params.py | 6 +++--- src/nimble_python/types/agent_create_response.py | 6 +++--- src/nimble_python/types/agent_get_response.py | 6 +++--- src/nimble_python/types/agent_list_response.py | 6 +++--- src/nimble_python/types/agent_update_response.py | 6 +++--- .../types/agents/template_get_response.py | 6 +++--- .../types/agents/template_list_response.py | 6 +++--- tests/api_resources/test_agents.py | 4 ++-- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf1adf0..fa0f943 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 58 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-5ef0df6e581135bd5d4ee9544b2504dc075bf7eb13684112aff5017caf5b3ee9.yml -openapi_spec_hash: 4221dbdb017148418ab6ccebbaa97506 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-2ecba3b66a79f34a38c53f7e49b9b0ac41f77c5d79ccb634b042bdbf3b16e032.yml +openapi_spec_hash: 95dd64bbbff2d2c2bf6014e72aea70f3 config_hash: 2a7bb5e7a725315963e311126f1f7e4c diff --git a/src/nimble_python/resources/agents/agents.py b/src/nimble_python/resources/agents/agents.py index 4bbe463..abb4d62 100644 --- a/src/nimble_python/resources/agents/agents.py +++ b/src/nimble_python/resources/agents/agents.py @@ -77,12 +77,12 @@ def create( agent_name: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, display_name: Optional[str] | Omit = omit, - domain_expertise: Optional[str] | Omit = omit, effort: Literal["low", "medium", "high", "x-high", "max"] | Omit = omit, goals: SequenceNotStr[str] | Omit = omit, icon: Optional[str] | Omit = omit, is_active: bool | Omit = omit, output_schema: Optional[Dict[str, object]] | Omit = omit, + skill: Optional[str] | Omit = omit, sources: agent_create_params.Sources | Omit = omit, suggested_questions: SequenceNotStr[str] | Omit = omit, template: Optional[str] | Omit = omit, @@ -108,8 +108,6 @@ def create( display_name: Human-friendly agent name shown to users. - domain_expertise: Domain expertise or operating context for the agent. - effort: Default effort level for this agent's runs. goals: Ordered goals for the agent to follow. @@ -120,6 +118,8 @@ def create( output_schema: JSON schema describing the structured output the agent should produce. + skill: Skill or operating context for the agent. + sources: Source guidance for the agent. suggested_questions: Suggested prompts users can run with this agent. @@ -144,12 +144,12 @@ def create( "agent_name": agent_name, "description": description, "display_name": display_name, - "domain_expertise": domain_expertise, "effort": effort, "goals": goals, "icon": icon, "is_active": is_active, "output_schema": output_schema, + "skill": skill, "sources": sources, "suggested_questions": suggested_questions, "template": template, @@ -355,12 +355,12 @@ async def create( agent_name: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, display_name: Optional[str] | Omit = omit, - domain_expertise: Optional[str] | Omit = omit, effort: Literal["low", "medium", "high", "x-high", "max"] | Omit = omit, goals: SequenceNotStr[str] | Omit = omit, icon: Optional[str] | Omit = omit, is_active: bool | Omit = omit, output_schema: Optional[Dict[str, object]] | Omit = omit, + skill: Optional[str] | Omit = omit, sources: agent_create_params.Sources | Omit = omit, suggested_questions: SequenceNotStr[str] | Omit = omit, template: Optional[str] | Omit = omit, @@ -386,8 +386,6 @@ async def create( display_name: Human-friendly agent name shown to users. - domain_expertise: Domain expertise or operating context for the agent. - effort: Default effort level for this agent's runs. goals: Ordered goals for the agent to follow. @@ -398,6 +396,8 @@ async def create( output_schema: JSON schema describing the structured output the agent should produce. + skill: Skill or operating context for the agent. + sources: Source guidance for the agent. suggested_questions: Suggested prompts users can run with this agent. @@ -422,12 +422,12 @@ async def create( "agent_name": agent_name, "description": description, "display_name": display_name, - "domain_expertise": domain_expertise, "effort": effort, "goals": goals, "icon": icon, "is_active": is_active, "output_schema": output_schema, + "skill": skill, "sources": sources, "suggested_questions": suggested_questions, "template": template, diff --git a/src/nimble_python/types/agent_create_params.py b/src/nimble_python/types/agent_create_params.py index 7e09867..2396ef5 100644 --- a/src/nimble_python/types/agent_create_params.py +++ b/src/nimble_python/types/agent_create_params.py @@ -20,9 +20,6 @@ class AgentCreateParams(TypedDict, total=False): display_name: Optional[str] """Human-friendly agent name shown to users.""" - domain_expertise: Optional[str] - """Domain expertise or operating context for the agent.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for this agent's runs.""" @@ -38,6 +35,9 @@ class AgentCreateParams(TypedDict, total=False): output_schema: Optional[Dict[str, object]] """JSON schema describing the structured output the agent should produce.""" + skill: Optional[str] + """Skill or operating context for the agent.""" + sources: Sources """Source guidance for the agent.""" diff --git a/src/nimble_python/types/agent_create_response.py b/src/nimble_python/types/agent_create_response.py index e3ce350..15a2bcf 100644 --- a/src/nimble_python/types/agent_create_response.py +++ b/src/nimble_python/types/agent_create_response.py @@ -88,9 +88,6 @@ class AgentCreateResponse(BaseModel): display_name: str """Human-friendly agent name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the agent.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for this agent's runs.""" @@ -106,6 +103,9 @@ class AgentCreateResponse(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the agent.""" + sources: Sources """Source guidance for the agent.""" diff --git a/src/nimble_python/types/agent_get_response.py b/src/nimble_python/types/agent_get_response.py index 1a42467..7dd29f8 100644 --- a/src/nimble_python/types/agent_get_response.py +++ b/src/nimble_python/types/agent_get_response.py @@ -88,9 +88,6 @@ class AgentGetResponse(BaseModel): display_name: str """Human-friendly agent name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the agent.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for this agent's runs.""" @@ -106,6 +103,9 @@ class AgentGetResponse(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the agent.""" + sources: Sources """Source guidance for the agent.""" diff --git a/src/nimble_python/types/agent_list_response.py b/src/nimble_python/types/agent_list_response.py index 67e9e98..31f3c4d 100644 --- a/src/nimble_python/types/agent_list_response.py +++ b/src/nimble_python/types/agent_list_response.py @@ -96,9 +96,6 @@ class Item(BaseModel): display_name: str """Human-friendly agent name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the agent.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for this agent's runs.""" @@ -114,6 +111,9 @@ class Item(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the agent.""" + sources: ItemSources """Source guidance for the agent.""" diff --git a/src/nimble_python/types/agent_update_response.py b/src/nimble_python/types/agent_update_response.py index f30f9ab..9195f5b 100644 --- a/src/nimble_python/types/agent_update_response.py +++ b/src/nimble_python/types/agent_update_response.py @@ -88,9 +88,6 @@ class AgentUpdateResponse(BaseModel): display_name: str """Human-friendly agent name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the agent.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for this agent's runs.""" @@ -106,6 +103,9 @@ class AgentUpdateResponse(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the agent.""" + sources: Sources """Source guidance for the agent.""" diff --git a/src/nimble_python/types/agents/template_get_response.py b/src/nimble_python/types/agents/template_get_response.py index d83cca1..edbcc25 100644 --- a/src/nimble_python/types/agents/template_get_response.py +++ b/src/nimble_python/types/agents/template_get_response.py @@ -58,9 +58,6 @@ class TemplateGetResponse(BaseModel): display_name: str """Human-friendly template name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the template.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for runs created from this template.""" @@ -73,6 +70,9 @@ class TemplateGetResponse(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the template.""" + sources: List[Source] """Ordered source groups for the template.""" diff --git a/src/nimble_python/types/agents/template_list_response.py b/src/nimble_python/types/agents/template_list_response.py index 2c3938a..a4841f4 100644 --- a/src/nimble_python/types/agents/template_list_response.py +++ b/src/nimble_python/types/agents/template_list_response.py @@ -58,9 +58,6 @@ class Item(BaseModel): display_name: str """Human-friendly template name shown to users.""" - domain_expertise: str - """Domain expertise or operating context for the template.""" - effort: Literal["low", "medium", "high", "x-high", "max"] """Default effort level for runs created from this template.""" @@ -73,6 +70,9 @@ class Item(BaseModel): output_schema: Optional[Dict[str, object]] = None """JSON schema describing the structured output the agent should produce.""" + skill: str + """Skill or operating context for the template.""" + sources: List[ItemSource] """Ordered source groups for the template.""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index d13a61d..a5d7d74 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -35,12 +35,12 @@ def test_method_create_with_all_params(self, client: Nimble) -> None: agent_name="agent_name", description="description", display_name="display_name", - domain_expertise="domain_expertise", effort="low", goals=["string"], icon="icon", is_active=True, output_schema={"foo": "bar"}, + skill="skill", sources={ "allow": [ { @@ -294,12 +294,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncNimble) -> agent_name="agent_name", description="description", display_name="display_name", - domain_expertise="domain_expertise", effort="low", goals=["string"], icon="icon", is_active=True, output_schema={"foo": "bar"}, + skill="skill", sources={ "allow": [ { From 40714b60e42e35f79f6263b0705c03c97a244d2d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 19:14:37 +0000 Subject: [PATCH 3/4] feat(api): manual updates --- .stats.yml | 6 +- api.md | 2 + src/nimble_python/resources/agents/agents.py | 149 +++++++++++++++++- src/nimble_python/types/__init__.py | 2 + src/nimble_python/types/agent_run_params.py | 74 +++++++++ src/nimble_python/types/agent_run_response.py | 54 +++++++ tests/api_resources/test_agents.py | 131 +++++++++++++++ 7 files changed, 413 insertions(+), 5 deletions(-) create mode 100644 src/nimble_python/types/agent_run_params.py create mode 100644 src/nimble_python/types/agent_run_response.py diff --git a/.stats.yml b/.stats.yml index fa0f943..f5f1fb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 58 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-2ecba3b66a79f34a38c53f7e49b9b0ac41f77c5d79ccb634b042bdbf3b16e032.yml +configured_endpoints: 59 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nimbleway/nimbleway-608baaa8a7325ace62afab2b1f8d1047934d3ad52d0f2ecd858415f057960677.yml openapi_spec_hash: 95dd64bbbff2d2c2bf6014e72aea70f3 -config_hash: 2a7bb5e7a725315963e311126f1f7e4c +config_hash: a9878e098a6929e32711d66374797185 diff --git a/api.md b/api.md index d8cfcc6..8256e56 100644 --- a/api.md +++ b/api.md @@ -106,6 +106,7 @@ from nimble_python.types import ( AgentUpdateResponse, AgentListResponse, AgentGetResponse, + AgentRunResponse, ) ``` @@ -116,6 +117,7 @@ Methods: - client.agents.list(\*\*params) -> AgentListResponse - client.agents.delete(agent_id) -> None - client.agents.get(agent_id) -> AgentGetResponse +- client.agents.run(\*\*params) -> AgentRunResponse ## Templates diff --git a/src/nimble_python/resources/agents/agents.py b/src/nimble_python/resources/agents/agents.py index abb4d62..0f65a7a 100644 --- a/src/nimble_python/resources/agents/agents.py +++ b/src/nimble_python/resources/agents/agents.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ RunsResourceWithStreamingResponse, AsyncRunsResourceWithStreamingResponse, ) -from ...types import agent_list_params, agent_create_params, agent_update_params +from ...types import agent_run_params, agent_list_params, agent_create_params, agent_update_params from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property @@ -36,6 +36,7 @@ ) from ..._base_client import make_request_options from ...types.agent_get_response import AgentGetResponse +from ...types.agent_run_response import AgentRunResponse from ...types.agent_list_response import AgentListResponse from ...types.agent_create_response import AgentCreateResponse from ...types.agent_update_response import AgentUpdateResponse @@ -320,6 +321,72 @@ def get( cast_to=AgentGetResponse, ) + def run( + self, + *, + input: str, + effort: Optional[Literal["low", "medium", "high", "x-high", "max"]] | Omit = omit, + enable_events: bool | Omit = omit, + input_data: Union[Iterable[Dict[str, object]], Dict[str, object], None] | Omit = omit, + output_schema: Optional[Dict[str, object]] | Omit = omit, + previous_interaction_id: Optional[str] | Omit = omit, + sources: Optional[agent_run_params.Sources] | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRunResponse: + """Creates a minimal persistent Web Search Agent and starts a run for it. + + The + response includes `web_search_agent_id` for later agent and run queries. + + Args: + input: User prompt or task instructions for the run. + + effort: Canonical effort tier names for the research graph. + + enable_events: Whether to stream run events when supported. + + input_data: Existing records to ENRICH: a list of partial rows, or a single object, + mirroring output_schema's shape. + + output_schema: JSON schema overriding the agent's default structured output for this run. + + previous_interaction_id: Previous interaction identifier used to continue a conversation. + + sources: Source guidance overriding the agent default. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v2/agents/runs", + body=maybe_transform( + { + "input": input, + "effort": effort, + "enable_events": enable_events, + "input_data": input_data, + "output_schema": output_schema, + "previous_interaction_id": previous_interaction_id, + "sources": sources, + }, + agent_run_params.AgentRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRunResponse, + ) + class AsyncAgentsResource(AsyncAPIResource): @cached_property @@ -598,6 +665,72 @@ async def get( cast_to=AgentGetResponse, ) + async def run( + self, + *, + input: str, + effort: Optional[Literal["low", "medium", "high", "x-high", "max"]] | Omit = omit, + enable_events: bool | Omit = omit, + input_data: Union[Iterable[Dict[str, object]], Dict[str, object], None] | Omit = omit, + output_schema: Optional[Dict[str, object]] | Omit = omit, + previous_interaction_id: Optional[str] | Omit = omit, + sources: Optional[agent_run_params.Sources] | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentRunResponse: + """Creates a minimal persistent Web Search Agent and starts a run for it. + + The + response includes `web_search_agent_id` for later agent and run queries. + + Args: + input: User prompt or task instructions for the run. + + effort: Canonical effort tier names for the research graph. + + enable_events: Whether to stream run events when supported. + + input_data: Existing records to ENRICH: a list of partial rows, or a single object, + mirroring output_schema's shape. + + output_schema: JSON schema overriding the agent's default structured output for this run. + + previous_interaction_id: Previous interaction identifier used to continue a conversation. + + sources: Source guidance overriding the agent default. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v2/agents/runs", + body=await async_maybe_transform( + { + "input": input, + "effort": effort, + "enable_events": enable_events, + "input_data": input_data, + "output_schema": output_schema, + "previous_interaction_id": previous_interaction_id, + "sources": sources, + }, + agent_run_params.AgentRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentRunResponse, + ) + class AgentsResourceWithRawResponse: def __init__(self, agents: AgentsResource) -> None: @@ -618,6 +751,9 @@ def __init__(self, agents: AgentsResource) -> None: self.get = to_raw_response_wrapper( agents.get, ) + self.run = to_raw_response_wrapper( + agents.run, + ) @cached_property def templates(self) -> TemplatesResourceWithRawResponse: @@ -647,6 +783,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.get = async_to_raw_response_wrapper( agents.get, ) + self.run = async_to_raw_response_wrapper( + agents.run, + ) @cached_property def templates(self) -> AsyncTemplatesResourceWithRawResponse: @@ -676,6 +815,9 @@ def __init__(self, agents: AgentsResource) -> None: self.get = to_streamed_response_wrapper( agents.get, ) + self.run = to_streamed_response_wrapper( + agents.run, + ) @cached_property def templates(self) -> TemplatesResourceWithStreamingResponse: @@ -705,6 +847,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.get = async_to_streamed_response_wrapper( agents.get, ) + self.run = async_to_streamed_response_wrapper( + agents.run, + ) @cached_property def templates(self) -> AsyncTemplatesResourceWithStreamingResponse: diff --git a/src/nimble_python/types/__init__.py b/src/nimble_python/types/__init__.py index dee2d91..128f66e 100644 --- a/src/nimble_python/types/__init__.py +++ b/src/nimble_python/types/__init__.py @@ -21,6 +21,7 @@ from .job_list_params import JobListParams as JobListParams from .search_response import SearchResponse as SearchResponse from .serp_run_params import SerpRunParams as SerpRunParams +from .agent_run_params import AgentRunParams as AgentRunParams from .crawl_run_params import CrawlRunParams as CrawlRunParams from .job_get_response import JobGetResponse as JobGetResponse from .media_run_params import MediaRunParams as MediaRunParams @@ -34,6 +35,7 @@ from .serp_run_response import SerpRunResponse as SerpRunResponse from .task_get_response import TaskGetResponse as TaskGetResponse from .agent_get_response import AgentGetResponse as AgentGetResponse +from .agent_run_response import AgentRunResponse as AgentRunResponse from .batch_get_response import BatchGetResponse as BatchGetResponse from .crawl_run_response import CrawlRunResponse as CrawlRunResponse from .extract_run_params import ExtractRunParams as ExtractRunParams diff --git a/src/nimble_python/types/agent_run_params.py b/src/nimble_python/types/agent_run_params.py new file mode 100644 index 0000000..bf110f5 --- /dev/null +++ b/src/nimble_python/types/agent_run_params.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["AgentRunParams", "Sources", "SourcesAllow", "SourcesBlock"] + + +class AgentRunParams(TypedDict, total=False): + input: Required[str] + """User prompt or task instructions for the run.""" + + effort: Optional[Literal["low", "medium", "high", "x-high", "max"]] + """Canonical effort tier names for the research graph.""" + + enable_events: bool + """Whether to stream run events when supported.""" + + input_data: Union[Iterable[Dict[str, object]], Dict[str, object], None] + """ + Existing records to ENRICH: a list of partial rows, or a single object, + mirroring output_schema's shape. + """ + + output_schema: Optional[Dict[str, object]] + """JSON schema overriding the agent's default structured output for this run.""" + + previous_interaction_id: Optional[str] + """Previous interaction identifier used to continue a conversation.""" + + sources: Optional[Sources] + """Source guidance overriding the agent default.""" + + +class SourcesAllow(TypedDict, total=False): + domains: Required[SequenceNotStr[str]] + """Domains included in this source group.""" + + title: Required[str] + """Source group title.""" + + order: int + """Zero-based source group position.""" + + +class SourcesBlock(TypedDict, total=False): + domains: Required[SequenceNotStr[str]] + """Domains included in this source group.""" + + title: Required[str] + """Source group title.""" + + order: int + """Zero-based source group position.""" + + +class Sources(TypedDict, total=False): + """Source guidance overriding the agent default.""" + + allow: Iterable[SourcesAllow] + """Source groups the agent is allowed to use.""" + + avoid: Optional[str] + """Free-text guidance describing sources or domains to avoid.""" + + block: Iterable[SourcesBlock] + """Source groups the agent should not use.""" + + prioritize: Optional[str] + """Free-text guidance describing sources or domains to prioritize.""" diff --git a/src/nimble_python/types/agent_run_response.py b/src/nimble_python/types/agent_run_response.py new file mode 100644 index 0000000..b8cfad0 --- /dev/null +++ b/src/nimble_python/types/agent_run_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["AgentRunResponse", "Error"] + + +class Error(BaseModel): + """Error details when the run failed.""" + + message: str + """Human-readable error description.""" + + ref_id: str + """Reference ID (equals the run id).""" + + +class AgentRunResponse(BaseModel): + id: str + """Run identifier, format "task*run*{uuid}".""" + + created_at: datetime + """When the run was created.""" + + effort: Literal["low", "medium", "high", "x-high", "max"] + """Effort level used for the run.""" + + interaction_id: str + """Interaction ID.""" + + is_active: bool + """True while status is 'queued' or 'running'.""" + + status: Literal["queued", "running", "completed", "failed", "cancelled"] + """Current run status.""" + + web_search_agent_id: str + """Web Search Agent instance this run belongs to.""" + + completed_at: Optional[datetime] = None + """When the run completed.""" + + error: Optional[Error] = None + """Error details when the run failed.""" + + prompt: Optional[str] = None + """Prompt submitted for the run.""" + + started_at: Optional[datetime] = None + """When the run started executing.""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index a5d7d74..bb615a7 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -11,6 +11,7 @@ from nimble_python import Nimble, AsyncNimble from nimble_python.types import ( AgentGetResponse, + AgentRunResponse, AgentListResponse, AgentCreateResponse, AgentUpdateResponse, @@ -275,6 +276,71 @@ def test_path_params_get(self, client: Nimble) -> None: "", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_run(self, client: Nimble) -> None: + agent = client.agents.run( + input="input", + ) + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_run_with_all_params(self, client: Nimble) -> None: + agent = client.agents.run( + input="input", + effort="low", + enable_events=True, + input_data=[{"foo": "bar"}], + output_schema={"foo": "bar"}, + previous_interaction_id="previous_interaction_id", + sources={ + "allow": [ + { + "domains": ["string"], + "title": "title", + "order": 0, + } + ], + "avoid": "avoid", + "block": [ + { + "domains": ["string"], + "title": "title", + "order": 0, + } + ], + "prioritize": "prioritize", + }, + ) + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_run(self, client: Nimble) -> None: + response = client.agents.with_raw_response.run( + input="input", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_run(self, client: Nimble) -> None: + with client.agents.with_streaming_response.run( + input="input", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncAgents: parametrize = pytest.mark.parametrize( @@ -533,3 +599,68 @@ async def test_path_params_get(self, async_client: AsyncNimble) -> None: await async_client.agents.with_raw_response.get( "", ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_run(self, async_client: AsyncNimble) -> None: + agent = await async_client.agents.run( + input="input", + ) + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_run_with_all_params(self, async_client: AsyncNimble) -> None: + agent = await async_client.agents.run( + input="input", + effort="low", + enable_events=True, + input_data=[{"foo": "bar"}], + output_schema={"foo": "bar"}, + previous_interaction_id="previous_interaction_id", + sources={ + "allow": [ + { + "domains": ["string"], + "title": "title", + "order": 0, + } + ], + "avoid": "avoid", + "block": [ + { + "domains": ["string"], + "title": "title", + "order": 0, + } + ], + "prioritize": "prioritize", + }, + ) + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_run(self, async_client: AsyncNimble) -> None: + response = await async_client.agents.with_raw_response.run( + input="input", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_run(self, async_client: AsyncNimble) -> None: + async with async_client.agents.with_streaming_response.run( + input="input", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRunResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True From 481176b983b973f45264d0403693a784f27f62af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 19:15:00 +0000 Subject: [PATCH 4/4] release: 1.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/nimble_python/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fea3454..2601677 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed7ae9..032422c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.1.0 (2026-07-21) + +Full Changelog: [v1.0.0...v1.1.0](https://github.com/Nimbleway/nimble-python/compare/v1.0.0...v1.1.0) + +### Features + +* **api:** api update ([eb7a6d1](https://github.com/Nimbleway/nimble-python/commit/eb7a6d1eb27a62f0dcb852b287f2dfb64dcce1b1)) +* **api:** manual updates ([40714b6](https://github.com/Nimbleway/nimble-python/commit/40714b60e42e35f79f6263b0705c03c97a244d2d)) + ## 1.0.0 (2026-07-20) Full Changelog: [v0.24.0...v1.0.0](https://github.com/Nimbleway/nimble-python/compare/v0.24.0...v1.0.0) diff --git a/pyproject.toml b/pyproject.toml index 683fd33..afd456e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nimble_python" -version = "1.0.0" +version = "1.1.0" description = "The official Python library for the nimble API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/nimble_python/_version.py b/src/nimble_python/_version.py index e878efd..8458c76 100644 --- a/src/nimble_python/_version.py +++ b/src/nimble_python/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "nimble_python" -__version__ = "1.0.0" # x-release-please-version +__version__ = "1.1.0" # x-release-please-version