applied-cli 0.5.65__tar.gz → 0.5.67__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {applied_cli-0.5.65 → applied_cli-0.5.67}/PKG-INFO +1 -1
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/__init__.py +1 -1
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/client.py +13 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/tools.py +47 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/PKG-INFO +1 -1
- {applied_cli-0.5.65 → applied_cli-0.5.67}/pyproject.toml +1 -1
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_benchmark_scenario_tools.py +3 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/README.md +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/agent_scoped_flows.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/cli.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/conversation_lookup.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/conversations.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/credentials.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/flow_helpers.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli/formatters.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/SOURCES.txt +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/dependency_links.txt +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/entry_points.txt +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/requires.txt +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/applied_cli.egg-info/top_level.txt +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/setup.cfg +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_agent_scoped_flows.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_audit_tools.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_cli.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_client.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_conversation_tools.py +0 -0
- {applied_cli-0.5.65 → applied_cli-0.5.67}/tests/test_flow_tools.py +0 -0
|
@@ -1879,11 +1879,20 @@ class AppliedClient:
|
|
|
1879
1879
|
"""Update a scenario run's properties (ratings, feedback, etc.)."""
|
|
1880
1880
|
return await self._request("PATCH", f"/v1/scenario-runs/{run_id}/", body=kwargs)
|
|
1881
1881
|
|
|
1882
|
+
async def delete_scenario(self, scenario_id: str) -> None:
|
|
1883
|
+
"""Delete a scenario."""
|
|
1884
|
+
await self._request("DELETE", f"/v1/conversation-scenarios/{scenario_id}/")
|
|
1885
|
+
|
|
1886
|
+
async def delete_scenario_run(self, run_id: str) -> None:
|
|
1887
|
+
"""Delete a scenario run."""
|
|
1888
|
+
await self._request("DELETE", f"/v1/scenario-runs/{run_id}/")
|
|
1889
|
+
|
|
1882
1890
|
async def bulk_run_scenarios(
|
|
1883
1891
|
self,
|
|
1884
1892
|
scenario_ids: list[str] | None = None,
|
|
1885
1893
|
benchmark_id: str | None = None,
|
|
1886
1894
|
target_agent_id: str | None = None,
|
|
1895
|
+
contact_override: dict | None = None,
|
|
1887
1896
|
) -> dict:
|
|
1888
1897
|
"""Run multiple scenarios at once.
|
|
1889
1898
|
|
|
@@ -1891,6 +1900,8 @@ class AppliedClient:
|
|
|
1891
1900
|
scenario_ids: List of scenario UUIDs to run
|
|
1892
1901
|
benchmark_id: Run all scenarios in this benchmark
|
|
1893
1902
|
target_agent_id: Optional agent to run against (for A/B testing)
|
|
1903
|
+
contact_override: Optional contact override dict, e.g.
|
|
1904
|
+
{"mode": "contact", "contact_id": "<uuid>"}
|
|
1894
1905
|
"""
|
|
1895
1906
|
body: dict[str, Any] = {}
|
|
1896
1907
|
if scenario_ids:
|
|
@@ -1899,6 +1910,8 @@ class AppliedClient:
|
|
|
1899
1910
|
body["benchmark_id"] = benchmark_id
|
|
1900
1911
|
if target_agent_id:
|
|
1901
1912
|
body["target_agent_id"] = target_agent_id
|
|
1913
|
+
if contact_override:
|
|
1914
|
+
body["contact_override"] = contact_override
|
|
1902
1915
|
return await self._request("POST", "/v1/scenario-runs/bulk-run/", body=body)
|
|
1903
1916
|
|
|
1904
1917
|
async def get_scenario_bulk_run_status(self, job_id: str) -> dict:
|
|
@@ -4785,6 +4785,28 @@ async def scenario_update(
|
|
|
4785
4785
|
return f"# Updated Scenario: {scenario.get('name')}\npass_status: {scenario.get('pass_status')}\ncsat_score: {scenario.get('csat_score')}"
|
|
4786
4786
|
|
|
4787
4787
|
|
|
4788
|
+
async def scenario_delete(
|
|
4789
|
+
client: AppliedClient,
|
|
4790
|
+
scenario_id: str,
|
|
4791
|
+
) -> str:
|
|
4792
|
+
"""
|
|
4793
|
+
Delete a scenario.
|
|
4794
|
+
|
|
4795
|
+
Args:
|
|
4796
|
+
client: Authenticated AppliedClient
|
|
4797
|
+
scenario_id: The scenario UUID
|
|
4798
|
+
|
|
4799
|
+
Returns:
|
|
4800
|
+
Success message
|
|
4801
|
+
"""
|
|
4802
|
+
try:
|
|
4803
|
+
await client.delete_scenario(scenario_id)
|
|
4804
|
+
except AppliedAPIError as e:
|
|
4805
|
+
return _format_error(e)
|
|
4806
|
+
|
|
4807
|
+
return f"Scenario {scenario_id} deleted successfully."
|
|
4808
|
+
|
|
4809
|
+
|
|
4788
4810
|
# -----------------------------------------------------------------------------
|
|
4789
4811
|
# Scenario Runs
|
|
4790
4812
|
# -----------------------------------------------------------------------------
|
|
@@ -4933,11 +4955,34 @@ async def scenario_run_update(
|
|
|
4933
4955
|
return f"# Updated Scenario Run\nid: {run.get('id')}\npass_status: {run.get('pass_status')}\ncsat_score: {run.get('csat_score')}"
|
|
4934
4956
|
|
|
4935
4957
|
|
|
4958
|
+
async def scenario_run_delete(
|
|
4959
|
+
client: AppliedClient,
|
|
4960
|
+
run_id: str,
|
|
4961
|
+
) -> str:
|
|
4962
|
+
"""
|
|
4963
|
+
Delete a scenario run.
|
|
4964
|
+
|
|
4965
|
+
Args:
|
|
4966
|
+
client: Authenticated AppliedClient
|
|
4967
|
+
run_id: The scenario run UUID
|
|
4968
|
+
|
|
4969
|
+
Returns:
|
|
4970
|
+
Success message
|
|
4971
|
+
"""
|
|
4972
|
+
try:
|
|
4973
|
+
await client.delete_scenario_run(run_id)
|
|
4974
|
+
except AppliedAPIError as e:
|
|
4975
|
+
return _format_error(e)
|
|
4976
|
+
|
|
4977
|
+
return f"Scenario run {run_id} deleted successfully."
|
|
4978
|
+
|
|
4979
|
+
|
|
4936
4980
|
async def scenario_bulk_run(
|
|
4937
4981
|
client: AppliedClient,
|
|
4938
4982
|
scenario_ids: list[str] | None = None,
|
|
4939
4983
|
benchmark_id: str | None = None,
|
|
4940
4984
|
target_agent_id: str | None = None,
|
|
4985
|
+
contact_override: dict | None = None,
|
|
4941
4986
|
output_format: str = "text",
|
|
4942
4987
|
) -> str:
|
|
4943
4988
|
"""
|
|
@@ -4948,6 +4993,7 @@ async def scenario_bulk_run(
|
|
|
4948
4993
|
scenario_ids: List of scenario UUIDs to run
|
|
4949
4994
|
benchmark_id: Run all scenarios in this benchmark
|
|
4950
4995
|
target_agent_id: Optional agent to run against (for A/B testing)
|
|
4996
|
+
contact_override: Optional contact override, e.g. {"mode": "contact", "contact_id": "<uuid>"}
|
|
4951
4997
|
|
|
4952
4998
|
Returns:
|
|
4953
4999
|
Summary of runs created
|
|
@@ -4975,6 +5021,7 @@ async def scenario_bulk_run(
|
|
|
4975
5021
|
result = await client.bulk_run_scenarios(
|
|
4976
5022
|
scenario_ids=resolved_scenario_ids,
|
|
4977
5023
|
target_agent_id=target_agent_id,
|
|
5024
|
+
contact_override=contact_override,
|
|
4978
5025
|
)
|
|
4979
5026
|
except AppliedAPIError as e:
|
|
4980
5027
|
return _format_error(e)
|
|
@@ -231,11 +231,13 @@ class FakeScenarioClient:
|
|
|
231
231
|
scenario_ids=None,
|
|
232
232
|
benchmark_id=None,
|
|
233
233
|
target_agent_id=None,
|
|
234
|
+
contact_override=None,
|
|
234
235
|
):
|
|
235
236
|
self.bulk_run_kwargs = {
|
|
236
237
|
"scenario_ids": scenario_ids,
|
|
237
238
|
"benchmark_id": benchmark_id,
|
|
238
239
|
"target_agent_id": target_agent_id,
|
|
240
|
+
"contact_override": contact_override,
|
|
239
241
|
}
|
|
240
242
|
return {
|
|
241
243
|
"job_id": "job-1",
|
|
@@ -351,6 +353,7 @@ async def test_scenario_bulk_run_resolves_ids_from_benchmark():
|
|
|
351
353
|
"scenario_ids": ["scenario-1"],
|
|
352
354
|
"benchmark_id": None,
|
|
353
355
|
"target_agent_id": "agent-2",
|
|
356
|
+
"contact_override": None,
|
|
354
357
|
}
|
|
355
358
|
assert payload["benchmark_id"] == "bench-1"
|
|
356
359
|
assert payload["scenario_run_ids"] == ["scenario-run-1"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|