Skip to content

Commit eee6b78

Browse files
committed
formatting fixes
1 parent 79ea205 commit eee6b78

6 files changed

Lines changed: 47 additions & 46 deletions

File tree

src/runloop_api_client/sdk/agent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class Agent:
1919
including retrieving agent information.
2020
2121
Example:
22-
>>> agent = runloop.agent.create_from_npm(
23-
... name="my-agent",
24-
... package_name="@runloop/example-agent"
25-
... )
22+
>>> agent = runloop.agent.create_from_npm(name="my-agent", package_name="@runloop/example-agent")
2623
>>> info = agent.get_info()
2724
>>> print(info.name)
2825
"""

src/runloop_api_client/sdk/async_.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ async def list(self, **params: Unpack[SDKScorerListParams]) -> list[AsyncScorer]
545545
"""
546546
page = await self._client.scenarios.scorers.list(**params)
547547
return [AsyncScorer(self._client, item.id) async for item in page]
548-
548+
549+
549550
class AsyncAgentOps:
550551
"""High-level async manager for creating and managing agents.
551552
@@ -555,15 +556,10 @@ class AsyncAgentOps:
555556
Example:
556557
>>> runloop = AsyncRunloopSDK()
557558
>>> # Create agent from NPM package
558-
>>> agent = await runloop.agent.create_from_npm(
559-
... name="my-agent",
560-
... package_name="@runloop/example-agent"
561-
... )
559+
>>> agent = await runloop.agent.create_from_npm(name="my-agent", package_name="@runloop/example-agent")
562560
>>> # Create agent from Git repository
563561
>>> agent = await runloop.agent.create_from_git(
564-
... name="git-agent",
565-
... repository="https://github.com/user/agent-repo",
566-
... ref="main"
562+
... name="git-agent", repository="https://github.com/user/agent-repo", ref="main"
567563
... )
568564
>>> # List all agents
569565
>>> agents = await runloop.agent.list(limit=10)
@@ -617,7 +613,9 @@ async def create_from_npm(
617613
:raises ValueError: If 'source' is provided in params
618614
"""
619615
if "source" in params:
620-
raise ValueError("Cannot specify 'source' when using create_from_npm(); source is automatically set to npm configuration")
616+
raise ValueError(
617+
"Cannot specify 'source' when using create_from_npm(); source is automatically set to npm configuration"
618+
)
621619

