Skip to content

Commit

Permalink
feat: playground improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Mar 1, 2024
1 parent 3b7db4f commit eccb053
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/frontend/components/Layout/UpgradeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export function UpgradePlans({ highlight }: { highlight?: string }) {
{ id: "team", title: "4 team members" },
{ id: "projects", title: "Unlimited Projects" },
{ id: "analytics", title: "Advanced Analytics" },
{ id: "playground", title: "Template Playground" },
{ id: "export", title: "Exports & API" },
]}
highlight={highlight}
Expand Down Expand Up @@ -250,9 +251,8 @@ export function UpgradePlans({ highlight }: { highlight?: string }) {
features={[
{ id: "events", title: "Unlimited events" },
{ id: "team", title: "10 team members" },
{ id: "playground", title: "Unlimited Playground" },
{ id: "evaluate", title: "Evaluations" },
{ id: "radar", title: "Radar & Alerts" },
{ id: "radar", title: "Radars & Alerts" },
{ id: "support", title: "Shared Slack channel" },
]}
highlight={highlight}
Expand Down Expand Up @@ -284,7 +284,7 @@ export function UpgradePlans({ highlight }: { highlight?: string }) {
</Group>
<Button
component="a"
href="https://lunary.ai/pricing/self-hosted"
href="https://lunary.ai/pricing"
target="_blank"
variant="gradient"
color="teal"
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/components/Prompts/PromptEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function PromptEditor({
value={value ?? ""}
onChange={(e) => onChange(e.currentTarget.value)}
minRows={5}
mb="lg"
autosize
/>
)
Expand Down
16 changes: 11 additions & 5 deletions packages/frontend/pages/prompts/[[...id]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ function Playground() {
const runPlayground = async () => {
const model = template.extra?.model

if (org?.plan === "free" || !org?.playAllowance) {
return openUpgrade("playground")
}

analytics.track("RunPlayground", {
model,
})

if (!org?.playAllowance) {
return openUpgrade("playground")
}

setError(null)
setOutput(null)
setOutputTokens(0)
Expand Down Expand Up @@ -380,7 +380,12 @@ function Playground() {
useEffect(() => {
setOutput(null)
setOutputTokens(0)
}, [template?.id, templateVersion?.id])
}, [
template?.id,
templateVersion?.id,
template?.mode,
templateVersion?.extra?.model,
])

const switchTemplateVersion = (v) => {
setTemplateVersion(v)
Expand Down Expand Up @@ -500,6 +505,7 @@ function Playground() {
value={
<SegmentedControl
size="xs"
disabled={loading || !templateVersion?.isDraft}
data={[
{
value: "openai",
Expand Down

0 comments on commit eccb053

Please sign in to comment.