Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 14, 2024
1 parent 4dee8c2 commit 414a487
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/structify%2Fstructify-aa1bdd07a9fcf09044a5dae55e26b5bf3fcd742b8f3a86e1e815f67c45cf5030.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/structify%2Fstructify-48f219e1b0e6ca3514d5922413233d8da39b0a01e299e434253db4e07e8e8fb3.yml
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Methods:
Types:

```python
from structify.types.structure import RunCreateResponse
from structify.types.structure import Llm, RunCreateResponse
```

Methods:
Expand All @@ -143,7 +143,7 @@ Methods:
Types:

```python
from structify.types.structure import RunAsyncCreateResponse
from structify.types.structure import Llm, RunAsyncCreateResponse
```

Methods:
Expand Down
37 changes: 22 additions & 15 deletions src/structify/resources/structure/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
from ..._base_client import (
make_request_options,
)
from ...types.structure import run_create_params
from ...types.structure import Llm, run_create_params
from ...types.structure.llm import Llm

__all__ = ["RunResource", "AsyncRunResource"]

Expand All @@ -42,9 +43,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_create_params.Variant0Text,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -75,9 +76,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
document: run_create_params.Variant1Document,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -108,9 +109,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
web: run_create_params.Variant2Web,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -141,9 +142,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
sec_filing: run_create_params.Variant3SecFiling,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 @@ -170,15 +171,18 @@ def create(
...

@required_args(
["dataset_name", "text"], ["dataset_name", "document"], ["dataset_name", "web"], ["dataset_name", "sec_filing"]
["dataset_name", "llm", "text"],
["dataset_name", "llm", "document"],
["dataset_name", "llm", "web"],
["dataset_name", "llm", "sec_filing"],
)
def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | NotGiven = NOT_GIVEN,
document: run_create_params.Variant1Document | NotGiven = NOT_GIVEN,
web: run_create_params.Variant2Web | NotGiven = NOT_GIVEN,
sec_filing: run_create_params.Variant3SecFiling | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -208,8 +212,8 @@ def create(
query=maybe_transform(
{
"dataset_name": dataset_name,
"custom_instruction": custom_instruction,
"llm": llm,
"custom_instruction": custom_instruction,
},
run_create_params.RunCreateParams,
),
Expand All @@ -232,9 +236,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_create_params.Variant0Text,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -265,9 +269,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
document: run_create_params.Variant1Document,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -298,9 +302,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
web: run_create_params.Variant2Web,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -331,9 +335,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
sec_filing: run_create_params.Variant3SecFiling,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 @@ -360,15 +364,18 @@ async def create(
...

@required_args(
["dataset_name", "text"], ["dataset_name", "document"], ["dataset_name", "web"], ["dataset_name", "sec_filing"]
["dataset_name", "llm", "text"],
["dataset_name", "llm", "document"],
["dataset_name", "llm", "web"],
["dataset_name", "llm", "sec_filing"],
)
async def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | NotGiven = NOT_GIVEN,
document: run_create_params.Variant1Document | NotGiven = NOT_GIVEN,
web: run_create_params.Variant2Web | NotGiven = NOT_GIVEN,
sec_filing: run_create_params.Variant3SecFiling | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -398,8 +405,8 @@ async def create(
query=await async_maybe_transform(
{
"dataset_name": dataset_name,
"custom_instruction": custom_instruction,
"llm": llm,
"custom_instruction": custom_instruction,
},
run_create_params.RunCreateParams,
),
Expand Down
37 changes: 22 additions & 15 deletions src/structify/resources/structure/run_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
from ..._base_client import (
make_request_options,
)
from ...types.structure import run_async_create_params
from ...types.structure import Llm, run_async_create_params
from ...types.structure.llm import Llm

__all__ = ["RunAsyncResource", "AsyncRunAsyncResource"]

Expand All @@ -42,9 +43,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_async_create_params.Variant0Text,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -74,9 +75,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
document: run_async_create_params.Variant1Document,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -106,9 +107,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
web: run_async_create_params.Variant2Web,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -138,9 +139,9 @@ def create(
self,
*,
dataset_name: str,
llm: Llm,
sec_filing: run_async_create_params.Variant3SecFiling,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 @@ -166,15 +167,18 @@ def create(
...

@required_args(
["dataset_name", "text"], ["dataset_name", "document"], ["dataset_name", "web"], ["dataset_name", "sec_filing"]
["dataset_name", "llm", "text"],
["dataset_name", "llm", "document"],
["dataset_name", "llm", "web"],
["dataset_name", "llm", "sec_filing"],
)
def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | NotGiven = NOT_GIVEN,
document: run_async_create_params.Variant1Document | NotGiven = NOT_GIVEN,
web: run_async_create_params.Variant2Web | NotGiven = NOT_GIVEN,
sec_filing: run_async_create_params.Variant3SecFiling | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -204,8 +208,8 @@ def create(
query=maybe_transform(
{
"dataset_name": dataset_name,
"custom_instruction": custom_instruction,
"llm": llm,
"custom_instruction": custom_instruction,
},
run_async_create_params.RunAsyncCreateParams,
),
Expand All @@ -228,9 +232,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_async_create_params.Variant0Text,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -260,9 +264,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
document: run_async_create_params.Variant1Document,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -292,9 +296,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
web: run_async_create_params.Variant2Web,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 Down Expand Up @@ -324,9 +328,9 @@ async def create(
self,
*,
dataset_name: str,
llm: Llm,
sec_filing: run_async_create_params.Variant3SecFiling,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | 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 @@ -352,15 +356,18 @@ async def create(
...

@required_args(
["dataset_name", "text"], ["dataset_name", "document"], ["dataset_name", "web"], ["dataset_name", "sec_filing"]
["dataset_name", "llm", "text"],
["dataset_name", "llm", "document"],
["dataset_name", "llm", "web"],
["dataset_name", "llm", "sec_filing"],
)
async def create(
self,
*,
dataset_name: str,
llm: Llm,
text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN,
custom_instruction: Optional[str] | NotGiven = NOT_GIVEN,
llm: Optional[object] | NotGiven = NOT_GIVEN,
document: run_async_create_params.Variant1Document | NotGiven = NOT_GIVEN,
web: run_async_create_params.Variant2Web | NotGiven = NOT_GIVEN,
sec_filing: run_async_create_params.Variant3SecFiling | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -390,8 +397,8 @@ async def create(
query=await async_maybe_transform(
{
"dataset_name": dataset_name,
"custom_instruction": custom_instruction,
"llm": llm,
"custom_instruction": custom_instruction,
},
run_async_create_params.RunAsyncCreateParams,
),
Expand Down
1 change: 1 addition & 0 deletions src/structify/types/structure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from .llm import Llm as Llm
from .is_complete import IsComplete as IsComplete
from .run_create_params import RunCreateParams as RunCreateParams
from .run_async_create_params import RunAsyncCreateParams as RunAsyncCreateParams
Expand Down
7 changes: 7 additions & 0 deletions src/structify/types/structure/llm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal

__all__ = ["Llm"]

Llm = Literal["Gpt4V", "Structify", "Human"]
Loading

0 comments on commit 414a487

Please sign in to comment.