From 539ce383d231bbfd44e128d0c0d856a0841a0a73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 16:37:30 +0000 Subject: [PATCH 1/4] feat(api): OpenAPI spec update via Stainless API (#2) --- .stats.yml | 2 +- src/structify/resources/structure/run.py | 21 ++++++++++--------- .../resources/structure/run_async.py | 21 ++++++++++--------- .../structure/run_async_create_params.py | 10 ++++----- .../types/structure/run_create_params.py | 10 ++++----- tests/api_resources/structure/test_run.py | 16 +++++++------- .../api_resources/structure/test_run_async.py | 16 +++++++------- 7 files changed, 49 insertions(+), 47 deletions(-) diff --git a/.stats.yml b/.stats.yml index 651c6c04..0dbcbc11 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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-2988f1610b40c428d0b457b5b596f5ca80d371daf3e99ef0317dad31d8f2dfa3.yml diff --git a/src/structify/resources/structure/run.py b/src/structify/resources/structure/run.py index 1ff3c950..1adfde3e 100644 --- a/src/structify/resources/structure/run.py +++ b/src/structify/resources/structure/run.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Optional, overload +from typing_extensions import Literal import httpx @@ -44,7 +45,7 @@ def create( dataset_name: str, text: run_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -77,7 +78,7 @@ def create( dataset_name: str, document: run_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -110,7 +111,7 @@ def create( dataset_name: str, web: run_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -143,7 +144,7 @@ def create( dataset_name: str, sec_filing: run_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -178,7 +179,7 @@ def create( dataset_name: str, text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -234,7 +235,7 @@ async def create( dataset_name: str, text: run_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -267,7 +268,7 @@ async def create( dataset_name: str, document: run_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -300,7 +301,7 @@ async def create( dataset_name: str, web: run_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -333,7 +334,7 @@ async def create( dataset_name: str, sec_filing: run_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -368,7 +369,7 @@ async def create( dataset_name: str, text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, diff --git a/src/structify/resources/structure/run_async.py b/src/structify/resources/structure/run_async.py index 1984aad4..84cb7676 100644 --- a/src/structify/resources/structure/run_async.py +++ b/src/structify/resources/structure/run_async.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Optional, overload +from typing_extensions import Literal import httpx @@ -44,7 +45,7 @@ def create( dataset_name: str, text: run_async_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -76,7 +77,7 @@ def create( dataset_name: str, document: run_async_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -108,7 +109,7 @@ def create( dataset_name: str, web: run_async_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -140,7 +141,7 @@ def create( dataset_name: str, sec_filing: run_async_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -174,7 +175,7 @@ def create( dataset_name: str, text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -230,7 +231,7 @@ async def create( dataset_name: str, text: run_async_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -262,7 +263,7 @@ async def create( dataset_name: str, document: run_async_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -294,7 +295,7 @@ async def create( dataset_name: str, web: run_async_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -326,7 +327,7 @@ async def create( dataset_name: str, sec_filing: run_async_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -360,7 +361,7 @@ async def create( dataset_name: str, text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[object] | NotGiven = NOT_GIVEN, + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, diff --git a/src/structify/types/structure/run_async_create_params.py b/src/structify/types/structure/run_async_create_params.py index c56a5dad..c7bdcbb4 100644 --- a/src/structify/types/structure/run_async_create_params.py +++ b/src/structify/types/structure/run_async_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Optional -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -27,7 +27,7 @@ class Variant0(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant0Text(TypedDict, total=False): @@ -41,7 +41,7 @@ class Variant1(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant1Document(TypedDict, total=False): @@ -55,7 +55,7 @@ class Variant2(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant2Web(TypedDict, total=False): @@ -71,7 +71,7 @@ class Variant3(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant3SecFiling(TypedDict, total=False): diff --git a/src/structify/types/structure/run_create_params.py b/src/structify/types/structure/run_create_params.py index 62f559d1..aca5c0c1 100644 --- a/src/structify/types/structure/run_create_params.py +++ b/src/structify/types/structure/run_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Optional -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -27,7 +27,7 @@ class Variant0(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant0Text(TypedDict, total=False): @@ -41,7 +41,7 @@ class Variant1(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant1Document(TypedDict, total=False): @@ -55,7 +55,7 @@ class Variant2(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant2Web(TypedDict, total=False): @@ -71,7 +71,7 @@ class Variant3(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[object] + llm: Optional[Literal["Gpt4V", "Structify", "Human"]] class Variant3SecFiling(TypedDict, total=False): diff --git a/tests/api_resources/structure/test_run.py b/tests/api_resources/structure/test_run.py index d9eaa000..3a265375 100644 --- a/tests/api_resources/structure/test_run.py +++ b/tests/api_resources/structure/test_run.py @@ -30,7 +30,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -74,7 +74,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -121,7 +121,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No "starting_website": "string", }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -169,7 +169,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No "year": 0, }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -217,7 +217,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -261,7 +261,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "starting_website": "string", }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) @@ -356,7 +356,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "year": 0, }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run, path=["response"]) diff --git a/tests/api_resources/structure/test_run_async.py b/tests/api_resources/structure/test_run_async.py index 9ecc154c..446926c8 100644 --- a/tests/api_resources/structure/test_run_async.py +++ b/tests/api_resources/structure/test_run_async.py @@ -30,7 +30,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -74,7 +74,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -121,7 +121,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No "starting_website": "string", }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -169,7 +169,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No "year": 0, }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -217,7 +217,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -261,7 +261,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "starting_website": "string", }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) @@ -356,7 +356,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "year": 0, }, custom_instruction="string", - llm={}, + llm="Gpt4V", ) assert_matches_type(object, run_async, path=["response"]) From 4dee8c279ef8d97cba2857d55cded4cc77b2e9f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 16:39:01 +0000 Subject: [PATCH 2/4] feat(api): update via SDK Studio (#3) --- .stats.yml | 2 +- src/structify/resources/structure/run.py | 21 +++++++++---------- .../resources/structure/run_async.py | 21 +++++++++---------- .../structure/run_async_create_params.py | 10 ++++----- .../types/structure/run_create_params.py | 10 ++++----- tests/api_resources/structure/test_run.py | 16 +++++++------- .../api_resources/structure/test_run_async.py | 16 +++++++------- 7 files changed, 47 insertions(+), 49 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0dbcbc11..651c6c04 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/structify%2Fstructify-2988f1610b40c428d0b457b5b596f5ca80d371daf3e99ef0317dad31d8f2dfa3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/structify%2Fstructify-aa1bdd07a9fcf09044a5dae55e26b5bf3fcd742b8f3a86e1e815f67c45cf5030.yml diff --git a/src/structify/resources/structure/run.py b/src/structify/resources/structure/run.py index 1adfde3e..1ff3c950 100644 --- a/src/structify/resources/structure/run.py +++ b/src/structify/resources/structure/run.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Optional, overload -from typing_extensions import Literal import httpx @@ -45,7 +44,7 @@ def create( dataset_name: str, text: run_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -78,7 +77,7 @@ def create( dataset_name: str, document: run_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -111,7 +110,7 @@ def create( dataset_name: str, web: run_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -144,7 +143,7 @@ def create( dataset_name: str, sec_filing: run_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -179,7 +178,7 @@ def create( dataset_name: str, text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -235,7 +234,7 @@ async def create( dataset_name: str, text: run_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -268,7 +267,7 @@ async def create( dataset_name: str, document: run_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -301,7 +300,7 @@ async def create( dataset_name: str, web: run_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -334,7 +333,7 @@ async def create( dataset_name: str, sec_filing: run_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -369,7 +368,7 @@ async def create( dataset_name: str, text: run_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, diff --git a/src/structify/resources/structure/run_async.py b/src/structify/resources/structure/run_async.py index 84cb7676..1984aad4 100644 --- a/src/structify/resources/structure/run_async.py +++ b/src/structify/resources/structure/run_async.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Optional, overload -from typing_extensions import Literal import httpx @@ -45,7 +44,7 @@ def create( dataset_name: str, text: run_async_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -77,7 +76,7 @@ def create( dataset_name: str, document: run_async_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -109,7 +108,7 @@ def create( dataset_name: str, web: run_async_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -141,7 +140,7 @@ def create( dataset_name: str, sec_filing: run_async_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -175,7 +174,7 @@ def create( dataset_name: str, text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -231,7 +230,7 @@ async def create( dataset_name: str, text: run_async_create_params.Variant0Text, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -263,7 +262,7 @@ async def create( dataset_name: str, document: run_async_create_params.Variant1Document, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -295,7 +294,7 @@ async def create( dataset_name: str, web: run_async_create_params.Variant2Web, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -327,7 +326,7 @@ async def create( dataset_name: str, sec_filing: run_async_create_params.Variant3SecFiling, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, @@ -361,7 +360,7 @@ async def create( dataset_name: str, text: run_async_create_params.Variant0Text | NotGiven = NOT_GIVEN, custom_instruction: Optional[str] | NotGiven = NOT_GIVEN, - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] | 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, diff --git a/src/structify/types/structure/run_async_create_params.py b/src/structify/types/structure/run_async_create_params.py index c7bdcbb4..c56a5dad 100644 --- a/src/structify/types/structure/run_async_create_params.py +++ b/src/structify/types/structure/run_async_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Optional -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -27,7 +27,7 @@ class Variant0(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant0Text(TypedDict, total=False): @@ -41,7 +41,7 @@ class Variant1(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant1Document(TypedDict, total=False): @@ -55,7 +55,7 @@ class Variant2(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant2Web(TypedDict, total=False): @@ -71,7 +71,7 @@ class Variant3(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant3SecFiling(TypedDict, total=False): diff --git a/src/structify/types/structure/run_create_params.py b/src/structify/types/structure/run_create_params.py index aca5c0c1..62f559d1 100644 --- a/src/structify/types/structure/run_create_params.py +++ b/src/structify/types/structure/run_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Optional -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -27,7 +27,7 @@ class Variant0(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant0Text(TypedDict, total=False): @@ -41,7 +41,7 @@ class Variant1(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant1Document(TypedDict, total=False): @@ -55,7 +55,7 @@ class Variant2(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant2Web(TypedDict, total=False): @@ -71,7 +71,7 @@ class Variant3(TypedDict, total=False): custom_instruction: Optional[str] - llm: Optional[Literal["Gpt4V", "Structify", "Human"]] + llm: Optional[object] class Variant3SecFiling(TypedDict, total=False): diff --git a/tests/api_resources/structure/test_run.py b/tests/api_resources/structure/test_run.py index 3a265375..d9eaa000 100644 --- a/tests/api_resources/structure/test_run.py +++ b/tests/api_resources/structure/test_run.py @@ -30,7 +30,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -74,7 +74,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -121,7 +121,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No "starting_website": "string", }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -169,7 +169,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No "year": 0, }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -217,7 +217,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -261,7 +261,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "starting_website": "string", }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -356,7 +356,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "year": 0, }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run, path=["response"]) diff --git a/tests/api_resources/structure/test_run_async.py b/tests/api_resources/structure/test_run_async.py index 446926c8..9ecc154c 100644 --- a/tests/api_resources/structure/test_run_async.py +++ b/tests/api_resources/structure/test_run_async.py @@ -30,7 +30,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -74,7 +74,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -121,7 +121,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No "starting_website": "string", }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -169,7 +169,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No "year": 0, }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -217,7 +217,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn dataset_name="string", text={"text_content": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -261,7 +261,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn dataset_name="string", document={"path": "string"}, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "starting_website": "string", }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -356,7 +356,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "year": 0, }, custom_instruction="string", - llm="Gpt4V", + llm={}, ) assert_matches_type(object, run_async, path=["response"]) From 414a487fdc9851185a2517c96ab16fb8e6dfd854 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 16:58:02 +0000 Subject: [PATCH 3/4] feat(api): OpenAPI spec update via Stainless API (#4) --- .stats.yml | 2 +- api.md | 4 +- src/structify/resources/structure/run.py | 37 ++++++++++------- .../resources/structure/run_async.py | 37 ++++++++++------- src/structify/types/structure/__init__.py | 1 + src/structify/types/structure/llm.py | 7 ++++ .../structure/run_async_create_params.py | 17 ++++---- .../types/structure/run_create_params.py | 17 ++++---- tests/api_resources/structure/test_run.py | 40 +++++++++++++++---- .../api_resources/structure/test_run_async.py | 40 +++++++++++++++---- 10 files changed, 137 insertions(+), 65 deletions(-) create mode 100644 src/structify/types/structure/llm.py diff --git a/.stats.yml b/.stats.yml index 651c6c04..f264ff63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/api.md b/api.md index 8f7bd9d7..8bee1453 100644 --- a/api.md +++ b/api.md @@ -131,7 +131,7 @@ Methods: Types: ```python -from structify.types.structure import RunCreateResponse +from structify.types.structure import Llm, RunCreateResponse ``` Methods: @@ -143,7 +143,7 @@ Methods: Types: ```python -from structify.types.structure import RunAsyncCreateResponse +from structify.types.structure import Llm, RunAsyncCreateResponse ``` Methods: diff --git a/src/structify/resources/structure/run.py b/src/structify/resources/structure/run.py index 1ff3c950..f7987842 100644 --- a/src/structify/resources/structure/run.py +++ b/src/structify/resources/structure/run.py @@ -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"] @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, ), @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, ), diff --git a/src/structify/resources/structure/run_async.py b/src/structify/resources/structure/run_async.py index 1984aad4..cc340618 100644 --- a/src/structify/resources/structure/run_async.py +++ b/src/structify/resources/structure/run_async.py @@ -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"] @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, ), @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, ), diff --git a/src/structify/types/structure/__init__.py b/src/structify/types/structure/__init__.py index bb4ab5e5..607eb106 100644 --- a/src/structify/types/structure/__init__.py +++ b/src/structify/types/structure/__init__.py @@ -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 diff --git a/src/structify/types/structure/llm.py b/src/structify/types/structure/llm.py new file mode 100644 index 00000000..4f7ecaf9 --- /dev/null +++ b/src/structify/types/structure/llm.py @@ -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"] diff --git a/src/structify/types/structure/run_async_create_params.py b/src/structify/types/structure/run_async_create_params.py index c56a5dad..72e396ea 100644 --- a/src/structify/types/structure/run_async_create_params.py +++ b/src/structify/types/structure/run_async_create_params.py @@ -5,6 +5,7 @@ from typing import Union, Optional from typing_extensions import Required, Annotated, TypedDict +from .llm import Llm from ..._utils import PropertyInfo __all__ = [ @@ -23,12 +24,12 @@ class Variant0(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + text: Required[Annotated[Variant0Text, PropertyInfo(alias="Text")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant0Text(TypedDict, total=False): text_content: Required[str] @@ -37,12 +38,12 @@ class Variant0Text(TypedDict, total=False): class Variant1(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + document: Required[Annotated[Variant1Document, PropertyInfo(alias="Document")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant1Document(TypedDict, total=False): path: Required[str] @@ -51,12 +52,12 @@ class Variant1Document(TypedDict, total=False): class Variant2(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + web: Required[Annotated[Variant2Web, PropertyInfo(alias="Web")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant2Web(TypedDict, total=False): phrase: Required[str] @@ -67,12 +68,12 @@ class Variant2Web(TypedDict, total=False): class Variant3(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + sec_filing: Required[Annotated[Variant3SecFiling, PropertyInfo(alias="SECFiling")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant3SecFiling(TypedDict, total=False): accession_number: Optional[str] diff --git a/src/structify/types/structure/run_create_params.py b/src/structify/types/structure/run_create_params.py index 62f559d1..d3d765f0 100644 --- a/src/structify/types/structure/run_create_params.py +++ b/src/structify/types/structure/run_create_params.py @@ -5,6 +5,7 @@ from typing import Union, Optional from typing_extensions import Required, Annotated, TypedDict +from .llm import Llm from ..._utils import PropertyInfo __all__ = [ @@ -23,12 +24,12 @@ class Variant0(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + text: Required[Annotated[Variant0Text, PropertyInfo(alias="Text")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant0Text(TypedDict, total=False): text_content: Required[str] @@ -37,12 +38,12 @@ class Variant0Text(TypedDict, total=False): class Variant1(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + document: Required[Annotated[Variant1Document, PropertyInfo(alias="Document")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant1Document(TypedDict, total=False): path: Required[str] @@ -51,12 +52,12 @@ class Variant1Document(TypedDict, total=False): class Variant2(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + web: Required[Annotated[Variant2Web, PropertyInfo(alias="Web")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant2Web(TypedDict, total=False): phrase: Required[str] @@ -67,12 +68,12 @@ class Variant2Web(TypedDict, total=False): class Variant3(TypedDict, total=False): dataset_name: Required[str] + llm: Required[Llm] + sec_filing: Required[Annotated[Variant3SecFiling, PropertyInfo(alias="SECFiling")]] custom_instruction: Optional[str] - llm: Optional[object] - class Variant3SecFiling(TypedDict, total=False): accession_number: Optional[str] diff --git a/tests/api_resources/structure/test_run.py b/tests/api_resources/structure/test_run.py index d9eaa000..68f5e32b 100644 --- a/tests/api_resources/structure/test_run.py +++ b/tests/api_resources/structure/test_run.py @@ -20,6 +20,7 @@ class TestRun: def test_method_create_overload_1(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -28,9 +29,9 @@ def test_method_create_overload_1(self, client: Structify) -> None: def test_method_create_with_all_params_overload_1(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -38,6 +39,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No def test_raw_response_create_overload_1(self, client: Structify) -> None: response = client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) @@ -50,6 +52,7 @@ def test_raw_response_create_overload_1(self, client: Structify) -> None: def test_streaming_response_create_overload_1(self, client: Structify) -> None: with client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) as response: assert not response.is_closed @@ -64,6 +67,7 @@ def test_streaming_response_create_overload_1(self, client: Structify) -> None: def test_method_create_overload_2(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -72,9 +76,9 @@ def test_method_create_overload_2(self, client: Structify) -> None: def test_method_create_with_all_params_overload_2(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -82,6 +86,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No def test_raw_response_create_overload_2(self, client: Structify) -> None: response = client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) @@ -94,6 +99,7 @@ def test_raw_response_create_overload_2(self, client: Structify) -> None: def test_streaming_response_create_overload_2(self, client: Structify) -> None: with client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) as response: assert not response.is_closed @@ -108,6 +114,7 @@ def test_streaming_response_create_overload_2(self, client: Structify) -> None: def test_method_create_overload_3(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -116,12 +123,12 @@ def test_method_create_overload_3(self, client: Structify) -> None: def test_method_create_with_all_params_overload_3(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", web={ "phrase": "string", "starting_website": "string", }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -129,6 +136,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No def test_raw_response_create_overload_3(self, client: Structify) -> None: response = client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) @@ -141,6 +149,7 @@ def test_raw_response_create_overload_3(self, client: Structify) -> None: def test_streaming_response_create_overload_3(self, client: Structify) -> None: with client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) as response: assert not response.is_closed @@ -155,6 +164,7 @@ def test_streaming_response_create_overload_3(self, client: Structify) -> None: def test_method_create_overload_4(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) assert_matches_type(object, run, path=["response"]) @@ -163,13 +173,13 @@ def test_method_create_overload_4(self, client: Structify) -> None: def test_method_create_with_all_params_overload_4(self, client: Structify) -> None: run = client.structure.run.create( dataset_name="string", + llm="Gpt4V", sec_filing={ "accession_number": "string", "quarter": 0, "year": 0, }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -177,6 +187,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No def test_raw_response_create_overload_4(self, client: Structify) -> None: response = client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) @@ -189,6 +200,7 @@ def test_raw_response_create_overload_4(self, client: Structify) -> None: def test_streaming_response_create_overload_4(self, client: Structify) -> None: with client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) as response: assert not response.is_closed @@ -207,6 +219,7 @@ class TestAsyncRun: async def test_method_create_overload_1(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -215,9 +228,9 @@ async def test_method_create_overload_1(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_1(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -225,6 +238,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) @@ -237,6 +251,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncStructify async def test_streaming_response_create_overload_1(self, async_client: AsyncStructify) -> None: async with async_client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) as response: assert not response.is_closed @@ -251,6 +266,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncStr async def test_method_create_overload_2(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -259,9 +275,9 @@ async def test_method_create_overload_2(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_2(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -269,6 +285,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) @@ -281,6 +298,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncStructify async def test_streaming_response_create_overload_2(self, async_client: AsyncStructify) -> None: async with async_client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) as response: assert not response.is_closed @@ -295,6 +313,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncStr async def test_method_create_overload_3(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) assert_matches_type(object, run, path=["response"]) @@ -303,12 +322,12 @@ async def test_method_create_overload_3(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_3(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", web={ "phrase": "string", "starting_website": "string", }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -316,6 +335,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_create_overload_3(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) @@ -328,6 +348,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncStructify async def test_streaming_response_create_overload_3(self, async_client: AsyncStructify) -> None: async with async_client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) as response: assert not response.is_closed @@ -342,6 +363,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncStr async def test_method_create_overload_4(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) assert_matches_type(object, run, path=["response"]) @@ -350,13 +372,13 @@ async def test_method_create_overload_4(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_4(self, async_client: AsyncStructify) -> None: run = await async_client.structure.run.create( dataset_name="string", + llm="Gpt4V", sec_filing={ "accession_number": "string", "quarter": 0, "year": 0, }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run, path=["response"]) @@ -364,6 +386,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_create_overload_4(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run.with_raw_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) @@ -376,6 +399,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncStructify async def test_streaming_response_create_overload_4(self, async_client: AsyncStructify) -> None: async with async_client.structure.run.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) as response: assert not response.is_closed diff --git a/tests/api_resources/structure/test_run_async.py b/tests/api_resources/structure/test_run_async.py index 9ecc154c..852f2a16 100644 --- a/tests/api_resources/structure/test_run_async.py +++ b/tests/api_resources/structure/test_run_async.py @@ -20,6 +20,7 @@ class TestRunAsync: def test_method_create_overload_1(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -28,9 +29,9 @@ def test_method_create_overload_1(self, client: Structify) -> None: def test_method_create_with_all_params_overload_1(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -38,6 +39,7 @@ def test_method_create_with_all_params_overload_1(self, client: Structify) -> No def test_raw_response_create_overload_1(self, client: Structify) -> None: response = client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) @@ -50,6 +52,7 @@ def test_raw_response_create_overload_1(self, client: Structify) -> None: def test_streaming_response_create_overload_1(self, client: Structify) -> None: with client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) as response: assert not response.is_closed @@ -64,6 +67,7 @@ def test_streaming_response_create_overload_1(self, client: Structify) -> None: def test_method_create_overload_2(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -72,9 +76,9 @@ def test_method_create_overload_2(self, client: Structify) -> None: def test_method_create_with_all_params_overload_2(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -82,6 +86,7 @@ def test_method_create_with_all_params_overload_2(self, client: Structify) -> No def test_raw_response_create_overload_2(self, client: Structify) -> None: response = client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) @@ -94,6 +99,7 @@ def test_raw_response_create_overload_2(self, client: Structify) -> None: def test_streaming_response_create_overload_2(self, client: Structify) -> None: with client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) as response: assert not response.is_closed @@ -108,6 +114,7 @@ def test_streaming_response_create_overload_2(self, client: Structify) -> None: def test_method_create_overload_3(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -116,12 +123,12 @@ def test_method_create_overload_3(self, client: Structify) -> None: def test_method_create_with_all_params_overload_3(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", web={ "phrase": "string", "starting_website": "string", }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -129,6 +136,7 @@ def test_method_create_with_all_params_overload_3(self, client: Structify) -> No def test_raw_response_create_overload_3(self, client: Structify) -> None: response = client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) @@ -141,6 +149,7 @@ def test_raw_response_create_overload_3(self, client: Structify) -> None: def test_streaming_response_create_overload_3(self, client: Structify) -> None: with client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) as response: assert not response.is_closed @@ -155,6 +164,7 @@ def test_streaming_response_create_overload_3(self, client: Structify) -> None: def test_method_create_overload_4(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -163,13 +173,13 @@ def test_method_create_overload_4(self, client: Structify) -> None: def test_method_create_with_all_params_overload_4(self, client: Structify) -> None: run_async = client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", sec_filing={ "accession_number": "string", "quarter": 0, "year": 0, }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -177,6 +187,7 @@ def test_method_create_with_all_params_overload_4(self, client: Structify) -> No def test_raw_response_create_overload_4(self, client: Structify) -> None: response = client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) @@ -189,6 +200,7 @@ def test_raw_response_create_overload_4(self, client: Structify) -> None: def test_streaming_response_create_overload_4(self, client: Structify) -> None: with client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) as response: assert not response.is_closed @@ -207,6 +219,7 @@ class TestAsyncRunAsync: async def test_method_create_overload_1(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -215,9 +228,9 @@ async def test_method_create_overload_1(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_1(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -225,6 +238,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn async def test_raw_response_create_overload_1(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) @@ -237,6 +251,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncStructify async def test_streaming_response_create_overload_1(self, async_client: AsyncStructify) -> None: async with async_client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", text={"text_content": "string"}, ) as response: assert not response.is_closed @@ -251,6 +266,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncStr async def test_method_create_overload_2(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -259,9 +275,9 @@ async def test_method_create_overload_2(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_2(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -269,6 +285,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) @@ -281,6 +298,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncStructify async def test_streaming_response_create_overload_2(self, async_client: AsyncStructify) -> None: async with async_client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", document={"path": "string"}, ) as response: assert not response.is_closed @@ -295,6 +313,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncStr async def test_method_create_overload_3(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) assert_matches_type(object, run_async, path=["response"]) @@ -303,12 +322,12 @@ async def test_method_create_overload_3(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_3(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", web={ "phrase": "string", "starting_website": "string", }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -316,6 +335,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn async def test_raw_response_create_overload_3(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) @@ -328,6 +348,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncStructify async def test_streaming_response_create_overload_3(self, async_client: AsyncStructify) -> None: async with async_client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", web={"phrase": "string"}, ) as response: assert not response.is_closed @@ -342,6 +363,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncStr async def test_method_create_overload_4(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -350,13 +372,13 @@ async def test_method_create_overload_4(self, async_client: AsyncStructify) -> N async def test_method_create_with_all_params_overload_4(self, async_client: AsyncStructify) -> None: run_async = await async_client.structure.run_async.create( dataset_name="string", + llm="Gpt4V", sec_filing={ "accession_number": "string", "quarter": 0, "year": 0, }, custom_instruction="string", - llm={}, ) assert_matches_type(object, run_async, path=["response"]) @@ -364,6 +386,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn async def test_raw_response_create_overload_4(self, async_client: AsyncStructify) -> None: response = await async_client.structure.run_async.with_raw_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) @@ -376,6 +399,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncStructify async def test_streaming_response_create_overload_4(self, async_client: AsyncStructify) -> None: async with async_client.structure.run_async.with_streaming_response.create( dataset_name="string", + llm="Gpt4V", sec_filing={}, ) as response: assert not response.is_closed From d3830e26261b24f2d3a0a6534ca67be2d848d6f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 16:58:12 +0000 Subject: [PATCH 4/4] release: 0.1.0-alpha.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/structify/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c3483..f14b480a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..b6af62ca --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +## 0.1.0-alpha.2 (2024-05-14) + +Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/StructifyAI/structify-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#2](https://github.com/StructifyAI/structify-python/issues/2)) ([539ce38](https://github.com/StructifyAI/structify-python/commit/539ce383d231bbfd44e128d0c0d856a0841a0a73)) +* **api:** OpenAPI spec update via Stainless API ([#4](https://github.com/StructifyAI/structify-python/issues/4)) ([414a487](https://github.com/StructifyAI/structify-python/commit/414a487fdc9851185a2517c96ab16fb8e6dfd854)) +* **api:** update via SDK Studio ([#3](https://github.com/StructifyAI/structify-python/issues/3)) ([4dee8c2](https://github.com/StructifyAI/structify-python/commit/4dee8c279ef8d97cba2857d55cded4cc77b2e9f6)) + + +### Chores + +* update SDK settings ([a31ca18](https://github.com/StructifyAI/structify-python/commit/a31ca1852c90d1e50d9d1856c9d6ca9e98ce6f58)) diff --git a/pyproject.toml b/pyproject.toml index f5035834..5ea569f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "structifyai" -version = "0.1.0-alpha.1" +version = "0.1.0-alpha.2" description = "The official Python library for the structify API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/structify/_version.py b/src/structify/_version.py index bcba97cf..4b40ea7d 100644 --- a/src/structify/_version.py +++ b/src/structify/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "structify" -__version__ = "0.1.0-alpha.1" # x-release-please-version +__version__ = "0.1.0-alpha.2" # x-release-please-version