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 .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brainbase-egrigokhan%2Fbrainbase-a3da5c68a303110755e163fd8678afb64c66d88a9dcd67a7a5dd0ce79cb2056e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brainbase-egrigokhan%2Fbrainbase-78ff4a594abdab542415d8093b3357eacdb461aaab3418d4b87690138bcc11dd.yml
92 changes: 84 additions & 8 deletions src/brainbase/resources/workers/deployments/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def create(
self,
worker_id: str,
*,
body: object,
name: str,
phone_number: str | NotGiven = NOT_GIVEN,
voice_id: str | NotGiven = NOT_GIVEN,
voice_provider: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -63,6 +66,14 @@ def create(
Create a new voice deployment

Args:
name: Name of the voice deployment

phone_number: Phone number for the voice deployment

voice_id: Voice ID for the deployment

voice_provider: Voice provider service

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -75,7 +86,15 @@ def create(
raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}")
return self._post(
f"/api/workers/{worker_id}/deployments/voice",
body=maybe_transform(body, voice_create_params.VoiceCreateParams),
body=maybe_transform(
{
"name": name,
"phone_number": phone_number,
"voice_id": voice_id,
"voice_provider": voice_provider,
},
voice_create_params.VoiceCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -123,7 +142,10 @@ def update(
deployment_id: str,
*,
worker_id: str,
body: object,
name: str,
phone_number: str | NotGiven = NOT_GIVEN,
voice_id: str | NotGiven = NOT_GIVEN,
voice_provider: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -135,6 +157,14 @@ def update(
Update a voice deployment

Args:
name: Name of the voice deployment

phone_number: Phone number for the voice deployment

voice_id: Voice ID for the deployment

voice_provider: Voice provider service

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -149,7 +179,15 @@ def update(
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
return self._put(
f"/api/workers/{worker_id}/deployments/voice/{deployment_id}",
body=maybe_transform(body, voice_update_params.VoiceUpdateParams),
body=maybe_transform(
{
"name": name,
"phone_number": phone_number,
"voice_id": voice_id,
"voice_provider": voice_provider,
},
voice_update_params.VoiceUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -251,7 +289,10 @@ async def create(
self,
worker_id: str,
*,
body: object,
name: str,
phone_number: str | NotGiven = NOT_GIVEN,
voice_id: str | NotGiven = NOT_GIVEN,
voice_provider: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -263,6 +304,14 @@ async def create(
Create a new voice deployment

Args:
name: Name of the voice deployment

phone_number: Phone number for the voice deployment

voice_id: Voice ID for the deployment

voice_provider: Voice provider service

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -275,7 +324,15 @@ async def create(
raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}")
return await self._post(
f"/api/workers/{worker_id}/deployments/voice",
body=await async_maybe_transform(body, voice_create_params.VoiceCreateParams),
body=await async_maybe_transform(
{
"name": name,
"phone_number": phone_number,
"voice_id": voice_id,
"voice_provider": voice_provider,
},
voice_create_params.VoiceCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -323,7 +380,10 @@ async def update(
deployment_id: str,
*,
worker_id: str,
body: object,
name: str,
phone_number: str | NotGiven = NOT_GIVEN,
voice_id: str | NotGiven = NOT_GIVEN,
voice_provider: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -335,6 +395,14 @@ async def update(
Update a voice deployment

Args:
name: Name of the voice deployment

phone_number: Phone number for the voice deployment

voice_id: Voice ID for the deployment

voice_provider: Voice provider service

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -349,7 +417,15 @@ async def update(
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
return await self._put(
f"/api/workers/{worker_id}/deployments/voice/{deployment_id}",
body=await async_maybe_transform(body, voice_update_params.VoiceUpdateParams),
body=await async_maybe_transform(
{
"name": name,
"phone_number": phone_number,
"voice_id": voice_id,
"voice_provider": voice_provider,
},
voice_update_params.VoiceUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
76 changes: 68 additions & 8 deletions src/brainbase/resources/workers/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def create(
self,
worker_id: str,
*,
body: object,
code: str,
name: str,
label: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -63,6 +65,12 @@ def create(
Create a new flow

Args:
code: Flow code

name: Name of the flow

label: Optional label for the flow

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -75,7 +83,14 @@ def create(
raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}")
return self._post(
f"/api/workers/{worker_id}/flows",
body=maybe_transform(body, flow_create_params.FlowCreateParams),
body=maybe_transform(
{
"code": code,
"name": name,
"label": label,
},
flow_create_params.FlowCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -123,7 +138,9 @@ def update(
flow_id: str,
*,
worker_id: str,
body: object,
code: str | NotGiven = NOT_GIVEN,
label: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -135,6 +152,12 @@ def update(
Update a flow

Args:
code: Flow code

label: Optional label for the flow

name: Name of the flow

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -149,7 +172,14 @@ def update(
raise ValueError(f"Expected a non-empty value for `flow_id` but received {flow_id!r}")
return self._put(
f"/api/workers/{worker_id}/flows/{flow_id}",
body=maybe_transform(body, flow_update_params.FlowUpdateParams),
body=maybe_transform(
{
"code": code,
"label": label,
"name": name,
},
flow_update_params.FlowUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -251,7 +281,9 @@ async def create(
self,
worker_id: str,
*,
body: object,
code: str,
name: str,
label: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -263,6 +295,12 @@ async def create(
Create a new flow

Args:
code: Flow code

name: Name of the flow

label: Optional label for the flow

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -275,7 +313,14 @@ async def create(
raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}")
return await self._post(
f"/api/workers/{worker_id}/flows",
body=await async_maybe_transform(body, flow_create_params.FlowCreateParams),
body=await async_maybe_transform(
{
"code": code,
"name": name,
"label": label,
},
flow_create_params.FlowCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -323,7 +368,9 @@ async def update(
flow_id: str,
*,
worker_id: str,
body: object,
code: str | NotGiven = NOT_GIVEN,
label: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -335,6 +382,12 @@ async def update(
Update a flow

Args:
code: Flow code

label: Optional label for the flow

name: Name of the flow

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -349,7 +402,14 @@ async def update(
raise ValueError(f"Expected a non-empty value for `flow_id` but received {flow_id!r}")
return await self._put(
f"/api/workers/{worker_id}/flows/{flow_id}",
body=await async_maybe_transform(body, flow_update_params.FlowUpdateParams),
body=await async_maybe_transform(
{
"code": code,
"label": label,
"name": name,
},
flow_update_params.FlowUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
Loading