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

[ENHANCEMENT] Option to detect and visualize repetitive text blocks. #5814

Open
kripper opened this issue Dec 21, 2024 · 1 comment
Open
Labels
c/ui enhancement New feature or request

Comments

@kripper
Copy link

kripper commented Dec 21, 2024

When tracing agents, it's common to see prompts that combine a) variable text and b) static text defined in templates that are included in multiple prompts (for example, a system prompt).

It would be nice if Phoenix cuold identify repetitive text patterns (prompt templates) and visualize them in other color, inside a text container that can be labeled, expanded and collapsed.

Example

Let's say we traced this input prompt:

image

We can now click the text block and assign it a custom label:

image

When viewing other prompts that contain the same text block, it will be displayed using our custom label:

image

This feature will make it much more easier to analyze prompts.

Optional

Please also consider that some templates have variables inside.
Eg: "The current date is {{date}} and the current time is {{time}}."

In this case, we would see this:

image

It would be nice if we could tell Phoenix to treat it as just one block that contains variables.
This way we could add it a custom label and only see:

image

@kripper kripper added enhancement New feature or request triage issues that need triage labels Dec 21, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Dec 21, 2024
@dosubot dosubot bot added the c/ui label Dec 21, 2024
@mikeldking
Copy link
Contributor

@kripper thanks for the feedback! We're actually working on formal representations of prompt templates via #5582 and will have more formal ways to declare these in the tracing as well.

We do currently have a rudimentary way to track prompt templates and template variables via these context managers (https://docs.arize.com/phoenix/tracing/how-to-tracing/customize-spans/instrumenting-prompt-templates-and-prompt-variables)

Let us know if those work out for you. Agree if we could "detect" repeated text and "discover" the template that would be ideal:)

@mikeldking mikeldking removed the triage issues that need triage label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/ui enhancement New feature or request
Projects
Status: 📘 Todo
Development

No branches or pull requests

2 participants