diff --git a/app/src/pages/playground/SavePromptForm.tsx b/app/src/pages/playground/SavePromptForm.tsx index 0a48fa3c79..6204c009ab 100644 --- a/app/src/pages/playground/SavePromptForm.tsx +++ b/app/src/pages/playground/SavePromptForm.tsx @@ -8,6 +8,8 @@ import { Button, Flex, View } from "@phoenix/components"; import { SavePromptFormQuery } from "@phoenix/pages/playground/__generated__/SavePromptFormQuery.graphql"; import { PromptComboBox } from "@phoenix/pages/playground/PromptComboBox"; +import { identifierPattern } from "../../utils/identifierUtils"; + export type SavePromptSubmitHandler = (params: SavePromptFormParams) => void; export type SavePromptFormParams = { @@ -100,6 +102,7 @@ export function SavePromptForm({ message: "Prompt is required", value: true, }, + pattern: identifierPattern, }} render={({ field: { onBlur, onChange } }) => ( None: diff --git a/tests/unit/server/api/routers/v1/test_prompts.py b/tests/unit/server/api/routers/v1/test_prompts.py index 712e4f6711..8d0accaf4b 100644 --- a/tests/unit/server/api/routers/v1/test_prompts.py +++ b/tests/unit/server/api/routers/v1/test_prompts.py @@ -65,7 +65,7 @@ async def test_get_prompt_version_by_tag_name( "a b c", "αβγ", *(p for p in string.punctuation if p not in (".", "/")), - *(f"x{p}y" for p in string.punctuation if p not in ("-", ".", "/")), + *(f"x{p}y" for p in string.punctuation if p not in ("_", "-", ".", "/")), ], ) async def test_invalid_identifier(