promptlayer 1.0.9__py3-none-any.whl → 1.0.11__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.
Potentially problematic release.
This version of promptlayer might be problematic. Click here for more details.
- promptlayer/__init__.py +3 -3
- promptlayer/utils.py +11 -0
- {promptlayer-1.0.9.dist-info → promptlayer-1.0.11.dist-info}/METADATA +1 -1
- {promptlayer-1.0.9.dist-info → promptlayer-1.0.11.dist-info}/RECORD +6 -6
- {promptlayer-1.0.9.dist-info → promptlayer-1.0.11.dist-info}/LICENSE +0 -0
- {promptlayer-1.0.9.dist-info → promptlayer-1.0.11.dist-info}/WHEEL +0 -0
promptlayer/__init__.py
CHANGED
|
@@ -160,12 +160,12 @@ class PromptLayer:
|
|
|
160
160
|
return stream_response(response, _track_request, stream_function)
|
|
161
161
|
request_log = _track_request(request_response=response.model_dump())
|
|
162
162
|
data = {
|
|
163
|
-
"request_id": request_log
|
|
163
|
+
"request_id": request_log.get("request_id", None),
|
|
164
164
|
"raw_response": response,
|
|
165
|
-
"prompt_blueprint": request_log
|
|
165
|
+
"prompt_blueprint": request_log.get("prompt_blueprint", None),
|
|
166
166
|
}
|
|
167
167
|
return data
|
|
168
168
|
|
|
169
169
|
|
|
170
|
-
__version__ = "1.0.
|
|
170
|
+
__version__ = "1.0.11"
|
|
171
171
|
__all__ = ["PromptLayer", "__version__"]
|
promptlayer/utils.py
CHANGED
|
@@ -863,3 +863,14 @@ def anthropic_request(prompt_blueprint: GetPromptTemplateResponse, **kwargs):
|
|
|
863
863
|
prompt_blueprint["prompt_template"]["type"]
|
|
864
864
|
]
|
|
865
865
|
return request_to_make(client, **kwargs)
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
# do not remove! This is used in the langchain integration.
|
|
869
|
+
def get_api_key():
|
|
870
|
+
# raise an error if the api key is not set
|
|
871
|
+
api_key = os.environ.get("PROMPTLAYER_API_KEY")
|
|
872
|
+
if not api_key:
|
|
873
|
+
raise Exception(
|
|
874
|
+
"Please set your PROMPTLAYER_API_KEY environment variable or set API KEY in code using 'promptlayer.api_key = <your_api_key>' "
|
|
875
|
+
)
|
|
876
|
+
return api_key
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
promptlayer/__init__.py,sha256=
|
|
1
|
+
promptlayer/__init__.py,sha256=Nk_YAsoldO0cNy-KQ9rlsdzRryWr9oEJMjqAIlXiOvs,6379
|
|
2
2
|
promptlayer/groups/__init__.py,sha256=-xs-2cn0nc0D_5YxZr3nC86iTdRVZmBhEpOKDJXE-sQ,224
|
|
3
3
|
promptlayer/groups/groups.py,sha256=yeO6T0TM3qB0ondZRiHhcH8G06YygrpFoM8b9RmoIao,165
|
|
4
4
|
promptlayer/promptlayer.py,sha256=1q1cZOBt27Luzu3aRWcYUjQiKbmwrF9R62Uw95Ryqqc,4035
|
|
@@ -7,8 +7,8 @@ promptlayer/track/__init__.py,sha256=VheO_Au0lffGlPKYYPQwkv8ci16wSXABCVSNRoFWu_w
|
|
|
7
7
|
promptlayer/track/track.py,sha256=XNEZT9yNiRBPp9vaDZo_f0dP_ldOu8q1qafpVfS5Ze8,1610
|
|
8
8
|
promptlayer/types/__init__.py,sha256=ulWSyCrk5hZ_PI-nKGpd6GPcRaK8lqP4wFl0LPNUYWk,61
|
|
9
9
|
promptlayer/types/prompt_template.py,sha256=QbxYSeIubrwp8KmDKdt9syAwzONFPh_So9yr4H73ANQ,4429
|
|
10
|
-
promptlayer/utils.py,sha256=
|
|
11
|
-
promptlayer-1.0.
|
|
12
|
-
promptlayer-1.0.
|
|
13
|
-
promptlayer-1.0.
|
|
14
|
-
promptlayer-1.0.
|
|
10
|
+
promptlayer/utils.py,sha256=AgzU6dcqUNkek_iH5Gh8nR8YiLOMiah3ejnC9l2Y9XE,28335
|
|
11
|
+
promptlayer-1.0.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
promptlayer-1.0.11.dist-info/METADATA,sha256=SYsOwgSi9oSzv36_4s3uEHjQ9kFJ6C9SZfx9LcTF3y0,4507
|
|
13
|
+
promptlayer-1.0.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
14
|
+
promptlayer-1.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|