Skip to content

Commit 4a1eecf

Browse files
fix lint
1 parent 0a34ca0 commit 4a1eecf

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,7 @@ prompt_payload = Prompt(
609609
# Sync
610610
saved_prompt = client.prompts.save(prompt_url, prompt=prompt_payload)
611611
# Async
612-
saved_prompt = await async_client.prompts.save(
613-
prompt_url, prompt=prompt_payload
614-
)
612+
saved_prompt = await async_client.prompts.save(prompt_url, prompt=prompt_payload)
615613
```
616614

617615
As a result, you will receive a `PromptMetadata` object:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ exclude = [
6363

6464
[tool.black]
6565
line-length = 80
66+
target-version = ["py310"]
6667
exclude = '''
6768
/(
6869
\.git

tests/integration/test_async_prompts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ async def _delete_if_exists(async_client: AsyncDial, url: str) -> None:
1818
pass
1919

2020

21-
def _create_prompt(url: str, content: str = "You are a helpful assistant.") -> Prompt:
21+
def _create_prompt(
22+
url: str, content: str = "You are a helpful assistant."
23+
) -> Prompt:
2224
path_parts = url.split("/")
2325
name = path_parts[-1]
2426
folder_id = "/".join(path_parts[2:-1])

tests/integration/test_sync_prompts.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def _delete_if_exists(sync_client: Dial, url: str) -> None:
1818
pass
1919

2020

21-
def _create_prompt(url: str, content: str = "You are a helpful assistant.") -> Prompt:
21+
def _create_prompt(
22+
url: str, content: str = "You are a helpful assistant."
23+
) -> Prompt:
2224
path_parts = url.split("/")
2325
name = path_parts[-1]
2426
folder_id = "/".join(path_parts[2:-1])
@@ -34,7 +36,9 @@ def _get_etag_or_skip(metadata: PromptMetadata) -> str:
3436

3537
def test_save_get_delete(sync_client: Dial):
3638
prompt_name = f"test-prompt-{uuid.uuid4()}"
37-
prompt_url = str(sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}")
39+
prompt_url = str(
40+
sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}"
41+
)
3842
_delete_if_exists(sync_client, prompt_url)
3943

4044
save_result = sync_client.prompts.save(
@@ -56,7 +60,9 @@ def test_save_get_delete(sync_client: Dial):
5660

5761
def test_save_with_etag_if_match(sync_client: Dial):
5862
prompt_name = f"test-prompt-{uuid.uuid4()}"
59-
prompt_url = str(sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}")
63+
prompt_url = str(
64+
sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}"
65+
)
6066
_delete_if_exists(sync_client, prompt_url)
6167

6268
first_save = sync_client.prompts.save(
@@ -81,7 +87,9 @@ def test_save_with_etag_if_match(sync_client: Dial):
8187

8288
def test_save_with_etag_if_none_match(sync_client: Dial):
8389
prompt_name = f"test-prompt-{uuid.uuid4()}"
84-
prompt_url = str(sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}")
90+
prompt_url = str(
91+
sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}"
92+
)
8593
_delete_if_exists(sync_client, prompt_url)
8694

8795
sync_client.prompts.save(
@@ -100,7 +108,9 @@ def test_save_with_etag_if_none_match(sync_client: Dial):
100108

101109
def test_delete_with_etag(sync_client: Dial):
102110
prompt_name = f"test-prompt-{uuid.uuid4()}"
103-
prompt_url = str(sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}")
111+
prompt_url = str(
112+
sync_client.my_prompts_home() / f"{PROMPT_FOLDER}/{prompt_name}"
113+
)
104114
_delete_if_exists(sync_client, prompt_url)
105115

106116
save_result = sync_client.prompts.save(

0 commit comments

Comments
 (0)