divi 0.0.1b2__py3-none-any.whl → 0.0.1b3__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.
divi/__init__.py CHANGED
@@ -13,5 +13,5 @@ _auth: Optional[Auth] = None
13
13
  _datapark: Optional[DataPark] = None
14
14
  _evaluator: Optional[Evaluator] = None
15
15
 
16
- __version__ = "0.0.1b2"
16
+ __version__ = "0.0.1b3"
17
17
  __all__ = ["obs_openai", "observable"]
@@ -19,6 +19,7 @@ class EvaluatorConfig:
19
19
  max_concurrency: int = 10,
20
20
  api_key: Optional[str] = None,
21
21
  base_url: Optional[str] = None,
22
+ language: str = "zh",
22
23
  ):
23
24
  self.model = model
24
25
  self.api_key = api_key
@@ -26,6 +27,7 @@ class EvaluatorConfig:
26
27
  self.temperature = temperature
27
28
  self.n_rounds = n_rounds
28
29
  self.max_concurrency = max_concurrency
30
+ self.language = language
29
31
 
30
32
 
31
33
  class EvaluationResult(BaseModel):
@@ -52,17 +54,22 @@ class Evaluator:
52
54
  )
53
55
 
54
56
  @staticmethod
55
- def generate_prompt(target: str, conversation: str, score: Score) -> str:
57
+ def generate_prompt(
58
+ target: str, conversation: str, score: Score, language: str
59
+ ) -> str:
56
60
  return PROMPT_TEMPLATE.format(
57
61
  requirements=PRESET_PROMPT[score.value],
58
62
  target=target,
59
63
  conversation=conversation,
64
+ language=language,
60
65
  )
61
66
 
62
67
  def _sync_evaluate_once(
63
68
  self, target: str, conversation: str, score: Score
64
69
  ) -> Optional[EvaluationResult]:
