freeplay 0.2.39__tar.gz → 0.2.40__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.
- {freeplay-0.2.39 → freeplay-0.2.40}/PKG-INFO +2 -1
- {freeplay-0.2.39 → freeplay-0.2.40}/pyproject.toml +1 -1
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/api_support.py +6 -1
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/support.py +16 -4
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/test_runs.py +11 -5
- {freeplay-0.2.39 → freeplay-0.2.40}/LICENSE +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/README.md +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/__init__.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/completions.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/errors.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/flavors.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/freeplay.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/freeplay_cli.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/llm_parameters.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/model.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/provider_config.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/py.typed +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/record.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/__init__.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/freeplay_thin.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/__init__.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/customer_feedback.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/prompts.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/recordings.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/thin/resources/sessions.py +0 -0
- {freeplay-0.2.39 → freeplay-0.2.40}/src/freeplay/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: freeplay
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.40
|
4
4
|
Summary:
|
5
5
|
License: MIT
|
6
6
|
Author: FreePlay Engineering
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
15
16
|
Requires-Dist: anthropic (>=0.7.7,<0.8.0)
|
16
17
|
Requires-Dist: click (==8.1.7)
|
17
18
|
Requires-Dist: dacite (>=1.8.0,<2.0.0)
|
@@ -76,8 +76,13 @@ def get(target_type: t.Type[T], api_key: str, url: str) -> T:
|
|
76
76
|
return maybe_object
|
77
77
|
|
78
78
|
|
79
|
-
def get_raw(
|
79
|
+
def get_raw(
|
80
|
+
api_key: str,
|
81
|
+
url: str,
|
82
|
+
params: t.Optional[Dict[str, str]] = None
|
83
|
+
) -> Response:
|
80
84
|
return requests.get(
|
81
85
|
url=url,
|
82
86
|
headers=build_request_header(api_key),
|
87
|
+
params=params
|
83
88
|
)
|
@@ -21,8 +21,9 @@ JsonDom = Dict[str, Any]
|
|
21
21
|
|
22
22
|
class TestCaseTestRunResponse:
|
23
23
|
def __init__(self, test_case: JsonDom):
|
24
|
-
self.variables: InputVariables = test_case['variables']
|
25
24
|
self.id: str = test_case['id']
|
25
|
+
self.variables: InputVariables = test_case['variables']
|
26
|
+
self.output: Optional[str] = test_case.get('output')
|
26
27
|
|
27
28
|
|
28
29
|
class TestRunResponse:
|
@@ -104,7 +105,10 @@ class CallSupport:
|
|
104
105
|
def get_prompt(self, project_id: str, template_name: str, environment: str) -> PromptTemplate:
|
105
106
|
response = api_support.get_raw(
|
106
107
|
api_key=self.freeplay_api_key,
|
107
|
-
url=f'{self.api_base}/v2/projects/{project_id}/prompt-templates/name/{template_name}'
|
108
|
+
url=f'{self.api_base}/v2/projects/{project_id}/prompt-templates/name/{template_name}',
|
109
|
+
params={
|
110
|
+
'environment': environment
|
111
|
+
}
|
108
112
|
)
|
109
113
|
|
110
114
|
if response.status_code != 200:
|
@@ -138,11 +142,19 @@ class CallSupport:
|
|
138
142
|
|
139
143
|
return maybe_prompts
|
140
144
|
|
141
|
-
def create_test_run(
|
145
|
+
def create_test_run(
|
146
|
+
self,
|
147
|
+
project_id: str,
|
148
|
+
testlist: str,
|
149
|
+
include_test_case_outputs: bool = False
|
150
|
+
) -> TestRunResponse:
|
142
151
|
response = api_support.post_raw(
|
143
152
|
api_key=self.freeplay_api_key,
|
144
153
|
url=f'{self.api_base}/projects/{project_id}/test-runs-cases',
|
145
|
-
payload={
|
154
|
+
payload={
|
155
|
+
'testlist_name': testlist,
|
156
|
+
'include_test_case_outputs': include_test_case_outputs,
|
157
|
+
},
|
146
158
|
)
|
147
159
|
|
148
160
|
if response.status_code != 201:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
|
-
from typing import List
|
2
|
+
from typing import List, Optional
|
3
3
|
|
4
4
|
from freeplay.model import InputVariables
|
5
5
|
from freeplay.support import CallSupport
|
@@ -8,9 +8,15 @@ from freeplay.thin.resources.recordings import TestRunInfo
|
|
8
8
|
|
9
9
|
@dataclass
|
10
10
|
class TestCase:
|
11
|
-
def __init__(
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
test_case_id: str,
|
14
|
+
variables: InputVariables,
|
15
|
+
output: Optional[str],
|
16
|
+
):
|
12
17
|
self.id = test_case_id
|
13
18
|
self.variables = variables
|
19
|
+
self.output = output
|
14
20
|
|
15
21
|
|
16
22
|
@dataclass
|
@@ -34,10 +40,10 @@ class TestRuns:
|
|
34
40
|
def __init__(self, call_support: CallSupport) -> None:
|
35
41
|
self.call_support = call_support
|
36
42
|
|
37
|
-
def create(self, project_id: str, testlist: str) -> TestRun:
|
38
|
-
test_run = self.call_support.create_test_run(project_id, testlist)
|
43
|
+
def create(self, project_id: str, testlist: str, include_outputs: bool = False) -> TestRun:
|
44
|
+
test_run = self.call_support.create_test_run(project_id, testlist, include_outputs)
|
39
45
|
test_cases = [
|
40
|
-
TestCase(test_case_id=test_case.id, variables=test_case.variables)
|
46
|
+
TestCase(test_case_id=test_case.id, variables=test_case.variables, output=test_case.output)
|
41
47
|
for test_case in test_run.test_cases
|
42
48
|
]
|
43
49
|
|
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
|
File without changes
|