622620
npm_config: dict = {"package_name": package_name}
623621
if npm_version is not None:
@@ -657,7 +655,9 @@ async def create_from_pip(
657655
:raises ValueError: If 'source' is provided in params
658656
"""
659657
if "source" in params:
660-
raise ValueError("Cannot specify 'source' when using create_from_pip(); source is automatically set to pip configuration")
658+
raise ValueError(
659+
"Cannot specify 'source' when using create_from_pip(); source is automatically set to pip configuration"
660+
)
661661

662662
pip_config: dict = {"package_name": package_name}
663663
if pip_version is not None:
@@ -694,7 +694,9 @@ async def create_from_git(
694694
:raises ValueError: If 'source' is provided in params
695695
"""
696696
if "source" in params:
697-
raise ValueError("Cannot specify 'source' when using create_from_git(); source is automatically set to git configuration")
697+
raise ValueError(
698+
"Cannot specify 'source' when using create_from_git(); source is automatically set to git configuration"
699+
)
698700

699701
git_config: dict = {"repository": repository}
700702
if ref is not None:
@@ -726,7 +728,9 @@ async def create_from_object(
726728
:raises ValueError: If 'source' is provided in params
727729
"""
728730
if "source" in params:
729-
raise ValueError("Cannot specify 'source' when using create_from_object(); source is automatically set to object configuration")
731+
raise ValueError(
732+
"Cannot specify 'source' when using create_from_object(); source is automatically set to object configuration"
733+
)
730734

731735
object_config: dict = {"object_id": object_id}
732736
if agent_setup is not None:

src/runloop_api_client/sdk/async_agent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class AsyncAgent:
1919
including retrieving agent information.
2020
2121
Example:
22-
>>> agent = await runloop.agent.create_from_npm(
23-
... name="my-agent",
24-
... package_name="@runloop/example-agent"
25-
... )
22+
>>> agent = await runloop.agent.create_from_npm(name="my-agent", package_name="@runloop/example-agent")
2623
>>> info = await agent.get_info()
2724
>>> print(info.name)
2825
"""

src/runloop_api_client/sdk/sync.py

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ def list(self, **params: Unpack[SDKScorerListParams]) -> list[Scorer]:
541541
page = self._client.scenarios.scorers.list(**params)
542542
return [Scorer(self._client, item.id) for item in page]
543543

544-
544+
545545
class AgentOps:
546546
"""High-level manager for creating and managing agents.
547547
@@ -551,15 +551,10 @@ class AgentOps:
551551
Example:
552552
>>> runloop = RunloopSDK()
553553
>>> # Create agent from NPM package
554-
>>> agent = runloop.agent.create_from_npm(
555-
... name="my-agent",
556-
... package_name="@runloop/example-agent"
557-
... )
554+
>>> agent = runloop.agent.create_from_npm(name="my-agent", package_name="@runloop/example-agent")
558555
>>> # Create agent from Git repository
559556
>>> agent = runloop.agent.create_from_git(
560-
... name="git-agent",
561-
... repository="https://github.com/user/agent-repo",
562-
... ref="main"
557+
... name="git-agent", repository="https://github.com/user/agent-repo", ref="main"
563558
... )
564559
>>> # List all agents
565560
>>> agents = runloop.agent.list(limit=10)
@@ -601,9 +596,7 @@ def create_from_npm(
601596
602597
Example:
603598
>>> agent = runloop.agent.create_from_npm(
604-
... name="my-npm-agent",
605-
... package_name="@runloop/example-agent",
606-
... npm_version="^1.0.0"
599+
... name="my-npm-agent", package_name="@runloop/example-agent", npm_version="^1.0.0"
607600
... )
608601
609602
:param package_name: NPM package name
@@ -620,7 +613,9 @@ def create_from_npm(
620613
:raises ValueError: If 'source' is provided in params
621614
"""
622615
if "source" in params:
623-
raise ValueError("Cannot specify 'source' when using create_from_npm(); source is automatically set to npm configuration")
616+
raise ValueError(
617+
"Cannot specify 'source' when using create_from_npm(); source is automatically set to npm configuration"
618+
)
624619

625620
npm_config: dict = {"package_name": package_name}
626621
if npm_version is not None:
@@ -648,9 +643,7 @@ def create_from_pip(
648643
649644
Example:
650645
>>> agent = runloop.agent.create_from_pip(
651-
... name="my-pip-agent",
652-
... package_name="runloop-example-agent",
653-
... pip_version=">=1.0.0"
646+
... name="my-pip-agent", package_name="runloop-example-agent", pip_version=">=1.0.0"
654647
... )
655648
656649
:param package_name: Pip package name
@@ -667,7 +660,9 @@ def create_from_pip(
667660
:raises ValueError: If 'source' is provided in params
668661
"""
669662
if "source" in params:
670-
raise ValueError("Cannot specify 'source' when using create_from_pip(); source is automatically set to pip configuration")
663+
raise ValueError(
664+
"Cannot specify 'source' when using create_from_pip(); source is automatically set to pip configuration"
665+
)
671666

672667
pip_config: dict = {"package_name": package_name}
673668
if pip_version is not None:
@@ -697,7 +692,7 @@ def create_from_git(
697692
... name="my-git-agent",
698693
... repository="https://github.com/user/agent-repo",
699694
... ref="main",
700-
... agent_setup=["npm install", "npm run build"]
695+
... agent_setup=["npm install", "npm run build"],
701696
... )
702697
703698
:param repository: Git repository URL
@@ -712,7 +707,9 @@ def create_from_git(
712707
:raises ValueError: If 'source' is provided in params
713708
"""
714709
if "source" in params:
715-
raise ValueError("Cannot specify 'source' when using create_from_git(); source is automatically set to git configuration")
710+
raise ValueError(
711+
"Cannot specify 'source' when using create_from_git(); source is automatically set to git configuration"
712+
)
716713

717714
git_config: dict = {"repository": repository}
718715
if ref is not None:
@@ -739,9 +736,7 @@ def create_from_object(
739736
>>> obj = runloop.storage_object.upload_from_dir("./my-agent")
740737
>>> # Then create agent from the object
741738
>>> agent = runloop.agent.create_from_object(
742-
... name="my-object-agent",
743-
... object_id=obj.id,
744-
... agent_setup=["chmod +x setup.sh", "./setup.sh"]
739+
... name="my-object-agent", object_id=obj.id, agent_setup=["chmod +x setup.sh", "./setup.sh"]
745740
... )
746741
747742
:param object_id: Storage object ID
@@ -754,7 +749,9 @@ def create_from_object(
754749
:raises ValueError: If 'source' is provided in params
755750
"""
756751
if "source" in params:
757-
raise ValueError("Cannot specify 'source' when using create_from_object(); source is automatically set to object configuration")
752+
raise ValueError(
753+
"Cannot specify 'source' when using create_from_object(); source is automatically set to object configuration"
754+
)
758755

759756
object_config: dict = {"object_id": object_id}
760757
if agent_setup is not None:

tests/sdk/test_async_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ async def async_iter():
730730
assert scorers[1].id == "scorer_002"
731731
mock_async_client.scenarios.scorers.list.assert_awaited_once()
732732

733-
733+
734734
class TestAsyncAgentClient:
735735
"""Tests for AsyncAgentClient class."""
736736

tests/smoketests/sdk/test_async_agent.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,15 @@ async def test_list_multiple_agents(self, async_sdk_client: AsyncRunloopSDK) ->
120120
}
121121

122122
# Create multiple agents
123-
agent1 = await async_sdk_client.agent.create(name=unique_name("sdk-async-agent-test-list-1"), source=source_config)
124-
agent2 = await async_sdk_client.agent.create(name=unique_name("sdk-async-agent-test-list-2"), source=source_config)
125-
agent3 = await async_sdk_client.agent.create(name=unique_name("sdk-async-agent-test-list-3"), source=source_config)
123+
agent1 = await async_sdk_client.agent.create(
124+
name=unique_name("sdk-async-agent-test-list-1"), source=source_config
125+
)
126+
agent2 = await async_sdk_client.agent.create(
127+
name=unique_name("sdk-async-agent-test-list-2"), source=source_config
128+
)
129+
agent3 = await async_sdk_client.agent.create(
130+
name=unique_name("sdk-async-agent-test-list-3"), source=source_config
131+
)
126132

127133
try:
128134
# List agents

0 commit comments

Comments
 (0)