-
Notifications
You must be signed in to change notification settings - Fork 94
feat(portkey): Add support for propmt template calls #1663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@cla-assistant check |
recheck |
if prompt_id := invocation_params.get("prompt_id"): | ||
yield SpanAttributes.PROMPT_ID, prompt_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should put the prompt.provider here too for clarity, just put portkey
in there
@@ -53,6 +53,12 @@ def get_extra_attributes_from_request( | |||
|
|||
yield SpanAttributes.LLM_INVOCATION_PARAMETERS, safe_json_dumps(invocation_params) | |||
|
|||
if prompt_id := invocation_params.get("prompt_id"): | |||
yield SpanAttributes.PROMPT_ID, prompt_id | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like you can produce a prompt URL pretty easily if you can: https://app.portkey.ai/prompts/ecc1de52-83dc-4846-a963-8d69f86dfee3 for example
e1b7557
to
011a9be
Compare
…per, but add functionality to place the prompt id and variables within the span attributes - tests included
011a9be
to
6fb030b
Compare
I have read the CLA Document and I hereby sign the CLA |
Resolves #1573
If prompt_id and prompt_variables are present in the invocation params it maps them to the span attributes prompt_id and llm.prompt_template.variables. Also wraps a the Prompt.completions function in the existing completion wrapper to ensure those spans are created.
Screenshots below

