freeplay 0.3.4__tar.gz → 0.3.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: freeplay
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: FreePlay Engineering
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "freeplay"
3
- version = "0.3.4"
3
+ version = "0.3.6"
4
4
  description = ""
5
5
  authors = ["FreePlay Engineering <engineering@freeplay.ai>"]
6
6
  license = "MIT"
@@ -1,7 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from typing import List, Union, Any, Dict, Mapping, TypedDict
3
3
 
4
- InputValue = Union[str, int, bool, Dict[str, Any], List[Any]]
4
+ InputValue = Union[str, int, bool, float, Dict[str, Any], List[Any]]
5
5
  InputVariables = Mapping[str, InputValue]
6
6
  TestRunInput = Mapping[str, InputValue]
7
7
  FeedbackValue = Union[bool, str, int, float]
@@ -256,13 +256,13 @@ class FilesystemTemplateResolver(TemplateResolver):
256
256
  def __render_into_v2(json_dom: Dict[str, Any]) -> PromptTemplate:
257
257
  format_version = json_dom.get('format_version')
258
258
 
259
- if format_version == 2:
259
+ if format_version and format_version >= 2:
260
260
  metadata = json_dom['metadata']
261
261
  flavor_name = metadata.get('flavor')
262
262
  model = metadata.get('model')
263
263
 
264
264
  return PromptTemplate(
265
- format_version=2,
265
+ format_version=format_version,
266
266
  prompt_template_id=json_dom.get('prompt_template_id'), # type: ignore
267
267
  prompt_template_version_id=json_dom.get('prompt_template_version_id'), # type: ignore
268
268
  prompt_template_name=json_dom.get('prompt_template_name'), # type: ignore
@@ -10,7 +10,7 @@ from .model import InputVariables
10
10
 
11
11
  # Validate that the variables are of the correct type, and do not include functions, dates, classes or None values.
12
12
  def all_valid(obj: Any) -> bool:
13
- if isinstance(obj, (int, str, bool)):
13
+ if isinstance(obj, (int, str, bool, float)):
14
14
  return True
15
15
  elif isinstance(obj, list):
16
16
  return all(all_valid(item) for item in obj)
File without changes
File without changes
File without changes