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

Helicone Prompts: Generate Route V1 #3258

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Helicone Prompts: Generate Route V1 #3258

wants to merge 15 commits into from

Conversation

tinomarques
Copy link
Collaborator

@tinomarques tinomarques commented Feb 13, 2025

Example usage:

payload = {
          # Prompt Info
          "promptId": "new-prompt",
          "version": "production",
          "inputs": {
              "num": "10",
          },
          # Helicone Properties
          "userId": "test-user",
          "sessionId": SESSION_ID,
}
headers = {
    # Helicone Auth
    "Helicone-Auth": f"Bearer {os.getenv('HELICONE_API_KEY')}",
    # Provider Keys
    "OPENAI_API_KEY": os.getenv("OPENAI_API_KEY"),
    "ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY"),
    "GOOGLE_API_KEY": os.getenv("GOOGLE_GENERATIVE_API_KEY"),
    "COHERE_API_KEY": os.getenv("COHERE_API_KEY"),
    "MISTRAL_API_KEY": os.getenv("MISTRAL_API_KEY"),
}
response = requests.post(generate_url, json=payload, headers=headers)

Planned in next version:

  • Add reverse mapper for anthropic, and other api paths
  • Add support for anthropic, and other api paths
  • Implement the kv for the prompt helicone template

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
helicone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 8:29pm
helicone-bifrost ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 8:29pm
helicone-eu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 8:29pm

Copy link

fumedev bot commented Feb 13, 2025

Summary

  • Introduces a new generate route for Helicone prompts, allowing for the generation of prompts with specified parameters.
  • Implements a POST request handler to facilitate generating prompts with the required payload, including promptId, version, inputs, userId, and sessionId.
  • Adds support for handling provider API keys and auth in the request headers.
  • Outlines future enhancements, including implementation of reverse mapping for Anthropics and other API paths.
  • Updates various files in the codebase to support the new generation functionality, including adding a new generateRouter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant