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

Dynamic prompting engine #527

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Dynamic prompting engine #527

merged 1 commit into from
Jun 25, 2024

Conversation

csansoon
Copy link
Contributor

@csansoon csansoon commented Jun 21, 2024

Describe your changes

New dynamic prompting feature!

  1. Create a prompts directory in your latitude project
  2. Add a .yaml file configuring your LLM provider
  3. Create a .prompt file with any prompt

BOOM! A new /api/prompt/<prompt-name> endpoint has been automatically created.

Screen.Recording.2024-06-21.at.13.05.51.mov

Checklist before requesting a review

  • I have added thorough tests
  • I have updated the documentation if necessary
  • I have added a human-readable description of the changes for the release notes
  • I have included a recorded video capture of the feature manually tested

@csansoon csansoon added the WIP label Jun 21, 2024
Copy link

changeset-bot bot commented Jun 21, 2024

🦋 Changeset detected

Latest commit: c12157d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@latitude-data/server Minor
@latitude-data/cli Minor
@latitude-data/client Patch
@latitude-data/llm-manager Patch
@latitude-data/react Patch
@latitude-data/svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@csansoon csansoon force-pushed the dynamic-prompts branch 2 times, most recently from 5825e96 to f1c77d3 Compare June 21, 2024 14:42
"cheerio": "1.0.0-rc.12",
"cli-width": "^4.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these server dependencies? Looks CLI dependencies or table dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a dependency for a server script.

@csansoon csansoon force-pushed the dynamic-prompts branch 4 times, most recently from d70fc5f to 5bd4941 Compare June 25, 2024 12:45
type Props = { params: { prompt?: string }; url: URL }
export async function GET({ params: args, url }: Props) {
try {
const { params, stream } = await getPromptParams(url)
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be cool to make this endpoint POST and allow to pass dynamic prompts from a UI written in a form

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The API is soo similar to queries (this was intended), that I think they should be the same for consistency. That use case could also be applied to queries.
Either both should be GET or both should be POST, but not different types.

@csansoon csansoon removed the WIP label Jun 25, 2024
@csansoon csansoon force-pushed the dynamic-prompts branch 4 times, most recently from 6d65db8 to f3be833 Compare June 25, 2024 15:03
@csansoon csansoon merged commit d8ab241 into canary Jun 25, 2024
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
@geclos geclos deleted the dynamic-prompts branch June 27, 2024 10:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants