Skip to content
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

feat: Propagate prompt id to playground spans metadata #6224

Open
wants to merge 4 commits into
base: prompts
Choose a base branch
from

Conversation

anticorrelator
Copy link
Contributor

resolves #6151

  • prompt_id can now be optionally passed to playground ChatCompletionInput and ChatCompletionOverDatasetInput
  • This prompt_id will be propagated to playground-generated spans

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 31, 2025
@@ -264,6 +267,10 @@ def input_value_and_mime_type(
yield INPUT_VALUE, safe_json_dumps(input_data)


def prompt_id_metadata(prompt_id: Optional[GlobalID]) -> Iterator[tuple[str, Any]]:
yield METADATA, {"phoenix-prompt-id": str(prompt_id)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Do we always want to set this even when no prompt id is set?

@@ -110,6 +110,7 @@ input ChatCompletionInput {
tools: [JSON!]
apiKey: String = null
template: TemplateOptions
promptId: GlobalID = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to also add this to the nonStreaming mutation? That one does not carry over prompt id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: 📘 Todo
Development

Successfully merging this pull request may close these issues.

2 participants