judgeval 0.0.4__py3-none-any.whl → 0.0.6__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.
- judgeval/clients.py +24 -4
- {judgeval-0.0.4.dist-info → judgeval-0.0.6.dist-info}/METADATA +1 -1
- {judgeval-0.0.4.dist-info → judgeval-0.0.6.dist-info}/RECORD +5 -5
- {judgeval-0.0.4.dist-info → judgeval-0.0.6.dist-info}/WHEEL +0 -0
- {judgeval-0.0.4.dist-info → judgeval-0.0.6.dist-info}/licenses/LICENSE.md +0 -0
judgeval/clients.py
CHANGED
@@ -2,18 +2,38 @@ import os
|
|
2
2
|
from dotenv import load_dotenv
|
3
3
|
from openai import OpenAI
|
4
4
|
from langfuse import Langfuse
|
5
|
+
from typing import Optional
|
5
6
|
from together import Together, AsyncTogether
|
6
7
|
|
7
8
|
PATH_TO_DOTENV = os.path.join(os.path.dirname(__file__), ".env")
|
8
9
|
load_dotenv(dotenv_path=PATH_TO_DOTENV)
|
9
10
|
|
10
|
-
# Initialize clients
|
11
|
-
client = OpenAI()
|
11
|
+
# Initialize required clients
|
12
12
|
langfuse = Langfuse(
|
13
13
|
secret_key=os.getenv("LANGFUSE_SECRET_KEY"),
|
14
14
|
public_key=os.getenv("LANGFUSE_PUBLIC_KEY"),
|
15
15
|
host=os.getenv("LANGFUSE_HOST"),
|
16
16
|
)
|
17
|
-
|
18
|
-
|
17
|
+
|
18
|
+
# Initialize optional OpenAI client
|
19
|
+
client: Optional['OpenAI'] = None
|
20
|
+
if os.getenv("OPENAI_API_KEY"):
|
21
|
+
try:
|
22
|
+
from openai import OpenAI
|
23
|
+
client = OpenAI()
|
24
|
+
except ImportError:
|
25
|
+
# openai package not installed
|
26
|
+
pass
|
27
|
+
|
28
|
+
# Initialize optional Together clients
|
29
|
+
together_client: Optional['Together'] = None
|
30
|
+
async_together_client: Optional['AsyncTogether'] = None
|
31
|
+
|
32
|
+
# Only initialize Together clients if API key is available
|
33
|
+
if os.getenv("TOGETHERAI_API_KEY"):
|
34
|
+
try:
|
35
|
+
together_client = Together(api_key=os.getenv("TOGETHERAI_API_KEY"))
|
36
|
+
async_together_client = AsyncTogether(api_key=os.getenv("TOGETHERAI_API_KEY"))
|
37
|
+
except Exception:
|
38
|
+
pass
|
19
39
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
judgeval/__init__.py,sha256=xiiG4CkeaOtey4fusCd9CBz0BVqzTIbV-K2EFIU0rUM,283
|
2
|
-
judgeval/clients.py,sha256=
|
2
|
+
judgeval/clients.py,sha256=Ns5ljrgPPXUMo7fSPJxO12H64lcPyKeQPIVG_RMi2cM,1162
|
3
3
|
judgeval/constants.py,sha256=5O1jWvxMCRyMSWhmkrvPqfBctx42c7kMtgTS7ORVcFw,1965
|
4
4
|
judgeval/evaluation_run.py,sha256=KcIS7mDR_9XEdqYrJXFcrLz5IDMof34HcD5VtjZgV8w,5884
|
5
5
|
judgeval/judgment_client.py,sha256=8Z4Woiv56qphYqlMI3bNy4rvQItZl_z9vNNd3UdrCes,11241
|
@@ -72,7 +72,7 @@ judgeval/scorers/judgeval_scorers/local_implementations/summarization/prompts.py
|
|
72
72
|
judgeval/scorers/judgeval_scorers/local_implementations/summarization/summarization_scorer.py,sha256=3FMn7EhM5IxNwJLGTcpeHODaOPJefMHW6rRizmlA93U,20775
|
73
73
|
judgeval/scorers/judgeval_scorers/local_implementations/tool_correctness/__init__.py,sha256=JUB3TMqS1OHr6PqpIGqkyiBNbyfUaw7lZuUATjU3_ek,168
|
74
74
|
judgeval/scorers/judgeval_scorers/local_implementations/tool_correctness/tool_correctness_scorer.py,sha256=oxhVDR3Pb55Kxp9KsvmuvHWKtMiV1BQRG6yaXEr5Bp8,5309
|
75
|
-
judgeval-0.0.
|
76
|
-
judgeval-0.0.
|
77
|
-
judgeval-0.0.
|
78
|
-
judgeval-0.0.
|
75
|
+
judgeval-0.0.6.dist-info/METADATA,sha256=2FbgDSASPozNG1ENnqljY9sptDu2omTYhRkCeVD3lQQ,1156
|
76
|
+
judgeval-0.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
77
|
+
judgeval-0.0.6.dist-info/licenses/LICENSE.md,sha256=tKmCg7k5QOmxPK19XMfzim04QiQJPmgIm0pAn55IJwk,11352
|
78
|
+
judgeval-0.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|