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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-5d4722a755a01f8917b975ab7e6528e590f53d09891baac758abba1e28df15d1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-a552977d2b7ab16d16020c083420cadbca97d5766ea0df7b49b3ed275626b995.yml
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ client = PromptFoundry(
)

model_parameters = client.prompts.get_parameters(
"1212121",
id="1212121",
variables={"hello": "world"},
)
print(model_parameters.parameters)
Expand Down Expand Up @@ -61,7 +61,7 @@ client = AsyncPromptFoundry(

async def main() -> None:
model_parameters = await client.prompts.get_parameters(
"1212121",
id="1212121",
variables={"hello": "world"},
)
print(model_parameters.parameters)
Expand Down Expand Up @@ -98,7 +98,7 @@ client = PromptFoundry()

try:
client.prompts.get_parameters(
"1212121",
id="1212121",
)
except prompt_foundry_python_sdk.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -143,7 +143,7 @@ client = PromptFoundry(

# Or, configure per-request:
client.with_options(max_retries=5).prompts.get_parameters(
"1212121",
id="1212121",
)
```

Expand All @@ -168,7 +168,7 @@ client = PromptFoundry(

# Override per-request:
client.with_options(timeout=5.0).prompts.get_parameters(
"1212121",
id="1212121",
)
```

Expand Down Expand Up @@ -209,7 +209,7 @@ from prompt_foundry_python_sdk import PromptFoundry

client = PromptFoundry()
response = client.prompts.with_raw_response.get_parameters(
"1212121",
id="1212121",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -229,7 +229,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.prompts.with_streaming_response.get_parameters(
"1212121",
id="1212121",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import (
make_request_options,
)
from .._base_client import make_request_options
from ..types.evaluation_assertion import EvaluationAssertion
from ..types.evaluation_assertion_list_response import EvaluationAssertionListResponse
from ..types.evaluation_assertion_delete_response import EvaluationAssertionDeleteResponse
Expand Down
4 changes: 1 addition & 3 deletions src/prompt_foundry_python_sdk/resources/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import (
make_request_options,
)
from .._base_client import make_request_options
from ..types.evaluation import Evaluation
from ..types.evaluation_list_response import EvaluationListResponse
from ..types.evaluation_delete_response import EvaluationDeleteResponse
Expand Down
4 changes: 1 addition & 3 deletions src/prompt_foundry_python_sdk/resources/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import (
make_request_options,
)
from .._base_client import make_request_options
from ..types.model_parameters import ModelParameters
from ..types.prompt_configuration import PromptConfiguration
from ..types.prompt_list_response import PromptListResponse
Expand Down
4 changes: 1 addition & 3 deletions src/prompt_foundry_python_sdk/resources/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
async_to_streamed_response_wrapper,
)
from ..types.tool import Tool
from .._base_client import (
make_request_options,
)
from .._base_client import make_request_options
from ..types.tool_list_response import ToolListResponse
from ..types.tool_delete_response import ToolDeleteResponse

Expand Down
128 changes: 64 additions & 64 deletions tests/api_resources/test_evaluation_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ class TestEvaluationAssertions:
@parametrize
def test_method_create(self, client: PromptFoundry) -> None:
evaluation_assertion = client.evaluation_assertions.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)
assert_matches_type(EvaluationAssertion, evaluation_assertion, path=["response"])

@parametrize
def test_raw_response_create(self, client: PromptFoundry) -> None:
response = client.evaluation_assertions.with_raw_response.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand All @@ -50,10 +50,10 @@ def test_raw_response_create(self, client: PromptFoundry) -> None:
@parametrize
def test_streaming_response_create(self, client: PromptFoundry) -> None:
with client.evaluation_assertions.with_streaming_response.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
) as response:
assert not response.is_closed
Expand All @@ -67,23 +67,23 @@ def test_streaming_response_create(self, client: PromptFoundry) -> None:
@parametrize
def test_method_update(self, client: PromptFoundry) -> None:
evaluation_assertion = client.evaluation_assertions.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)
assert_matches_type(EvaluationAssertion, evaluation_assertion, path=["response"])

@parametrize
def test_raw_response_update(self, client: PromptFoundry) -> None:
response = client.evaluation_assertions.with_raw_response.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand All @@ -95,11 +95,11 @@ def test_raw_response_update(self, client: PromptFoundry) -> None:
@parametrize
def test_streaming_response_update(self, client: PromptFoundry) -> None:
with client.evaluation_assertions.with_streaming_response.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
) as response:
assert not response.is_closed
Expand All @@ -114,11 +114,11 @@ def test_streaming_response_update(self, client: PromptFoundry) -> None:
def test_path_params_update(self, client: PromptFoundry) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
client.evaluation_assertions.with_raw_response.update(
"",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand Down Expand Up @@ -237,21 +237,21 @@ class TestAsyncEvaluationAssertions:
@parametrize
async def test_method_create(self, async_client: AsyncPromptFoundry) -> None:
evaluation_assertion = await async_client.evaluation_assertions.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)
assert_matches_type(EvaluationAssertion, evaluation_assertion, path=["response"])

@parametrize
async def test_raw_response_create(self, async_client: AsyncPromptFoundry) -> None:
response = await async_client.evaluation_assertions.with_raw_response.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand All @@ -263,10 +263,10 @@ async def test_raw_response_create(self, async_client: AsyncPromptFoundry) -> No
@parametrize
async def test_streaming_response_create(self, async_client: AsyncPromptFoundry) -> None:
async with async_client.evaluation_assertions.with_streaming_response.create(
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
) as response:
assert not response.is_closed
Expand All @@ -280,23 +280,23 @@ async def test_streaming_response_create(self, async_client: AsyncPromptFoundry)
@parametrize
async def test_method_update(self, async_client: AsyncPromptFoundry) -> None:
evaluation_assertion = await async_client.evaluation_assertions.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)
assert_matches_type(EvaluationAssertion, evaluation_assertion, path=["response"])

@parametrize
async def test_raw_response_update(self, async_client: AsyncPromptFoundry) -> None:
response = await async_client.evaluation_assertions.with_raw_response.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand All @@ -308,11 +308,11 @@ async def test_raw_response_update(self, async_client: AsyncPromptFoundry) -> No
@parametrize
async def test_streaming_response_update(self, async_client: AsyncPromptFoundry) -> None:
async with async_client.evaluation_assertions.with_streaming_response.update(
"1212121",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="1212121",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
) as response:
assert not response.is_closed
Expand All @@ -327,11 +327,11 @@ async def test_streaming_response_update(self, async_client: AsyncPromptFoundry)
async def test_path_params_update(self, async_client: AsyncPromptFoundry) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
await async_client.evaluation_assertions.with_raw_response.update(
"",
evaluation_id="string",
json_path="string",
target_value="string",
tool_name="string",
id="",
evaluation_id="evaluationId",
json_path="jsonPath",
target_value="targetValue",
tool_name="toolName",
type="CONTAINS",
)

Expand Down
Loading