65
- prompt = self.generate_prompt(target, conversation, score)
70
+ prompt = self.generate_prompt(
71
+ target, conversation, score, self.config.language
72
+ )
66
73
  response = self.sync_client.beta.chat.completions.parse(
67
74
  model=self.config.model,
68
75
  messages=[{"role": "user", "content": prompt}],
@@ -77,7 +84,9 @@ class Evaluator:
77
84
  async def _async_evaluate_once(
78
85
  self, target: str, conversation: str, score: Score
79
86
  ) -> Optional[EvaluationResult]:
80
- prompt = self.generate_prompt(target, conversation, score)
87
+ prompt = self.generate_prompt(
88
+ target, conversation, score, self.config.language
89
+ )
81
90
  response = await self.async_client.beta.chat.completions.parse(
82
91
  model=self.config.model,
83
92
  messages=[{"role": "user", "content": prompt}],
@@ -8,7 +8,7 @@ PROMPT_TEMPLATE = (
8
8
  "Strictly output your answer in the following JSON format:\n"
9
9
  "{{\n"
10
10
  ' "judgment": bool, # true if the response meets all requirements\n'
11
- ' "reasoning": "string" # concise explanation, hitting only the key points\n'
11
+ ' "reasoning": "string" # concise explanation, in {language}, hitting only the key points\n'
12
12
  "}}\n"
13
13
  "Do not output anything else."
14
14
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: divi
3
- Version: 0.0.1b2
3
+ Version: 0.0.1b3
4
4
  Summary: The Agent Platform for Observability & Evaluation
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -1,5 +1,5 @@
1
1
  divi/README.md,sha256=hdw10Mkebd1SGMeA3tPJtlOwbWZzuQ8J-N9YPEHGuXg,67
2
- divi/__init__.py,sha256=FNz-nbMRHLhT-JWowhQTK7zMajy2XY0TFPD3Jjar1sw,436
2
+ divi/__init__.py,sha256=hscfdliNohMGPl12Xzr6UGm6QDJfxxbLXjhc0FPI4Fc,436
3
3
  divi/utils.py,sha256=fXkjoyo_Lh8AZliKICOP460m0czUcNQjcEcceJbaOVA,1439
4
4
  divi/decorators/__init__.py,sha256=HkyWdC1ctTsVFucCWCkj57JB4NmwONus1d2S2dUbvs4,110
5
5
  divi/decorators/collect.py,sha256=5iUxAnbHYx4ISkFg64IK_4miGdrWgbOXLJxKz8lGIv8,1074
@@ -8,8 +8,8 @@ divi/decorators/observable.py,sha256=orDNCP1_uOTwgg71lg2c0qXOv6DtcxufRzuQZqXOrH4
8
8
  divi/decorators/observe.py,sha256=I2RVsp2WQep6iTLSxkAlMP8wiRsSYiiYrxR2hJzPxcI,1211
9
9
  divi/evaluation/__init__.py,sha256=SVu4tYZLgx4juEa1JtkXGcwB_Xuwvh60lbVhYKMseQo,129
10
10
  divi/evaluation/evaluate.py,sha256=lVMCw5vHGa5sJvUyhVDZ9m3Sgl4baCjWhw2OKazhvgM,1861
11
- divi/evaluation/evaluator.py,sha256=D1s6upIOiGTjf24WAQfygYYUI8Lcc65vRgJ2wW2_3Uo,6108
12
- divi/evaluation/prompts.py,sha256=4oL8K8X2-zdmTDuAetc53o7Ys_vph-eWYhPmvRKYAng,960
11
+ divi/evaluation/evaluator.py,sha256=UbKBedn0iYMSBT2L-_e7AUB1D8kvRlP0oai1dqWOA3c,6319
12
+ divi/evaluation/prompts.py,sha256=NBPSn09GarOHXXIcdiViMuOupcL7MHP1_qiyDq6rO5Y,975
13
13
  divi/evaluation/scores.py,sha256=ZgSxfve-ZivX3WU4TGcgPOSpUQVMbG5a15IQNPeq_bQ,173
14
14
  divi/proto/common/v1/common.proto,sha256=Rx8wr0_tOtQ1NseTMnsav4ApD1MDALzQDBA2IvLRTU0,1775
15
15
  divi/proto/common/v1/common_pb2.py,sha256=br61OHQVAi6SI3baFcb5xJv2Xd-AZ04A19xeSjLNMXo,2442
@@ -46,7 +46,7 @@ divi/session/teardown.py,sha256=YiBz_3yCiljMFEofZ60VmRL5sb8WA5GT7EYF8nFznZ4,133
46
46
  divi/signals/__init__.py,sha256=wfSkkCwkRsFP4aLj8aGHk_k6Y50P5yN44WWlO3XyW18,43
47
47
  divi/signals/span.py,sha256=AQ24C8EKzGceryybX0rBe9B0z43kKaULdR6eOeOCtno,2804
48
48
  divi/signals/trace.py,sha256=US_M2CAYNGUhEa5pppRPJN8dfNA5owgHMFDK2AOrFXA,2345
49
- divi-0.0.1b2.dist-info/METADATA,sha256=IS0W_tN3EECkWRlX18GiUtX2idT3lYS2sAF2Z4jmoKA,493
50
- divi-0.0.1b2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- divi-0.0.1b2.dist-info/licenses/LICENSE,sha256=5OJuZ4wMMEV0DgF0tofhAlS_KLkaUsZwwwDS2U_GwQ0,1063
52
- divi-0.0.1b2.dist-info/RECORD,,
49
+ divi-0.0.1b3.dist-info/METADATA,sha256=VwB4fMovuRHqB8jr0Z218r702bZbov6SSYsCQc_TesE,493
50
+ divi-0.0.1b3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
+ divi-0.0.1b3.dist-info/licenses/LICENSE,sha256=5OJuZ4wMMEV0DgF0tofhAlS_KLkaUsZwwwDS2U_GwQ0,1063
52
+ divi-0.0.1b3.dist-info/RECORD,,
File without changes