Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.49.0"
".": "0.50.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 73
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-2e4776730f9ad1261f13d4f7f8f7604be69bde3b937433c4fefa2c3c9198199f.yml
openapi_spec_hash: 1c91f2db23dc5afefe433f93109c5369
config_hash: 718a763c108eede78d67ce71ecdac365
configured_endpoints: 75
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-877efb225a136be0aae8263a10935ef8b95f8385487840f27f3c83a401981af8.yml
openapi_spec_hash: 713311bd044cbfc0b31e25d7538f0bc3
config_hash: 341368a8c64fae1694b7fad2df7c56e0
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 0.50.0 (2026-06-18)

Full Changelog: [v0.49.0...v0.50.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.49.0...v0.50.0)

### Features

* **api:** api update ([9660589](https://github.com/cooper-square-technologies/profound-python-sdk/commit/96605890cbb3bf8d4d6fc349cf14349d88c49380))
* **api:** api update ([f30590e](https://github.com/cooper-square-technologies/profound-python-sdk/commit/f30590e2ec11dbec6580470922500d4a95e01610))
* **api:** manual updates ([e987549](https://github.com/cooper-square-technologies/profound-python-sdk/commit/e9875493f3100ef3f0ca5f39e7510734cd37aa59))
* **api:** manual updates ([1fb8411](https://github.com/cooper-square-technologies/profound-python-sdk/commit/1fb84111ac9d7527f83664bea512138af9665414))

## 0.49.0 (2026-06-17)

Full Changelog: [v0.48.0...v0.49.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.48.0...v0.49.0)
Expand Down
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ from profound.types import (
TopicNameFilter,
URLFilter,
ReportCitationsResponse,
ReportQuerySentimentV2Response,
ReportStreamCitationsResponse,
ReportStreamSentimentResponse,
ReportStreamVisibilityResponse,
Expand All @@ -128,6 +129,7 @@ Methods:
- <code title="post /v1/reports/referrals">client.reports.<a href="./src/profound/resources/reports/reports.py">get_referrals_report</a>(\*\*<a href="src/profound/types/report_get_referrals_report_params.py">params</a>) -> <a href="./src/profound/types/report_response.py">ReportResponse</a></code>
- <code title="post /v2/reports/referrals">client.reports.<a href="./src/profound/resources/reports/reports.py">get_referrals_report_v2</a>(\*\*<a href="src/profound/types/report_get_referrals_report_v2_params.py">params</a>) -> <a href="./src/profound/types/report_response.py">ReportResponse</a></code>
- <code title="post /v1/reports/query-fanouts">client.reports.<a href="./src/profound/resources/reports/reports.py">query_fanouts</a>(\*\*<a href="src/profound/types/report_query_fanouts_params.py">params</a>) -> <a href="./src/profound/types/report_response.py">ReportResponse</a></code>
- <code title="post /v1/reports/sentiment-v2">client.reports.<a href="./src/profound/resources/reports/reports.py">query_sentiment_v2</a>(\*\*<a href="src/profound/types/report_query_sentiment_v2_params.py">params</a>) -> <a href="./src/profound/types/report_query_sentiment_v2_response.py">ReportQuerySentimentV2Response</a></code>
- <code title="post /v1/reports/sentiment">client.reports.<a href="./src/profound/resources/reports/reports.py">sentiment</a>(\*\*<a href="src/profound/types/report_sentiment_params.py">params</a>) -> <a href="./src/profound/types/report_response.py">ReportResponse</a></code>
- <code title="post /v1/reports/citations/stream">client.reports.<a href="./src/profound/resources/reports/reports.py">stream_citations</a>(\*\*<a href="src/profound/types/report_stream_citations_params.py">params</a>) -> <a href="./src/profound/types/report_stream_citations_response.py">ReportStreamCitationsResponse</a></code>
- <code title="post /v1/reports/sentiment/stream">client.reports.<a href="./src/profound/resources/reports/reports.py">stream_sentiment</a>(\*\*<a href="src/profound/types/report_stream_sentiment_params.py">params</a>) -> <a href="./src/profound/types/report_stream_sentiment_response.py">ReportStreamSentimentResponse</a></code>
Expand Down Expand Up @@ -261,6 +263,7 @@ from profound.types import (
AgentUpdateResponse,
AgentListResponse,
AgentPublishResponse,
AgentRetrieveGraphResponse,
)
```

Expand All @@ -271,6 +274,7 @@ Methods:
- <code title="patch /v1/agents/{agent_id}">client.agents.<a href="./src/profound/resources/agents/agents.py">update</a>(agent_id, \*\*<a href="src/profound/types/agent_update_params.py">params</a>) -> <a href="./src/profound/types/agent_update_response.py">AgentUpdateResponse</a></code>
- <code title="get /v1/agents">client.agents.<a href="./src/profound/resources/agents/agents.py">list</a>(\*\*<a href="src/profound/types/agent_list_params.py">params</a>) -> <a href="./src/profound/types/agent_list_response.py">AgentListResponse</a></code>
- <code title="post /v1/agents/{agent_id}/publish">client.agents.<a href="./src/profound/resources/agents/agents.py">publish</a>(agent_id) -> <a href="./src/profound/types/agent_publish_response.py">AgentPublishResponse</a></code>
- <code title="get /v1/agents/{agent_id}/graph">client.agents.<a href="./src/profound/resources/agents/agents.py">retrieve_graph</a>(agent_id, \*\*<a href="src/profound/types/agent_retrieve_graph_params.py">params</a>) -> <a href="./src/profound/types/agent_retrieve_graph_response.py">AgentRetrieveGraphResponse</a></code>

## Runs

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "profound"
version = "0.49.0"
version = "0.50.0"
description = "The official Python library for the profound API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/profound/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "profound"
__version__ = "0.49.0" # x-release-please-version
__version__ = "0.50.0" # x-release-please-version
129 changes: 124 additions & 5 deletions src/profound/resources/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
RunsResourceWithStreamingResponse,
AsyncRunsResourceWithStreamingResponse,
)
from ...types import agent_list_params, agent_create_params, agent_update_params, agent_retrieve_params
from ...types import (
agent_list_params,
agent_create_params,
agent_update_params,
agent_retrieve_params,
agent_retrieve_graph_params,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
Expand All @@ -40,6 +46,7 @@
from ...types.agent_update_response import AgentUpdateResponse
from ...types.agent_publish_response import AgentPublishResponse
from ...types.agent_retrieve_response import AgentRetrieveResponse
from ...types.agent_retrieve_graph_response import AgentRetrieveGraphResponse

__all__ = ["AgentsResource", "AsyncAgentsResource"]

Expand Down Expand Up @@ -204,8 +211,8 @@ def update(

graph: New workflow graph for the agent's draft version. Replaces the current draft
graph; the agent is iterated in place rather than re-created, so its ID is
stable. Required — Magi rejects a null graph, so an empty update is a 422 here
rather than a relayed upstream error.
stable. Required — a null graph is rejected as a 422 here rather than as a
relayed upstream error.

extra_headers: Send extra headers

Expand Down Expand Up @@ -317,6 +324,55 @@ def publish(
cast_to=AgentPublishResponse,
)

def retrieve_graph(
self,
agent_id: str,
*,
version: Literal["published", "draft"] | 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,
) -> AgentRetrieveGraphResponse:
"""
Retrieve an agent's full workflow graph (`{nodes, edges}`).

The graph is returned verbatim in the canonical dialect — the same shape
`POST /v1/agents` and `PATCH /v1/agents/{agent_id}` accept — so a known-good
agent can be read back, copied, and edited. Tool-backed nodes appear in their
lowered `tool` form rather than the friendly v1 node types. A `draft` is visible
only to its creator; the `published` version is visible across its organization.

Args:
agent_id: The ID of the agent whose graph to retrieve.

version: Version of the agent whose graph to retrieve. Use `published` for the live
version, or `draft` for the latest unpublished changes. Defaults to `published`.

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
"""
if not agent_id:
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
return self._get(
path_template("/v1/agents/{agent_id}/graph", agent_id=agent_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"version": version}, agent_retrieve_graph_params.AgentRetrieveGraphParams),
),
cast_to=AgentRetrieveGraphResponse,
)


class AsyncAgentsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -478,8 +534,8 @@ async def update(

graph: New workflow graph for the agent's draft version. Replaces the current draft
graph; the agent is iterated in place rather than re-created, so its ID is
stable. Required — Magi rejects a null graph, so an empty update is a 422 here
rather than a relayed upstream error.
stable. Required — a null graph is rejected as a 422 here rather than as a
relayed upstream error.

extra_headers: Send extra headers

Expand Down Expand Up @@ -591,6 +647,57 @@ async def publish(
cast_to=AgentPublishResponse,
)

async def retrieve_graph(
self,
agent_id: str,
*,
version: Literal["published", "draft"] | 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,
) -> AgentRetrieveGraphResponse:
"""
Retrieve an agent's full workflow graph (`{nodes, edges}`).

The graph is returned verbatim in the canonical dialect — the same shape
`POST /v1/agents` and `PATCH /v1/agents/{agent_id}` accept — so a known-good
agent can be read back, copied, and edited. Tool-backed nodes appear in their
lowered `tool` form rather than the friendly v1 node types. A `draft` is visible
only to its creator; the `published` version is visible across its organization.

Args:
agent_id: The ID of the agent whose graph to retrieve.

version: Version of the agent whose graph to retrieve. Use `published` for the live
version, or `draft` for the latest unpublished changes. Defaults to `published`.

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
"""
if not agent_id:
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
return await self._get(
path_template("/v1/agents/{agent_id}/graph", agent_id=agent_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"version": version}, agent_retrieve_graph_params.AgentRetrieveGraphParams
),
),
cast_to=AgentRetrieveGraphResponse,
)


class AgentsResourceWithRawResponse:
def __init__(self, agents: AgentsResource) -> None:
Expand All @@ -611,6 +718,9 @@ def __init__(self, agents: AgentsResource) -> None:
self.publish = to_raw_response_wrapper(
agents.publish,
)
self.retrieve_graph = to_raw_response_wrapper(
agents.retrieve_graph,
)

@cached_property
def runs(self) -> RunsResourceWithRawResponse:
Expand Down Expand Up @@ -640,6 +750,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
self.publish = async_to_raw_response_wrapper(
agents.publish,
)
self.retrieve_graph = async_to_raw_response_wrapper(
agents.retrieve_graph,
)

@cached_property
def runs(self) -> AsyncRunsResourceWithRawResponse:
Expand Down Expand Up @@ -669,6 +782,9 @@ def __init__(self, agents: AgentsResource) -> None:
self.publish = to_streamed_response_wrapper(
agents.publish,
)
self.retrieve_graph = to_streamed_response_wrapper(
agents.retrieve_graph,
)

@cached_property
def runs(self) -> RunsResourceWithStreamingResponse:
Expand Down Expand Up @@ -698,6 +814,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
self.publish = async_to_streamed_response_wrapper(
agents.publish,
)
self.retrieve_graph = async_to_streamed_response_wrapper(
agents.retrieve_graph,
)

@cached_property
def runs(self) -> AsyncRunsResourceWithStreamingResponse:
Expand Down
4 changes: 4 additions & 0 deletions src/profound/resources/reports/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ def create_overview(
comparison_start_date: Optional[str] | Omit = omit,
date_bucket: Optional[str] | Omit = omit,
exclude_topic_ids: bool | Omit = omit,
group_by: Literal["period", "theme"] | Omit = omit,
include_no_persona: bool | Omit = omit,
include_no_tag: bool | Omit = omit,
persona_ids: Optional[SequenceNotStr[str]] | Omit = omit,
Expand Down Expand Up @@ -733,6 +734,7 @@ def create_overview(
"comparison_start_date": comparison_start_date,
"date_bucket": date_bucket,
"exclude_topic_ids": exclude_topic_ids,
"group_by": group_by,
"include_no_persona": include_no_persona,
"include_no_tag": include_no_tag,
"persona_ids": persona_ids,
Expand Down Expand Up @@ -1503,6 +1505,7 @@ async def create_overview(
comparison_start_date: Optional[str] | Omit = omit,
date_bucket: Optional[str] | Omit = omit,
exclude_topic_ids: bool | Omit = omit,
group_by: Literal["period", "theme"] | Omit = omit,
include_no_persona: bool | Omit = omit,
include_no_tag: bool | Omit = omit,
persona_ids: Optional[SequenceNotStr[str]] | Omit = omit,
Expand Down Expand Up @@ -1543,6 +1546,7 @@ async def create_overview(
"comparison_start_date": comparison_start_date,
"date_bucket": date_bucket,
"exclude_topic_ids": exclude_topic_ids,
"group_by": group_by,
"include_no_persona": include_no_persona,
"include_no_tag": include_no_tag,
"persona_ids": persona_ids,
Expand Down
Loading
Loading