fiddler-evals 0.2.0__tar.gz → 0.2.0rc2__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.
- {fiddler_evals-0.2.0/fiddler_evals.egg-info → fiddler_evals-0.2.0rc2}/PKG-INFO +2 -2
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/PUBLIC.md +1 -1
- fiddler_evals-0.2.0rc2/fiddler_evals/VERSION +1 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/connection.py +95 -58
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/application.py +77 -82
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/dataset.py +331 -347
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/experiment.py +284 -291
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/project.py +60 -67
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/answer_relevance.py +17 -19
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/regex.py +4 -4
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/exceptions.py +62 -44
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/evaluation.py +62 -64
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2/fiddler_evals.egg-info}/PKG-INFO +2 -2
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/pyproject.toml +1 -1
- fiddler_evals-0.2.0/fiddler_evals/VERSION +0 -1
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/MANIFEST.in +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/README.md +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/configs.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/conftest.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/constants.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/decorators.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/base.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_application.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_dataset.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_dataset_items.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_experiment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_experiment_items.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_experiment_results.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/entities/tests/test_project.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/base.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/coherence.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/conciseness.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/eval_fn.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/ftl_prompt_safety.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/ftl_response_faithfulness.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/sentiment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_answer_relevance.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_coherence.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_conciseness.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_eval_fn.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_ftl_prompt_safety.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_ftl_response_faithfulness.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_regex.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_sentiment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/tests/test_topic_classification.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/evaluators/topic.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/http_client.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/json_encoder.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/semver.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/tests/test_json_encoder.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/libs/tests/test_request_client.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/application.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/base.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/compact.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/dataset.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/error.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/evaluator.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/experiment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/filter_query.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/project.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/response.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/score.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/pydantic_models/server_info.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/executor.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/experiment_result_publisher.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/experiment_runner.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/tests/test_evaluate.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/runner/tests/test_experiment_result_publisher.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/tests/constants.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/tests/test_connection.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/tests/test_decorators.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/environment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/pd.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/tests/__init__.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/tests/test_environment.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/utils/tqdm.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals/version.py +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals.egg-info/SOURCES.txt +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals.egg-info/dependency_links.txt +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals.egg-info/requires.txt +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/fiddler_evals.egg-info/top_level.txt +0 -0
- {fiddler_evals-0.2.0 → fiddler_evals-0.2.0rc2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiddler-evals
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.0rc2
|
|
4
4
|
Summary: Python SDK for evaluating LLM Applications
|
|
5
5
|
Author-email: Fiddler AI <support@fiddler.ai>
|
|
6
6
|
Maintainer-email: Fiddler AI <support@fiddler.ai>
|
|
@@ -59,7 +59,7 @@ pip install --upgrade --pre fiddler-evals
|
|
|
59
59
|
from fiddler_evals import init
|
|
60
60
|
|
|
61
61
|
# Initialize connection
|
|
62
|
-
init(url='https://your-
|
|
62
|
+
init(url='https://your-org.fiddler.ai', token='your-api-token')
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### 2. Create Project Structure
|
|
@@ -38,7 +38,7 @@ pip install --upgrade --pre fiddler-evals
|
|
|
38
38
|
from fiddler_evals import init
|
|
39
39
|
|
|
40
40
|
# Initialize connection
|
|
41
|
-
init(url='https://your-
|
|
41
|
+
init(url='https://your-org.fiddler.ai', token='your-api-token')
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### 2. Create Project Structure
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.0rc2
|
|
@@ -29,30 +29,63 @@ class Connection:
|
|
|
29
29
|
managing connection parameters, authentication tokens, and ensuring proper
|
|
30
30
|
communication protocols are established.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
Attributes
|
|
33
|
+
----------
|
|
34
|
+
url : str
|
|
35
|
+
Base URL of the Fiddler platform instance
|
|
36
|
+
token : str
|
|
37
|
+
Authentication token for API access
|
|
38
|
+
proxies : dict, optional
|
|
39
|
+
Optional proxy configuration for HTTP requests
|
|
40
|
+
timeout : float or tuple, optional
|
|
41
|
+
HTTP request timeout settings
|
|
42
|
+
verify : bool
|
|
43
|
+
Whether to verify SSL/TLS certificates
|
|
44
|
+
request_headers : dict
|
|
45
|
+
HTTP headers including authentication and client info
|
|
46
|
+
client : RequestClient
|
|
47
|
+
Cached HTTP client instance for making requests
|
|
48
|
+
server_info : ServerInfo
|
|
49
|
+
Cached server information and metadata
|
|
50
|
+
server_version : VersionInfo
|
|
51
|
+
Version of the connected Fiddler server
|
|
52
|
+
organization_name : str
|
|
53
|
+
Name of the connected organization
|
|
54
|
+
organization_id : UUID
|
|
55
|
+
UUID of the connected organization
|
|
56
|
+
|
|
57
|
+
Examples
|
|
58
|
+
--------
|
|
59
|
+
Creating a basic connection:
|
|
60
|
+
|
|
61
|
+
.. code-block:: python
|
|
62
|
+
|
|
63
|
+
connection = Connection(
|
|
64
|
+
url="https://your-fiddler-instance.com",
|
|
65
|
+
token="your-auth-token"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
Creating a connection with custom timeout and proxy:
|
|
69
|
+
|
|
70
|
+
.. code-block:: python
|
|
71
|
+
|
|
72
|
+
connection = Connection(
|
|
73
|
+
url="https://your-fiddler-instance.com",
|
|
74
|
+
token="your-auth-token",
|
|
75
|
+
timeout=(5.0, 30.0), # (connect_timeout, read_timeout)
|
|
76
|
+
proxies={"https": "https://proxy.company.com:8080"}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
Creating a connection without SSL verification:
|
|
80
|
+
|
|
81
|
+
.. code-block:: python
|
|
82
|
+
|
|
83
|
+
connection = Connection(
|
|
84
|
+
url="https://your-fiddler-instance.com",
|
|
85
|
+
token="your-auth-token",
|
|
86
|
+
verify=False, # Not recommended for production
|
|
87
|
+
validate=False # Skip version compatibility check
|
|
88
|
+
)
|
|
56
89
|
"""
|
|
57
90
|
|
|
58
91
|
def __init__( # pylint: disable=too-many-arguments
|
|
@@ -66,17 +99,27 @@ class Connection:
|
|
|
66
99
|
) -> None:
|
|
67
100
|
"""Initialize a connection to the Fiddler platform.
|
|
68
101
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
url : str
|
|
105
|
+
The base URL to your Fiddler platform instance
|
|
106
|
+
token : str
|
|
107
|
+
Authentication token obtained from the Fiddler UI
|
|
108
|
+
proxies : dict, optional
|
|
109
|
+
Dictionary mapping protocol to proxy URL for HTTP requests
|
|
110
|
+
timeout : float or tuple, optional
|
|
111
|
+
HTTP request timeout settings (float or tuple of connect/read timeouts)
|
|
112
|
+
verify : bool, default True
|
|
113
|
+
Whether to verify server's TLS certificate
|
|
114
|
+
validate : bool, default True
|
|
115
|
+
Whether to validate server/client version compatibility
|
|
116
|
+
|
|
117
|
+
Raises
|
|
118
|
+
------
|
|
119
|
+
ValueError
|
|
120
|
+
If url or token parameters are empty
|
|
121
|
+
IncompatibleClient
|
|
122
|
+
If server version is incompatible with client version
|
|
80
123
|
"""
|
|
81
124
|
|
|
82
125
|
self.url = url
|
|
@@ -320,36 +363,30 @@ def init( # pylint: disable=too-many-arguments
|
|
|
320
363
|
Examples:
|
|
321
364
|
Basic initialization:
|
|
322
365
|
|
|
323
|
-
|
|
366
|
+
import fiddler as fdl
|
|
324
367
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
token="your-auth-token"
|
|
330
|
-
)
|
|
368
|
+
fdl.init(
|
|
369
|
+
url="https://your-fiddler-instance.com",
|
|
370
|
+
token="your-auth-token"
|
|
371
|
+
)
|
|
331
372
|
|
|
332
373
|
Initialization with custom timeout and proxy:
|
|
333
374
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
proxies={"https": "https://proxy.company.com:8080"}
|
|
341
|
-
)
|
|
375
|
+
fdl.init(
|
|
376
|
+
url="https://your-fiddler-instance.com",
|
|
377
|
+
token="your-auth-token",
|
|
378
|
+
timeout=(10.0, 60.0), # 10s connect, 60s read timeout
|
|
379
|
+
proxies={"https": "https://proxy.company.com:8080"}
|
|
380
|
+
)
|
|
342
381
|
|
|
343
382
|
Initialization for development with relaxed settings:
|
|
344
383
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
validate=False, # Skip version compatibility check
|
|
352
|
-
)
|
|
384
|
+
fdl.init(
|
|
385
|
+
url="https://dev-fiddler-instance.com",
|
|
386
|
+
token="dev-token",
|
|
387
|
+
verify=False, # Skip SSL verification
|
|
388
|
+
validate=False, # Skip version compatibility check
|
|
389
|
+
)
|
|
353
390
|
|
|
354
391
|
|
|
355
392
|
|
|
@@ -19,10 +19,8 @@ Common Workflow:
|
|
|
19
19
|
4. Manage application-level settings and access permissions
|
|
20
20
|
|
|
21
21
|
Example:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# Create a new application within a project
|
|
25
|
-
application = Application.create(name="fraud_detection_app", project_id=project_id)
|
|
22
|
+
# Create a new application within a project
|
|
23
|
+
application = Application.create(name="fraud_detection_app", project_id=project_id)
|
|
26
24
|
|
|
27
25
|
Note:
|
|
28
26
|
Application names must be unique within a project. Applications cannot be renamed
|
|
@@ -74,12 +72,19 @@ class Application(BaseEntity):
|
|
|
74
72
|
4. **Maintenance**: Update configurations and resources
|
|
75
73
|
5. **Cleanup**: Delete application when no longer needed
|
|
76
74
|
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
Attributes:
|
|
76
|
+
id (UUID): Unique application identifier, assigned by server on creation.
|
|
77
|
+
name (str): Application name, must be unique within the project.
|
|
78
|
+
created_at (datetime): Application creation timestamp.
|
|
79
|
+
updated_at (datetime): Last modification timestamp.
|
|
80
|
+
created_by (UserCompact): User who created the application.
|
|
81
|
+
updated_by (UserCompact): User who last updated the application.
|
|
82
|
+
project (ProjectCompact): Project containing this application.
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
Example:
|
|
85
|
+
# Create a new application for fraud detection
|
|
86
|
+
application = Application.create(name="fraud-detection-app", project_id=project_id)
|
|
87
|
+
print(f"Created application: {application.name} (ID: {application.id})")
|
|
83
88
|
|
|
84
89
|
Note:
|
|
85
90
|
Applications are permanent containers - once created, the name cannot be changed.
|
|
@@ -149,13 +154,11 @@ class Application(BaseEntity):
|
|
|
149
154
|
ApiError: If there's an error communicating with the Fiddler API.
|
|
150
155
|
|
|
151
156
|
Example:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
print(f"Created: {application.created_at}")
|
|
158
|
-
print(f"Project: {application.project.name}")
|
|
157
|
+
# Get application by UUID
|
|
158
|
+
application = Application.get_by_id(id_="550e8400-e29b-41d4-a716-446655440000")
|
|
159
|
+
print(f"Retrieved application: {application.name}")
|
|
160
|
+
print(f"Created: {application.created_at}")
|
|
161
|
+
print(f"Project: {application.project.name}")
|
|
159
162
|
|
|
160
163
|
Note:
|
|
161
164
|
This method makes an API call to fetch the latest application state from the server.
|
|
@@ -187,19 +190,17 @@ class Application(BaseEntity):
|
|
|
187
190
|
ApiError: If there's an error communicating with the Fiddler API.
|
|
188
191
|
|
|
189
192
|
Example:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
# Get project instance
|
|
193
|
-
project = Project.get_by_name(name="fraud-detection-project")
|
|
193
|
+
# Get project instance
|
|
194
|
+
project = Project.get_by_name(name="fraud-detection-project")
|
|
194
195
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
# Get application by name within a project
|
|
197
|
+
application = Application.get_by_name(
|
|
198
|
+
name="fraud-detection-app",
|
|
199
|
+
project_id=project.id
|
|
200
|
+
)
|
|
201
|
+
print(f"Found application: {application.name} (ID: {application.id})")
|
|
202
|
+
print(f"Created: {application.created_at}")
|
|
203
|
+
print(f"Project: {application.project.name}")
|
|
203
204
|
|
|
204
205
|
Note:
|
|
205
206
|
Application names are case-sensitive and must match exactly. Use this method
|
|
@@ -247,27 +248,25 @@ class Application(BaseEntity):
|
|
|
247
248
|
ApiError: If there's an error communicating with the Fiddler API.
|
|
248
249
|
|
|
249
250
|
Example:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]
|
|
270
|
-
print(f"Fraud detection applications: {len(fraud_apps)}")
|
|
251
|
+
# Get project instance
|
|
252
|
+
project = Project.get_by_name(name="fraud-detection-project")
|
|
253
|
+
|
|
254
|
+
# List all applications in a project
|
|
255
|
+
for application in Application.list(project_id=project.id):
|
|
256
|
+
print(f"Application: {application.name}")
|
|
257
|
+
print(f" ID: {application.id}")
|
|
258
|
+
print(f" Created: {application.created_at}")
|
|
259
|
+
|
|
260
|
+
# Convert to list for counting and filtering
|
|
261
|
+
applications = list(Application.list(project_id=project.id))
|
|
262
|
+
print(f"Total applications in project: {len(applications)}")
|
|
263
|
+
|
|
264
|
+
# Find applications by name pattern
|
|
265
|
+
fraud_apps = [
|
|
266
|
+
app for app in Application.list(project_id=project.id)
|
|
267
|
+
if "fraud" in app.name.lower()
|
|
268
|
+
]
|
|
269
|
+
print(f"Fraud detection applications: {len(fraud_apps)}")
|
|
271
270
|
|
|
272
271
|
Note:
|
|
273
272
|
This method returns an iterator for memory efficiency. Convert to a list
|
|
@@ -309,19 +308,17 @@ class Application(BaseEntity):
|
|
|
309
308
|
ApiError: If there's an error communicating with the Fiddler API.
|
|
310
309
|
|
|
311
310
|
Example:
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
# Get project instance
|
|
315
|
-
project = Project.get_by_name(name="fraud-detection-project")
|
|
311
|
+
# Get project instance
|
|
312
|
+
project = Project.get_by_name(name="fraud-detection-project")
|
|
316
313
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
314
|
+
# Create a new application for fraud detection
|
|
315
|
+
application = Application.create(
|
|
316
|
+
name="fraud-detection-app",
|
|
317
|
+
project_id=project.id
|
|
318
|
+
)
|
|
319
|
+
print(f"Created application with ID: {application.id}")
|
|
320
|
+
print(f"Created at: {application.created_at}")
|
|
321
|
+
print(f"Project: {application.project.name}")
|
|
325
322
|
|
|
326
323
|
Note:
|
|
327
324
|
After successful creation, the application instance is returned with
|
|
@@ -364,33 +361,31 @@ class Application(BaseEntity):
|
|
|
364
361
|
ApiError: If there's an error communicating with the Fiddler API.
|
|
365
362
|
|
|
366
363
|
Example:
|
|
367
|
-
|
|
364
|
+
# Get project instance
|
|
365
|
+
project = Project.get_by_name(name="fraud-detection-project")
|
|
368
366
|
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
# Safe application setup - get existing or create new
|
|
368
|
+
application = Application.get_or_create(
|
|
369
|
+
name="fraud-detection-app",
|
|
370
|
+
project_id=project.id
|
|
371
|
+
)
|
|
372
|
+
print(f"Using application: {application.name} (ID: {application.id})")
|
|
371
373
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
print(f"Using application: {application.name} (ID: {application.id})")
|
|
374
|
+
# Idempotent setup in deployment scripts
|
|
375
|
+
application = Application.get_or_create(
|
|
376
|
+
name="llm-pipeline-app",
|
|
377
|
+
project_id=project.id
|
|
378
|
+
)
|
|
378
379
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
# Use in configuration management
|
|
381
|
+
environments = ["dev", "staging", "prod"]
|
|
382
|
+
applications = {}
|
|
383
|
+
for env in environments:
|
|
384
|
+
applications[env] = Application.get_or_create(
|
|
385
|
+
name=f"fraud-detection-{env}",
|
|
382
386
|
project_id=project.id
|
|
383
387
|
)
|
|
384
388
|
|
|
385
|
-
# Use in configuration management
|
|
386
|
-
environments = ["dev", "staging", "prod"]
|
|
387
|
-
applications = {}
|
|
388
|
-
for env in environments:
|
|
389
|
-
applications[env] = Application.get_or_create(
|
|
390
|
-
name=f"fraud-detection-{env}",
|
|
391
|
-
project_id=project.id
|
|
392
|
-
)
|
|
393
|
-
|
|
394
389
|
Note:
|
|
395
390
|
This method is idempotent - calling it multiple times with the same name
|
|
396
391
|
and project_id will return the same application. It logs when creating a new
|