deepeval 3.5.7__py3-none-any.whl → 3.5.8__py3-none-any.whl

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.
deepeval/_version.py CHANGED
@@ -1 +1 @@
1
- __version__: str = "3.5.7"
1
+ __version__: str = "3.5.8"
deepeval/prompt/api.py CHANGED
@@ -8,6 +8,7 @@ class PromptInterpolationType(Enum):
8
8
  MUSTACHE_WITH_SPACE = "MUSTACHE_WITH_SPACE"
9
9
  FSTRING = "FSTRING"
10
10
  DOLLAR_BRACKETS = "DOLLAR_BRACKETS"
11
+ JINJA = "JINJA"
11
12
 
12
13
 
13
14
  class PromptMessage(BaseModel):
deepeval/prompt/prompt.py CHANGED
@@ -64,6 +64,10 @@ class Prompt:
64
64
  raise TypeError(
65
65
  "Unable to create Prompt where 'alias' and 'template' are both None. Please provide at least one to continue."
66
66
  )
67
+ if template and messages_template:
68
+ raise TypeError(
69
+ "Unable to create Prompt where 'template' and 'messages_template' are both provided. Please provide only one to continue."
70
+ )
67
71
 
68
72
  self.alias = alias
69
73
  self._text_template = template
@@ -71,6 +75,10 @@ class Prompt:
71
75
  self._version = None
72
76
  self._polling_tasks: Dict[str, asyncio.Task] = {}
73
77
  self._refresh_map: Dict[str, int] = {}
78
+ if template:
79
+ self._type = PromptType.TEXT
80
+ elif messages_template:
81
+ self._type = PromptType.LIST
74
82
 
75
83
  @property
76
84
  def version(self):
deepeval/prompt/utils.py CHANGED
@@ -1,5 +1,7 @@
1
- from deepeval.prompt.api import PromptInterpolationType
2
1
  import re
2
+ from jinja2 import Template
3
+
4
+ from deepeval.prompt.api import PromptInterpolationType
3
5
 
4
6
 
5
7
  def interpolate_mustache(text: str, **kwargs) -> str:
@@ -25,6 +27,11 @@ def interpolate_dollar_brackets(text: str, **kwargs) -> str:
25
27
  return formatted_template.format(**kwargs)
26
28
 
27
29
 
30
+ def interpolate_jinja(text: str, **kwargs) -> str:
31
+ template = Template(text)
32
+ return template.render(**kwargs)
33
+
34
+
28
35
  def interpolate_text(
29
36
  interpolation_type: PromptInterpolationType, text: str, **kwargs
30
37
  ) -> str:
