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(llm-observability): Add LLM conversation rendering #27626

Merged
merged 15 commits into from
Jan 17, 2025

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Jan 16, 2025

Changes

Intuitive LLM conversation UI:

conv

Give it a try in the Generations tab.

Added a few stories for various cases, see UI snapshots.

Copy link
Contributor

github-actions bot commented Jan 16, 2025

Size Change: +8.2 kB (+0.73%)

Total Size: 1.13 MB

Filename Size Change
frontend/dist/toolbar.js 1.13 MB +8.2 kB (+0.73%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

  • chromium: 0 added, 4 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@k11kirky k11kirky left a comment

Choose a reason for hiding this comment

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

Support for darkmode

@Twixes Twixes requested a review from k11kirky January 17, 2025 15:30
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

126 snapshot changes in total. 0 added, 126 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@Twixes Twixes force-pushed the llm-prompt-rendering branch from b75b7e4 to e71e477 Compare January 17, 2025 16:30
Copy link
Contributor

@skoob13 skoob13 left a comment

Choose a reason for hiding this comment

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

Left a few comments, but nothing blocks it

Comment on lines 162 to 175
function MessageDisplay({
role,
content,
additionalKwargs,
isOutput,
}: {
role: CompletionMessage['role']
content: CompletionMessage['content']
additionalKwargs: CompletionMessage['additional_kwargs']
isOutput?: boolean
}): JSX.Element {
const [isRenderingMarkdown, setIsRenderingMarkdown] = useState(!!content)

const additionalKwargsEntries = additionalKwargs && Object.entries(additionalKwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tool calls can also be a part of a message.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, let's ditch additional_kwargs if we're consolidating on including tool calls etc. within the message in the SDKs

<JSONViewer
key={key}
name={key}
src={value}
Copy link
Contributor

Choose a reason for hiding this comment

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

tool_call.function.arguments is a stringified JSON. It's better to parse the string argument to an object so users can navigate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, added parsing

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

20 snapshot changes in total. 0 added, 20 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot

This comment was marked as outdated.

@posthog-bot

This comment was marked as outdated.

@Twixes Twixes force-pushed the llm-prompt-rendering branch from b31e0aa to 1c1f959 Compare January 17, 2025 19:46
@Twixes Twixes force-pushed the llm-prompt-rendering branch from 1c1f959 to 31cb736 Compare January 17, 2025 19:52
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (wasn't pushed!)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@k11kirky k11kirky merged commit e9b0df5 into master Jan 17, 2025
99 checks passed
@k11kirky k11kirky deleted the llm-prompt-rendering branch January 17, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants