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(prompts)!: prompt template management #5724

Draft
wants to merge 151 commits into
base: main
Choose a base branch
from
Draft

feat(prompts)!: prompt template management #5724

wants to merge 151 commits into from

Conversation

mikeldking
Copy link
Contributor

resolves #5582

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 12, 2024
@mikeldking mikeldking marked this pull request as draft December 12, 2024 22:10
@mikeldking mikeldking added the feature branch a feature branch that consolidates multiple features into a single commit on main label Dec 12, 2024
Copy link
Contributor

@RogerHYang RogerHYang left a comment

Choose a reason for hiding this comment

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

blocking feature branch

@mikeldking mikeldking force-pushed the prompts branch 4 times, most recently from 6da6bdc to 3c3c5e0 Compare December 28, 2024 07:57
@mikeldking mikeldking force-pushed the prompts branch 2 times, most recently from b34c106 to 4973813 Compare January 9, 2025 20:06
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

mikeldking and others added 17 commits February 5, 2025 21:43
* wip

* WIP

* WIP

* add the prompt type

* add initial listing

* feat: temporary prompt

* final changes

* add aria role
…rompt specific playground (#5748)

* feat(prompts): Add prompt selection combobox to playground instances

* Implement prompt/:id/playground route and add link from prompt page

* Rename prompt combobox components for clarity
* feat(prompts): Implement SavePromptForm for creating new prompts

* Rename button to 'save'
* Add prompt table migrations

* Fix typo

* Update migration test

* Address migration feedback

* Use default names for constraints

* Add source prompt id
* cleanup

* feat(prompts): rudimentary prompt details page #5741

* Update app/src/pages/prompt/PromptTabContent.tsx

Co-authored-by: Anthony Powell <[email protected]>

---------

Co-authored-by: Anthony Powell <[email protected]>
* Add PromptVersion query

* Update src/phoenix/server/api/types/PromptVersion.py

* reorganize

* cleanup

* Update the schema

---------

Co-authored-by: Mikyo King <[email protected]>
* refactor(prompts): URL based routing and loader sharing for prompts

- /prompts/:prompId has been converted to a layout component
- sub-routes of promptId share loader data with promptLoader
- prompt detail page tabs perform navigations

* feat(prompts): Add query fragment to prompt versions sub-route

* feat(prompts): Implement routing, loaders, and fragments for prompt version list

* Add PromptVersion to node query

* fix imports

* Ensure all unset fields are set

* fix comma

* Distinguish prompt version details from one another

* Move truncate component

* Consolidate prompt tab nav logic

---------

Co-authored-by: Dustin Ngo <[email protected]>
…5780)

* feat(prompts): Render model invocation params in propt details view

* Use fragment in PromptInvocationParameters

* temporarily use component styles for lists until we can migrate

* fix scrolling

---------

Co-authored-by: Mikyo King <[email protected]>
* feat(prompts): Render prompt messages on prompt detail view

* Remove unused import

* Implement copy and paste button on prompt chat messages

* Render chat messages on prompt version details page

* Redirect to latest version when clicking versions tab

Additionally highlight active version in versions list

* Update example data to match template language

* Fix prompt details page width, prompt versions borders / scroll

* Distinguish readOnly TemplateEditor styling from normal TemplateEditor

* Refactor active prompt id into prop

* Replace custom button with styled anchor

* Rename node in promptVersion query
* Flesh out PromptVersionTemplate type

* Return GraphQL objects with the correct type

* Use new types in node query

* Decouple pydantic models and gql types

* Rebuild gql schema

* Rework model names

* Update gql schema

* Propagate name into schema

* Incorporate feedback

* Update schema

* adjust UI to new schema

* cleanup

* Remove `hub` naming and clean up type annotations

---------

Co-authored-by: Mikyo King <[email protected]>
* chore: fix lint errors

* cleanup

* cleanup
* feat(prompts): preview of last 5 versions

* feat(prompts): preview of last 5 versions

* rename
cephalization and others added 29 commits February 6, 2025 16:03
* Include prompt name in playground experiment name

* Remove old type ignore
)

* feat(prompts): Add support for Vercel AI sdk to TS phoenix-client

* Add support for response_format, fix tools, add tests
* feat(prompts): Denormalize tool choice before saving/using

We were previously storing and sending tool choice in openai format,
regardless of the destination provider.

This caused silent failures with anthropic, and invalid validation on the backend (now that we are validating)

* Clean up ToolChoiceSelector
* refactor(prompts): Reorganize llm schemas and converters

* feat(prompts): Enhance LLM SDK provider converters and constants

* refactor(prompts): Enforce zod schemas match openapi types
* feat(prompts): edit description

* rudamentry styles

* feat(prompts): update description

* cleanup
…nes (#6325)

* refactor(components): switch to leadingVisual

* WIP

* refactor
* feat(playground): hotkeys

* key bindings

* wip

* feat(prompts): command enter to run the playground

* cleanup

* cleanup

* add windows support

* add missing
* fix(prompts): Make playground page blocking less intrusive

* Only block dirty navigations on saved prompts
…#6330)

If you saved an azure openai provider prompt, and then tried to load it back into playground,
it would load as "openai" and you would lose your endpoint, and base url settings.

Now we properly carry over azure_openai, and we will restore any saved azure (or openai) specific settings when loading prompt into playground
)

* fix(prompts): Save tool calls from playground message into prompt
…roviders (#6339)

* fix(prompts): Do not wipe playground invocation parameters when switching between providers

* Ensure only supported invocation parameters are stored per-provider

* Fix response format autocomplete
* feat(components): migrate text field

* WIP

* migrate more

* final push

* change message according to mode

* Update app/.eslintrc.js

Co-authored-by: Anthony Powell <[email protected]>

---------

Co-authored-by: Anthony Powell <[email protected]>
* fix(prompts): Fix tool definition copy paste button

It should copy current content of the editor, even if it is invalid.
* fix: restore playwrite tests

* add ci
* docs(prompts): Add deno notebook example for TS phoenix-client

* Add cross-sdk notebook example

* Update text

* Update import hash

* Add Vercel AI SDK notebook
@mikeldking mikeldking changed the title feat(prompts!): prompt template management feat(prompts)!: prompt template management Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature branch a feature branch that consolidates multiple features into a single commit on main size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: 🔍. Needs Review
Development

Successfully merging this pull request may close these issues.

🗺 Prompt Management
6 participants