@@ -37,5 +44,7 @@ def interpolate_text(
37
44
  return interpolate_fstring(text, **kwargs)
38
45
  elif interpolation_type == PromptInterpolationType.DOLLAR_BRACKETS:
39
46
  return interpolate_dollar_brackets(text, **kwargs)
47
+ elif interpolation_type == PromptInterpolationType.JINJA:
48
+ return interpolate_jinja(text, **kwargs)
40
49
 
41
50
  raise ValueError(f"Unsupported interpolation type: {interpolation_type}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepeval
3
- Version: 3.5.7
3
+ Version: 3.5.8
4
4
  Summary: The LLM Evaluation Framework
5
5
  Home-page: https://github.com/confident-ai/deepeval
6
6
  License: Apache-2.0
@@ -17,6 +17,7 @@ Requires-Dist: anthropic
17
17
  Requires-Dist: click (>=8.0.0,<8.3.0)
18
18
  Requires-Dist: google-genai (>=1.9.0,<2.0.0)
19
19
  Requires-Dist: grpcio (>=1.67.1,<2.0.0)
20
+ Requires-Dist: jinja2
20
21
  Requires-Dist: nest_asyncio
21
22
  Requires-Dist: ollama
22
23
  Requires-Dist: openai
@@ -1,5 +1,5 @@
1
1
  deepeval/__init__.py,sha256=6fsb813LD_jNhqR-xZnSdE5E-KsBbC3tc4oIg5ZMgTw,2115
2
- deepeval/_version.py,sha256=5PpKL25tWtYxTPc0_se2v49WDFVCzYaCu8yogWsx_qQ,27
2
+ deepeval/_version.py,sha256=unWkmwnFycd1EkbcelGqbdnCdsoFCoHp1cgSea6zrS0,27
3
3
  deepeval/annotation/__init__.py,sha256=ZFhUVNNuH_YgQSZJ-m5E9iUb9TkAkEV33a6ouMDZ8EI,111
4
4
  deepeval/annotation/annotation.py,sha256=3j3-syeJepAcEj3u3e4T_BeRDzNr7yXGDIoNQGMKpwQ,2298
5
5
  deepeval/annotation/api.py,sha256=EYN33ACVzVxsFleRYm60KB4Exvff3rPJKt1VBuuX970,2147
@@ -404,9 +404,9 @@ deepeval/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
404
404
  deepeval/plugins/plugin.py,sha256=_dwsdx4Dg9DbXxK3f7zJY4QWTJQWc7QE1HmIg2Zjjag,1515
405
405
  deepeval/progress_context.py,sha256=ZSKpxrE9sdgt9G3REKnVeXAv7GJXHHVGgLynpG1Pudw,3557
406
406
  deepeval/prompt/__init__.py,sha256=M99QTWdxOfiNeySGCSqN873Q80PPxqRvjLq4_Mw-X1w,49
407
- deepeval/prompt/api.py,sha256=ccrMT6_Otuef9zrRm9iQsmZ-Apkjj3nypvw3wc8-eW0,1708
408
- deepeval/prompt/prompt.py,sha256=DlUPib0EAVC2T54SQB1xxEQBNSpEirL5x-CtrKE1rek,15463
409
- deepeval/prompt/utils.py,sha256=Gk0zj_9BK8MQccs8GmiC8o-YVtkou6ZJEz8kWgW5Mog,1678
407
+ deepeval/prompt/api.py,sha256=kR3MkaHuU2wYILKVnvnXhQWxWp0XgtcWX-kIjpMJRl8,1728
408
+ deepeval/prompt/prompt.py,sha256=192W5zFBx08nELxRHHDQscMM3psj8OUFV_JR85BZv8Q,15823
409
+ deepeval/prompt/utils.py,sha256=Ermw9P-1-T5wQ5uYuj5yWgdj7pVB_JLw8D37Qvmh9ok,1938
410
410
  deepeval/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
411
411
  deepeval/red_teaming/README.md,sha256=BY5rAdpp3-sMMToEKwq0Nsd9ivkGDzPE16DeDb8GY7U,154
412
412
  deepeval/scorer/__init__.py,sha256=hTvtoV3a4l0dSBjERm-jX7jveTtKZXK0c9JerQo0T_w,27
@@ -461,8 +461,8 @@ deepeval/tracing/tracing.py,sha256=b-0T3W6lAEOEGhODx0e-yIwBkm5V46EDNAWS9lcWkD0,4
461
461
  deepeval/tracing/types.py,sha256=l_utWKerNlE5H3mOKpeUJLsvpP3cMyjH7HRANNgTmSQ,5306
462
462
  deepeval/tracing/utils.py,sha256=w_kdhuyBCygllnbqLpDdKJqpJo42t3ZMlGhNicV2A8c,6467
463
463
  deepeval/utils.py,sha256=r8tV_NYJSi6ib-oQw6cLw3L7ZSe4KIJVJc1ng6-kDX4,17179
464
- deepeval-3.5.7.dist-info/LICENSE.md,sha256=0ATkuLv6QgsJTBODUHC5Rak_PArA6gv2t7inJzNTP38,11352
465
- deepeval-3.5.7.dist-info/METADATA,sha256=NldO1OinDSv_gGUP-kkFk1zpMGXKTceoYMtF92XGbgs,18721
466
- deepeval-3.5.7.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
467
- deepeval-3.5.7.dist-info/entry_points.txt,sha256=fVr8UphXTfJe9I2rObmUtfU3gkSrYeM0pLy-NbJYg10,94
468
- deepeval-3.5.7.dist-info/RECORD,,
464
+ deepeval-3.5.8.dist-info/LICENSE.md,sha256=0ATkuLv6QgsJTBODUHC5Rak_PArA6gv2t7inJzNTP38,11352
465
+ deepeval-3.5.8.dist-info/METADATA,sha256=7yiM7djTQ2fLy8XfdyecBxMg3cgk3hDAsGLUjRamC44,18743
466
+ deepeval-3.5.8.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
467
+ deepeval-3.5.8.dist-info/entry_points.txt,sha256=fVr8UphXTfJe9I2rObmUtfU3gkSrYeM0pLy-NbJYg10,94
468
+ deepeval-3.5.8.dist-info/RECORD,,