Skip to content

Commit

Permalink
feat(prompts): Convert from Prompt message schema to LLM Provider sch…
Browse files Browse the repository at this point in the history
…ema for code snippets (#6132)

* feat(prompts): Convert from Prompt message schema to LLM Provider schema for code snippets

* Update prompt code snippet empty state

* Reuse prompt utils in promptToOpenai conversion and back
  • Loading branch information
cephalization authored Jan 21, 2025
1 parent b31d7ca commit 6f3958b
Show file tree
Hide file tree
Showing 6 changed files with 588 additions and 19 deletions.
18 changes: 18 additions & 0 deletions app/src/pages/prompt/PromptCodeExportCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
DisclosurePanel,
DisclosureTrigger,
Flex,
Text,
View,
} from "@phoenix/components";
import {
Expand Down Expand Up @@ -63,6 +64,10 @@ export function PromptCodeExportCard({
__typename
toolCall {
toolCallId
toolCall {
name
arguments
}
}
}
... on ToolResultContentPart {
Expand All @@ -89,6 +94,19 @@ export function PromptCodeExportCard({
() => mapPromptToSnippet({ promptVersion: data, language }),
[data, language]
);
if (!snippet) {
return (
<Card title="Code" variant="compact" bodyStyle={{ padding: 0 }}>
<View padding="size-100">
<Flex justifyContent="center" alignItems="center">
<Text color="text-300">
No code snippet available for this prompt
</Text>
</Flex>
</View>
</Card>
);
}
return (
<Card
title="Code"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f3958b

Please sign in to comment.